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

Programming nrf52840 via SPI

Hi,

I have to program the application on an nrf52840 chip that is connected to another MCU via the SPI interface. Since I have to send the image from the MCU to program the Nordic chip, I have the following questions.

1. I should send a .hex file (used by the nRF programmer) or a .bin file (used my mcumgr)

2. I know the .hex file has the address, but I don't know if the MCU software has to read the .hex file and create SPI frames with the proper address or any other way it has to be done.

3. If I have to use a .bin file, how to get the address from a .bin file? 

Looking forward to your reply to move forward with my application updates.

Thanks,

Ram

Parents
  • Hi,

    Which SDK are you using?

    You can reference the examples found in the blog post Getting started with Nordic's Secure DFU bootloader, a step by step guide. The section 6. DFU Master code contains C example projects for both SPI DFU master and SPIS bootloader.

    Best regards,
    Jørgen

  • Hi Jorgen,

    Thank you very much for your reply!

    In your link, C example project for the SPI DFU master is really useful. However, I am not clear on the slave side so far. I am tying to understand it.

    Let me clarify a few things first before I ask questions.

    1. I am using nRF Connect SDK v1.4.0, which creates hex and binary files.

    2. I have B0, MCUboot, and application code on a nRF52840-DK.

    3. My application would use buttonless DFU mode.

    4. Another MCU (nRF52840-DK at this time) connected to nRF52840-DK via SPI will act as a DFU master to send the application/MCUboot code. These may be signed.

    5. The master will update either application or MCUboot at a time, not both together.

    Could you please clarify the following?

    a. Shall DFU master use the hex file or the binary file (Awneil has suggested to use the binary file)?

    b. Since the device will be in DFU mode to update the firmware, I need to make the code changes in the bootloader, not in the application. Is it correct?

    \ncs\bootloader\mcuboot\boot\zephyr\serial_adaptor.c and other files.

    Thanks,

    Ram

Reply
  • Hi Jorgen,

    Thank you very much for your reply!

    In your link, C example project for the SPI DFU master is really useful. However, I am not clear on the slave side so far. I am tying to understand it.

    Let me clarify a few things first before I ask questions.

    1. I am using nRF Connect SDK v1.4.0, which creates hex and binary files.

    2. I have B0, MCUboot, and application code on a nRF52840-DK.

    3. My application would use buttonless DFU mode.

    4. Another MCU (nRF52840-DK at this time) connected to nRF52840-DK via SPI will act as a DFU master to send the application/MCUboot code. These may be signed.

    5. The master will update either application or MCUboot at a time, not both together.

    Could you please clarify the following?

    a. Shall DFU master use the hex file or the binary file (Awneil has suggested to use the binary file)?

    b. Since the device will be in DFU mode to update the firmware, I need to make the code changes in the bootloader, not in the application. Is it correct?

    \ncs\bootloader\mcuboot\boot\zephyr\serial_adaptor.c and other files.

    Thanks,

    Ram

Children
No Data
Related