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

I want to insert a DFU module through BLE in my old ble project to upgrade my nrf5340 image

    i have look for many DFU examples in NCS1.5.0 , but samples are Abstract ,and can not to start . a ble test  app in phone have a menu that  can  send file to nrf5340 through ble ,  when ble of nrf5340 receive this file  ,file can as  a new image.

Parents
  • Simon thank for your anser 

      1.  my project is derived from example peripheral_uart in NCS1.5.0  and final MCU used in  my project will be  nrf5340, so I use nrf5340dk and example peripheral_uart to start my project . 

     2. a ble receive event and a ble send thread are used to communicate with andriod pad or phone in my project ,  ble is basic and important function in my project .  i  nearly use  example peripheral_uart 's ble function and only a little change.

    3.my project is Gradually improved ,and old image will be repalced by a new better image . so i want to use andriod pad or phone app  DFU old image in nrf5340  THROUGH BLE .

    4.when insert DFU  function in my project ,,jlink also can be used to download and debug.  that is to say:  two ways can update old image , first way is by JLINK ,the other way is by DFU with a app through BLE.

    5. using ble DFU method like smp_svr maybe can DFU a project have no function of ble , if a project like peripheral_uart have ble function , DFU ble and project ble will conflict. last time i have showed you that  smp_svr's  net core image merged_CPUNET.hex is different  with peripheral_uart's net core image merged_CPUNET.hex. that is to say ,only one ble can work well. if you work periperal_uart 's ble , smp_svr's ble can not work .

    6. how to use a old-fashion method to upgrade  old image rather than method of smp_svr  :  ble module in peripheral_uart running in nrf5340   receive a file (new image as a file ) from app  , then nrf5340 write new image file in it's own flash area , then nrf5340 reset and load new image in flash area .

  • You should try to merge the peripheral_uart sample with the smp_svr sample, and create a sample peripheral_uart_smp_svr. Then you will be able to use both the UART service, as well as the SMP service:

      

    Then you can do the following to make sure it's working

    1. Add printk("version 1") in peripheral_uart_smp_svr-->main() and flash it to the device
      1. Check if you see "Version 1" in the terminal
    2. Change the above to printk("version 2") and build the sample peripheral_uart_smp_svr again, without flashing
    3. Eventually you can transfer the app_update.bin from step 2 and make sure you see the log "version 2"

    I tried to do this (merge peripheral_uart with smp_svr), but I encountered some issues when transferring the file. However, I can set off some time and get this to work, if you want to?

    Best regards,

    Simon

Reply
  • You should try to merge the peripheral_uart sample with the smp_svr sample, and create a sample peripheral_uart_smp_svr. Then you will be able to use both the UART service, as well as the SMP service:

      

    Then you can do the following to make sure it's working

    1. Add printk("version 1") in peripheral_uart_smp_svr-->main() and flash it to the device
      1. Check if you see "Version 1" in the terminal
    2. Change the above to printk("version 2") and build the sample peripheral_uart_smp_svr again, without flashing
    3. Eventually you can transfer the app_update.bin from step 2 and make sure you see the log "version 2"

    I tried to do this (merge peripheral_uart with smp_svr), but I encountered some issues when transferring the file. However, I can set off some time and get this to work, if you want to?

    Best regards,

    Simon

Children
No Data
Related