-
Notifications
You must be signed in to change notification settings - Fork 2k
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
OTA: tracking issue #9342
Comments
Linker offset supports depends on |
State of developmentPlease update this list as required so that we all know what we're up to Development branches and reposHere's a list of active branches and repos where people are developing. Please add your own with a short description if you can get around to it. Related issues not in the diagram aboveEither because they are dependencies to the issues above, or some other reason. Basically here are some issues you might want to be aware of, and help along if you can. Current work being undertakenDan - working on RAPstore project on integration, so architecture can be informed by situational concerns |
For binflash I would also have a dependency of And I am thinking, why do we even need to do |
As far as my early tests went, it was very complicated to manage ihex files especially when you want to flash bootloader + image (slot 1 or 2). Then build an hex file with such information was very challenging at that time. To speed up things, and make something more reliable I used bin files flashed at the needed address. Now we have all the information we need to know where to flash, so I'd say there's no problem using and flashing binary files while a bootloader takes the beginning of the flash. |
For the bootloader, the mimimal set of required metadata is this: /**
* @brief Structure to store firmware metadata
* @{
*/
typedef struct {
uint32_t magic_number; /**< metadata magic_number (always "RIOT") */
uint32_t version; /**< Integer representing firmware version */
uint32_t start_addr; /**< Start address in flash */
uint32_t chksum; /**< checksum of metadata */
} firmware_metadata_t;
/** @} */
|
Documentation todo
|
Notes about edbg
Some work is only required to disable erasing everything and supporting flashing from an edbg.inc.mk: allow flashing with an offset in rom without erasing all ROM #9788 OpenocdOpenocd supports flashing from binary as is, except that the flashing address must be given. http://openocd.org/doc/html/Flash-Commands.html I plan to use the EDIT: The address cannot easily extracted from the build system, I queried this address from openocd. openocd.sh: allow flashing binary files without configuration #9787 This would give a common behavior between boards using edbg and openocd. |
Minutes from this week's OTA meeting (15.08.2018) available here |
Which option is preferred to add comments/questions on the minutes? Should I comment via this issue, create a new issue, or ...? |
I'd say: comment here? |
I agree that it makes sense to use the existing Block1 functionality for now. Conceptually, some host sends firmware to the (RIOT) device, although I guess use of PUT/POST or GET depends on the higher-level application protocol. At any rate, the device is on the receiving end. Also, "roadblock" is not a word I like to see associated with my name! I'm reviewing the RFC and Block2 PR (#8932), and plan to comment in the next day or so on moving forward. |
@kb2ma actually Block2 has advantages in terms of security characteristics (since it is pull-based). |
Both It currently still requires setting two different variables to handle both openocd and edbg to flash a binary file but will be addressed by #8838. |
Another dependency I remember as I am rebasing the branch, is process dependencies for CPU and move |
Finally I got to test the current state with a rebased branch with most recent changes in master related to OTA. The most updated branch is at [1]. Two problems:
/Users/facosta/git/RIOT-OS/RIOT/dist/tools/edbg/edbg --offset $((0x1000 --offset + --offset 0x1f800)) -t atmel_cm0p -b -v -p -f /Users/facosta/git/RIOT-OS/RIOT/examples/suit_updater/bin/samr21-xpro/suit_updater-slot2.signed.bin
bash: 0x1000 --offset + --offset 0x1f800: syntax error in expression (error token is "--offset + --offset 0x1f800")
make: *** [/Users/facosta/git/RIOT-OS/RIOT/makefiles/riotboot.mk:112: riotboot/flash-slot2] Error 1 [1] https://github.com/kYc0o/RIOT/tree/wip/rebase/ota_work_branch |
For
The first one can be done directly on our side to make it work, and upstream the proper fix to RIOT after. |
I found the issue for the offset on slot 2, the assert was right. In And then the ldscript changes can be reverted. |
We are not consistent with the names yet. If |
I also have some issues when building the bootloader on my laptop as For me it is an issue that 'git am` tries to use local configuration to do the commit. I want to fix this for some time but did not have real visible problems to show. |
@cladmi the previous dependency graph highlighted two building blocks (1) Linker/Bootloader and (2) OTA, and each building showed the same amount of details. Furthermore, roughly half of the discussions in this issue relate to the bootloader. I really don't see why this issue is exclusively related to OTA. Just to be clear: If there is a separate bootloader issue, fine with me. But then, #9342 should refer to this issue because the bootloader is a requirement to implement OTA; and any bootloader discussions should then be noted there. |
Would "OTA support" be a title that would satisfy the requirements discussed here? It seems to me that all parties are, essentially, arguing for something overarching which doesn't exclude bootloader implementation (or, indeed, anything else we need to implement). Would this definition therefore be appropriate? |
@waehlisch to be more precise maybe, our goal, is not really to do a real "bootloader", in fact the bootloader implementation does only "find newest firmware, boot" 30 lines with spaces https://github.com/RIOT-OS/RIOT/pull/9969/files#diff-1dce55b2dc2ce6dc6fd5b018e55a1482R27 which for me would not really need discussions on its own, except BS integration and filesystem organization but that will go in its PR. What is however related to the bootloader, and mixed in our description graph and discussions, is that the implementation of OTA and, what the bootloader handles, is based on "ROM slots". And all the work currently integrated since this issues started and was in "linker/bootloader" block is 95% only to help create and manage these rom slots, without concerning any radio transfer. And maybe naming it "bootloader" was not reflecting exactly our goal for the outsiders but was enough to split the work between involved developers. If it was mixed to the "linker/bootloader" section is that for us it made sense as an intermediate standalone goal that could be integrated in RIOT The reason we push toward adding a bootloader as an intermediate step, is that it is the simplest way of really testing these mechanisms and so merge them to master without any coap/suit dependencies, but it is never a goal on its own. Maybe the fact that it is "OTA using ROM slots" should be more emphasized, but not that we try to do a bootloader. |
@cladmi I'm confused. A boot loader basically calls the OS into memory. Boot loaders may have different capabilities (e.g., think about first-stage and second-stage boot loaders). That a boot loader decides between two different OS versions (or "firmwares") is not a conflict. And, you can use this piece of software outside of OTA I think what confused me is that a link to #10065 (or any other issue that tracks the state ot the boot loader) was missed, and that some discussions in #9342 related more to a boot loader instead of core OTA. |
#10065 is pretty new and in the diagram is clearly the next step (it was also clear in the previous diagram) so it was missed for obvious reasons. Now that it exists we can link it here and discuss there the implementation and design. Here we can continue to discuss the next steps.
What do you call core OTA? In that regard, you might want to send firmwares, or whatever, Over The Air, but without a bootloader I don't think it will work flawlessly (ok you can boot the update from the running image, just don't dare to reboot the node). Thus, to be clear about my position: OTA stands for the whole process of updating the firmware of a running RIOT node, which involves a bootloader, wired/wireless protocols to transfer the firmware and the tools to secure it, if it's wanted. IMHO no renaming is needed. |
I don't know why it was missed for obvious reasons but this missing piece of information was one reason why I was originally arguing that the caption is misleading. And, I don't care if you discuss bootloader and OTA in a single or in separate issues/PRs ;).
I don't agree here: OTA is one functionality, boot loader is another. OTA needs a boot loader, but a boot loader doesn't need OTA. For me, OTA includes everything that (securely) delivers the OS wirelessly to the target. The boot loader ensures to execute the stored OS, maybe also securely. Side comment: There are other options to ship the OS. Think about an USB stick. |
@bergzand @cladmi @kYc0o @danpetry for the record, to summarize based on the last TF discussions, the immediate next steps are simplified such that we go for:
After that, a simple follow-up PR providing CoAP handlers for OTA compliant with SUIT (draft-01 version) would be close-at-hand, now that CoAP block2 support has been merged. |
Note: efforts have moved to #11818 |
Issue with |
I don't see any progress tracking in this tracking issue. So what is the progress? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Ping? |
Let's see if anyone screams when I close this. |
😱 |
Tracking OTA progress
Tracking issue for the different parts required to enable over the air updates.
Overview
We are aiming at a simple OTA prototype in a first phase,
which can be extended in later phases.
The blueprint for the first prototype is the implementation we had working at the SUIT Hackathon in June 2018 (see slide 3 of this recap).
This combines a simplistic bootloader, 2 firmware slots and metadata that follows the SUIT specification.
A basic update module, embarked in each image, manages firmware transfer (via CoAP), verification (complying with SUIT) and storage in Flash within the non-running image slot.
Work breakdown
Current state of development
@cladmi is addressing the tooling for the bootloader and metadata
@kYc0o is addressing the bootloader
@OYTIS is working on support for RIOT, including OTA, for KEA128LEDLIGHTRD board (#9655)
See the GitHub Software Updates project for more details.
System diagrams
Both of the diagrams reflect the content of the working OTA update branch. This contains working examples for both a metadata-based update, and a SUIT manifest-based update. The areas not relevant to the example addressed in each section are greyed out.
Non-SUIT metadata based update mechanism
A description of the metadata is given here.
SUIT metadata based update mechanism
The process being followed is to merge the functionality required for OTA updates piecewise, instead of as a large monolithic PR.
Files for diagrams above
The diagrams were done using draw.io (https://www.draw.io/). Contact @danpetry for the project files.
The text was updated successfully, but these errors were encountered: