7#ifndef _BOOT_PICOBOOT_H
8#define _BOOT_PICOBOOT_H
14#ifndef NO_PICO_PLATFORM
24#include "picoboot_constants.h"
26#define PICOBOOT_MAGIC 0x431fd10bu
33#define PICOBOOT_IF_RESET 0x41
36#define PICOBOOT_IF_CMD_STATUS 0x42
48 PC_EXCLUSIVE_ACCESS = 0x1,
54 PC_ENTER_CMD_XIP = 0x7,
56 PC_VECTORIZE_FLASH = 0x9,
66 PICOBOOT_UNKNOWN_CMD = 1,
67 PICOBOOT_INVALID_CMD_LENGTH = 2,
68 PICOBOOT_INVALID_TRANSFER_LENGTH = 3,
69 PICOBOOT_INVALID_ADDRESS = 4,
70 PICOBOOT_BAD_ALIGNMENT = 5,
71 PICOBOOT_INTERLEAVED_WRITE = 6,
72 PICOBOOT_REBOOTING = 7,
73 PICOBOOT_UNKNOWN_ERROR = 8,
74 PICOBOOT_INVALID_STATE = 9,
75 PICOBOOT_NOT_PERMITTED = 10,
76 PICOBOOT_INVALID_ARG = 11,
77 PICOBOOT_BUFFER_TOO_SMALL = 12,
78 PICOBOOT_PRECONDITION_NOT_MET = 13,
79 PICOBOOT_MODIFIED_DATA = 14,
80 PICOBOOT_INVALID_DATA = 15,
81 PICOBOOT_NOT_FOUND = 16,
82 PICOBOOT_UNSUPPORTED_MODIFICATION = 17,
183struct __packed __aligned(4) picoboot_cmd {
189 uint32_t dTransferLength;
201static_assert(32 ==
sizeof(
struct picoboot_cmd),
"picoboot_cmd must be 32 bytes big");
209struct __packed __aligned(4) picoboot_cmd_status {
211 uint32_t dStatusCode;
217static_assert(16 ==
sizeof(
struct picoboot_cmd_status),
"picoboot_cmd_status must be 16 bytes big");
Definition bootrom_constants.h:282
Parameters for a command that operates on a single address (RP2040 only).
Definition picoboot.h:114
uint32_t dAddr
Target address.
Definition picoboot.h:115
Parameters for an exclusive-access command.
Definition picoboot.h:147
uint8_t bExclusive
Exclusivity level; one of the picoboot_exclusive_type values.
Definition picoboot.h:148
Definition picoboot.h:129
Parameters for a get-info command (not available on RP2040).
Definition picoboot.h:167
uint8_t bParam
Unused.
Definition picoboot.h:169
uint32_t dParams[3]
Additional parameters for the selected info type.
Definition picoboot.h:171
uint16_t wParam
Unused.
Definition picoboot.h:170
uint8_t bType
Info type selector.
Definition picoboot.h:168
Parameters for an OTP read or write command (not available on RP2040).
Definition picoboot.h:156
uint8_t bEcc
Non-zero to use ECC (16-bit per register); zero for raw 24-bit access (stored as 32-bit).
Definition picoboot.h:159
uint16_t wRow
OTP row index to start from.
Definition picoboot.h:157
uint16_t wRowCount
Number of rows to transfer.
Definition picoboot.h:158
Parameters for a command that operates on an address range.
Definition picoboot.h:123
uint32_t dAddr
Start address of the range.
Definition picoboot.h:124
uint32_t dSize
Size of the range in bytes.
Definition picoboot.h:125
Parameters for an extended reboot command (not available on RP2040).
Definition picoboot.h:101
uint32_t dDelayMS
Delay in milliseconds before rebooting.
Definition picoboot.h:103
uint32_t dFlags
Reboot flags controlling the boot path.
Definition picoboot.h:102
uint32_t dParam0
First reboot parameter (interpretation depends on flags).
Definition picoboot.h:104
uint32_t dParam1
Second reboot parameter (interpretation depends on flags).
Definition picoboot.h:105
Parameters for a reboot command (RP2040 only).
Definition picoboot.h:90
uint32_t dPC
Program counter to reboot to; 0 means reset into the regular boot path, otherwise must be a RAM addre...
Definition picoboot.h:91
uint32_t dDelayMS
Delay in milliseconds before rebooting.
Definition picoboot.h:93
uint32_t dSP
Stack pointer value at reboot; ignored unless dPC is a RAM address.
Definition picoboot.h:92