Skip to content

what's resetting my IO_BANK0 registers? #2686

Answered by afflux
afflux asked this question in Q&A
Discussion options

You must be logged in to vote

So the OTA handler also runs its own copy of runtime_init_early_resets(), and this will still reset IO_BANK0.

The quickest fix I see for this would be to to add an earlier runtime_init_func that checks if we are in OTA, and if not, continue with this

arduino-pico/ota/ota.c

Lines 181 to 196 in dc0dc50

#ifdef __riscv
extern void __mainapp();
__mainapp();
// Should never get here!
return 0;
#else
// Reset the interrupt/etc. vectors to the real app. Will be copied to RAM in app's runtime_init
scb_hw->vtor = (uint32_t)0x10003000;
// Jump to it
register uint32_t* sp asm("sp");
register uint32_t _sp = *(uint32_t *)0x10003000;

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@afflux
Comment options

Answer selected by afflux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant