Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nickez/dont boot to ff #1332

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/bootloader/bootloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,8 @@ static size_t _api_write_chunk(const uint8_t* buf, uint8_t chunknum, uint8_t* ou

// Erase is handled inside of flash_write
if (flash_write(
&FLASH_0,
FLASH_APP_START + (chunknum * FIRMWARE_CHUNK_LEN),
(const uint8_t*)buf,
FIRMWARE_CHUNK_LEN) != ERR_NONE) {
&FLASH_0, FLASH_APP_START + (chunknum * FIRMWARE_CHUNK_LEN), buf, FIRMWARE_CHUNK_LEN) !=
ERR_NONE) {
return _report_status(OP_STATUS_ERR_WRITE, output);
}

Expand Down Expand Up @@ -902,7 +900,12 @@ static bool _devdevice_enter(secbool_u32 firmware_verified)
UG_PutString(0, 0, " <Enter bootloader>", false);
UG_PutString(0, SCREEN_HEIGHT / 2 - 11, "DEV DEVICE", false);
UG_PutString(0, SCREEN_HEIGHT / 2 + 2, "NOT FOR VALUE", false);
UG_PutString(0, SCREEN_HEIGHT - 9, " <Continue>", false);
// Check that the firmware's reset handler isn't invalid.
if (((uint32_t*)FLASH_APP_START)[1] != 0xffffffff) {
UG_PutString(0, SCREEN_HEIGHT - 9, " <Continue>", false);
} else {
UG_PutString(0, SCREEN_HEIGHT - 9, " No firmware found", false);
}
uint16_t ypos = SCREEN_HEIGHT / 2 - 4;
uint16_t xpos = SCREEN_WIDTH - 10;
if (firmware_verified != sectrue_u32) {
Expand All @@ -923,7 +926,8 @@ static bool _devdevice_enter(secbool_u32 firmware_verified)
if (qtouch_is_scroller_active(top_slider)) {
return true;
}
if (qtouch_is_scroller_active(bottom_slider)) {
if (qtouch_is_scroller_active(bottom_slider) &&
((uint32_t*)FLASH_APP_START)[1] != 0xffffffff) {
return false;
}
}
Expand Down