-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to switch to the image uploaded in the slot 1? #19
Comments
Right, these commands are not implemented. We don't need them at the moment, I think because of the "CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD=y" setting. But feel free to submit a PR, and I'll integrated it, should be easy. |
So how do you use the uploaded image in slot 1 then ? I do have CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD=y in my prj.conf but still when I upload it goes to slot 1,I have no idea how it will be used after the reset . |
It is a bit tricky. We use mcuboot to update the image. So we figured that we don't need the usual swap process, because we can always update it again from mcuboot, if something went wrong. And with the setting "CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD=y", slot 1 is actually slot 0, see flash_map_extended.c:
And we also have our custom sign script:
This creates a pre-confirmed image. And the flash partition table is defined like this:
We have also a slot 2, to update an external flash with application data:
All this allows us to directly update slot 1 (which is in fact slot 0, as shown above, which is the slot used to boot the image for the first core), and also slot 2 for the external flash. I reserved slot 1 for later, if we want someday update it from the application instead of mcuboot, with the usual swap on reboot process, or if we want to use the second core of the STM32, which is currently disabled. |
Thanks for the clarification. In our use case ,we have BLE Dongle , we use two virtual interfaces /dev/ttyACM0 and /dev/ttyACM1 on it. On one our application runs using HCI UART. On the second interface we upload the image with mcumgr.
So when uploading the image , it goes here to slot=1, and then I have to do whole testing, confirming to make the image active in slot 0. |
Ok, this sounds like what we do for another hardware, which we update OTA with Bluetooth while the application is running. We are using pre-confirmed images for this as well (see the custom Python sign step I wrote), which avoids the testing and confirming step on the device. Should be effectively the same as the "image confirm" step of the Go mcumgr program, if you don't need the confirm step done by the app on the device. But could be that HCI UART is different. If you have a sample project of your configuration for the nRF5340-DK, then I can test it. |
We use the sample project from Zephyr for HCI UART for nrf52840dongle, should work with nrf5340dk as well. |
We use dual-bank updates over serial. A second serial port is offered for mcumgr, where we upload the image, mark it for testing, and also confirm it after running. Unfortunately, we cannot use this tool because of the missing support for marking images for testing/confirmed. We will need to stick with the poor Go version. This feature would be really nice if you can add it. If not, I can have a look when I get some time :) |
The go mcumgr client has some commands for
image test
andimage confirm <hash>
to test and confirm the uploaded image,
I don't seem to see how it is done using this client.
I am able to upload the image and can also reset ,the functionality that was just added I think.
But I am not able to switch to the newly uploaded image.
Here is what I mean :
now when I upload the image
NOTE:
(see I had to reduce the MTU to 256, default does not work I don't know why, any way that's another issue)
I can see it being uploaded correctly
Even after resetting the device it does not move it to slot 0 and nor can I test or confirm the image.
The text was updated successfully, but these errors were encountered: