File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -116,16 +116,27 @@ bool NANO_RP2040OTACloudProcess::isOtaCapable() {
116116 return true ;
117117}
118118
119- // extern void* __stext ;
119+ extern uint32_t __flash_binary_start ;
120120extern uint32_t __flash_binary_end;
121121
122+ #if defined(UNINITIALIZED_DATA_SECTION)
123+ extern uint32_t __uninitialized_data_start__;
124+ extern uint32_t __uninitialized_data_end__;
125+ #endif
122126
123127void * NANO_RP2040OTACloudProcess::appStartAddress () {
124- // return &__flash_binary_start;
128+ #if defined(UNINITIALIZED_DATA_SECTION)
129+ return &__flash_binary_start;
130+ #else
125131 return (void *)XIP_BASE;
132+ #endif
126133}
127134uint32_t NANO_RP2040OTACloudProcess::appSize () {
128- return (&__flash_binary_end - (uint32_t *)appStartAddress ())*sizeof (void *);
135+ #if defined(UNINITIALIZED_DATA_SECTION)
136+ return ((&__flash_binary_end - (uint32_t *)appStartAddress ()) - (&__uninitialized_data_end__ - &__uninitialized_data_start__)) * sizeof (void *);
137+ #else
138+ return (&__flash_binary_end - (uint32_t *)appStartAddress ()) * sizeof (void *);
139+ #endif
129140}
130141
131- #endif // defined(ARDUINO_NANO_RP2040_CONNECT) && OTA_ENABLED
142+ #endif // defined(ARDUINO_NANO_RP2040_CONNECT) && OTA_ENABLED
You can’t perform that action at this time.
0 commit comments