jannic / rp2040-flash

Some helper functions to allow writing to flash from an rp2040 firmware.
18 stars 8 forks source link

Fix register clobbers in read_flash asm #14

Open kevinmehall opened 2 weeks ago

kevinmehall commented 2 weeks ago

I was seeing crashes shortly after calling flash_unique_id, and found that the asm code uses r5 and r7 without declaring them as clobbered.

(r7 is likely not a practical issue because as the frame pointer, the function prologue always saves it, but just to be safe I added a push/pop because it can't be marked as a regular clobber)