Debugging TFM application on nrf9151

I'm not able to debug any of example applications that uses non secure build. Non ns versions works fine. I have added CONFIG_TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO=y  to my prj.conf. Debugger connects but I'm not able to pause it, place breakpoints or checking any of program variables. I'm using nrf connect with vscode.

Thank you for your help.

Parents
  • Hi,
    There was someone with a similar issue you could check out. In short you could try to set debug level in the .config file under build/{app_name}/zephyr/

    This exercise is also great to check if you are new to debugging in NCS on VSCode.

    The CONFIG_TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO symbol is for debugging the code in the Secure Processing Environment. Applications are running in the Non-secure Processing Environment and this Kconfig symbol should not matter.

Reply
  • Hi,
    There was someone with a similar issue you could check out. In short you could try to set debug level in the .config file under build/{app_name}/zephyr/

    This exercise is also great to check if you are new to debugging in NCS on VSCode.

    The CONFIG_TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO symbol is for debugging the code in the Secure Processing Environment. Applications are running in the Non-secure Processing Environment and this Kconfig symbol should not matter.

Children
  • Hi, just to bump this thread, because my experience is the same as  With an _ns application, I don't seem to be able to debug anything at all. When I run the debugger, it gets stuck either inside cmsis_gcc_m.h or at reset_handler(). If I continue, it never triggers again, and never reaches my main (which has breakpoints waiting for it). I've tried all the suggestions I could unearth from this forum (CONFIG settings; -exec mon reset ... ) , but nothing appears to work. 

    I'm working on a recent install of the nRF Connect environment in VS Code. My application is running on an nRF9151 on a custom board, and I'm using my 9151 DK as a programmer with the DEBUG OUT port (if that is relevant). 

    If I just flash the code, it seems to work fine by the way. I can capture I2C transfers on my oscilloscope and fiddle with PWM outputs. 

Related