Skip to content

RP2040 Connect OTA fix appSize computation with cores using PRNG #505

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

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/ota/implementation/OTANanoRP2040.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,27 @@ bool NANO_RP2040OTACloudProcess::isOtaCapable() {
return true;
}

// extern void* __stext;
extern uint32_t __flash_binary_start;
extern uint32_t __flash_binary_end;

#if defined(UNINITIALIZED_DATA_SECTION)
extern uint32_t __uninitialized_data_start__;
extern uint32_t __uninitialized_data_end__;
#endif

void* NANO_RP2040OTACloudProcess::appStartAddress() {
// return &__flash_binary_start;
#if defined(UNINITIALIZED_DATA_SECTION)
return &__flash_binary_start;
#else
return (void*)XIP_BASE;
#endif
}
uint32_t NANO_RP2040OTACloudProcess::appSize() {
return (&__flash_binary_end - (uint32_t*)appStartAddress())*sizeof(void*);
#if defined(UNINITIALIZED_DATA_SECTION)
return ((&__flash_binary_end - (uint32_t*)appStartAddress()) - (&__uninitialized_data_end__ - &__uninitialized_data_start__)) * sizeof(void*);
#else
return (&__flash_binary_end - (uint32_t*)appStartAddress()) * sizeof(void*);
#endif
}

#endif // defined(ARDUINO_NANO_RP2040_CONNECT) && OTA_ENABLED
#endif // defined(ARDUINO_NANO_RP2040_CONNECT) && OTA_ENABLED
Loading