File tree 1 file changed +15
-4
lines changed
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() {
116
116
return true ;
117
117
}
118
118
119
- // extern void* __stext ;
119
+ extern uint32_t __flash_binary_start ;
120
120
extern uint32_t __flash_binary_end;
121
121
122
+ #if defined(UNINITIALIZED_DATA_SECTION)
123
+ extern uint32_t __uninitialized_data_start__;
124
+ extern uint32_t __uninitialized_data_end__;
125
+ #endif
122
126
123
127
void * NANO_RP2040OTACloudProcess::appStartAddress () {
124
- // return &__flash_binary_start;
128
+ #if defined(UNINITIALIZED_DATA_SECTION)
129
+ return &__flash_binary_start;
130
+ #else
125
131
return (void *)XIP_BASE;
132
+ #endif
126
133
}
127
134
uint32_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
129
140
}
130
141
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