This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF5340 Debugging using "Segger Embedded Studio" for Bluetooth related APIs

Hi Nordic Team,

1. Actually we try to debug "Mesh Light" sample code using "Build and Debug" option of Segger Embedded Studio..
2. Unfortunately debugging stopped at below line of API bt_enable() of hci_core.c
err = bt_dev.drv->open();
3. But by programming the "merged_domains.hex" through nRF connect programmer , able to see the only serial print message(in putty)
like "printk("BT driver opened...\n");
printk("Bluetooth initialized\n");
printk("Mesh initialized\n");

Please clarify the below queries:
1. shall we know which file will be loaded when clicking the
"Build and Debug" option of "Segger Embedded Studio"
2. Is any option present to choose the file to be loaded for debug in
"Segger Embedded Studio"

3. What is the proper option of "Segger Embedded Studio" for debugging of
blue mesh related codes?

Thanks
Selvam

Parents
  • Hi Selvam, 

    Before testing with debugging have you verified that it actually works an run normally. If you use nRF Mesh on the phone can you scan for the unprovisioned mesh node ? 

    Please made sure the network core has been flashed with the merged_CPUNET.hex inside \mesh\light\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\ 
    It's the sub-image hci_rpmsg for the netcore that's compiled when you compile the mesh light example. 

    If you follow the instruction here at Programming the network sample from SES you can find how to make it flashed automatically when you flash the application core but if not you can just use nrf Connect Programmer to flash merged_CPUNET.hex to the network core, or you can use nrfjprog.exe 

    After that you can start flashing the application core using Segger embedded studio (it will flash merged.hex inside \mesh\light\build_nrf5340dk_nrf5340_cpuapp\zephyr) and can debug from there. 

  • Thanks for the response Hung Bui,

    Yes mesh light is actually works fine and run normally and able to control LED on nRF5340 DK.

    Ensured that merged_CPUNET.hex is present at \mesh\light\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\ - it looks like old date.

    Will it not updated during clean-build through "Segger Embedded Studio"?

    More understanding from your inputs:

    If the link "Working with nRF53 Series — nRF Connect SDK 1.5.99 documentation (nordicsemi.com)" for programming the network sample from SES confuse, we shall follow the below steps:

    1. Load the merged_CPUNET.hex from \mesh\light\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\ using nRF using "nrf Connect Programmer".

    2. Load the merged.hex through build and debug option of "Segger Embedded Studio".

    3. Now we can debug.

    Please correct us, if understanding need corrections.

    Thanks

    Selvam

  • Hi Selvam, 

    Yes you can do my suggested steps. At the end of the day they are the same.

     The important part is that you flash merged_CPUNET.hex into the network core and flash the merged.hex in the application core for debugging. 

    Note you only need to flash the merged_CPUNET.hex once if you haven't made any change to the network code. 

Reply Children
No Data
Related