Thingy91X SWD debugging broken (SDK 3.0.1, VSCode, Windows 11)

1st issue: Tingy91X doesnt build at all with debug -Og enabled:

Because of all the strange issues of Thingy91 (nRF9151) and "not to be used in new products) we ordered a couple of the latest and greatest Thingy91X. How surprised was I to see that the vanilla sample lwm2m_client without any modifications doesn't build with debug options (-Og) enabled. How can this be fixed asap?

c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: address 0x38943 of bin\tfm_s.axf section `.ER_TFM_CODE' is not within region `FLASH'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: address 0x3b960 of bin\tfm_s.axf section `.TFM_UNPRIV_CODE' is not within region `FLASH'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: address 0x3fc40 of bin\tfm_s.axf section `.gnu.sgstubs' is not within region `FLASH'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: bin\tfm_s.axf section `.TFM_DATA' will not fit in region `FLASH'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: address 0x38943 of bin\tfm_s.axf section `.ER_TFM_CODE' is not within region `FLASH'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: address 0x3b960 of bin\tfm_s.axf section `.TFM_UNPRIV_CODE' is not within region `FLASH'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: address 0x3fc40 of bin\tfm_s.axf section `.gnu.sgstubs' is not within region `FLASH'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: region `FLASH' overflowed by 32116 bytes
Memory region Used Size Region Size %age Used
FLASH: 64372 B 32256 B 199.57%
RAM: 15460 B 40 KB 37.74%
collect2.exe: error: ld returned 1 exit status

Parents
  • In my other ticket "cannot debug Thingy91" Dejan asked me to add "CONFIG_TFM_CMAKE_BUILD_TYPE_MINSIZEREL=y" which fixed the issue on the Thingy91.

    Here on the Thingy91X it helps me to resolve the linker error from above - the project builds with debug options.

    BUT -

    2nd issue The debugger is not starting on any sample on the Thingy91X - after hitting "debug" and west flashed the image I always get a popup: "Unable to start debugging. GDB exitet unexpectedly with exit code -3. Could not connect to targt."


    Even the simplest blinky sample can SWD flash but cannot start the debugger:

Reply
  • In my other ticket "cannot debug Thingy91" Dejan asked me to add "CONFIG_TFM_CMAKE_BUILD_TYPE_MINSIZEREL=y" which fixed the issue on the Thingy91.

    Here on the Thingy91X it helps me to resolve the linker error from above - the project builds with debug options.

    BUT -

    2nd issue The debugger is not starting on any sample on the Thingy91X - after hitting "debug" and west flashed the image I always get a popup: "Unable to start debugging. GDB exitet unexpectedly with exit code -3. Could not connect to targt."


    Even the simplest blinky sample can SWD flash but cannot start the debugger:

Children
No Data
Related