zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.99k stars 6.69k forks source link

DFU for nrf52840 #9352

Closed arun-kmr closed 6 years ago

arun-kmr commented 6 years ago

Is it possible to Upgrade a bare metal firmware(not from zephyr, may be from nrf sdk example) through smp server explained in zephyr project ?

cvinayak commented 6 years ago

@lemrey FYI

cvinayak commented 6 years ago

Relates to #9055

lemrey commented 6 years ago

Short answer: no, that is not possible.

The SMP server works with MCUBoot and Zephyr/Mynewt; it won't work with the nRF5 SDK bootloader and a bare metal application, like those in the nRF5 SDK. However, it is possible to migrate from the nRF5 SDK bootloader to MCUboot and use a built-in firmware update procedure, like the serial recovery mode, to program the SMP server. You would need a signed bootloader image to update bootloader though.

nvlsianpu commented 6 years ago

I not possible to upgrade bare-metal application using smp functionality, unless it is not implemented inside it (and is not). smp server solution's is implemented for zephyr and mynew, not for bare metal (of course you can port it, which dosen't make big sense).

arun-kmr commented 6 years ago

I have nrf52840 PDK with smp server example running into it. I have also tested DFU by using hello world example of zephyr (having CONFIG_BOOTLOADER_MCUBOOT=y). It also worked as expected. Now i wan't to update the firmware with a simple blinky code (no operating system, no bootloader configuration enabled). will i be able to update that firmware ? at least till the image testing stage.

nvlsianpu commented 6 years ago

I will be possible once you compile application designed to place from image_0 offset, which vector table shifted by 0x200.

arun-kmr commented 6 years ago

After changing the address, when i am getting following error after signing the image. mcu_boot

carlescufi commented 6 years ago

Now i wan't to update the firmware with a simple blinky code (no operating system, no bootloader configuration enabled). will i be able to update that firmware ?

No

arun-kmr commented 6 years ago

Please explain the reason behind it.

nvlsianpu commented 6 years ago

@IotPanorama I misses sense of your question before. Once you upgrade running application to the blinky_app you have lost smp_svr functionality as it is not implemented in the blinky - that te reason.

arun-kmr commented 6 years ago

That's fine . i want to update the image only once. but i am not even being able to sign the blinky image.

nvlsianpu commented 6 years ago

Look here: https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts#L89 @IotPanorama Your application should be linked into addresses from 0xc200, Your reset vector should start at 0xc200. Your app should take cere about vector relocation if your use any interrupts or expected any exception. Area from 0xc000 to 0xc2000 shouldn't be free.

carlescufi commented 6 years ago

Closing this since the question was answered