zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.77k stars 6.57k forks source link

Add MPS2 AN386 board for emulated Cortex-M4 test coverage #45319

Open stephanosio opened 2 years ago

stephanosio commented 2 years ago

Is your enhancement proposal related to a problem? Please describe.

As noted in #22870, we do not currently have Cortex-M4 test coverage in the CI because Zephyr does not support any emulation-capable boards with a Cortex-M4 core.

Cortex-M4 emulation is important for FPU testing (Cortex-M0 and Cortex-M3 cores cannot be configured with an FPU); we currently cover this using the mps2_an521_remote target, but it has some limitations.

Describe the solution you'd like

Add mps2_an386 board support (mainly for emulation).

Describe alternatives you've considered

There is #22870, which tried to introduce Cortex-M4 emulation support through the netduinoplus2 machine type, which is based on a STM32 SoC with a Cortex-M4 core; but, it is better to target an ARM reference platform.

Additional context

MPS2 AN386 documentation QEMU MPS2 AN386 implementation

stephanosio commented 2 years ago

cc @microbuilder @povergoing

microbuilder commented 1 year ago

I see QEMU was also recently updated with the mps2-an500, which is an M7 and may include support for double-precision floating point operations: https://github.com/qemu/qemu/commit/6d4811c4b688de368748c8095250ba12c905a21c

stephanosio commented 1 year ago

I see QEMU was also recently updated with the mps2-an500, which is an M7 and may include support for double-precision floating point operations: qemu/qemu@6d4811c

Yes, https://github.com/zephyrproject-rtos/zephyr/issues/22870#issuecomment-1116967262. Though, adding support for it will likely involve a bit more work than this.

JPHutchins commented 1 year ago

If I understand correctly, the current solution to test emulated M4 / M33 is to use mps2_an521 like this?

tests:
  sample.testing.ztest:
    platform_allow: mps2_an521
    tags: testing