Hi, My project include two MCU with n51822 and STM32. I expect upgrading STM32 application firmware by n51822 DFU function. Do you give your advice to implement it by modifying nRF51_SDK_8.1.0_b6ed55f\examples\dfu\bootloader example? Thank you.
Hi, My project include two MCU with n51822 and STM32. I expect upgrading STM32 application firmware by n51822 DFU function. Do you give your advice to implement it by modifying nRF51_SDK_8.1.0_b6ed55f\examples\dfu\bootloader example? Thank you.
Hi Leif,
It should be ok with what you planning to have.
You have two options. First is to have a RAM buffer on the nRF51 and then send the packets you receive from the phone to the STM32 via UART on the fly. This approach require you to have a DFU bootloader or something like that to handle the packets from the nRF51 on the STM chip running at the same time. This solution doesn't have restriction on the size of the new image of the SRM32 chip.
Second approach is what you described, you store the image for STM32 on the nRF51 and then later on you have the bootloader on the STM32 to talk to the nRF51 and get the image from the nRF51. With this approach you will have limitation of the size of the swap area on the nRF51 (about 70kB). But it's safer because the image is stored on flash before it's sent to STM32.
Unfortunately, we don't have any example for doing that. What we have is the bootloader for the nRF51 only. But I don't see any technical problem to implement it.
Hi Leif,
It should be ok with what you planning to have.
You have two options. First is to have a RAM buffer on the nRF51 and then send the packets you receive from the phone to the STM32 via UART on the fly. This approach require you to have a DFU bootloader or something like that to handle the packets from the nRF51 on the STM chip running at the same time. This solution doesn't have restriction on the size of the new image of the SRM32 chip.
Second approach is what you described, you store the image for STM32 on the nRF51 and then later on you have the bootloader on the STM32 to talk to the nRF51 and get the image from the nRF51. With this approach you will have limitation of the size of the swap area on the nRF51 (about 70kB). But it's safer because the image is stored on flash before it's sent to STM32.
Unfortunately, we don't have any example for doing that. What we have is the bootloader for the nRF51 only. But I don't see any technical problem to implement it.
if using single-bank update for only applictaion. it will extend the limitaiton of the image size with over 70kB. i presume that nRF51822 occupy max image size with 48kB then upgrading STM32 max imgage size is 96kB. is my descritpion ok? Another, does single-bank updates not support softdevice update or bootloader update? must use dual-bank updates if expecting softdevice or bootloader update?
Yes, you can use single bank update. You will need to update the nRF51 application every time you update the STM32 firmware. The swap area size should be around 140kB depends on the softdevice size.
Note that you don't have to update nRF51 and STM32 firmware at the same time. You can update the STM32 first and then update the nRF51 firmware after that. So the max size of each of them is 140kB.
Thank your reply. according to your advice, it can update nRF51 and STM32 firmware with max size 140kB separately. but how to identify updating firmware that is nRF51 or STM32? if so,update STM32 first,because erase nRF51 application, i need to add UART protocol to update STM32 in your bootloader code. it maybe be hard. my original idea is that entering nRF51 application from bootloader after update nRF51 firmware then update STM32 firmare between nRF51 application and STM32 bootloader with UART protocol. now, the UART protocol have run ok between nRF51 application and STM32 application. my case will not need to modify your bootloader code or less.
Hi Leif,
If you want to maximize the limit size of the STM application image then implementing the mechanism to transfer the image from the nRF51 to the STM in the nRF51 bootloader is what I would suggest. You can use a simple flag to tell if the image is for the STM or for the nRF51.
If the size of the application on the nRF51 is not too big, you can think of integrate it into the bootloader of the nRF51.
Then you can have just the bootloader on the nRF51 doing both, normal tasks and the DFU task.
You can do what you describe, on receiving the image by the bootloader, and then use the application to talk to the STM32 and send the image. But it will require 2 steps. And I don't think it would be much less work.