Skip to content

Commit 2687945

Browse files
authored
Merge pull request #19 from gpappasv/feature/add_log
Add logging for image auth pass/fail
2 parents 87847ff + 5ae5510 commit 2687945

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

projects/bootloader/src/main.c

+9-2
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ fsm_auth_hdl(bl_fsm_ctx_s * const ctx)
313313
// If transfer failed, mark the check as failed.
314314
return BL_FSM_CHECK_FAIL_EVT;
315315
}
316+
#ifdef DEBUG_LOG
317+
printf("Secondary image auth failed\r\n");
318+
#endif
316319

317320
// If authentication failed, mark the check as failed.
318321
return BL_FSM_CHECK_FAIL_EVT;
@@ -339,11 +342,13 @@ fsm_auth_hdl(bl_fsm_ctx_s * const ctx)
339342
return BL_FSM_CHECK_PASS_EVT;
340343
}
341344

342-
// If transfer failed, recovery failed, so raise an error.
343345
return BL_FSM_ERR_OR_NONE_EVT;
344346
}
345347

346348
// If authentication failed, mark the check as failed.
349+
#ifdef DEBUG_LOG
350+
printf("Secondary image auth failed\r\n");
351+
#endif
347352
return BL_FSM_ERR_OR_NONE_EVT;
348353
}
349354
#ifdef DEBUG_LOG
@@ -356,7 +361,9 @@ fsm_auth_hdl(bl_fsm_ctx_s * const ctx)
356361
// If auth is ok, mark the check as passed.
357362
return BL_FSM_CHECK_PASS_EVT;
358363
}
359-
364+
#ifdef DEBUG_LOG
365+
printf("Primary image auth failed\r\n");
366+
#endif
360367
// If authentication failed, mark the check as failed.
361368
ctx->recover_main_img = true;
362369
return BL_FSM_CHECK_FAIL_EVT;

0 commit comments

Comments
 (0)