6 years, 11 months ago.

Nordic nRF52-DK disconnects from computer when uploading compiled BIN files from mbed

I have a Nordic nRF52-DK that I am using to create and run programs written using the mbed compiler. I have followed the instructions outlined here on the mbed website( https://os.mbed.com/platforms/Nordic-...) for uploading the current firmware also provided on that website. Now, whenever I try to upload a compiled BIN file that I have written and compiled using the mbed compiler, the board disconnects from my computer and immediately reconnects, whilst having no compiled BIN file on the board. Also, at random points while the board is connected and I am doing things not related to the board, like traversing the internet, the board will also disconnect and reconnect.

1 Answer

6 years, 11 months ago.

Hi Keith,

When the .bin file is copied to your board, the expected behavior is that when the file is successfully copied over, the board will disconnect and then reconnect itself to your computer (effectively resetting itself so the flashed program/.bin file will begin running). As for the random disconnecting/reconnecting, this might be related to your computer and how it handles detecting when something is connected to its USB ports. Also, after it disconnects then reconnects, you will no longer see the .bin file on the board when you view it in your file system viewer on your computer (this represents that that .bin file was copied by the board to its flash memory successfully).

Is your .bin file running on the board successfully? I would add some printf statements to your code and check it's output when your board is running your program and connected to your computer. You can see these printf statements by connected to your board's serial port in a serial terminal viewer. More instructions on this process can be viewed here: https://os.mbed.com/docs/latest/tutorials/serial-comm.html

Please let me know if you have any questions!

- Jenny, team Mbed

I also noticed a file titled "fail.txt" that appears on the board's root directory after it disconnects and reconnects from my laptop at random tines while I am typing. It does not appear when uploading the compiled code. The contents of the file read "timeout".

I know the compiled .hex file which contains the code from mbed is not working properly, because if I press or hold down the reset button after uploading the code, the same thing happens as when I press or hold down the button before I upload the compiled code.

posted by Keith Hammock 21 Dec 2017