Skip to content

Should void rp2040.enableDoubleResetBootloader() work on the Pi Pico 2 RP2350? #2606

Answered by earlephilhower
Andy2No asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, looks like either the CPU or ROM flushes RAM after a reset, so the flag will always be stomped. Simple test here shows after upload the 2nd stack is all 0 (as expected), but after a HW reset the core1 stack is filled completely with pseudo-random data.

uint32_t *m = (uint32_t *)0x20000000 + 50 * 1024 / 4; // Hardcode address unused by this app for test purposes
void setup() {
  delay(5000);
  Serial.printf("PRE : %08lx %08lx %08lx\n", m[0], m[1], m[2]);
  m[0] = 0xabcd1234;
  m[1] = 0x22229999;
  m[2] = 0x12345678;
  Serial.printf("POST: %08lx %08lx %08lx\n\n\n\n", m[0], m[1], m[2]);
  uint32_t *stack = (uint32_t*)0x20080000;
  for (int i = 0; i < 8192 / 4; i++) {
    if (! (i % 8)) …

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Andy2No
Comment options

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

Comment options

You must be logged in to vote
3 replies
@earlephilhower
Comment options

@Andy2No
Comment options

@earlephilhower
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants