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

How to upload arduino sketch file via J-Link?

Hello Everyone,

I designed and fabricated a small nRF52 board.
The design of this board is based on the Adafruit nRF52 feather.
The difference between my designed board and nRF52 feather is the existence of the pressure sensor.

backside of the custom board

However, I have one big problems here.

I would like to upload my arduino sketch file onto this my custom nRF52 board.
but my UART-USB chips did not work. (I used FT-232 instead of CP2104. I found that FT-232 does not works with nRF52 and Adafruit's nRF52 bootloader later.)

Therefore, I am looking for the way how to upload the sketch file via J Link such I used to upload bootloader. (using SWDIO and SWDCLK lines)


Would you please give me some advice how to upload it onto my nRF52 board?
Any comments and advises are welcome. 

Thanks,
Best regards,
S-H Choe.

Parents
  • Hi,

    If you designed the board, you should know which pins are SWDCLK/SWDIO?

    You only need to connect these pins, in addition to GND and VDD to VTG on the nRF52 DK. You can the use the nRF Connect Programming app or nrfjprog to flash hex-files. Do you get a hex-file output from the Arduino IDE?

    Best regards,
    Jørgen

  • Is the file bootloader_v050_s132_v201.hex the arduino bootloader? 

    The bootloader and application should be located in different sections in flash, you should not need to merge it before flashing. Just make sure you do not erase the chip between flashing the two hex-files.

  • Hi Thanks for your support.

    Yes. the file bootloader_v050_s132_v201.hex  is the arduino bootloader, which is provided by Adafruit industries.

    https://github.com/adafruit/Adafruit_nRF52_Arduino_Bootloader/releases

    Here is my upload procedure.

    (1) I prepared the bootloader.hex and arduino-sketch file.

        Arduino-sketch file was checked with other nRF52 development board. The code was OK.

        Arduino-sketch file was converted to hex file with Arduino IDE program. I call it arduino-sketch.hex.

    (2) Connect the my custom nRF board with DK. The wiring is like the following picture.

       Open the command window and put the following commands 

     ./nrfjprog -e -f nrf52

    ./nrfjprog --program bootloader_v050_s132_v201.hex -f nrf52

    ./nrfjprog --program arduino.hex -f nrf52

    ./nrfjprog --reset -f nrf52

       

    (3) Then I could see that the program was uploaded to my custom nRF board. the LED was blinking.

         but the program was not running correctly which was OK at the other nRF52 development board.

    Summary

    (1) I think that bootloader and sketch program can be uploaded with J-link.

    (2) However, the sketch program did not work correctly.

    (3) First, I will check the version of the bootloader and IDE settings.

    I will report you when I found something. Please give me any advises, They gave me great help to solve this problem.

    Thanks

    Best regards,

    S-H Choe

Reply
  • Hi Thanks for your support.

    Yes. the file bootloader_v050_s132_v201.hex  is the arduino bootloader, which is provided by Adafruit industries.

    https://github.com/adafruit/Adafruit_nRF52_Arduino_Bootloader/releases

    Here is my upload procedure.

    (1) I prepared the bootloader.hex and arduino-sketch file.

        Arduino-sketch file was checked with other nRF52 development board. The code was OK.

        Arduino-sketch file was converted to hex file with Arduino IDE program. I call it arduino-sketch.hex.

    (2) Connect the my custom nRF board with DK. The wiring is like the following picture.

       Open the command window and put the following commands 

     ./nrfjprog -e -f nrf52

    ./nrfjprog --program bootloader_v050_s132_v201.hex -f nrf52

    ./nrfjprog --program arduino.hex -f nrf52

    ./nrfjprog --reset -f nrf52

       

    (3) Then I could see that the program was uploaded to my custom nRF board. the LED was blinking.

         but the program was not running correctly which was OK at the other nRF52 development board.

    Summary

    (1) I think that bootloader and sketch program can be uploaded with J-link.

    (2) However, the sketch program did not work correctly.

    (3) First, I will check the version of the bootloader and IDE settings.

    I will report you when I found something. Please give me any advises, They gave me great help to solve this problem.

    Thanks

    Best regards,

    S-H Choe

Children
No Data