Skip to content

Conversation

@wdx04
Copy link

@wdx04 wdx04 commented May 25, 2025

Summary of changes

Enables ICACHE, LPTICKER, TRNG and WATCHDOG features for the STM32H5 family.
MPU Region 5 is used to avoid hardfaults when ICACHE is enabled:
https://community.st.com/t5/stm32-mcus/how-to-avoid-a-hardfault-when-icache-is-enabled-on-the-stm32h5/ta-p/630085

Impact of changes

Migration actions required

Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

I run GreenTea tests on a NUCLEO-H563ZI board and passed the LPTICKER, TRNG and WATCHDOG tests.
The hal-sleep test failed when LPTICKER is used as wakup source from deepsleep mode, but it seems unrelated to LPTICKER itself: even if I comment out the code that setup the LPTICKER interrupt, the system will still wake up from deepsleep mode after 309 ticks. The netsocket related tests failed with Hard Faults. I'm not sure how to setup the test environments for netsocket tests or skip them.

greentea-log-nucleo-h563zi.txt


@multiplemonomials
Copy link
Collaborator

I can test this on my end to see what's up with the Ethernet tests.

@multiplemonomials
Copy link
Collaborator

OK I ran the netsocket tests and set a breakpoint on MemManage_Handler. It appears that it's crashing when trying to get the MAC address!

image

@multiplemonomials
Copy link
Collaborator

Interesting, it appears that this is the result of the workaround that you linked (for making the OTP memory non-cacheable) not actually working. Despite the workaround, we are seeing a data access violation when trying to access OTP memory.

I think I figured out why, as well. If you look at mbed_mpu_init() in mbed_mpu_v8m.c, this is actually resetting all MPU regions when it runs, and changing other MPU config as well! So that's why your workaround is getting wiped away. Sure enough, if I add return at the start of mbed_mpu_init(), the network tests start working.

I think the proper fix for this issue is to make STM32H5 use MBED_MPU_CUSTOM, since it needs this workaround that requires non-standard MPU configuration. I did this recently for the MCU_LPC546XX target. Basically you have to copy mbed_mpu_v8m.c to the TARGET_STM32H5 folder and change it to use the correct MPU configuration for STM32H5. Then you have to add MBED_MPU_CUSTOM in the macros section of MCU_STM32H5 in targets.json.

@wdx04
Copy link
Author

wdx04 commented Jun 12, 2025

Interesting, it appears that this is the result of the workaround that you linked (for making the OTP memory non-cacheable) not actually working. Despite the workaround, we are seeing a data access violation when trying to access OTP memory.

I think I figured out why, as well. If you look at mbed_mpu_init() in mbed_mpu_v8m.c, this is actually resetting all MPU regions when it runs, and changing other MPU config as well! So that's why your workaround is getting wiped away. Sure enough, if I add return at the start of mbed_mpu_init(), the network tests start working.

I think the proper fix for this issue is to make STM32H5 use MBED_MPU_CUSTOM, since it needs this workaround that requires non-standard MPU configuration. I did this recently for the MCU_LPC546XX target. Basically you have to copy mbed_mpu_v8m.c to the TARGET_STM32H5 folder and change it to use the correct MPU configuration for STM32H5. Then you have to add MBED_MPU_CUSTOM in the macros section of MCU_STM32H5 in targets.json.

Thanks for looking into this! Yes, the workaround to make OTP memory non-cacheable is not working. But this is not because the mbed_mpu_init() function resets all the MPU regions, but because Armv8-M (unlike Armv7-M) does not allow MPU regions to overlap. The mbed_mpu_init() function is actually called before mbed_sdk_init() or SetSysClock(), so it won't wipe away our new region. We only need to change the address range of Region 0 from 0x00000000-0x0FFFFFFF to 0x00000000-0x08FFF7FF, and leave 0x08FFF800-0x0FFFFFFF to Region 5.

…ult implementation for STM32F7/H7 with L1 cache

override Cache_Init() function for STM32U5/H5
Cache_Init() function is called by mbed_sdk_init()
@multiplemonomials
Copy link
Collaborator

Ah, excellent find! I was not aware about that quirk of ARMv8! Tested your latest branch and it works perfectly with the network tests.

@multiplemonomials
Copy link
Collaborator

but it seems unrelated to LPTICKER itself: even if I comment out the code that setup the LPTICKER interrupt, the system will still wake up from deepsleep mode after 309 ticks.

Ah yeah, sounds like another interrupt is waking it up. I actually debugged a similar issue to this once on nRF52840, and I did it by manually disabling every single interrupt prior to entering deep sleep, then commenting out the disabling code one by one until the issue started happening again. That allowed me to narrow it down to the UART interrupt (turns out it was still sending stuff during the deep sleep test, causing the UART to wake it up).

Is it possible that the system tick is waking it up? I am not sure but maybe we need to enable tickless mode?

@wdx04
Copy link
Author

wdx04 commented Jun 13, 2025

Ah yeah, sounds like another interrupt is waking it up. I actually debugged a similar issue to this once on nRF52840, and I did it by manually disabling every single interrupt prior to entering deep sleep, then commenting out the disabling code one by one until the issue started happening again. That allowed me to narrow it down to the UART interrupt (turns out it was still sending stuff during the deep sleep test, causing the UART to wake it up).

Is it possible that the system tick is waking it up? I am not sure but maybe we need to enable tickless mode?

How did you fix the problem after you found out that it was the UART interrupt to wake up the system?

Tickless mode is already enabled for STM32H5 family.

mbed-os/targets/targets.json5

Lines 3100 to 3103 in 40a020a

"macros_add": [
"EXTRA_IDLE_STACK_REQUIRED",
"MBED_TICKLESS"
],

@wdx04
Copy link
Author

wdx04 commented Jun 14, 2025

Ah, excellent find! I was not aware about that quirk of ARMv8! Tested your latest branch and it works perfectly with the network tests.

I still haven't been able to pass any of the nanostack tests, the lwipstack-tls test and the network-emac test.
I'm running the tests on a Windows 11 machine, with the firewall disabled.
What's your host system type to run the tests? Windows or Linux?

Actually, I'm getting compliation errors on the lwip test executables because OnboardNetworkStack::get_default_instance() has multiple definitions(see the attached log). They can be compiled if I comment out one of the definitions.
greentea-log.txt
greentea-ninja.txt

@multiplemonomials
Copy link
Collaborator

How did you fix the problem after you found out that it was the UART interrupt to wake up the system?

In this case I had to add an additional sleep in the test so that it had time to finish printing everything before it went to sleep

@multiplemonomials
Copy link
Collaborator

Actually, I'm getting compliation errors on the lwip test executable

Huh, I don't see any compilation errors in the attached log. Also I don't think the github actions CI would pass if the tests didn't compile. What's the error you're running into?

@multiplemonomials
Copy link
Collaborator

I checked the network tests with your branch, and everything seems to pass on my end except for two of the nanostack tests (which currently do not pass consistently, these are tests I recently added to confirm that nanostack actually works and are not expected to reliably pass). Also the TLS tests are failing but I do not think that's related to your branch.

I am good to merge this except for the LP ticker issue. Would it be possible to revert adding LP ticker in this PR and make a separate PR for that one so we can dig deeper into the issue?

@wdx04
Copy link
Author

wdx04 commented Jun 17, 2025

Actually, I'm getting compliation errors on the lwip test executable

Huh, I don't see any compilation errors in the attached log. Also I don't think the github actions CI would pass if the tests didn't compile. What's the error you're running into?

In the attached greentea-ninja.txt:

[1169/1178] Linking CXX executable connectivity\netsocket\...ket\tcp\test-mbed-connectivity-netsocket-lwipstack-tcp.elf
FAILED: connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.elf
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D D:\Develop\Mbed\mbed-ce-app\greentea-h563\connectivity\netsocket\tests\TESTS\netsocket\tcp && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E touch D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.elf.map && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E rename D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.elf.map D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.elf.map.old && cd D:\Develop\Mbed\mbed-ce-app\greentea-h563" && D:\Develop\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-g++.exe -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mcpu=cortex-m33+nodsp+nofp -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -Wl,-Map=D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf -T D:/Develop/Mbed/mbed-ce-app/greentea-h563/mbed-nucleo-h563zi.link_script.ld @CMakeFiles\test-mbed-connectivity-netsocket-lwipstack-tcp.rsp -o connectivity\netsocket\tests\TESTS\netsocket\tcp\test-mbed-connectivity-netsocket-lwipstack-tcp.elf  && C:\WINDOWS\system32\cmd.exe /C "cd /D D:\Develop\Mbed\mbed-ce-app\greentea-h563\connectivity\netsocket\tests\TESTS\netsocket\tcp && D:\Develop\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-objcopy.exe -O binary D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.elf D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.bin && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E echo "-- built: D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.bin" && D:\Develop\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-objcopy.exe -O ihex D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.elf D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.hex && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E echo "-- built: D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.hex" && cd /D D:\Develop\Mbed\mbed-ce-app\mbed-os\tools\python && C:\Python311\python.exe -m memap.memap -t GCC_ARM D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tcp/test-mbed-connectivity-netsocket-lwipstack-tcp.elf.map --depth 2 --memory-banks-json D:/Develop/Mbed/mbed-ce-app/greentea-h563/memory_banks.json""
D:/Develop/STM32CubeCLT_1.18.0/GNU-tools-for-STM32/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: connectivity/lwipstack/libmbed-lwipstack.a(LWIPStack.cpp.obj): in function `OnboardNetworkStack::get_default_instance()':
D:/Develop/Mbed/mbed-ce-app/mbed-os/connectivity/lwipstack/source/LWIPStack.cpp:821: multiple definition of `OnboardNetworkStack::get_default_instance()'; connectivity/netsocket/tests/TESTS/common/libmbed-netsocket-tests-use-lwipstack.a(greentea_network_stack_lwipstack.cpp.obj):D:/Develop/Mbed/mbed-ce-app/mbed-os/connectivity/netsocket/tests/TESTS/common/greentea_network_stack_lwipstack.cpp:23: first defined here
collect2.exe: error: ld returned 1 exit status
[1170/1178] Linking CXX executable connectivity\netsocket\...ket\udp\test-mbed-connectivity-netsocket-lwipstack-udp.elf
FAILED: connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.elf
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D D:\Develop\Mbed\mbed-ce-app\greentea-h563\connectivity\netsocket\tests\TESTS\netsocket\udp && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E touch D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.elf.map && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E rename D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.elf.map D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.elf.map.old && cd D:\Develop\Mbed\mbed-ce-app\greentea-h563" && D:\Develop\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-g++.exe -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mcpu=cortex-m33+nodsp+nofp -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -Wl,-Map=D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf -T D:/Develop/Mbed/mbed-ce-app/greentea-h563/mbed-nucleo-h563zi.link_script.ld @CMakeFiles\test-mbed-connectivity-netsocket-lwipstack-udp.rsp -o connectivity\netsocket\tests\TESTS\netsocket\udp\test-mbed-connectivity-netsocket-lwipstack-udp.elf  && C:\WINDOWS\system32\cmd.exe /C "cd /D D:\Develop\Mbed\mbed-ce-app\greentea-h563\connectivity\netsocket\tests\TESTS\netsocket\udp && D:\Develop\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-objcopy.exe -O binary D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.elf D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.bin && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E echo "-- built: D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.bin" && D:\Develop\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-objcopy.exe -O ihex D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.elf D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.hex && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E echo "-- built: D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.hex" && cd /D D:\Develop\Mbed\mbed-ce-app\mbed-os\tools\python && C:\Python311\python.exe -m memap.memap -t GCC_ARM D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/udp/test-mbed-connectivity-netsocket-lwipstack-udp.elf.map --depth 2 --memory-banks-json D:/Develop/Mbed/mbed-ce-app/greentea-h563/memory_banks.json""
D:/Develop/STM32CubeCLT_1.18.0/GNU-tools-for-STM32/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: connectivity/lwipstack/libmbed-lwipstack.a(LWIPStack.cpp.obj): in function `OnboardNetworkStack::get_default_instance()':
D:/Develop/Mbed/mbed-ce-app/mbed-os/connectivity/lwipstack/source/LWIPStack.cpp:821: multiple definition of `OnboardNetworkStack::get_default_instance()'; connectivity/netsocket/tests/TESTS/common/libmbed-netsocket-tests-use-lwipstack.a(greentea_network_stack_lwipstack.cpp.obj):D:/Develop/Mbed/mbed-ce-app/mbed-os/connectivity/netsocket/tests/TESTS/common/greentea_network_stack_lwipstack.cpp:23: first defined here
collect2.exe: error: ld returned 1 exit status
[1171/1178] Linking CXX executable connectivity\netsocket\...ket\tls\test-mbed-connectivity-netsocket-lwipstack-tls.elf
FAILED: connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.elf
C:\WINDOWS\system32\cmd.exe /C "C:\WINDOWS\system32\cmd.exe /C "cd /D D:\Develop\Mbed\mbed-ce-app\greentea-h563\connectivity\netsocket\tests\TESTS\netsocket\tls && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E touch D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.elf.map && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E rename D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.elf.map D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.elf.map.old && cd D:\Develop\Mbed\mbed-ce-app\greentea-h563" && D:\Develop\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-g++.exe -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-psabi -Wno-packed-bitfield-compat -fmessage-length=0 -fno-exceptions -ffunction-sections -fdata-sections -funsigned-char -fomit-frame-pointer -g3 -mthumb -mcpu=cortex-m33+nodsp+nofp -Wno-register -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group -specs=nosys.specs -Wl,--cref    -Wl,-Map=D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.elf.map -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,--wrap,printf -Wl,--wrap,sprintf -Wl,--wrap,snprintf -Wl,--wrap,vprintf -Wl,--wrap,vsprintf -Wl,--wrap,vsnprintf -Wl,--wrap,fprintf -Wl,--wrap,vfprintf -T D:/Develop/Mbed/mbed-ce-app/greentea-h563/mbed-nucleo-h563zi.link_script.ld @CMakeFiles\test-mbed-connectivity-netsocket-lwipstack-tls.rsp -o connectivity\netsocket\tests\TESTS\netsocket\tls\test-mbed-connectivity-netsocket-lwipstack-tls.elf  && C:\WINDOWS\system32\cmd.exe /C "cd /D D:\Develop\Mbed\mbed-ce-app\greentea-h563\connectivity\netsocket\tests\TESTS\netsocket\tls && D:\Develop\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-objcopy.exe -O binary D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.elf D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.bin && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E echo "-- built: D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.bin" && D:\Develop\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-objcopy.exe -O ihex D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.elf D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.hex && D:\Develop\STM32CubeCLT_1.18.0\CMake\bin\cmake.exe -E echo "-- built: D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.hex" && cd /D D:\Develop\Mbed\mbed-ce-app\mbed-os\tools\python && C:\Python311\python.exe -m memap.memap -t GCC_ARM D:/Develop/Mbed/mbed-ce-app/greentea-h563/connectivity/netsocket/tests/TESTS/netsocket/tls/test-mbed-connectivity-netsocket-lwipstack-tls.elf.map --depth 2 --memory-banks-json D:/Develop/Mbed/mbed-ce-app/greentea-h563/memory_banks.json""
D:/Develop/STM32CubeCLT_1.18.0/GNU-tools-for-STM32/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: connectivity/lwipstack/libmbed-lwipstack.a(LWIPStack.cpp.obj): in function `OnboardNetworkStack::get_default_instance()':
D:/Develop/Mbed/mbed-ce-app/mbed-os/connectivity/lwipstack/source/LWIPStack.cpp:821: multiple definition of `OnboardNetworkStack::get_default_instance()'; connectivity/netsocket/tests/TESTS/common/libmbed-netsocket-tests-use-lwipstack.a(greentea_network_stack_lwipstack.cpp.obj):D:/Develop/Mbed/mbed-ce-app/mbed-os/connectivity/netsocket/tests/TESTS/common/greentea_network_stack_lwipstack.cpp:23: first defined here
collect2.exe: error: ld returned 1 exit status

@multiplemonomials
Copy link
Collaborator

Ah I bet I know what happened, you need to pass

-DMBED_APP_JSON_PATH=TESTS/configs/greentea_full.json5

when compiling greentea tests. That contains the critical line

"nsapi.default-stack": null,

which disables the definition of the network stack. It should say this in the docs somewhere, does it not? Maybe still need to add that X_X.

@multiplemonomials multiplemonomials changed the title Enable ICACHE, LPTICKER, TRNG and WATCHDOG for STM32H5 Enable ICACHE, TRNG and WATCHDOG for STM32H5 Jun 18, 2025
@multiplemonomials
Copy link
Collaborator

Thanks so much for submitting this!

@multiplemonomials multiplemonomials merged commit 8ac2744 into mbed-ce:master Jun 18, 2025
52 checks passed
@wdx04 wdx04 deleted the stm32h5-icache-trng-wdg-lpticker branch July 12, 2025 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants