Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ it and is upstream Adafruit history, kept for provenance.

- DFU screens on I2C mono OLEDs (SSD1306 and SH1106), with a four-line layout: title, mode, version, and banner. A board opts in by defining `DISPLAY_PIN_SDA` in its `board.h`; `boards.h` rejects a board that also defines `DISPLAY_PIN_SCK`, since TWIM0 and SPIM0 share a peripheral. The bootloader probes 0x3C and 0x3D and reads the controller type off the panel, and a board with no panel shows nothing and otherwise behaves as before. Enabled on `wiscore_rak4631_board`, `wiscore_rak3401`, `wio_tracker_l1`, `promicro_nrf52840`, `xiao_nrf52840_ble`, and `xiao_nrf52840_ble_sense`, for about 2 KB of bootloader flash each. Verified on the RAK4631 and the Wio Tracker L1; the other four follow their firmware variants' pins. On the RAK4631 and RAK3401, DFU raises the switched 3V3_S rail (WB_IO2) that feeds the WisBlock slots, and lowers it again when no panel answers.
- Fixed an out-of-bounds write in `printicon()` on the 160x80 `heltec_t096` and `heltec_t1`, where the third drag icon ran past the end of `frame_buf`. Those boards place it inside the panel, and `printicon()` skips any icon that would land outside.
- Fixed BLE OTA started from an application's buttonless DFU falling back to the application after about 10 s. The 0xB1 entry now restarts through the 0xA8 path, so the bootloader initializes the SoftDevice itself; the peer data for reconnection survives the reset.

## OTAFIX 2.5

Expand Down
9 changes: 9 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ int main(void) {
// TODO move to CF2
BOOTLOADER_VERSION_REGISTER = (MK_BOOTLOADER_VERSION);

// 0xB1 claims the app jumped here with the SoftDevice already set up, but it
// also survives a reset (a lockup during the app's handover leaves exactly
// that). Restart on the 0xA8 path, which inits the SoftDevice itself and
// keeps the peer data in .noinit.
if (NRF_POWER->GPREGRET == DFU_MAGIC_OTA_APPJUM) {
NRF_POWER->GPREGRET = DFU_MAGIC_OTA_RESET;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
NVIC_SystemReset();
}

board_init();
bootloader_init();
PRINTF("Bootloader Start\r\n");
Expand Down
Loading