-
-
Notifications
You must be signed in to change notification settings - Fork 730
Add support for updating sketches from an SD card #203
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
Conversation
Is there some kind of documentation on how to use this? Just copy the update.bin to sd-card and reboot arduino zero with the ota sketch? Would this be possible with SPI flash as well? Is there some special boot-loader required? [update] |
@@ -67,6 +67,9 @@ SECTIONS | |||
{ | |||
__text_start__ = .; | |||
|
|||
KEEP(*(.ota_boot)) | |||
|
|||
. = ALIGN(256); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd align the .ota_boot section to either 0x2000 or 0x4000 to make sure that the reset vector does not get relocated to something different than 0x6000 if the 2nd stage bootloader becomes slightly smaller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it to 0x2000
.
Maybe we can have a clearer name for this section second_stage
, second_stage_boot
or sketch_boot
?
ping |
✅ Build completed. ⬇️ Build URL: ℹ️ To test this build:
|
@tuxedo0801 |
@cmaglie thanks for first feedback. That would help me continuing my development into the right direction... |
For now it's SD card only. |
Out of curiosity, is this going to replace the default boot loader or run in tandem with it? |
@dlabun good question! It will run in tandem. |
To give you an insight in why I want to use SPI flash instead of SD card: I'm developing small devices for KNX home automation bus. The devices are totally bus-powered. And the KNX transceiver chip allows max ~50mA to be drawn from KNX bus. So it's very low power. SD cards consume too much energy to be powered from KNX bus. SPI flash consumes almost nothing, compared to SD card. And even micro-sd card socket is much bigger than a small SPI flash package... Size matters ;-) As the SPI flash is not pluggable like SD card, the new sketch is received directly from KNX bus. So updating a device is just a simple click on the control-application on a PC that is also connected to bus. File is transferred over bus and stored into SPI flash. I guess there are more people out there that wand to read the firmware from somewhere else than a pluggable SD card (get via ethernet, wifi, some radio module, power line, ... whatever and stored on any storage). I would be glad if you foresee a user-friendly mechanism that allows the sketch-writer to speficy an own storage mechanism to read the update from, that don't requires fiddling with core classes and modifying the samd core. Beside my whishes: Tumbs up for this new feature... Keep up the good work. |
what CS pin are you using ? (mine is pin 10) I can't have the bootloader to boot from the SD
but it stays in booloader mode with the led glowing |
Sorry to insist : I can't figure how to get started |
Via 2nd stage boot code that checks SD card for UPDATE.bin
✅ Build completed. ⬇️ Build URL: ℹ️ To test this build:
|
✅ Build completed. ⬇️ Build URL: ℹ️ To test this build:
|
Where do you set the CS pin to use ? |
✅ Build completed. ⬇️ Build URL: ℹ️ To test this build:
|
Tested. LGTM |
@agdl How do you set the CS pin ? |
It has been merged into master about three weeks ago. So it's ready now? Questions so far:
|
For anyone searching the same information: #220 |
Via 2nd stage boot code that checks SD card for
UPDATE.bin
.Also, added tool info to
platform.txt
to update sketches via HTTP outside the core for later.cc/ @cmaglie @facchinm @agdl @akash73