nRF52840dongle new strange probelm

Upto a week I had *no* problem in programming a nRF52840 dongle with an app I am porting from the nRF52840dk.

All of a sudden I can't get the app running, the dongle appears dead.

I've reisntalled all software and notice the following behaviour.

From scratch (after reinstall of software for example) I can program the dongle with an app I developed with the nRF5SDK using segger - no problem.

Then I can program the dongle with an example program, in this case the periperal lbs example with segger and nRF Connect SDK - no problem.

If I use VSCode and program the dongle with the periperal lbs example the dongle does not work. (Even though the dongle is reported as successfully programmed (and verified if I use that option).

To get the board working again I have to reprogramme with the app from the nRF5SDK! After programming with the VScode the dongle can't be repgrammed from segger and nRF Connect SDK.

Would appreciate any suggestions to fix the problem!

Parents
  • Hi,

    I am struggling a bit to get a full understanding of this. Is it so that in all cases you are programming using a debugger (so not USB DFU via nRF Connect Programmer), and that programming etc. always works? The "only" issue is that your application from a point in time stopped working, and you only see example applications working? If so, what change did you do around the time when your application stopped working? What have you found from debugging?

    Without knowing more, and with the understanding I currently have, I wonder if it could be that you need a higher VDD than 1.8V and the changes you did a week ago cause da change in the VDD voltage (which is output of REG0)? If so, that could match with that it works after you program a example firmware, which will set REG0 output voltage to 3.0 V in UICR. As long as you don't do a full chip erase that is kept. But if you do a full chip erase UICR is also erased, and in that case your new application must also set it to 3.0 V. (This may not be the issue though, both because I don't know if this is actually what is happening, of if 1.8 V is a problem for your application).

  • Thanks for the reply.

    I've managed to narrow down the problem. It appears  erase&flash in VSCode causes the problem. I can succesfuly program with the command line command nrfjprog.

    So to be clear I'm using the nRF52840dongle attached to a nRF52840-dk to program the dongle via a TC2050 lead.

    I can generate a hex file in Segger IDE or VSCode and program with nrfjprog.

    I can program the dongle from inside the Segger IDE as normal.

    It seems just the erase&flash in VSCode causes a problem and stops the dongle being programmed until I program with an nRF5SDK based app. (Even though erase&flash reports success!).

    I haven't yet had time to go any further, but I need to understand why does the reprogramming with an nRF5SDK app 'reset' the dongle, and why is the erase&flash causing a problem.

    If you have any thought on that I'd be insterested but otherwise I'll keep plugging away.

    (As used: nrfjprog -f nrf52 --program  /opt/nordic/ncs/v1.9.1/nrf/samples/bluetooth/peripheral_lbs/build_nrf52840dongle_nrf52840/zephyr/zephyr.hex --sectorerase --verify -reset)

  • I am not able to explain this. Are you able to debug in the case when the app is not working? What do you find by debugging? Also, what if you dump the flash content and UICR and compare between working and non-working case. What is the difference?

    A simple way to dump flash in an easily readable way is like this:

    nrfjprog.exe --memrd 0 --n 0x100000 > flash_dump.txt
    nrfjprog.exe --memrd 0x10001000 --n 0x1000 > uicr_dump.txt

  • I cannot debug with a non-working app "Disassembly not available".

    Here are the dumps appropiately labelled.

  • The above were from VSCode deblocked dongle showing flash vs erase&flash.

    Here

    https://www.dropbox.com/s/ftiooy94mfu38y7/sectoreraseVSchiperase.zip?dl=0

    is a comparison between the dumps with --sectorerase and --chiperase from the nrfjprog command.

  • Also please note the same thing happens with the elf file produced in segger of the same app. Unblock and program with --sectorease ok, program with --chiperase option app doesn't work.

    Also tried an another dongle. Same thing.

Reply Children
Related