Hi,
I am working on an application to transfer firmware file via BLE-GATT to nRF52833.
Can you kindly suggest any sample code for me to evaluate.
Thanks,
Ubaid
Hi,
I am working on an application to transfer firmware file via BLE-GATT to nRF52833.
Can you kindly suggest any sample code for me to evaluate.
Thanks,
Ubaid
Ubaid_M said:Kindly suggest DFU TX sample program for me to run on nrf52833dk_nrf52833 (device-1) & evaluate.
We do not have that, unfortunately.
I suggest that you check out the source code for nRF Toolbox or DeviceManager.
Other than that, we don't have much documentation or examples, I am afraid. The mcuboot bootloader is a Zephyr bootloader, and the counterpart is originally implemented in mcumgr, but we have no implementation for the nRF chips.
Best regards,
Edvin
Hello Edvin,
This sample worked for me, on the suggested sample I have query.
So, DFU app copies the new firmware file from nordic connect android app on DFU mode.
This firmware I built with the prj.conf having "CONFIG_BOOTLOADER_MCUBOOT=y", so the same .bin file being updated has mcuboot code as well.
Here is the sequence of events I believe are happening in the provided DFU sample app.
1. DFU app is running on my board nrf52833dk
2. nordic connect android app notifies DFU and sends the new firmware file to nrf52833dk.
3. nrf52833dk receives the new firmware file and downloads it, the DFU goes for a soft reset.
https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu#:~:text=Since%20the%20DFU%20support%20is%20added%20to%20the%20application%2C%20the%20chip%20needs%20to%20be%20reset%2C%20to%20give%20control%20to%20MCUboot%2C%20which%20will%C2%A0validate%C2%A0the%20new%20uploaded%20image%20and%20swap%20it%20with%20the%20old%20image
4. Post soft reset, control goes to mcuboot which starts swapping the image.
5. This explains the swapping of firmware file which is fine.
6. But the same .bin file also has mcuboot code right..? Who replaces mcuboot code is my query..?
7. What does this line mean..? : https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu#:~:text=Finally%2C%20BOOTLOADER_MCUBOOT%20includes%C2%A0MCUboot%C2%A0as%20a%20child%20image
Does it mean bootloader itself is replacing mcuboot code..? what is the meaning of
"Finally, BOOTLOADER_MCUBOOT includes MCUboot as a child image"
Thanks,
Hello,
Ubaid_M said:Does it mean bootloader itself is replacing mcuboot code..?
No, it does not.
Ubaid_M said:
It means that if you add CONFIG_BOOTLOADER_MCUBOOT=y, the compiler will add and compile the mcuboot image to your project, so that it is flashed when you use west flash. However, it does not mean that if you make any changes to the mcuboot image, it will be uploaded during DFU. If you need to update the mcuboot, you will need yet another bootloader, the "immutable bootloader", which you can read about here.
Note: the link to this is found here:

Best regards,
Edvin
Hello Edvin,
It means that if you add CONFIG_BOOTLOADER_MCUBOOT=y, the compiler will add and compile the mcuboot image to your project, so that it is flashed when you use west flash.
I was able to find out more on this, In the build folder there are 2 build files
1. One for application build file at location: "build\zephyr"
2. One for child image (mcuboot file): "build\mcuboot\zephyr"
Now if I want to flash on board the mcuboot build file found at the path : "build\mcuboot\zephyr",
Please guide how do I flash it..?
Thanks,
If you have enabled the bootloader in your project using the guide from my first reply, then it will be automatically flashed when you either flash using nRF Connect for Visual Studio Code, or "west flash -d build", or however you flash your application. It will be part of the build output.