micropython/ports/qemu-arm
Angus Gratton decf8e6a8b all: Remove the "STATIC" macro and just use "static" instead.
The STATIC macro was introduced a very long time ago in commit
d5df6cd44a.  The original reason for this was
to have the option to define it to nothing so that all static functions
become global functions and therefore visible to certain debug tools, so
one could do function size comparison and other things.

This STATIC feature is rarely (if ever) used.  And with the use of LTO and
heavy inline optimisation, analysing the size of individual functions when
they are not static is not a good representation of the size of code when
fully optimised.

So the macro does not have much use and it's simpler to just remove it.
Then you know exactly what it's doing.  For example, newcomers don't have
to learn what the STATIC macro is and why it exists.  Reading the code is
also less "loud" with a lowercase static.

One other minor point in favour of removing it, is that it stops bugs with
`STATIC inline`, which should always be `static inline`.

Methodology for this commit was:

1) git ls-files | egrep '\.[ch]$' | \
   xargs sed -Ei "s/(^| )STATIC($| )/\1static\2/"

2) Do some manual cleanup in the diff by searching for the word STATIC in
   comments and changing those back.

3) "git-grep STATIC docs/", manually fixed those cases.

4) "rg -t python STATIC", manually fixed codegen lines that used STATIC.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-03-07 14:20:42 +11:00
..
test-frzmpy examples: Mark asm, pio, etc. as noqa: F821 (undefined-name). 2023-08-16 16:12:33 +10:00
Makefile ports: Switch build to use common lib/libm list of source files. 2023-12-08 15:42:41 +11:00
Makefile.test tools/tinytest-codegen.py: Externalise tests list. 2023-11-07 15:53:27 +11:00
README.md docs: Update links for Arm GCC toolchain. 2022-08-11 14:27:06 +10:00
imx6.ld qemu-arm: Add support for Cortex-A9 via sabrelite board. 2021-05-26 16:24:00 +10:00
main.c py/builtinevex: Handle invalid filenames for execfile. 2023-10-12 15:17:59 +11:00
modmachine.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
mpconfigport.h qemu-arm/mpconfigport: Use MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES. 2024-01-29 13:07:31 +11:00
mphalport.h qemu-arm: Rework to run bare-metal on boards with Cortex-M CPUs. 2019-02-12 13:50:01 +11:00
mps2.ld qemu-arm: Rework to run bare-metal on boards with Cortex-M CPUs. 2019-02-12 13:50:01 +11:00
nrf51.ld qemu-arm: Rework to run bare-metal on boards with Cortex-M CPUs. 2019-02-12 13:50:01 +11:00
qstrdefsport.h all: Add *FORMAT-OFF* in various places. 2020-02-28 10:31:07 +11:00
startup.c qemu-arm: Add support for Cortex-A9 via sabrelite board. 2021-05-26 16:24:00 +10:00
stm32.ld qemu-arm: Rework to run bare-metal on boards with Cortex-M CPUs. 2019-02-12 13:50:01 +11:00
test_main.c py/builtinevex: Handle invalid filenames for execfile. 2023-10-12 15:17:59 +11:00
tests_profile.txt tools/tinytest-codegen.py: Externalise tests list. 2023-11-07 15:53:27 +11:00
uart.c qemu-arm: Add support for Cortex-A9 via sabrelite board. 2021-05-26 16:24:00 +10:00
uart.h qemu-arm: Rework to run bare-metal on boards with Cortex-M CPUs. 2019-02-12 13:50:01 +11:00

README.md

This is experimental, community-supported port for Cortex-M emulation as provided by QEMU (http://qemu.org).

The purposes of this port are to enable:

  1. Continuous integration
    • run tests against architecture-specific parts of code base
  2. Experimentation
    • simulation & prototyping of anything that has architecture-specific code
    • exploring instruction set in terms of optimising some part of MicroPython or a module
  3. Streamlined debugging
    • no need for JTAG or even an MCU chip itself
    • no need to use OpenOCD or anything else that might slow down the process in terms of plugging things together, pressing buttons, etc.

This port will only work with the [GNU ARM Embedded Toolchain]( https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads and not with CodeSourcery toolchain. You will need to modify LDFLAGS if you want to use CodeSourcery's version of arm-none-eabi. The difference is that CodeSourcery needs -T generic-m-hosted.ld while ARM's version requires --specs=nano.specs --specs=rdimon.specs to be passed to the linker.

To build and run image with builtin testsuite:

make -f Makefile.test test