Closed ArvinHou closed 1 month ago
Have a look at the sdk documentation under pico_flash. There are mechanisms for doing this, I have never used them though. There is also the option of using the method you already have, but you need to make sure to use the victim init function on the secondary core. I am not sure how that will work with freertos, but the pico_flash functions mention freertos and what to look out for.
best to visit https://forums.raspberrypi.com/viewforum.php?f=143 for questions
Have a look at the sdk documentation under pico_flash. There are mechanisms for doing this, I have never used them though. There is also the option of using the method you already have, but you need to make sure to use the victim init function on the secondary core. I am not sure how that will work with freertos, but the pico_flash functions mention freertos and what to look out for.
Thank for reply.I searched carefully again and found that there are some functions more suitable in pico_flash.
Put flash_safe_execute_core_init();
at the begin of code in core 1.
When I want to write flash in core 0. Using flash_safe_execute
like bellow:
flash_safe_execute(write_flash,&background_arc_color,2000);
Well, it worked!
I‘m using freertos(SMP) + lvgl . There is 3 tasks.
The program can run successfully. When a button click on screen. change a global value.Then write flash in main_task.
when code running flash_range_erase , the program crash ,But I can't see any logs。 Use Clion debug pico swd, the pc point running to 0xfffffffe .
I also tried the UF2 program method, Still failing.
I also tried using
multicore_lockout_start_blocking
multicore_lockout_end_blocking
.But failed.Maybe there are some errors in my code.How to write flash safely? Can someone help me? Thanks !