File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
lib/sdk11/components/libraries/bootloader_dfu Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,20 @@ static void wait_for_events(void)
138
138
139
139
bool bootloader_app_is_valid (void )
140
140
{
141
+ bool success = false;
141
142
uint32_t const app_addr = DFU_BANK_0_REGION_START ;
143
+
142
144
bootloader_settings_t const * p_bootloader_settings ;
145
+ bootloader_util_settings_get (& p_bootloader_settings );
143
146
144
- bool success = false ;
147
+ enum { EMPTY_FLASH = 0xFFFFFFFFUL } ;
145
148
146
- bootloader_util_settings_get (& p_bootloader_settings );
149
+ // Application is invalid if first 2 words are all 0xFFFFFFF
150
+ if ( * ((uint32_t * )app_addr ) == EMPTY_FLASH &&
151
+ * ((uint32_t * )(app_addr + 4 )) == EMPTY_FLASH )
152
+ {
153
+ return false;
154
+ }
147
155
148
156
// The application in CODE region 1 is flagged as valid during update.
149
157
if ( p_bootloader_settings -> bank_0 == BANK_VALID_APP )
You can’t perform that action at this time.
0 commit comments