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

Keil debug disabled/greyed out run button

Hi,

I am trying to debug on nRF52840 dongle using JLink debugger and Keil uVision V5.18.0 

What I have been through is here:https://devzone.nordicsemi.com/f/nordic-q-a/50579/nrf52840-dongle-dfu-bootloader-and-reset-problem

I am now able to flash the code to the dongle. You can see in the picture that it says application is running. However the application does not run. It runs the program which was previously flashed. I tried it for both sd and non-sd examples, nothing different. When in debug the code however the run button and others are disabled/greyed out. I am using exactly the same set up to debug my custom board with ISP1507 which is nRF52832 based. 

I have read some posts; one was suggesting checking the simulator option under debug tab in target for options which I did. It is not that either. 

Another observation of mine is; when I run eraseall command from nrfjprog, in Keil debug the run and the other buttons are not disabled however they do not work. When I flash the bootloader they are disabled again. 

Any ideas are appreciated. 

Parents
  • I am sorry for the consecutive posts, however I want to give details as much as I can.

    I have just visually confirmed what I have said using nrf connect. This is what I did;

    nfrjprog --family nrf52 --eraseall (done correctly)

    nrfjprog --family nrf52 --program "bootloader.hex location" --verify (it has been verified)

    nfrjprog --family nrf52 --reset (DFU light did not blink)

    I then pressed the reset button on the board and the led started blinking. I plugged it in to usb and checked the device memory layout. Bootloader and the MBR are there as expected

    Then;

    nrfjprog --family nrf52 --program "blinky.hex location" --verify (it has been verified)

    nfrjprog --family nrf52 --reset (only DFU red led blinks no other blinkies). It got into the DFU mode directly and detected by nrf connect. When I selected the device, the memory layout did not change at all. The blinky application was not there. Again there were only Bootloader and the MBR.

    After all these, I loaded the blinky application using Keil IDE. It said the application is running, however it was not. I pressed the reset button again check the memory layout, the blinky application was not there again. I tried to debug, the run button was disabled as before.

    One last thing I did; I flashed the blinky application using nrf connect, checked the memory content and it was fine. After making sure that blinky is in there, I tried to debug again and it worked! I was able to start and stop and use break points. 

    So the problem is that, Keil and nrfjprog cannot load the applications into the device via the debugger and this way of debugging is not helping much as you can guess.

    How can I overcome this?

  • Hi Denin, 

    the bootloader will calculate the CRC of the application in flash and compare it to the CRC value stored on the bootloader settings page. This check will fail as the bootloader settings page will be blank. 

    So you need to generate a bootloader settings file using nrfutil, see https://github.com/NordicSemiconductor/pc-nrfutil#settings, and then flash the settings file to the nrf52840 after flashing the botoloader using nrfjprog using --sectorerase. This will ensure that the new settings page overwrites the default one which is flashed when you flash the bootloader. 

    Best regards

    Bjørn

Reply Children
No Data
Related