Partually working usb gdb
This commit is contained in:
parent
012fa54f4e
commit
b57b872386
|
@ -5,51 +5,56 @@ set(BM_SOURCES
|
|||
${BM_DIR}/src/platforms/common/swdptap.c
|
||||
${BM_DIR}/src/platforms/common/jtagtap.c
|
||||
${BM_DIR}/src/gdb_main.c
|
||||
${BM_DIR}/src/command.c
|
||||
${BM_DIR}/src/crc32.c
|
||||
${BM_DIR}/src/exception.c
|
||||
${BM_DIR}/src/gdb_hostio.c
|
||||
${BM_DIR}/src/gdb_main.c
|
||||
${BM_DIR}/src/command.c
|
||||
${BM_DIR}/src/crc32.c
|
||||
${BM_DIR}/src/exception.c
|
||||
${BM_DIR}/src/gdb_hostio.c
|
||||
${BM_DIR}/src/gdb_main.c
|
||||
${BM_DIR}/src/gdb_packet.c
|
||||
${BM_DIR}/src/remote.c
|
||||
${BM_DIR}/src/hex_utils.c
|
||||
${BM_DIR}/src/main.c
|
||||
${BM_DIR}/src/morse.c
|
||||
${BM_DIR}/src/remote.c
|
||||
${BM_DIR}/src/hex_utils.c
|
||||
${BM_DIR}/src/main.c
|
||||
${BM_DIR}/src/morse.c
|
||||
|
||||
#TODO move to project
|
||||
${PLATFORM_DIR}/platform.c
|
||||
#gdb_if.c
|
||||
${PLATFORM_DIR}/platform.c
|
||||
${PLATFORM_DIR}/gdb-glue.c
|
||||
)
|
||||
|
||||
set(BM_TARGETS
|
||||
${BM_DIR}/src/target/adiv5.c
|
||||
${BM_DIR}/src/target/cortexa.c
|
||||
${BM_DIR}/src/target/lpc11xx.c
|
||||
${BM_DIR}/src/target/lpc_common.c
|
||||
${BM_DIR}/src/target/nxpke04.c
|
||||
${BM_DIR}/src/target/samd.c
|
||||
${BM_DIR}/src/target/stm32h7.c
|
||||
${BM_DIR}/src/target/target.c
|
||||
${BM_DIR}/src/target/cortexm.c
|
||||
${BM_DIR}/src/target/jtag_devs.c
|
||||
${BM_DIR}/src/target/lpc15xx.c
|
||||
${BM_DIR}/src/target/sam3x.c
|
||||
${BM_DIR}/src/target/samx5x.c
|
||||
${BM_DIR}/src/target/stm32l0.c
|
||||
${BM_DIR}/src/target/adiv5_jtagdp.c
|
||||
${BM_DIR}/src/target/kinetis.c
|
||||
${BM_DIR}/src/target/lpc17xx.c
|
||||
${BM_DIR}/src/target/msp432.c
|
||||
${BM_DIR}/src/target/sam4l.c
|
||||
${BM_DIR}/src/target/stm32f1.c
|
||||
${BM_DIR}/src/target/adiv5.c
|
||||
${BM_DIR}/src/target/cortexa.c
|
||||
${BM_DIR}/src/target/jtag_devs.c
|
||||
${BM_DIR}/src/target/kinetis.c
|
||||
${BM_DIR}/src/target/lpc15xx.c
|
||||
${BM_DIR}/src/target/lpc546xx.c
|
||||
${BM_DIR}/src/target/nrf51.c
|
||||
${BM_DIR}/src/target/sam3x.c
|
||||
${BM_DIR}/src/target/samx5x.c
|
||||
${BM_DIR}/src/target/stm32g0.c
|
||||
${BM_DIR}/src/target/stm32l4.c
|
||||
${BM_DIR}/src/target/adiv5_swdp.c
|
||||
${BM_DIR}/src/target/efm32.c
|
||||
${BM_DIR}/src/target/jtag_scan.c
|
||||
${BM_DIR}/src/target/lmi.c
|
||||
${BM_DIR}/src/target/lpc43xx.c
|
||||
${BM_DIR}/src/target/nrf51.c
|
||||
${BM_DIR}/src/target/stm32f4.c
|
||||
${BM_DIR}/src/target/adiv5_jtagdp.c
|
||||
${BM_DIR}/src/target/cortexm.c
|
||||
${BM_DIR}/src/target/jtag_scan.c
|
||||
${BM_DIR}/src/target/lmi.c
|
||||
${BM_DIR}/src/target/lpc17xx.c
|
||||
${BM_DIR}/src/target/lpc_common.c
|
||||
${BM_DIR}/src/target/nxpke04.c
|
||||
${BM_DIR}/src/target/sam4l.c
|
||||
${BM_DIR}/src/target/stm32f1.c
|
||||
${BM_DIR}/src/target/stm32h7.c
|
||||
# ${BM_DIR}/src/target/swdptap_generic.c
|
||||
${BM_DIR}/src/target/adiv5_swdp.c
|
||||
${BM_DIR}/src/target/efm32.c
|
||||
# ${BM_DIR}/src/target/jtagtap_generic.c
|
||||
${BM_DIR}/src/target/lpc11xx.c
|
||||
${BM_DIR}/src/target/lpc43xx.c
|
||||
${BM_DIR}/src/target/msp432.c
|
||||
${BM_DIR}/src/target/rp.c
|
||||
${BM_DIR}/src/target/samd.c
|
||||
${BM_DIR}/src/target/stm32f4.c
|
||||
${BM_DIR}/src/target/stm32l0.c
|
||||
${BM_DIR}/src/target/target.c
|
||||
)
|
||||
|
||||
set(BM_INCLUDE
|
||||
|
@ -60,7 +65,16 @@ set(BM_INCLUDE
|
|||
${PLATFORM_DIR}
|
||||
)
|
||||
|
||||
idf_component_register(SRCS ${BM_SOURCES} ${BM_TARGETS}
|
||||
# Get the current working branch
|
||||
execute_process(
|
||||
COMMAND git describe --always --dirty --tags
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_DESC
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
message(STATUS "FW Version: ${GIT_DESC}")
|
||||
|
||||
idf_component_register(SRCS ${BM_SOURCES} ${BM_TARGETS}
|
||||
INCLUDE_DIRS ${BM_INCLUDE})
|
||||
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE -DPC_HOSTED=0 -Wno-char-subscripts)
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE -DPC_HOSTED=0 -DFIRMWARE_VERSION="${GIT_DESC}" -Wno-char-subscripts)
|
|
@ -0,0 +1,58 @@
|
|||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <esp_log.h>
|
||||
|
||||
size_t usb_cdc_rx(uint8_t* buffer, size_t size);
|
||||
size_t usb_cdc_rx_with_timeout(uint8_t* buffer, size_t size, uint32_t timeout);
|
||||
void usb_cdc_tx(uint8_t* buffer, size_t size, bool flush);
|
||||
|
||||
unsigned char gdb_if_getchar_to(int timeout) {
|
||||
const uint8_t buffer_size = 1;
|
||||
uint8_t buffer[buffer_size];
|
||||
|
||||
size_t cnt = usb_cdc_rx_with_timeout(buffer, buffer_size, timeout);
|
||||
if(cnt) {
|
||||
return buffer[buffer_size - 1];
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char gdb_if_getchar(void) {
|
||||
const uint8_t buffer_size = 1;
|
||||
uint8_t buffer[buffer_size];
|
||||
|
||||
size_t cnt = usb_cdc_rx(buffer, buffer_size);
|
||||
if(cnt) {
|
||||
return buffer[buffer_size - 1];
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#define BUFFER_TX_SIZE 64
|
||||
static uint8_t buffer_tx[BUFFER_TX_SIZE + 1];
|
||||
static size_t buffer_tx_counter = 0;
|
||||
|
||||
void gdb_if_putchar(unsigned char c, int flush) {
|
||||
// usb_cdc_tx(&c, 1, flush);
|
||||
|
||||
buffer_tx[buffer_tx_counter] = c;
|
||||
buffer_tx_counter += 1;
|
||||
|
||||
if(flush || (buffer_tx_counter == BUFFER_TX_SIZE)) {
|
||||
usb_cdc_tx(buffer_tx, buffer_tx_counter, flush);
|
||||
|
||||
// buffer_tx[buffer_tx_counter] = '\0';
|
||||
// ESP_LOGW("gdb_if", "tx> %s", buffer_tx);
|
||||
|
||||
/*if(flush && (buffer_tx_counter == BUFFER_TX_SIZE)) {
|
||||
uint8_t zero_byte = 0;
|
||||
usb_cdc_tx(&zero_byte, 1, 1);
|
||||
// ESP_LOGW("gdb_if", "tx> [zb]");
|
||||
}*/
|
||||
|
||||
buffer_tx_counter = 0;
|
||||
}
|
||||
}
|
|
@ -1,30 +1,97 @@
|
|||
#include <stdint.h>
|
||||
// #include <hal\gpio_types.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "general.h"
|
||||
#include <esp_log.h>
|
||||
#include <driver/gpio.h>
|
||||
#include <rom/ets_sys.h>
|
||||
|
||||
uint32_t swd_delay_cnt = 0;
|
||||
static const char* TAG = "gdb-platform";
|
||||
|
||||
void platform_swdio_mode_float(void) {
|
||||
// gpio_set_direction(SWDIO_PIN, GPIO_MODE_INPUT);
|
||||
// gpio_set_pull_mode(SWDIO_PIN, GPIO_FLOATING);
|
||||
// ESP_LOGI(TAG, "swdio_mode_float");
|
||||
gpio_set_direction(SWDIO_PIN, GPIO_MODE_INPUT);
|
||||
gpio_set_pull_mode(SWDIO_PIN, GPIO_FLOATING);
|
||||
}
|
||||
|
||||
void platform_swdio_mode_drive(void) {
|
||||
// gpio_set_direction(SWDIO_PIN, GPIO_MODE_OUTPUT);
|
||||
// ESP_LOGI(TAG, "swdio_mode_drive");
|
||||
gpio_set_direction(SWDIO_PIN, GPIO_MODE_OUTPUT);
|
||||
}
|
||||
|
||||
void platform_gpio_set_level(int32_t gpio_num, uint32_t value) {
|
||||
/* TODO gpio_set_level(pin, value);*/
|
||||
/* ignore that -> sdk_os_delay_us(2); */
|
||||
// ESP_LOGI(TAG, "pin %d set %d", gpio_num, value);
|
||||
gpio_set_level(gpio_num, value);
|
||||
ets_delay_us(2);
|
||||
}
|
||||
|
||||
void platform_gpio_set(int32_t gpio_num) {
|
||||
// platform_gpio_set_level(gpio_num, 1);
|
||||
// ESP_LOGI(TAG, "pin %d set 1", gpio_num);
|
||||
platform_gpio_set_level(gpio_num, 1);
|
||||
}
|
||||
|
||||
void platform_gpio_clear(int32_t gpio_num) {
|
||||
// platform_gpio_set_level(gpio_num, 0);
|
||||
// ESP_LOGI(TAG, "pin %d set 0", gpio_num);
|
||||
platform_gpio_set_level(gpio_num, 0);
|
||||
}
|
||||
|
||||
int platform_gpio_get_level(int32_t gpio_num) {
|
||||
int level = gpio_get_level(gpio_num);
|
||||
// ESP_LOGI(TAG, "pin %d get %d", gpio_num, level);
|
||||
return level;
|
||||
}
|
||||
|
||||
// init platform
|
||||
void platform_init() {
|
||||
}
|
||||
|
||||
// set reset target pin level
|
||||
void platform_srst_set_val(bool assert) {
|
||||
(void)assert;
|
||||
}
|
||||
|
||||
// get reset target pin level
|
||||
bool platform_srst_get_val(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// target voltage
|
||||
const char* platform_target_voltage(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// platform time counter
|
||||
uint32_t platform_time_ms(void) {
|
||||
int64_t time_milli = esp_timer_get_time() / 1000;
|
||||
return ((uint32_t)time_milli);
|
||||
}
|
||||
|
||||
// delay ms
|
||||
void platform_delay(uint32_t ms) {
|
||||
vTaskDelay((ms) / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
// hardware version
|
||||
int platform_hwversion(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// set timeout
|
||||
void platform_timeout_set(platform_timeout* t, uint32_t ms) {
|
||||
t->time = platform_time_ms() + ms;
|
||||
}
|
||||
|
||||
// check timeout
|
||||
bool platform_timeout_is_expired(platform_timeout* t) {
|
||||
return platform_time_ms() > t->time;
|
||||
}
|
||||
|
||||
// set interface freq
|
||||
void platform_max_frequency_set(uint32_t freq) {
|
||||
}
|
||||
|
||||
// get interface freq
|
||||
uint32_t platform_max_frequency_get(void) {
|
||||
return 0;
|
||||
}
|
|
@ -48,8 +48,8 @@ int platform_gpio_get_level(int32_t gpio_num);
|
|||
// ON ESP32 we dont have the PORTS, this is dummy value until code is corrected
|
||||
#define SWCLK_PORT 0
|
||||
|
||||
#define SWDIO_PIN (13)
|
||||
#define SWCLK_PIN (12)
|
||||
#define SWDIO_PIN (4)
|
||||
#define SWCLK_PIN (3)
|
||||
|
||||
#define gpio_set_val(port, pin, value) \
|
||||
do { \
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
#define FIRMWARE_VERSION "0000"
|
||||
// for includes only
|
||||
// we provide the FIRMWARE_VERSION through the build system
|
39
main/main.c
39
main/main.c
|
@ -3,15 +3,50 @@
|
|||
#include "usb-cdc.h"
|
||||
#include "nvs.h"
|
||||
#include "wifi.h"
|
||||
#include "gdb_main.h"
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
#include <rom/ets_sys.h>
|
||||
|
||||
static const char* TAG = "main";
|
||||
|
||||
void gdb_application_thread(void* pvParameters) {
|
||||
ESP_LOGI("gdb", "start");
|
||||
while(1) {
|
||||
gdb_main();
|
||||
}
|
||||
ESP_LOGI("gdb", "end");
|
||||
}
|
||||
|
||||
#include <platform.h>
|
||||
#include <driver/gpio.h>
|
||||
|
||||
void pins_init() {
|
||||
gpio_config_t io_conf;
|
||||
// disable interrupt
|
||||
io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
|
||||
// set as output mode
|
||||
io_conf.mode = GPIO_MODE_OUTPUT;
|
||||
// bit mask of the pins that you want to set
|
||||
io_conf.pin_bit_mask = ((1 << SWCLK_PIN) | (1 << SWDIO_PIN));
|
||||
// disable pull-down mode
|
||||
io_conf.pull_down_en = 0;
|
||||
// disable pull-up mode
|
||||
io_conf.pull_up_en = 0;
|
||||
// configure GPIO with the given settings
|
||||
gpio_config(&io_conf);
|
||||
}
|
||||
|
||||
void app_main(void) {
|
||||
ESP_LOGI(TAG, "start");
|
||||
|
||||
usb_cdc_init();
|
||||
nvs_init();
|
||||
wifi_init();
|
||||
// nvs_init();
|
||||
// wifi_init();
|
||||
|
||||
pins_init();
|
||||
|
||||
xTaskCreate(&gdb_application_thread, "gdb_thread", 16 * 4096, NULL, 5, NULL);
|
||||
|
||||
ESP_LOGI(TAG, "end");
|
||||
}
|
||||
|
|
133
main/usb-cdc.c
133
main/usb-cdc.c
|
@ -2,34 +2,120 @@
|
|||
#include <esp_log.h>
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
#include <freertos/stream_buffer.h>
|
||||
#include <tinyusb.h>
|
||||
#include <tusb_cdc_acm.h>
|
||||
#include <sdkconfig.h>
|
||||
|
||||
static const char* TAG = "usb-cdc";
|
||||
static uint8_t buf[CONFIG_USB_CDC_RX_BUFSIZE + 1];
|
||||
static uint8_t buffer_rx[CONFIG_USB_CDC_RX_BUFSIZE + 1];
|
||||
|
||||
void usb_cdc_rx_callback(int itf, cdcacm_event_t* event) {
|
||||
size_t rx_size = 0;
|
||||
// #define buffer_tx_size 10000
|
||||
// static uint8_t buffer_tx[buffer_tx_size + 1];
|
||||
// static size_t buffer_tx_counter = 0;
|
||||
|
||||
esp_err_t ret = tinyusb_cdcacm_read(itf, buf, CONFIG_USB_CDC_RX_BUFSIZE, &rx_size);
|
||||
if(ret == ESP_OK) {
|
||||
buf[rx_size] = '\0';
|
||||
ESP_LOGI(TAG, "Got data (%d bytes): %s", rx_size, buf);
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Read error");
|
||||
typedef struct {
|
||||
volatile bool connected;
|
||||
volatile bool dtr;
|
||||
volatile bool rts;
|
||||
|
||||
StreamBufferHandle_t rx_stream;
|
||||
volatile bool rx_stream_full;
|
||||
} FuriHalVcp;
|
||||
|
||||
static FuriHalVcp furi_hal_vcp;
|
||||
|
||||
size_t usb_cdc_rx(uint8_t* buffer, size_t size) {
|
||||
size_t received = xStreamBufferReceive(furi_hal_vcp.rx_stream, buffer, size, portMAX_DELAY);
|
||||
|
||||
if(furi_hal_vcp.rx_stream_full &&
|
||||
xStreamBufferSpacesAvailable(furi_hal_vcp.rx_stream) >= CONFIG_USB_CDC_RX_BUFSIZE) {
|
||||
furi_hal_vcp.rx_stream_full = false;
|
||||
ESP_LOGW(TAG, "Stream is not full now");
|
||||
}
|
||||
|
||||
// echo
|
||||
tinyusb_cdcacm_write_queue(itf, buf, rx_size);
|
||||
tinyusb_cdcacm_write_flush(itf, 0);
|
||||
return received;
|
||||
}
|
||||
|
||||
size_t usb_cdc_rx_with_timeout(uint8_t* buffer, size_t size, uint32_t timeout) {
|
||||
size_t received = xStreamBufferReceive(furi_hal_vcp.rx_stream, buffer, size, timeout);
|
||||
|
||||
if(furi_hal_vcp.rx_stream_full &&
|
||||
xStreamBufferSpacesAvailable(furi_hal_vcp.rx_stream) >= CONFIG_USB_CDC_RX_BUFSIZE) {
|
||||
furi_hal_vcp.rx_stream_full = false;
|
||||
ESP_LOGW(TAG, "Stream is not full now");
|
||||
}
|
||||
|
||||
return received;
|
||||
}
|
||||
|
||||
void usb_cdc_tx(uint8_t* buffer, size_t size, bool flush) {
|
||||
/*if(furi_hal_vcp.connected) {
|
||||
//printf("%c", buffer[0]);
|
||||
if((buffer_tx_counter + size) < buffer_tx_size) {
|
||||
memcpy(&buffer_tx[buffer_tx_counter], buffer, size);
|
||||
buffer_tx_counter += size;
|
||||
}
|
||||
|
||||
while(size > 0) {
|
||||
size_t tx_size = tinyusb_cdcacm_write_queue(TINYUSB_USBDEV_0, buffer, size);
|
||||
size -= tx_size;
|
||||
buffer += tx_size;
|
||||
}
|
||||
|
||||
if(flush) {
|
||||
buffer_tx[buffer_tx_counter] = '\0';
|
||||
ESP_LOGI(TAG, "tx> %s", buffer_tx);
|
||||
buffer_tx_counter = 0;
|
||||
|
||||
// TODO: timeout size
|
||||
ESP_ERROR_CHECK_WITHOUT_ABORT(tinyusb_cdcacm_write_flush(TINYUSB_USBDEV_0, 10));
|
||||
}
|
||||
}*/
|
||||
while(size > 0) {
|
||||
size_t tx_size = tinyusb_cdcacm_write_queue(TINYUSB_USBDEV_0, buffer, size);
|
||||
size -= tx_size;
|
||||
buffer += tx_size;
|
||||
}
|
||||
|
||||
if(flush) {
|
||||
// TODO: timeout size
|
||||
ESP_ERROR_CHECK_WITHOUT_ABORT(tinyusb_cdcacm_write_flush(TINYUSB_USBDEV_0, 100));
|
||||
}
|
||||
}
|
||||
|
||||
void usb_cdc_rx_callback(int itf, cdcacm_event_t* event) {
|
||||
uint16_t max_len = xStreamBufferSpacesAvailable(furi_hal_vcp.rx_stream);
|
||||
|
||||
if(max_len > 0) {
|
||||
if(max_len > CONFIG_USB_CDC_RX_BUFSIZE) max_len = CONFIG_USB_CDC_RX_BUFSIZE;
|
||||
size_t rx_size = 0;
|
||||
esp_err_t err = tinyusb_cdcacm_read(itf, buffer_rx, max_len, &rx_size);
|
||||
|
||||
if(err == ESP_OK) {
|
||||
if(rx_size > 0) {
|
||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||
size_t ret = xStreamBufferSendFromISR(
|
||||
furi_hal_vcp.rx_stream, buffer_rx, rx_size, &xHigherPriorityTaskWoken);
|
||||
ESP_ERROR_CHECK(ret != rx_size);
|
||||
// buffer_rx[rx_size] = '\0';
|
||||
// ESP_LOGI(TAG, "rx< %s", buffer_rx);
|
||||
}
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Read error");
|
||||
}
|
||||
|
||||
} else {
|
||||
furi_hal_vcp.rx_stream_full = true;
|
||||
ESP_LOGE(TAG, "Stream is full");
|
||||
};
|
||||
}
|
||||
|
||||
void usb_cdc_line_state_changed_callback(int itf, cdcacm_event_t* event) {
|
||||
int dtr = event->line_state_changed_data.dtr;
|
||||
int rst = event->line_state_changed_data.rts;
|
||||
furi_hal_vcp.dtr = event->line_state_changed_data.dtr;
|
||||
furi_hal_vcp.rts = event->line_state_changed_data.rts;
|
||||
|
||||
ESP_LOGI(TAG, "Line state changed! dtr:%d, rst:%d", dtr, rst);
|
||||
ESP_LOGI(TAG, "Line state changed! dtr:%d, rst:%d", furi_hal_vcp.dtr, furi_hal_vcp.rts);
|
||||
}
|
||||
|
||||
void usb_cdc_line_coding_changed_callback(int itf, cdcacm_event_t* event) {
|
||||
|
@ -47,7 +133,24 @@ void usb_cdc_line_coding_changed_callback(int itf, cdcacm_event_t* event) {
|
|||
data_bits);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Device callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
void tud_mount_cb(void) {
|
||||
ESP_LOGI(TAG, "Mount");
|
||||
furi_hal_vcp.connected = true;
|
||||
}
|
||||
|
||||
void tud_umount_cb(void) {
|
||||
ESP_LOGI(TAG, "Unmount");
|
||||
furi_hal_vcp.connected = false;
|
||||
}
|
||||
|
||||
void usb_cdc_init(void) {
|
||||
furi_hal_vcp.connected = false;
|
||||
furi_hal_vcp.rx_stream = xStreamBufferCreate((CONFIG_USB_CDC_RX_BUFSIZE * 16), 1);
|
||||
furi_hal_vcp.rx_stream_full = false;
|
||||
|
||||
ESP_LOGI(TAG, "USB initialization");
|
||||
tinyusb_config_t tusb_cfg = {};
|
||||
ESP_ERROR_CHECK(tinyusb_driver_install(&tusb_cfg));
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
void usb_cdc_init(void);
|
||||
|
||||
size_t usb_cdc_rx(uint8_t* buffer, size_t size);
|
||||
size_t usb_cdc_rx_with_timeout(uint8_t* buffer, size_t size, uint32_t timeout);
|
||||
void usb_cdc_tx(uint8_t* buffer, size_t size, bool flush);
|
|
@ -80,4 +80,6 @@ void wifi_init(void) {
|
|||
|
||||
ESP_ERROR_CHECK(esp_event_handler_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler));
|
||||
ESP_ERROR_CHECK(esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler));
|
||||
|
||||
vEventGroupDelete(wifi_event_group);
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,5 @@
|
|||
# ESP-IDF Partition Table
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs,data,nvs,0x9000,24K,
|
||||
phy_init,data,phy,0xf000,4K,
|
||||
factory,app,factory,0x10000,1M,
|
|
Loading…
Reference in New Issue