Skip to content

Commit

Permalink
Requires increased bootrom stack size on Risc-V
Browse files Browse the repository at this point in the history
  • Loading branch information
will-v-pi committed Nov 22, 2024
1 parent 1e8324a commit 9730601
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/rp2_common/pico_cyw43_driver/cyw43_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,21 @@ bool cyw43_driver_init(async_context_t *context) {
}

if (picked_p >= 0) {
#ifdef __riscv
// Increased bootrom stack is required for this function
bootrom_stack_t stack = {
.base = malloc(0x400),
.size = 0x400
};
rom_set_bootrom_stack(&stack);
#endif
uint32_t* workarea = malloc(0x1000);
picked_p = rom_pick_ab_update_partition(workarea, 0x1000, picked_p);
free(workarea);
#ifdef __riscv
// Reset bootrom stack
rom_set_bootrom_stack(&stack);
#endif

if (picked_p < 0) {
if (picked_p == BOOTROM_ERROR_NOT_FOUND) {
Expand Down

0 comments on commit 9730601

Please sign in to comment.