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

Flashing nRF52DK pass but not running , J-Link and segger embedded studio

Hi,

I am using nRF52Dk dev kit with nRF_SDK_15. I did some using segger embedded studio with J-Link for debugging. I am way past the blinky stuff. I am able to flash and run on the PCA_10040 kit. I belive all my flashing and compiling environment are set. 

I was trying to use inbuilt ble_uart_app example. I am able to compile it, when I try to flash it, I could see the J-Link pop up erasing and flashing, but my example wouldnot run. I tried erasing the and re-flashing, it still would not run. I also checked whether I am flashing the soft_devices.hex its getting flashed. I tried with nfjprog, still the same. But my blinky runs anyway, if i flash it. So I went to debugging mode and clicked the play button,now my example runs. But its not running when I just flash it in donwload. The example is not occupyng too much program memory, roughly 40% of it. checked the address spaces, all seems fine. 

Thanks

Parents
  • Hi!

    I don't have any problems with the ble_app_uart example from SDK 15.

    Did you make any modifications or changes at all to the code?
    Could you test the pre-compiled hex file in the SDK? You should find this in the;
    sdk_folder/examples/ble_peripheral/ble_app_uart/hex/ble_app_uart_pca10040_s132.hex

    I also checked whether I am flashing the soft_devices.hex its getting flashed.

    Which version of the softdevice are you using?

    Best regards.

  • Hi Joakim,

    Thanks for the reply. I didnot make any changes to the code. I tried flashing them. I was using this "ble_app_uart_pca10040_s132.hex". is the SDK15 unstable any problem over my interface. I am using J-Link over USB.

    Best Regards,

    Nihadh

  • Ah ok! Then I misunderstood you.

    The ble_app_uart_pca10040_s132.hex file is the unmodified ble_app_uart application, merged with the softdevice.
    Hence, you do not need to merge that with the softdevice.

    When you build your application, i.e in SES, there will be generated a hex-file that contains only the application.
    When using SES, this hex-file can be found in:
    examples/ble_peripheral/ble_app_uart/pca10040/s132/ses/Output/Debug(or Release, depending on what configuration you are using)/Exe

    You should use that hex file and merge it with the softdevice.

    Let me know if you still face any issues.
    Best regards,
    Joakim.

  • Hi,

    I tried to merge the ble_hex from the sample with s132_nrf52_6.1.0_softdevice.hex, it works great. But when I do the same for my application hex, the merge is happening, but the application is not running. My application is also based on ble_app_uart_sample, it was not modified much, just the broadcast name.My application works well when through IDE debugging.

    Best Regards,

    Nihadh

  • I actually asked you in a previous comment about any modifications to the code, where you said that no changes were made.
    Changing the advertisment name is the only change from the original example?

    I would assume that the issue is related to the modification you made to the code.

    Maybe you could upload your project, so that I can test this myself?

    Best regards,
    Joakim

  • Hi!

    There seems to be more changes to the project than only the broadcasting name.

    There is also files included in the project that isn't included in your folder (lamp.c, lamp.h, rdm.c).

    Once I removed all the files that was not included in your folder etc. The example runs just fine. I can flash the example and it runs just as expected, no need to start the debug session.

    Maybe you could try to copy the main.c file of your modified example to the stock ble_app_uart example, and then build and flash it?

    Also, I would not recommend using the nrfx_coredep_delay_us() as you do in your project. This will halt the MCU and delay execution.
    This means that you will not be able to connect, advertise etc. as long as the delay-function is active. I would suggest using a timer instead.

    Regards.

Reply
  • Hi!

    There seems to be more changes to the project than only the broadcasting name.

    There is also files included in the project that isn't included in your folder (lamp.c, lamp.h, rdm.c).

    Once I removed all the files that was not included in your folder etc. The example runs just fine. I can flash the example and it runs just as expected, no need to start the debug session.

    Maybe you could try to copy the main.c file of your modified example to the stock ble_app_uart example, and then build and flash it?

    Also, I would not recommend using the nrfx_coredep_delay_us() as you do in your project. This will halt the MCU and delay execution.
    This means that you will not be able to connect, advertise etc. as long as the delay-function is active. I would suggest using a timer instead.

    Regards.

Children
Related