Due to post-build script not supporting custom board, both the below UART configurations are enabled on NuMaker-IoT-M2354 board:
- UART0 PA7/PA6 enabled by bl2.bin
- UART0 PB9/PB8 enabled by tfm_s.bin and later by mbed
Both PA7/PA6 and PB9/PB8 enabled on UART0, PB8 gets disturbed and stdin mis-behaves on NuMaker-IoT-M2354 board.
NuMaker-M2354 : UART TX/RX = UART0 PA7/PA6
NuMaker-IoT_M2354 : UART TX/RX = UART0 PB9/PB8
This bugfix tries to enable post-build for custom board to some degree (not completely), with Mbed CLI.
NOTE: For Mbed CLI, the build process still sees NuMaker-M2354's partition/ and applies its mcuboot build options. Custom board must align on these.
Add
- STM32G050K8Tx for all STM32G050x8 targets
- STM32G051K8Tx for all STM32G051x8 targets
- STM32G061K8Tx for all STM32G061x8 targets
- STM32G0B0RETx for all STM32G0B0xE targets
- STM32G0B1RETx for all STM32G0B1xE targets
The most common extension for static libraries is .a and CMake generates
it with both GCC and Arm toolchains. Mbed CLI 1 generates .ar files with
the Arm Compiler, but since Mbed CLI 2 uses memap.py to generate map
files too, both extensions should be permitted.
This fixes a warning when building greentea tests:
Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o)
Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o)
Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o)
...
which repeats over 30 times per test.
1. In TF-M, fix NSPE interrupt-disabled NSC call broken. Check:
https://developer.trustedfirmware.org/T966
2. In TF-M, enable mcuboot log enabled forcibly. This is to help check firmware update process.
3. Update readme and script
Change MCUboot image versioning to meet requirements below:
1. Major.Minor.Revision must be non-decremental when used to derive security counter (-s 'auto').
2. Make Major.Minor.Revision+Build incremental to identify the firmware itself through psa_fwu_query().
3. Get around MCUboot failure with TF-M underestimated MAX_BOOT_RECORD_SZ
We put macros in a response file compile_time_defs.txt and pass it
to the compiler. Adding a pair of single quotes around each -D flag
ensures macro values are quoted correctly.
For example,
* String
* target_compile_definitions(): either FOO="BAR" or FOO=\"BAR\"
* response file: '-DFOO="BAR"'
* actual definition: #define FOO "BAR"
* Array of integers
* target_compile_definitions(): FOO={1, 2, 3}
* response file: '-DFOO={1, 2, 3}'
* actual definition: #define FOO {1, 2, 3}
Add a new argument `TEST_SKIPPED` to `mbed_greentea_add_test()` to
indicate a test is skipped and give a reason (e.g. the Mbed target
and/or configuration does not provide what the test requires).
The skip reason of a test is printed when running tests with `ctest`,
and the test is marked as "Skipped" in the test report.
Call add_test in mbed_greentea_add_test and specify mbedhtrun as the
command to run.
An MBED_HTRUN_ARGUMENTS variable has been added, which is a semicolon
separated list of arguments to forward to htrun. The user is required to
pass in any arguments mbedhtrun needs to communicate with the device
under test at CMake configuration time.
We automate passing some of the htrun arguments in CMake using data
provided by mbed_config.cmake or gathered from the CMake environment.
The following arguments are passed to htrun from CMake:
* -f/--image-path
* -e/--enum-host-tests
* -m/--micro
* -R/--reset-timeout
--baud-rate is also passed if the MBED_CONF_PLATFORM_STDIO_BAUD_RATE
config parameter is defined.
Temporary checks have been added to mbed_greentea_add_test to keep the
old flow working until we port all of the greentea tests to CTest. These
checks should be removed after we make all greentea tests runnable by
CTest.
1. Change from single image boot to multiple image boot
2. SDH is configured to Secure for placing update firmware. It becomes inaccessible to Mbed.
3. Post-build script supports both multiple image boot and single image boot
4. Update readme to reflect above change
5. Increase forced_reset_timeout due to longer booting time for Greentea test
The variable for archiver is automatically set by CMake. There is
no need to explicitly set it, unless a project really needs to
override the default archiver.
CMake versions 3.20 and below always add compiler and linker flags
based on `CMAKE_SYSTEM_PROCESSOR`, for example `--cpu=Cortex-M33`.
This sometimes overrides flags we set in tools/cmake/cores/*.cmake
and results in link failure or unbootable binaries. To workaround
this, we added more linker flags to "counter" what CMake automatically
adds.
From CMake 3.21 onwards, CMake by default does not add flags to
armclang anymore, and it fully relies on projects to set all flags.
In this case we do not need to set `CMAKE_SYSTEM_PROCESSOR` or use
workarounds anymore. We still turn on workarounds when an older
version of CMake (3.19 and 3.20) is used, but in the future we might
require users to have at least CMake 3.21.
As we're moving away from the use of CMAKE_SYSTEM_PROCESSOR, use
MBED_CPU_CORE instead. They differ in cases, but both GCC and Arm
toolchains support case-insensitive CPU names.
When building greentea tests, each test is an executable with its
own output binary path. This is also the case when a user project
produces multiple executables. But the current implementation of
post-build operations always assumes there's only one executable,
at the root of the build directory.
The post-build command depends on Mbed target, and it always takes
the the executable we build as an input file. To achieve this, we
let each Mbed target (that has a post-build command) define a function
function(mbed_post_build_function target)
which takes a CMake executable target as an argument from which it can
get its binary path using generator expressions. It generates and adds
to the passed executable target a post-build custom command.
Notes:
* The function name needs to be exact, because CMake only supports
literal function calls - CMake can't dereference a function name from
a variable. To avoid multiple definitions of this function, each Mbed
target needs to guard it with a macro to check if the user is
building this Mbed target.
* `mbed_post_build_function()` is a function, but it is usually
defined by another macro rather than a parent function, because
nesting functions would make many variables inaccessible inside the
innermost `mbed_post_build_function()`.
* There's no more need to force regenerate images. Previously, post-
build commands were custom *targets* which always got to run, so we
force regenerated images on every build to avoid patching an image
that's already been patched once on previous build. Now post-build
commands are custom *commands* of the same executable target, and they
are only run if the executable target itself is rebuilt.
The 'post build' functions are made visible by adding the mbed-os
subdirectory. This is not ideal as any components in mbed-os wishing to
call the functions must be added after the functions are defined. To
improve modularity move these functions to a separate CMake script.
We include the post build CMake script in app.cmake for now so we don't
break user's projects.