Datasheet

Table Of Contents
Offset Name Value / Description
0x09 bCmdSize 0x00
0x0c dTransferLength 0x00000000
2.7.5.4.8. EXEC (0x08)
Executes a function on the device. This function takes no arguments and returns no results, so it must communicate via
RAM. Execution of this method will block any other commands as well as Mass Storage Interface UF2 writes, so should
only be used in exclusive mode and with extreme care (and it should save and restore registers as per the ARM EABI).
This method is called from a regular (non IRQ) context, and has a very limited stack, so the function should use its own.
Table 176. PICOBOOT
Execute function on
device command
structure
Offset Name Value / Description
0x08 bCmdId 0x08 (EXEC)
0x09 bCmdSize 0x04
0x0c dTransferLength 0x00000000
0x10 dAddr Function address to execute at (a thumb bit will be added for you since you will
have forgotten).
2.7.5.4.9. VECTORIZE_FLASH (0x09)
Requests that that the vector table of flash access functions used internally by the Mass Storage and PICOBOOT
interfaces be copied into RAM, such that the method implementations can be replaced with custom versions (For
example, if the board uses flash that does not support standard commands)
Table 177. PICOBOOT
Vectorise flash
command structure
Offset Name Value / Description
0x08 bCmdId 0x09 (VECTORIZE_FLASH)
0x09 bCmdSize 0x04
0x0c dTransferLength 0x00000000
0x10 dAddr Pointer to where to place vector table in RAM
Flash function vector table
struct {
Ê uint32_t size; // 28
Ê uint32_t (*do_flash_enter_cmd_xip)();
Ê uint32_t (*do_flash_exit_xip)();
Ê uint32_t (*do_flash_erase_sector)();
Ê uint32_t (*do_flash_erase_range)(uint32_t addr, uint32_t size);
Ê uint32_t (*do_flash_page_program)(uint32_t addr, uint8_t *data);
Ê uint32_t (*do_flash_page_read)(uint32_t addr, uint8_t *data);
};
These methods have the same signature and arguments as the corresponding flash access functions in the bootrom (see
Section 2.7.3.1.3).
Note that the host must subsequently update the RAM copy of this table via an EXEC command running on the RP2040 as
any write to RAM from the host via a PICOBOOT WRITE that overlaps this (now active in RAM) vector table will cause a
reset to the use of the default ROM Flash function vector table.
RP2040 Datasheet
2.7. Bootrom 133