Skip to content

Commit bb42809

Browse files
committed
Requires increased bootrom stack size on Risc-V
1 parent a319766 commit bb42809

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/rp2_common/pico_cyw43_driver/cyw43_driver.c

+12
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,21 @@ bool cyw43_driver_init(async_context_t *context) {
143143
}
144144

145145
if (picked_p >= 0) {
146+
#ifdef __riscv
147+
// Increased bootrom stack is required for this function
148+
bootrom_stack_t stack = {
149+
.base = malloc(0x400),
150+
.size = 0x400
151+
};
152+
rom_set_bootrom_stack(&stack);
153+
#endif
146154
uint32_t* workarea = malloc(0x1000);
147155
picked_p = rom_pick_ab_update_partition(workarea, 0x1000, picked_p);
148156
free(workarea);
157+
#ifdef __riscv
158+
// Reset bootrom stack
159+
rom_set_bootrom_stack(&stack);
160+
#endif
149161

150162
if (picked_p < 0) {
151163
if (picked_p == BOOTROM_ERROR_NOT_FOUND) {

0 commit comments

Comments
 (0)