aboutsummaryrefslogtreecommitdiff
path: root/ports
AgeCommit message (Collapse)Author
2018-10-15stm32/usbd_cdc_interface: Handle disconnect IRQ to set VCP disconnected.Damien George
pyb.USB_VCP().isconnected() will now return False if the USB is disconnected after having previously been connected. See issue #4210.
2018-10-11nrf/bluetooth: Set GAP_ADV_MAX_SIZE to 31 (s132/s140).Glenn Ruben Bakke
For s132 and s140, GAP_ADV_MAX_SIZE was currently set to BLE_GATT_ATT_MTU_DEFAULT, which is 23. The correct value should have been 31, but there are no define for this in the s132/s140 header files as for s110. Updating define in ble_drv.c to the correct value of 31.
2018-10-05stm32/main: Add configuration macros for board to set heap start/end.Andrew Leech
The macros are MICROPY_HEAP_START and MICROPY_HEAP_END, and if not defined by a board then the default values will be used (maximum heap from SRAM as defined by linker symbols). As part of this commit the SDRAM initialisation is moved to much earlier in main() to potentially make it available to other peripherals and avoid re-initialisation on soft-reboot. On boards with SDRAM enabled the heap has been set to use that.
2018-10-05windows/msvc: Implement file/directory type query.stijn
Add some more POSIX compatibility by adding a d_type field to the dirent structure and defining corresponding macros so listdir_next in the unix' port modos.c can use it, end result being uos.ilistdir now reports the file type.
2018-10-05windows/msvc: Fix incorrect indentation in dirent.c.stijn
2018-10-05unix/moduselect: Raise OSError(ENOENT) if obj to modify is not in pollerPaul Sokolovsky
Previously, the function silently succeeded. The new behavior is consistent with both baremetal uselect implementation and CPython 3.
2018-09-27esp8266: Remove scanning of GC pointers in native code block.Damien George
The native code no longer holds live GC pointers so doesn't need to be scanned.
2018-09-26unix/mpconfigport.h: Enable MICROPY_PY_UHASHLIB_MD5 for uhashlib.md5.Paul Sokolovsky
This will allow to e.g. implement HTTP Digest authentication. Adds 540 bytes for x86_32, 332 for arm_thumb2 (for Unix port, which already includes axTLS library).
2018-09-26stm32/mpconfigport.h: Enable math.factorial, optimised version.Damien George
2018-09-26py/modmath: Add math.factorial, optimised and non-opt implementations.Christopher Swenson
This commit adds the math.factorial function in two variants: - squared difference, which is faster than the naive version, relatively compact, and non-recursive; - a mildly optimised recursive version, faster than the above one. There are some more optimisations that could be done, but they tend to take more code, and more storage space. The recursive version seems like a sensible compromise. The new function is disabled by default, and uses the non-optimised version by default if it is enabled. The options are MICROPY_PY_MATH_FACTORIAL and MICROPY_OPT_MATH_FACTORIAL.
2018-09-26stm32/usbd_conf: Allocate enough space in USB HS TX FIFO for CDC packet.Damien George
The CDC maximum packet size is 512 bytes, or 128 32-bit words, and the TX FIFO must be configured to have at least this size.
2018-09-24stm32/powerctrl: Don't configure clocks if already at desired frequency.Damien George
Configuring clocks is a critical operation and is best to avoid when possible. If the clocks really need to be reset to the same values then one can pass in a slightly higher value, eg 168000001 Hz to get 168MHz.
2018-09-24stm32/powerctrl: Optimise passing of default values to set_sysclk.Damien George
2018-09-24stm32/powerctrl: Factor code that configures PLLSAI on F7 MCUs.Damien George
2018-09-24stm32/powerctrl: Factor code to set RCC PLL and use it in startup.Damien George
This ensures that on first boot the most optimal settings are used for the voltage scaling and flash latency (for F7 MCUs). This commit also provides more fine-grained control for the flash latency settings.
2018-09-24stm32/powerctrl: Fix configuring APB1/APB2 frequency when AHB also set.Damien George
APB1/APB2 are derived from AHB, so if the user sets AHB!=SYSCLK then the APB1/APB2 dividers must be computed from the new AHB.
2018-09-24stm32/powerctrl: Move function to set SYSCLK into new powerctrl file.Damien George
Power and clock control is low-level functionality and it makes sense to have it in a dedicated file, at least so it can be reused by other parts of the code.
2018-09-24stm32/modmachine: Re-enable PLLSAI[1] after waking from stop mode.Damien George
On F7s PLLSAI is used as a 48MHz clock source if the main PLL cannot provide such a frequency, and on L4s PLLSAI1 is always used as a clock source for the peripherals. This commit makes sure these PLLs are re-enabled upon waking from stop mode so the peripherals work. See issues #4022 and #4178 (L4 specific).
2018-09-21stm32/boards/NUCLEO_F091RC: Enable USART3-8 with default pins.Damien George
2018-09-21stm32/uart: Add support for USART3-8 on F0 MCUs.Damien George
2018-09-21stm32/dcmi: Add F4/F7/H7 hal files and dma definitions for DCMI periph.Andrew Leech
2018-09-20stm32/adc: Increase sample time for internal sensors on L4 MCUs.Damien George
They need time (around 4us for VREFINT) to obtain accurate results. Fixes issue #4022.
2018-09-20stm32/adc: Fix ADC calibration scale for L4 MCUs, they use 3.0V.Damien George
2018-09-20esp32/machine_rtc: Fix locals dict entry, init qstr points to init meth.Damien George
2018-09-20stm32/Makefile: Include copysign.c in double precision float builds.Damien George
This is required for DEBUG=1 builds when MICROPY_FLOAT_IMPL=double. Thanks to Andrew Leech.
2018-09-20unix/modjni: Get building under coverage and nanbox builds.Damien George
Changes made: - make use of MP_OBJ_TO_PTR and MP_OBJ_FROM_PTR where necessary - fix shadowing of index variable i, renamed to j - fix type of above variable to size_t to prevent comparison warning - fix shadowing of res variable - use "(void)" instead of "()" for functions that take no arguments
2018-09-20unix/modjni: Update .getiter signature to include mp_obj_iter_buf_t* .Paul Sokolovsky
And thus be buildable again.
2018-09-20stm32: Add support for STM32F765xx MCUs.Andrew Leech
This part is functionally similar to STM32F767xx (they share a datasheet) so support is generally comparable. When adding board support the stm32f767_af.csv and stm32f767.ld should be used.
2018-09-20py/objstr: Make % (__mod__) formatting operator configurable.Paul Sokolovsky
Default is enabled, disabled for minimal builds. Saves 1296 bytes on x86, 976 bytes on ARM.
2018-09-20stm32/boards/STM32F769DISC: Add optional support for external SDRAM.Damien George
2018-09-20stm32/sdram: Add support for 32-bit wide data bus and 256MB in MPU cfg.Damien George
2018-09-16stm32/dma: Get DMA working on F0 MCUs.Damien George
Changes made: - fix DMA_SUB_INSTANCE_AS_UINT8 - fix dma_id numbers in dma_descr_t - add F0 DMA IRQ handlers - set DmaBaseAddress and ChannelIndex when reinit'ing
2018-09-14esp32: Fix int overflow in machine.sleep/deepsleep functions.Siarhei Farbotka
2018-09-14unix/modos: Include extmod/vfs.h for MP_S_IFDIR, etc.Paul Sokolovsky
If DTTOIF() macro is not defined, the code refers to MP_S_IFDIR, etc. symbols defined in extmod/vfs.h, so should include it. This fixes build for Android.
2018-09-14zephyr/CMakeLists: Update for latest Zephyr CMake usage refactorings.Paul Sokolovsky
Added cmake_minimum_required and updated target_link_libraries directives.
2018-09-14zephyr/prj_base.conf: Update for net_config subsys refactor.Paul Sokolovsky
net_config subsystem was split off from net_app, and as a result, settings need renaming from CONFIG_NET_APP_* to CONFIG_NET_CONFIG_*.
2018-09-12stm32/sdcard: Fully reset SDMMC periph before calling HAL DMA functions.Damien George
The HAL DMA functions enable SDMMC interrupts before fully resetting the peripheral, and this can lead to a DTIMEOUT IRQ during the initialisation of the DMA transfer, which then clears out the DMA state and leads to the read/write not working at all. The DTIMEOUT is there from previous SDMMC DMA transfers, even those that succeeded, and is of duration ~180 seconds, which is 0xffffffff / 24MHz (default DTIMER value, and clock of peripheral). To work around this issue, fully reset the SDMMC peripheral before calling the HAL SD DMA functions. Fixes issue #4110.
2018-09-12unix/mpconfigport_coverage.h: Enable uhashlib.md5.Damien George
2018-09-12stm32/flashbdev: Protect flash writes from cache flushing and USB MSC.Damien George
2018-09-12stm32: Change flash IRQ priority from 2 to 6 to prevent preemption.Damien George
The flash-IRQ handler is used to flush the storage cache, ie write outstanding block data from RAM to flash. This is triggered by a timeout, or by a direct call to flush all storage caches. Prior to this commit, a timeout could trigger the cache flushing to occur during the execution of a read/write to external SPI flash storage. In such a case the storage subsystem would break down. SPI storage transfers are already protected against USB IRQs, so by changing the priority of the flash IRQ to that of the USB IRQ (what is done in this commit) the SPI transfers can be protected against any timeouts triggering a cache flush (the cache flush would be postponed until after the transfer finished, but note that in the case of SPI writes the timeout is rescheduled after the transfer finishes). The handling of internal flash sync'ing needs to be changed to directly call flash_bdev_irq_handler() sync may be called with the IRQ priority already raised (eg when called from a USB MSC IRQ handler).
2018-09-11stm32/spi: Be sure to set all SPI config values in SPI proto init.Damien George
2018-09-11stm32/sdcard: Move temporary DMA state from BSS to stack.Damien George
2018-09-11stm32/sdcard: Use only a single DMA stream for both SDIO TX/RX.Damien George
No need to be wasteful on DMA resources.
2018-09-11stm32/dma: Reinitialise the DMA if the direction changed on the channel.Damien George
2018-09-11stm32/dma: Pass DMA direction as parameter to dma_init not in cfg structDamien George
Some DMA channels (eg for SDIO) can be used in both directions and this patch allows such peripherals to dynamically select the DMA direction.
2018-09-11stm32: For MCUs that have PLLSAI allow to set SYSCLK at 2MHz increments.Damien George
MCUs that have a PLLSAI can use it to generate a 48MHz clock for USB, SDIO and RNG peripherals. In such cases the SYSCLK is not restricted to values that allow the system PLL to generate 48MHz, but can be any frequency. This patch allows such configurability for F7 MCUs, allowing the SYSCLK to be set in 2MHz increments via machine.freq(). PLLSAI will only be enabled if needed, and consumes about 1mA extra. This fine grained control of frequency is useful to get accurate SPI baudrates, for example.
2018-09-11stm32/boards/STM32L476DISC: Enable external RTC xtal to get RTC working.roland
2018-09-11stm32/Makefile: Allow external BOARD_DIR directory to be specified.Andrew Leech
This makes it easy to add a custom board definition outside of the micropython tree, keeping the micropython submodule clean and official.
2018-09-10unix/Makefile: Build libffi inside $BUILD.Paul Sokolovsky
Avoids polluting the source tree, allows to build for different (sub)archs without intermediate cleaning.
2018-09-08esp8266/main: Increase heap by 2kb, now that axtls rodata is in ROM.Damien George