-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Milestone
Description
I'm seeing this in someone else's project (a proper SDK one, but I usually use the Arduino-Pico environment as shown here)...
#include "hardware/structs/xip_ctrl.h"
static uint32_t boot2_copyout[64];
void __no_inline_not_in_flash_func(setup) () {
memcpy (boot2_copyout, (void *)XIP_BASE, sizeof (boot2_copyout));
while (1) {
xip_ctrl_hw->flush = 1;
while (!(xip_ctrl_hw->stat & XIP_STAT_FLUSH_READY_BITS))
tight_loop_contents();
if (memcmp ((void *)XIP_BASE, boot2_copyout, sizeof (boot2_copyout)) != 0)
break; // Something's wrong!
digitalWrite (LED_BUILTIN, HIGH);
delay (100);
digitalWrite (LED_BUILTIN, LOW);
delay (100);
}
}
void __no_inline_not_in_flash_func(loop) () {
}
Back to the real project: I've created a flash memory update routine, and I'm flushing the cache to verify a write, but sometimes it fails to read back any written data - this sketch has the least code which shows what's failing.
Eventually, the memory compare doesn't get back what's in the flash memory chip and the LED stops flashing.
Metadata
Metadata
Assignees
Labels
No labels