You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(this is not a bug report or feature request, I just wanted to document the results of a brief exploration)
Having started using DocTest recently (impressive!), I wanted to try and see if it could be used for embedded µC development as well, and for starters I'm focusing on STM32 µCs. The larger chips have 512 kB flash + 128 kB RAM, or more. For a first test, I'm using their low-cost 32F723EDISCOVERY board, with PlatformIO as build tool to manage all the arm-none-eabi-* details.
The first experiment was simply to try and compile a main app with one CHECK in it. Results:
as is, no special options, the compiler complains about issues in signal.h and about mutex
with DOCTEST_CONFIG_NO_POSIX_SIGNALS defined, the list narrows down to basically this:
doctest.h: error: 'mutex' in namespace 'std' does not name a type
doctest.h: error: 'mutex' is not a member of 'std'
doctest.h: error: 'mutex' was not declared in this scope
doctest.h: error: template argument 1 is invalid
doctest.h: note: suggested alternative: 'quoted'
doctest.h: warning: unused variable 'lock' [-Wunused-variable]
I removed the XML & JUnit reporters and commented out a few remaining references to mutex in the console reporter:
$ pio run
Processing embed (platform: ststm32; framework: cmsis; board: disco_f723ie)
-------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/disco_f723ie.html
PLATFORM: ST STM32 (13.0.0) > 32F723EDISCOVERY
HARDWARE: STM32F723IEK6 216MHz, 192KB RAM, 512KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
- framework-cmsis 2.50501.200527 (5.5.1)
- framework-cmsis-stm32f7 1.2.5
- tool-dfuutil 1.9.200310
- tool-ldscripts-ststm32 0.1.0
- tool-openocd 2.1000.200630 (10.0)
- tool-stm32duino 1.0.1
- toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ strict
Found 11 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/embed/src/main.o
Linking .pio/build/embed/firmware.elf
Checking size .pio/build/embed/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 3.6% (used 7056 bytes from 196608 bytes)
Flash: [==== ] 36.5% (used 191348 bytes from 524288 bytes)
Configuring upload protocol...
(this is not a bug report or feature request, I just wanted to document the results of a brief exploration)
Having started using DocTest recently (impressive!), I wanted to try and see if it could be used for embedded µC development as well, and for starters I'm focusing on STM32 µCs. The larger chips have 512 kB flash + 128 kB RAM, or more. For a first test, I'm using their low-cost 32F723EDISCOVERY board, with PlatformIO as build tool to manage all the
arm-none-eabi-*
details.The first experiment was simply to try and compile a main app with one CHECK in it. Results:
signal.h
and aboutmutex
DOCTEST_CONFIG_NO_POSIX_SIGNALS
defined, the list narrows down to basically this:I removed the XML & JUnit reporters and commented out a few remaining references to
mutex
in the console reporter:As you can see, the result compiles and uploads.
This is the source setup I'm using:
This is
main.cpp
:And this is the
platformio.ini
configuration:That's just a first step, as the output needs to be directed to a h/w UART for this to be of use. But it looks promising to me.
FWIW, the Unity test framework supports embedded builds via a very simple API, see this documentation, for example.
IMO, it would be really nice if doctest can be made to run on such embedded systems as well. It definitely seems very doable.
The text was updated successfully, but these errors were encountered: