summaryrefslogtreecommitdiff
path: root/ports/stm32/main.c
AgeCommit message (Collapse)Author
2019-10-13remove ports/stm32Dan Halbert
2018-06-12ports: Call gc_sweep_all() when doing a soft reset.Damien George
This calls finalisers of things like files and sockets to cleanly close them.
2018-05-28stm32: Add support for Cortex-M0 CPUs.Damien George
2018-05-28stm32: Allow to have no storage support if there are no block devices.Damien George
If no block devices are defined by a board then storage support will be disabled. This means there is no filesystem provided by either the internal flash or external SPI flash. But the VFS system can still be enabled and filesystems provided on external devices like an SD card.
2018-05-22stm32/main: Use consistent indenting of macro #if's.Damien George
2018-05-21stm32: Integrate lwIP as implementation of usocket module.Damien George
This patch allows to use lwIP as the implementation of the usocket module, instead of the existing socket-multiplexer that delegates the entire TCP/IP layer to the NIC itself. This is disabled by default, and enabled by defining MICROPY_PY_LWIP to 1. When enabled, the lwIP TCP/IP stack will be included in the build with default settings for memory usage and performance (see lwip_inc/lwipopts.h). It is then up to a particular NIC to register itself with lwIP using the standard lwIP netif API.
2018-05-14stm32/pyb_i2c: Put pyb.I2C under MICROPY_PY_PYB_LEGACY setting.Damien George
When disabled, the pyb.I2C class saves around 8k of code space and 172 bytes of RAM. The same functionality is now available in machine.I2C (for F4 and F7 MCUs). It is still enabled by default.
2018-05-02stm32/main: Clean up and optimise initial start-up code of the MCU.Damien George
2018-04-23stm32/uart: Allow ctrl-C to work with UARTs put on REPL via os.dupterm.Damien George
2018-04-11stm32/main: Allow a board to configure the label of the flash FS.Damien George
To change the default label a board should define: #define MICROPY_HW_FLASH_FS_LABEL "label"
2018-04-10stm32/main: Guard usb_mode lines in default boot.py by relevant #if.Peter D. Gray
2018-03-29stm32/main: Only update reset_mode if board doesn't use a bootloader.Damien George
If the board is configured to use a bootloader then that bootloader will pass through the reset_mode.
2018-03-29stm32/main: Rename main to stm32_main and pass through first argument.Damien George
The main() function has a predefined type in C which is not so useful for embedded contexts. This patch renames main() to stm32_main() so we can define our own type signature for this function. The type signature is defined to have a single argument which is the "reset_mode" and is passed through as r0 from Reset_Handler. This allows, for example, a bootloader to pass through information into the main application.
2018-03-17stm32: Use STM32xx macros instead of MCU_SERIES_xx to select MCU type.Damien George
The CMSIS files for the STM32 range provide macros to distinguish between the different MCU series: STM32F4, STM32F7, STM32H7, STM32L4, etc. Prefer to use these instead of custom ones.
2018-03-09stm32/main: Enable D2 SRAM1/2/3 clocks on H7 MCUs.iabdalkader
2018-02-13stm32: Introduce MICROPY_HW_ENABLE_USB and clean up USB config.Damien George
This patch allows to completely compile-out support for USB, and no-USB is now the default. If a board wants to enable USB it should define: #define MICROPY_HW_ENABLE_USB (1) And then one or more of the following to select the USB PHY: #define MICROPY_HW_USB_FS (1) #define MICROPY_HW_USB_HS (1) #define MICROPY_HW_USB_HS_IN_FS (1)
2018-02-13stm32: Update HAL macro and constant names to use newer versions.Damien George
Newer versions of the HAL use names which are cleaner and more self-consistent amongst the HAL itself. This patch switches to use those names in most places so it is easier to update the HAL in the future.
2018-02-05stm32/main: Remove need for first_soft_reset variable.Damien George
2018-02-05stm32/main: Reorder some init calls to put them before soft-reset loop.Damien George
The calls to rtc_init_start(), sdcard_init() and storage_init() are all guarded by a check for first_soft_reset, so it's simpler to just put them all before the soft-reset loop, without the check. The call to machine_init() can also go before the soft-reset loop because it is only needed to check the reset cause which can happen once at the first boot. To allow this to work, the reset cause must be set to SOFT upon a soft-reset, which is the role of the new function machine_deinit().
2018-02-02stm32/i2c: Allow I2C peripheral state to persist across a soft reset.Damien George
The I2C sub-system is independent from the uPy state (eg the heap) and so can safely persist across a soft reset.
2018-02-02stm32/spi: Allow SPI peripheral state to persist across a soft reset.Damien George
The SPI sub-system is independent from the uPy state (eg the heap) and so can safely persist across a soft reset. And this is actually necessary for drivers that rely on SPI and that also need to persist across soft reset (eg external SPI flash memory).
2018-02-02stm32/rng: Simplify RNG implementation by accessing raw peripheral regs.Damien George
It saves code size and RAM, and is more efficient to execute.
2017-12-22stm32: Allow to build a board without any hardware I2C ports defined.Damien George
This patch adds in internal config value MICROPY_HW_ENABLE_HW_I2C that is automatically configured, and enabled only if one or more hardware I2C ports are defined in the mpconfigboard.h file. If none are defined then the pyb.I2C class is excluded from the build, along with all supporting code. The machine.I2C class will still be available for software I2C. Disabling all hardware I2C on an F4 board saves around 10,000 bytes of code and 200 bytes of RAM.
2017-12-11stm32: Add support for using the Python stack.Damien George
2017-09-06ports: Make new ports/ sub-directory and move all ports there.Damien George
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.