Hi,
I recently ported an old FreeScale system to a Nucleo H753ZI dev board (one of the few Ethernet boards available back then). Software port to Mbed is reasonably easy, hardware consists of quite a bunch of wires over to a headless donor board. This was then consolidated into a custom board using the STM32F437VIT6 (TQFP100 is plenty and there’s space restrictions, plus availability considerations again). I made two of them and both do work at least on a basic level, e.g. blinky examples and printf responses via STM32CubeIDE work fine. The board is programmed via a smaller Nucleo F103RB STLinkv2 that is known good by also running the H753 in that configuration, circumventing the STlink v3e of the H753.
Mbed however does not work at all. There’s little support of the exact chip in the first place, the Keil STM32F4 package is outdated, the STM32Cube_FW files are outdated, and basically the only thing I get back from the board is the blinking lights of death. I can move around the LED by changing PinNames.h definition (#define LED1 PE_15 // act1), but that’s about it. Debugging sessions yield nothing, as I cannot run code or even stop before code execution. There’s one warning when starting the debug, “Loadable section “RW_IRAM1” outside of ELF segments”, on which I dug deeper over the last two days into all the weird and wonderful config files, but I cannot make that go away and I don’t even know if that is a fatal error or just a warning.
So - how do I make Mbed stop right at the beginning of code execution so that I can actually watch something crash and make the thing enter mbed_die()? Any input is highly appreciated.
Debug output:
0018843:INFO:loader:Erased chip, programmed 62464 bytes (61 pages), skipped 3072 bytes (3 pages) at 3.64 kB/s
Resetting target with halt
Successfully halted device on reset
Image loaded: c:/Users/Buchwald.M/Mbed Programs/753blinky/BUILD/EL112-3/ARMC6/753blinky.elf
Note: automatically using hardware breakpoints for read-only addresses.
Pressing Pause on the Debugger adds these lines:
received signal SIGINT, Interrupt.
0x080076ca in _wait_us_ticks (ticks=400000) at .\mbed-os\platform\source/mbed_wait_api_no_rtos.c:44
44 while (((us_ticker_read() - start) & US_TICKER_MASK) < ticks);
custom_targets.json
{
"MCU_STM32F437xI": {
"inherits": [
"MCU_STM32F4"
],
"extra_labels_add": [
"STM32F437xI"
],
"macros_add": [
"STM32F437xx",
"STM32F437VITx",
"STM32F437",
"MBEDTLS_CONFIG_HW_SUPPORT"
],
"device_has_add": [
"ANALOGOUT",
"CAN",
"TRNG"
],
"device_name": "STM32F437VITx"
},
"EL112-3": {
"detect_code": [
"0799"
],
"inherits": ["MCU_STM32F437xI"],
"bootloader_supported": true
}
}
mbed_app.json:
{ "config": {
"clock_source": "USE_PLL_HSI"
}
,
"target_overrides": {
"*": {
"target.stdio_uart_tx": "PD_8",
"target.stdio_uart_rx": "PD_9",
"target.printf_lib": "std",
"target.c_lib": "std",
"platform.stdio-baud-rate": 9600,
"platform.stdio-buffered-serial": true,
"platform.default-serial-baud-rate": 9600,
"platform.error-filename-capture-enabled": true,
"platform.error-all-threads-info": true,
"platform.crash-capture-enabled": false,
"platform.stack-dump-enabled": false,
"clock_source": "USE_PLL_HSI",
"platform.use-mpu": false
}
}
}
enabling platform.crash-capture-enabled in the above field yields compile errors, which seems to be a known bug
[Error] @0,0: L6218E: Undefined symbol Image$$RW_m_crash_data$$ZI$$Base (referred from BUILD/EL112-3/ARMC6/mbed-os/platform/source/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o).
Error: L6218E: Undefined symbol Image$$RW_m_crash_data$$ZI$$Base (referred from BUILD/EL112-3/ARMC6/mbed-os/platform/source/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o).
Finished: 0 information, 0 warning and 1 error messages.
[ERROR] Error: L6218E: Undefined symbol Image$$RW_m_crash_data$$ZI$$Base (referred from BUILD/EL112-3/ARMC6/mbed-os/platform/source/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o).
Finished: 0 information, 0 warning and 1 error messages.
Similar things happen on platform.stack-dump-enabled
[Error] @0,0: L6218E: Undefined symbol __INITIAL_SP (referred from BUILD/EL112-3/ARMC6/mbed-os/platform/source/mbed_error.o).
Error: L6218E: Undefined symbol __INITIAL_SP (referred from BUILD/EL112-3/ARMC6/mbed-os/platform/source/mbed_error.o).
Finished: 0 information, 0 warning and 1 error messages.
[ERROR] Error: L6218E: Undefined symbol __INITIAL_SP (referred from BUILD/EL112-3/ARMC6/mbed-os/platform/source/mbed_error.o).
Finished: 0 information, 0 warning and 1 error messages.
Code crashing instantly includes the standard blinky or something trivial like
#include "mbed.h"
int main()
{
int i = 1;
while (true) {
wait_us(i * 1000);
i++;
}
}
(Mbed ignoring all breakpoints possible on those few lines of code)
And so on, and so forth…porting 15 year old code from a different manufacturer and architecture plus adding Ethernet connectivity for the first time ever was easy peasy compared to making code from a STM32 H753 run on a F437 as well?!