-
Notifications
You must be signed in to change notification settings - Fork 3k
RTL8195AM - refactor bootloader and fota support #5531
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
#define OTA_TAG_OFS 0x0 | ||
#define OTA_VER_OFS 0x4 | ||
#define OTA_EPOCH_OFS 0x8 | ||
#define OTA_SIZE_OFS 0xf |
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.
Shouldn't the size offset be 0x10?
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.
Yeap. It should be 0x10. Thanks.
I'm unable to boot up. This is the error I'm getting:
|
e36f9a3
to
d1d31c7
Compare
@marcuschangarm Hi, updated bootloader. Please give it a try. Thanks. |
@tung7970 It works now! We are back in business! |
/morph build |
Build : FAILUREBuild number : 571 |
When running locally looks like a string is being passed in the number argument to
error. Specifically the RAM2_HEADER tag and ver fields look like junk when running on the event_flags test for example. |
I don't understand why not all of the compilations are failing. In the trace output, most of the binaries are created correctly. What command are you using? When I build locally it works:
|
Running the same command I can reproduce the error on the CI test node and on a local Linux machine both running Python 2.7.12. That's really strange, I'm honestly not sure why only certain builds cause it. It doesn't seem to happen to the same binaries each time. |
d1d31c7
to
c026b7f
Compare
/morph build |
Build : SUCCESSBuild number : 592 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 204 |
Test : SUCCESSBuild number : 405 |
Can we get this in before the freeze, please? 😄 |
Waiting for review from @theotherjimmy (tools changes) |
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.
The print might be removed, the rest LGTM
return 0; | ||
} | ||
|
||
printf("OTA: read addr=0x%lx\r\n", addr); | ||
return flash_ext_stream_read(&flash_obj, addr, len, data); | ||
printf("OTA: read addr=0x%lx\r\n", start); |
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.
is this debug print? Should not print always?
Preparing for bootloader redesign. Signed-off-by: Tony Wu <[email protected]>
1. move ota region 1 from 0x00b000 to 0x040000 2. move ota region 2 from 0x0c0000 to 0x120000 3. refactor bootloader header as follows: uint32_t tag; uint32_t ver; uint64_t timestamp; uint32_t size; uint8_t hash[32]; uint8_t campaign[16]; uint32_t crc32; where, a. hash is the sha256 checksum of the payload. b. crc32 is the crc32 checksum of headers from tag to campaign. 4. Call NVIC_SystemReset for soft reset. Signed-off-by: Tony Wu <[email protected]>
c026b7f
to
a4575a9
Compare
@0xc0170 Done. |
/morph build |
Build : SUCCESSBuild number : 614 Triggering tests/morph test |
Test : SUCCESSBuild number : 434 |
Exporter Build : SUCCESSBuild number : 231 |
Before I approve this, @tung7970 Are the tools changes backwards compatible? That is, If I were to use the tools directory to compile, say, Mbed OS 5.5.7, would it work? |
@theotherjimmy Yes. This commit is atomic, as long as python script and bootloader bin are used together. |
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.
Thanks. Be aware this this will upgrade all website builds to the new bootloader when the tools on the website are upgraded. This includes older releases of Mbed OS.
Description
Refactor bootloader and fota support.
OTA regions are moved to 0x040000 and 0x120000 to make room for mbed credentials and settings.
Headers are redefined for better integration with mbed cloud FOTA services.
Status
READY
Migrations
NONE
Related PRs
NONE
Todos
NONE
Deploy notes
NONE
Steps to test or reproduce
NONE