Files
micropython/ports/samd/mcu
Damien George a43a8ac89e py/mpconfig: Automatically configure thumb2 and float emitter features.
Prior to this commit a port would need to manually configure the
`MICROPY_EMIT_THUMB_ARMV7M` and `MICROPY_EMIT_INLINE_THUMB_FLOAT` options,
based on whether the CPU is Thumb2 and whether it has hardware floating
point support (eg Cortex-M0+ vs Cortex-M3 vs Cortex-M4).

This is error prone, for example on stm32:
- `NUCLEO_G0B1RE` (a Cortex-M0+ MCU) had both enabled even though neither
  options work on that target.
- `NUCLEO_L152RE` (a Cortex-M3 MCU) had both enabled but this target does
  not support hardware floating point.

The change here automatically enables the two options based on built-in
compiler macros.

This change is tested on the following boards:
- alif ALIF_ENSEMBLE: both enabled
- rp2 RPI_PICO: both disabled
- rp2 RPI_PICO2: both enabled
- samd SAMD21_XPLAINED_PRO: both disabled
- samd SAMD_GENERIC_D51X20: both enabled
- stm32 NUCLEO_G0B1RE: both disabled
- stm32 NUCLEO_L152RE: only MICROPY_EMIT_THUMB_ARMV7M enabled
- stm32 PYBD_SF6: both enabled
- stm32 PYBV10: both enabled

Signed-off-by: Damien George <damien@micropython.org>
2026-04-15 15:49:44 +10:00
..