File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -168,20 +168,24 @@ int target_init(void) {
168
168
/* Test if user code is programmed starting from USBD_DFU_APP_DEFAULT_ADD
169
169
* address. TODO check MCUBoot header instead.
170
170
*/
171
- int app_valid = (((*(__IO uint32_t *) 0x08040000 ) & 0xFF000000 ) == 0x20000000 )
172
- || (((*(__IO uint32_t *) 0x08040000 ) & 0xFF000000 ) == 0x24000000 )
173
- || (((*(__IO uint32_t *) 0x08040000 ) & 0xFF000000 ) == 0x30000000 )
174
- || (((*(__IO uint32_t *) 0x08040000 ) & 0xFF000000 ) == 0x38000000 );
171
+ // int app_valid = (((*(__IO uint32_t *) 0x08040000) & 0xFF000000) == 0x20000000)
172
+ // || (((*(__IO uint32_t *) 0x08040000) & 0xFF000000) == 0x24000000)
173
+ // || (((*(__IO uint32_t *) 0x08040000) & 0xFF000000) == 0x30000000)
174
+ // || (((*(__IO uint32_t *) 0x08040000) & 0xFF000000) == 0x38000000);
175
175
176
- if (app_valid && magic != 0xDF59 && magic != 0x07AA && boot_sel==0 ) {
176
+ if (/* app_valid &&*/ magic != 0xDF59 /* && magic != 0x07AA*/ && boot_sel==0 ) {
177
177
RTCSetBKPRegister (RTC_BKP_DR0, 0 );
178
178
HAL_FLASH_Lock ();
179
179
BOOT_LOG_DBG (" Envie app magic 0x%x" , RTCGetBKPRegister (RTC_BKP_DR0));
180
180
return 0 ;
181
181
182
182
} else {
183
183
BOOT_LOG_DBG (" Envie loop magic 0x%x" , RTCGetBKPRegister (RTC_BKP_DR0));
184
- return 1 ;
184
+ if (boot_sel) {
185
+ return 1 ;
186
+ } else {
187
+ return 2 ;
188
+ }
185
189
}
186
190
}
187
191
You can’t perform that action at this time.
0 commit comments