Accept USB BOOTSEL reboot on the UART firmware
The regular firmware now answers the EP0 vendor INFO and BOOTSEL reboot requests with the AIO wire protocol, so switch-pico-config reboot bootsel works when the Pico's USB side is on a PC. Wire constants move to usb_management_protocol.h; other operations stall.
This commit is contained in:
parent
6e0676d9df
commit
8db720fb9a
16 changed files with 489 additions and 67 deletions
14
tests/native_stubs/pico/bootrom.h
Normal file
14
tests/native_stubs/pico/bootrom.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void reset_usb_boot(uint32_t usb_activity_gpio_pin_mask,
|
||||
uint32_t disable_interface_mask);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
@ -12,6 +13,8 @@ typedef struct {
|
|||
|
||||
absolute_time_t get_absolute_time(void);
|
||||
uint32_t to_ms_since_boot(absolute_time_t time);
|
||||
absolute_time_t make_timeout_time_ms(uint32_t milliseconds);
|
||||
bool time_reached(absolute_time_t time);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ enum {
|
|||
TUSB_DIR_IN = 1,
|
||||
TUSB_DESC_ENDPOINT = 5,
|
||||
TUSB_DESC_STRING = 3,
|
||||
TUSB_REQ_RCPT_DEVICE = 0,
|
||||
TUSB_REQ_TYPE_VENDOR = 2,
|
||||
CONTROL_STAGE_SETUP = 0,
|
||||
CONTROL_STAGE_DATA = 1,
|
||||
CONTROL_STAGE_ACK = 2,
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
|
@ -64,13 +69,23 @@ static inline uint8_t tu_edpt_dir(uint8_t endpoint) {
|
|||
}
|
||||
|
||||
typedef struct {
|
||||
uint8_t bmRequestType;
|
||||
union {
|
||||
struct {
|
||||
uint8_t recipient : 5;
|
||||
uint8_t type : 2;
|
||||
uint8_t direction : 1;
|
||||
} bmRequestType_bit;
|
||||
uint8_t bmRequestType;
|
||||
};
|
||||
uint8_t bRequest;
|
||||
uint16_t wValue;
|
||||
uint16_t wIndex;
|
||||
uint16_t wLength;
|
||||
} tusb_control_request_t;
|
||||
|
||||
bool tud_control_xfer(uint8_t rhport, tusb_control_request_t const* request,
|
||||
void* buffer, uint16_t length);
|
||||
|
||||
bool tud_hid_n_ready(uint8_t instance);
|
||||
bool tud_hid_n_report(uint8_t instance, uint8_t report_id,
|
||||
const void* report, uint16_t length);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue