From a0a4dcbf83a3049e865e9779c80dc0b7c39ecd7c Mon Sep 17 00:00:00 2001 From: Lou Tianhao Date: Fri, 27 Sep 2024 11:56:19 +0800 Subject: [PATCH 01/56] change(esp_pm): change pm_slp_iram_opt dependence --- components/esp_pm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_pm/Kconfig b/components/esp_pm/Kconfig index 5475bbd0f64e..a0378e796421 100644 --- a/components/esp_pm/Kconfig +++ b/components/esp_pm/Kconfig @@ -49,7 +49,7 @@ menu "Power Management" config PM_SLP_IRAM_OPT bool "Put lightsleep related codes in internal RAM" - depends on FREERTOS_USE_TICKLESS_IDLE + default n help If enabled, about 1.8KB of lightsleep related source code would be in IRAM and chip would sleep longer for 760us at most each time. From 12f07d846b53bffdaff4d25918d57c6de2cb4f85 Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Tue, 7 May 2024 05:17:16 +0800 Subject: [PATCH 02/56] refactor(usb): Rename mock class files - Rename "test_usb_mock_..." class files to "mock_..." - Fixed some codespell issues - Fixed comment spacing --- .../usb/test_apps/common/CMakeLists.txt | 4 +- .../{test_usb_mock_hid.c => mock_hid.c} | 18 +-- .../{test_usb_mock_hid.h => mock_hid.h} | 1 - .../{test_usb_mock_msc.c => mock_msc.c} | 26 ++-- .../{test_usb_mock_msc.h => mock_msc.h} | 0 .../usb/test_apps/common/test_usb_common.c | 8 +- .../usb/test_apps/hcd/main/test_app_main.c | 2 +- .../usb/test_apps/hcd/main/test_hcd_bulk.c | 30 ++--- .../usb/test_apps/hcd/main/test_hcd_common.c | 91 +++++++------- .../usb/test_apps/hcd/main/test_hcd_ctrl.c | 100 +++++++-------- .../usb/test_apps/hcd/main/test_hcd_intr.c | 24 ++-- .../usb/test_apps/hcd/main/test_hcd_isoc.c | 96 +++++++------- .../usb/test_apps/hcd/main/test_hcd_port.c | 118 +++++++++--------- .../usb/test_apps/hcd/main/test_usb_helpers.c | 30 ++--- components/usb/test_apps/usb_host/README.md | 2 +- .../usb_host/main/ctrl_client_async_seq.c | 26 ++-- .../usb_host/main/msc_client_async_dconn.c | 56 ++++----- .../usb_host/main/msc_client_async_enum.c | 38 +++--- .../usb_host/main/msc_client_async_seq.c | 52 ++++---- .../test_apps/usb_host/main/test_app_main.c | 14 +-- .../usb_host/main/test_usb_host_async.c | 40 +++--- .../usb_host/main/test_usb_host_plugging.c | 24 ++-- 22 files changed, 401 insertions(+), 399 deletions(-) rename components/usb/test_apps/common/{test_usb_mock_hid.c => mock_hid.c} (75%) rename components/usb/test_apps/common/{test_usb_mock_hid.h => mock_hid.h} (99%) rename components/usb/test_apps/common/{test_usb_mock_msc.c => mock_msc.c} (87%) rename components/usb/test_apps/common/{test_usb_mock_msc.h => mock_msc.h} (100%) diff --git a/components/usb/test_apps/common/CMakeLists.txt b/components/usb/test_apps/common/CMakeLists.txt index f03c668f9efa..ce2bfb32b3a6 100644 --- a/components/usb/test_apps/common/CMakeLists.txt +++ b/components/usb/test_apps/common/CMakeLists.txt @@ -1,3 +1,5 @@ -idf_component_register(SRCS "test_usb_common.c" "test_usb_mock_msc.c" "test_usb_mock_hid.c" +idf_component_register(SRCS "mock_hid.c" + "mock_msc.c" + "test_usb_common.c" INCLUDE_DIRS "." REQUIRES usb unity) diff --git a/components/usb/test_apps/common/test_usb_mock_hid.c b/components/usb/test_apps/common/mock_hid.c similarity index 75% rename from components/usb/test_apps/common/test_usb_mock_hid.c rename to components/usb/test_apps/common/mock_hid.c index ea7dc32af9b6..4f91e7b29457 100644 --- a/components/usb/test_apps/common/test_usb_mock_hid.c +++ b/components/usb/test_apps/common/mock_hid.c @@ -9,33 +9,33 @@ #include #include #include "usb/usb_types_ch9.h" -#include "test_usb_mock_hid.h" +#include "mock_hid.h" // ---------------------------------------------------- HID Mouse ------------------------------------------------------ const usb_ep_desc_t mock_hid_mouse_in_ep_desc = { .bLength = sizeof(usb_ep_desc_t), .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, - .bEndpointAddress = MOCK_HID_MOUSE_INTR_IN_EP_ADDR, //EP 1 IN + .bEndpointAddress = MOCK_HID_MOUSE_INTR_IN_EP_ADDR, // EP 1 IN .bmAttributes = USB_BM_ATTRIBUTES_XFER_INT, .wMaxPacketSize = MOCK_HID_MOUSE_INTR_IN_MPS, - .bInterval = 10, //Interval of 10ms + .bInterval = 10, // Interval of 10ms }; void mock_hid_process_report(mock_hid_mouse_report_t *report, int iter) { static int x_pos = 0; static int y_pos = 0; - //Update X position - if (report->x_movement & 0x80) { //Positive movement + // Update X position + if (report->x_movement & 0x80) { // Positive movement x_pos += report->x_movement & 0x7F; - } else { //Negative movement + } else { // Negative movement x_pos -= report->x_movement & 0x7F; } - //Update Y position - if (report->y_movement & 0x80) { //Positive movement + // Update Y position + if (report->y_movement & 0x80) { // Positive movement y_pos += report->y_movement & 0x7F; - } else { //Negative movement + } else { // Negative movement y_pos -= report->y_movement & 0x7F; } printf("\rX:%d\tY:%d\tIter: %d\n", x_pos, y_pos, iter); diff --git a/components/usb/test_apps/common/test_usb_mock_hid.h b/components/usb/test_apps/common/mock_hid.h similarity index 99% rename from components/usb/test_apps/common/test_usb_mock_hid.h rename to components/usb/test_apps/common/mock_hid.h index 8cbf22d33c82..a9a145fbdfc2 100644 --- a/components/usb/test_apps/common/test_usb_mock_hid.h +++ b/components/usb/test_apps/common/mock_hid.h @@ -22,7 +22,6 @@ extern "C" { // ---------------------------------------------------- HID Mouse ------------------------------------------------------ - /* Note: The mock HID mouse tests require that USB low speed mouse be connected. The mouse should... diff --git a/components/usb/test_apps/common/test_usb_mock_msc.c b/components/usb/test_apps/common/mock_msc.c similarity index 87% rename from components/usb/test_apps/common/test_usb_mock_msc.c rename to components/usb/test_apps/common/mock_msc.c index db61ec10b7f7..7420e8492872 100644 --- a/components/usb/test_apps/common/test_usb_mock_msc.c +++ b/components/usb/test_apps/common/mock_msc.c @@ -9,7 +9,7 @@ #include #include #include "usb/usb_types_ch9.h" -#include "test_usb_mock_msc.h" +#include "mock_msc.h" // ---------------------------------------------------- MSC SCSI ------------------------------------------------------- @@ -41,7 +41,7 @@ static const usb_config_desc_t mock_msc_config_desc = { .bConfigurationValue = 1, .iConfiguration = 0, .bmAttributes = 0x80, - .bMaxPower = 0x70, //224mA + .bMaxPower = 0x70, // 224mA }; static const usb_intf_desc_t mock_msc_intf_desc = { @@ -51,8 +51,8 @@ static const usb_intf_desc_t mock_msc_intf_desc = { .bAlternateSetting = MOCK_MSC_SCSI_INTF_ALT_SETTING, .bNumEndpoints = 2, .bInterfaceClass = USB_CLASS_MASS_STORAGE, - .bInterfaceSubClass = 0x06, //SCSI - .bInterfaceProtocol = 0x50, //Bulk only + .bInterfaceSubClass = 0x06, // SCSI + .bInterfaceProtocol = 0x50, // Bulk only .iInterface = 0, }; @@ -64,9 +64,9 @@ uint16_t mock_msc_scsi_str_desc_ser_num[128]; const usb_ep_desc_t mock_msc_scsi_bulk_out_ep_desc = { .bLength = sizeof(usb_ep_desc_t), .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, - .bEndpointAddress = MOCK_MSC_SCSI_BULK_OUT_EP_ADDR, //EP 1 OUT + .bEndpointAddress = MOCK_MSC_SCSI_BULK_OUT_EP_ADDR, // EP 1 OUT .bmAttributes = USB_BM_ATTRIBUTES_XFER_BULK, - .wMaxPacketSize = MOCK_MSC_SCSI_BULK_EP_MPS, //MPS of 64 bytes + .wMaxPacketSize = MOCK_MSC_SCSI_BULK_EP_MPS, // MPS of 64 bytes .bInterval = 0, }; @@ -75,20 +75,20 @@ const usb_ep_desc_t mock_msc_scsi_bulk_in_ep_desc = { .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, .bEndpointAddress = MOCK_MSC_SCSI_BULK_IN_EP_ADDR, .bmAttributes = USB_BM_ATTRIBUTES_XFER_BULK, - .wMaxPacketSize = MOCK_MSC_SCSI_BULK_EP_MPS, //MPS of 64 bytes + .wMaxPacketSize = MOCK_MSC_SCSI_BULK_EP_MPS, // MPS of 64 bytes .bInterval = 0, }; void mock_msc_scsi_init_cbw(mock_msc_bulk_cbw_t *cbw, bool is_read, int offset, int num_sectors, uint32_t tag) { - cbw->dCBWSignature = 0x43425355; //Fixed value - cbw->dCBWTag = tag; //Random value that is echoed back + cbw->dCBWSignature = 0x43425355; // Fixed value + cbw->dCBWTag = tag; // Random value that is echoed back cbw->dCBWDataTransferLength = num_sectors * MOCK_MSC_SCSI_SECTOR_SIZE; - cbw->bmCBWFlags = (is_read) ? (1 << 7) : 0; //If this is a read, set the direction flag + cbw->bmCBWFlags = (is_read) ? (1 << 7) : 0; // If this is a read, set the direction flag cbw->bCBWLUN = MOCK_MSC_SCSI_LUN; - cbw->bCBWCBLength = 10; //The length of the SCSI command - //Initialize SCSI CMD as READ10 or WRITE 10 - cbw->CBWCB.opcode = (is_read) ? 0x28 : 0x2A; //SCSI CMD READ10 or WRITE10 + cbw->bCBWCBLength = 10; // The length of the SCSI command + // Initialize SCSI CMD as READ10 or WRITE 10 + cbw->CBWCB.opcode = (is_read) ? 0x28 : 0x2A; // SCSI CMD READ10 or WRITE10 cbw->CBWCB.flags = 0; cbw->CBWCB.lba_3 = (offset >> 24); cbw->CBWCB.lba_2 = (offset >> 16); diff --git a/components/usb/test_apps/common/test_usb_mock_msc.h b/components/usb/test_apps/common/mock_msc.h similarity index 100% rename from components/usb/test_apps/common/test_usb_mock_msc.h rename to components/usb/test_apps/common/mock_msc.h diff --git a/components/usb/test_apps/common/test_usb_common.c b/components/usb/test_apps/common/test_usb_common.c index 2fa98b3dabba..09345017625f 100644 --- a/components/usb/test_apps/common/test_usb_common.c +++ b/components/usb/test_apps/common/test_usb_common.c @@ -17,12 +17,12 @@ static usb_phy_handle_t phy_hdl = NULL; void test_usb_init_phy(void) { - //Initialize the internal USB PHY to connect to the USB OTG peripheral + // Initialize the internal USB PHY to connect to the USB OTG peripheral usb_phy_config_t phy_config = { .controller = USB_PHY_CTRL_OTG, .target = USB_PHY_TARGET_INT, .otg_mode = USB_OTG_MODE_HOST, - .otg_speed = USB_PHY_SPEED_UNDEFINED, //In Host mode, the speed is determined by the connected device + .otg_speed = USB_PHY_SPEED_UNDEFINED, // In Host mode, the speed is determined by the connected device .ext_io_conf = NULL, .otg_io_conf = NULL, }; @@ -31,7 +31,7 @@ void test_usb_init_phy(void) void test_usb_deinit_phy(void) { - //Deinitialize the internal USB PHY + // Deinitialize the internal USB PHY TEST_ASSERT_EQUAL_MESSAGE(ESP_OK, usb_del_phy(phy_hdl), "Failed to delete PHY"); phy_hdl = NULL; } @@ -39,7 +39,7 @@ void test_usb_deinit_phy(void) void test_usb_set_phy_state(bool connected, TickType_t delay_ticks) { if (delay_ticks > 0) { - //Delay of 0 ticks causes a yield. So skip if delay_ticks is 0. + // Delay of 0 ticks causes a yield. So skip if delay_ticks is 0. vTaskDelay(delay_ticks); } ESP_ERROR_CHECK(usb_phy_action(phy_hdl, (connected) ? USB_PHY_ACTION_HOST_ALLOW_CONN : USB_PHY_ACTION_HOST_FORCE_DISCONN)); diff --git a/components/usb/test_apps/hcd/main/test_app_main.c b/components/usb/test_apps/hcd/main/test_app_main.c index 224b068adae8..d9a01d71e819 100644 --- a/components/usb/test_apps/hcd/main/test_app_main.c +++ b/components/usb/test_apps/hcd/main/test_app_main.c @@ -20,7 +20,7 @@ void setUp(void) void tearDown(void) { - //Short delay to allow task to be cleaned up + // Short delay to allow task to be cleaned up vTaskDelay(10); test_hcd_teardown(port_hdl); port_hdl = NULL; diff --git a/components/usb/test_apps/hcd/main/test_hcd_bulk.c b/components/usb/test_apps/hcd/main/test_hcd_bulk.c index b22273752a19..39731b568db7 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_bulk.c +++ b/components/usb/test_apps/hcd/main/test_hcd_bulk.c @@ -9,24 +9,24 @@ #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" #include "unity.h" -#include "test_usb_mock_msc.h" +#include "mock_msc.h" #include "test_hcd_common.h" // --------------------------------------------------- Test Cases ------------------------------------------------------ static void mock_msc_reset_req(hcd_pipe_handle_t default_pipe) { - //Create URB + // Create URB urb_t *urb = test_hcd_alloc_urb(0, sizeof(usb_setup_packet_t)); usb_setup_packet_t *setup_pkt = (usb_setup_packet_t *)urb->transfer.data_buffer; MOCK_MSC_SCSI_REQ_INIT_RESET(setup_pkt, MOCK_MSC_SCSI_INTF_NUMBER); urb->transfer.num_bytes = sizeof(usb_setup_packet_t); - //Enqueue, wait, dequeue, and check URB + // Enqueue, wait, dequeue, and check URB TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb)); test_hcd_expect_pipe_event(default_pipe, HCD_PIPE_EVENT_URB_DONE); TEST_ASSERT_EQUAL_PTR(urb, hcd_urb_dequeue(default_pipe)); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); - //Free URB + // Free URB test_hcd_free_urb(urb); } @@ -54,18 +54,18 @@ Test HCD bulk pipe URBs TEST_CASE("Test HCD bulk pipe URBs", "[bulk][full_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Enumerate and reset MSC SCSI device - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); //Create a default pipe (using a NULL EP descriptor) + // Enumerate and reset MSC SCSI device + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); // Create a default pipe (using a NULL EP descriptor) uint8_t dev_addr = test_hcd_enum_device(default_pipe); mock_msc_reset_req(default_pipe); - //Create BULK IN and BULK OUT pipes for SCSI + // Create BULK IN and BULK OUT pipes for SCSI hcd_pipe_handle_t bulk_out_pipe = test_hcd_pipe_alloc(port_hdl, &mock_msc_scsi_bulk_out_ep_desc, dev_addr, port_speed); hcd_pipe_handle_t bulk_in_pipe = test_hcd_pipe_alloc(port_hdl, &mock_msc_scsi_bulk_in_ep_desc, dev_addr, port_speed); - //Create URBs for CBW, Data, and CSW transport. IN Buffer sizes are rounded up to nearest MPS + // Create URBs for CBW, Data, and CSW transport. IN Buffer sizes are rounded up to nearest MPS urb_t *urb_cbw = test_hcd_alloc_urb(0, sizeof(mock_msc_bulk_cbw_t)); urb_t *urb_data = test_hcd_alloc_urb(0, TEST_NUM_SECTORS_PER_XFER * MOCK_MSC_SCSI_SECTOR_SIZE); const uint16_t mps = USB_EP_DESC_GET_MPS(&mock_msc_scsi_bulk_in_ep_desc) ; @@ -75,25 +75,25 @@ TEST_CASE("Test HCD bulk pipe URBs", "[bulk][full_speed]") urb_csw->transfer.num_bytes = sizeof(mock_msc_bulk_csw_t) + (mps - (sizeof(mock_msc_bulk_csw_t) % mps)); for (int block_num = 0; block_num < TEST_NUM_SECTORS_TOTAL; block_num += TEST_NUM_SECTORS_PER_XFER) { - //Initialize CBW URB, then send it on the BULK OUT pipe + // Initialize CBW URB, then send it on the BULK OUT pipe mock_msc_scsi_init_cbw((mock_msc_bulk_cbw_t *)urb_cbw->transfer.data_buffer, true, block_num, TEST_NUM_SECTORS_PER_XFER, 0xAAAAAAAA); TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(bulk_out_pipe, urb_cbw)); test_hcd_expect_pipe_event(bulk_out_pipe, HCD_PIPE_EVENT_URB_DONE); TEST_ASSERT_EQUAL_PTR(urb_cbw, hcd_urb_dequeue(bulk_out_pipe)); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb_cbw->transfer.status, "Transfer NOT completed"); - //Read data through BULK IN pipe + // Read data through BULK IN pipe TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(bulk_in_pipe, urb_data)); test_hcd_expect_pipe_event(bulk_in_pipe, HCD_PIPE_EVENT_URB_DONE); TEST_ASSERT_EQUAL_PTR(urb_data, hcd_urb_dequeue(bulk_in_pipe)); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb_data->transfer.status, "Transfer NOT completed"); - //Read the CSW through BULK IN pipe + // Read the CSW through BULK IN pipe TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(bulk_in_pipe, urb_csw)); test_hcd_expect_pipe_event(bulk_in_pipe, HCD_PIPE_EVENT_URB_DONE); TEST_ASSERT_EQUAL_PTR(urb_csw, hcd_urb_dequeue(bulk_in_pipe)); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb_data->transfer.status, "Transfer NOT completed"); TEST_ASSERT_EQUAL(sizeof(mock_msc_bulk_csw_t), urb_csw->transfer.actual_num_bytes); TEST_ASSERT_TRUE(mock_msc_scsi_check_csw((mock_msc_bulk_csw_t *)urb_csw->transfer.data_buffer, 0xAAAAAAAA)); - //Print the read data + // Print the read data printf("Block %d to %d:\n", block_num, block_num + TEST_NUM_SECTORS_PER_XFER); for (int i = 0; i < urb_data->transfer.actual_num_bytes; i++) { printf("0x%02x,", ((char *)urb_data->transfer.data_buffer)[i]); @@ -107,6 +107,6 @@ TEST_CASE("Test HCD bulk pipe URBs", "[bulk][full_speed]") test_hcd_pipe_free(bulk_out_pipe); test_hcd_pipe_free(bulk_in_pipe); test_hcd_pipe_free(default_pipe); - //Cleanup + // Cleanup test_hcd_wait_for_disconn(port_hdl, false); } diff --git a/components/usb/test_apps/hcd/main/test_hcd_common.c b/components/usb/test_apps/hcd/main/test_hcd_common.c index fdad5bc2f207..9ae43715d5ce 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_common.c +++ b/components/usb/test_apps/hcd/main/test_hcd_common.c @@ -19,12 +19,13 @@ #include "usb/usb_types_ch9.h" #include "test_hcd_common.h" #include "test_usb_common.h" +#include "mock_msc.h" #include "unity.h" #define PORT_NUM 1 #define EVENT_QUEUE_LEN 5 -#define ENUM_ADDR 1 //Device address to use for tests that enumerate the device -#define ENUM_CONFIG 1 //Device configuration number to use for tests that enumerate the device +#define ENUM_ADDR 1 // Device address to use for tests that enumerate the device +#define ENUM_CONFIG 1 // Device configuration number to use for tests that enumerate the device typedef struct { hcd_port_handle_t port_hdl; @@ -52,10 +53,10 @@ hcd_port_handle_t port_hdl = NULL; */ static bool port_callback(hcd_port_handle_t port_hdl, hcd_port_event_t port_event, void *user_arg, bool in_isr) { - //We store the port's queue handle in the port's context variable + // We store the port's queue handle in the port's context variable void *port_ctx = hcd_port_get_context(port_hdl); QueueHandle_t port_evt_queue = (QueueHandle_t)port_ctx; - TEST_ASSERT_TRUE(in_isr); //Current HCD implementation should never call a port callback in a task context + TEST_ASSERT_TRUE(in_isr); // Current HCD implementation should never call a port callback in a task context port_event_msg_t msg = { .port_hdl = port_hdl, .port_event = port_event, @@ -96,14 +97,14 @@ static bool pipe_callback(hcd_pipe_handle_t pipe_hdl, hcd_pipe_event_t pipe_even void test_hcd_expect_port_event(hcd_port_handle_t port_hdl, hcd_port_event_t expected_event) { - //Get the port event queue from the port's context variable + // Get the port event queue from the port's context variable QueueHandle_t port_evt_queue = (QueueHandle_t)hcd_port_get_context(port_hdl); TEST_ASSERT_NOT_NULL(port_evt_queue); - //Wait for port callback to send an event message + // Wait for port callback to send an event message port_event_msg_t msg; BaseType_t ret = xQueueReceive(port_evt_queue, &msg, pdMS_TO_TICKS(5000)); TEST_ASSERT_EQUAL_MESSAGE(pdPASS, ret, "Port event not generated on time"); - //Check the contents of that event message + // Check the contents of that event message TEST_ASSERT_EQUAL(port_hdl, msg.port_hdl); TEST_ASSERT_EQUAL_MESSAGE(expected_event, msg.port_event, "Unexpected event"); printf("\t-> Port event\n"); @@ -111,21 +112,21 @@ void test_hcd_expect_port_event(hcd_port_handle_t port_hdl, hcd_port_event_t exp void test_hcd_expect_pipe_event(hcd_pipe_handle_t pipe_hdl, hcd_pipe_event_t expected_event) { - //Get the pipe's event queue from the pipe's context variable + // Get the pipe's event queue from the pipe's context variable QueueHandle_t pipe_evt_queue = (QueueHandle_t)hcd_pipe_get_context(pipe_hdl); TEST_ASSERT_NOT_NULL(pipe_evt_queue); - //Wait for pipe callback to send an event message + // Wait for pipe callback to send an event message pipe_event_msg_t msg; BaseType_t ret = xQueueReceive(pipe_evt_queue, &msg, pdMS_TO_TICKS(5000)); TEST_ASSERT_EQUAL_MESSAGE(pdPASS, ret, "Pipe event not generated on time"); - //Check the contents of that event message + // Check the contents of that event message TEST_ASSERT_EQUAL(pipe_hdl, msg.pipe_hdl); TEST_ASSERT_EQUAL_MESSAGE(expected_event, msg.pipe_event, "Unexpected event"); } int test_hcd_get_num_port_events(hcd_port_handle_t port_hdl) { - //Get the port event queue from the port's context variable + // Get the port event queue from the port's context variable QueueHandle_t port_evt_queue = (QueueHandle_t)hcd_port_get_context(port_hdl); TEST_ASSERT_NOT_NULL(port_evt_queue); return EVENT_QUEUE_LEN - uxQueueSpacesAvailable(port_evt_queue); @@ -133,7 +134,7 @@ int test_hcd_get_num_port_events(hcd_port_handle_t port_hdl) int test_hcd_get_num_pipe_events(hcd_pipe_handle_t pipe_hdl) { - //Get the pipe's event queue from the pipe's context variable + // Get the pipe's event queue from the pipe's context variable QueueHandle_t pipe_evt_queue = (QueueHandle_t)hcd_pipe_get_context(pipe_hdl); TEST_ASSERT_NOT_NULL(pipe_evt_queue); return EVENT_QUEUE_LEN - uxQueueSpacesAvailable(pipe_evt_queue); @@ -143,16 +144,16 @@ int test_hcd_get_num_pipe_events(hcd_pipe_handle_t pipe_hdl) hcd_port_handle_t test_hcd_setup(void) { - test_usb_init_phy(); //Initialize the internal USB PHY and USB Controller for testing - //Create a queue for port callback to queue up port events + test_usb_init_phy(); // Initialize the internal USB PHY and USB Controller for testing + // Create a queue for port callback to queue up port events QueueHandle_t port_evt_queue = xQueueCreate(EVENT_QUEUE_LEN, sizeof(port_event_msg_t)); TEST_ASSERT_NOT_NULL(port_evt_queue); - //Install HCD + // Install HCD hcd_config_t hcd_config = { .intr_flags = ESP_INTR_FLAG_LEVEL1, }; TEST_ASSERT_EQUAL(ESP_OK, hcd_install(&hcd_config)); - //Initialize a port + // Initialize a port hcd_port_config_t port_config = { .fifo_bias = HCD_PORT_FIFO_BIAS_BALANCED, .callback = port_callback, @@ -163,7 +164,7 @@ hcd_port_handle_t test_hcd_setup(void) TEST_ASSERT_EQUAL(ESP_OK, hcd_port_init(PORT_NUM, &port_config, &port_hdl)); TEST_ASSERT_NOT_NULL(port_hdl); TEST_ASSERT_EQUAL(HCD_PORT_STATE_NOT_POWERED, hcd_port_get_state(port_hdl)); - test_usb_set_phy_state(false, 0); //Force disconnected state on PHY + test_usb_set_phy_state(false, 0); // Force disconnected state on PHY return port_hdl; } @@ -172,33 +173,33 @@ void test_hcd_teardown(hcd_port_handle_t port_hdl) if (!port_hdl) { return; // In case of setup stage failure, don't run tear-down stage } - //Get the queue handle from the port's context variable + // Get the queue handle from the port's context variable QueueHandle_t port_evt_queue = (QueueHandle_t)hcd_port_get_context(port_hdl); TEST_ASSERT_NOT_NULL(port_evt_queue); - //Deinitialize a port + // Deinitialize a port TEST_ASSERT_EQUAL(ESP_OK, hcd_port_deinit(port_hdl)); - //Uninstall the HCD + // Uninstall the HCD TEST_ASSERT_EQUAL(ESP_OK, hcd_uninstall()); vQueueDelete(port_evt_queue); - test_usb_deinit_phy(); //Deinitialize the internal USB PHY after testing + test_usb_deinit_phy(); // Deinitialize the internal USB PHY after testing } usb_speed_t test_hcd_wait_for_conn(hcd_port_handle_t port_hdl) { - //Power ON the port + // Power ON the port TEST_ASSERT_EQUAL(ESP_OK, hcd_port_command(port_hdl, HCD_PORT_CMD_POWER_ON)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_DISCONNECTED, hcd_port_get_state(port_hdl)); - //Wait for connection event + // Wait for connection event printf("Waiting for connection\n"); - test_usb_set_phy_state(true, pdMS_TO_TICKS(100)); //Allow for connected state on PHY + test_usb_set_phy_state(true, pdMS_TO_TICKS(100)); // Allow for connected state on PHY test_hcd_expect_port_event(port_hdl, HCD_PORT_EVENT_CONNECTION); TEST_ASSERT_EQUAL(HCD_PORT_EVENT_CONNECTION, hcd_port_handle_event(port_hdl)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_DISABLED, hcd_port_get_state(port_hdl)); - //Reset newly connected device + // Reset newly connected device printf("Resetting\n"); TEST_ASSERT_EQUAL(ESP_OK, hcd_port_command(port_hdl, HCD_PORT_CMD_RESET)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_ENABLED, hcd_port_get_state(port_hdl)); - //Get speed of connected + // Get speed of connected usb_speed_t port_speed; TEST_ASSERT_EQUAL(ESP_OK, hcd_port_get_speed(port_hdl, &port_speed)); if (port_speed == USB_SPEED_FULL) { @@ -212,18 +213,18 @@ usb_speed_t test_hcd_wait_for_conn(hcd_port_handle_t port_hdl) void test_hcd_wait_for_disconn(hcd_port_handle_t port_hdl, bool already_disabled) { if (!already_disabled) { - //Disable the device + // Disable the device printf("Disabling\n"); TEST_ASSERT_EQUAL(ESP_OK, hcd_port_command(port_hdl, HCD_PORT_CMD_DISABLE)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_DISABLED, hcd_port_get_state(port_hdl)); } - //Wait for a safe disconnect + // Wait for a safe disconnect printf("Waiting for disconnection\n"); - test_usb_set_phy_state(false, pdMS_TO_TICKS(100)); //Force disconnected state on PHY + test_usb_set_phy_state(false, pdMS_TO_TICKS(100)); // Force disconnected state on PHY test_hcd_expect_port_event(port_hdl, HCD_PORT_EVENT_DISCONNECTION); TEST_ASSERT_EQUAL(HCD_PORT_EVENT_DISCONNECTION, hcd_port_handle_event(port_hdl)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_RECOVERY, hcd_port_get_state(port_hdl)); - //Power down the port + // Power down the port TEST_ASSERT_EQUAL(ESP_OK, hcd_port_command(port_hdl, HCD_PORT_CMD_POWER_OFF)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_NOT_POWERED, hcd_port_get_state(port_hdl)); } @@ -232,7 +233,7 @@ void test_hcd_wait_for_disconn(hcd_port_handle_t port_hdl, bool already_disabled hcd_pipe_handle_t test_hcd_pipe_alloc(hcd_port_handle_t port_hdl, const usb_ep_desc_t *ep_desc, uint8_t dev_addr, usb_speed_t dev_speed) { - //Create a queue for pipe callback to queue up pipe events + // Create a queue for pipe callback to queue up pipe events QueueHandle_t pipe_evt_queue = xQueueCreate(EVENT_QUEUE_LEN, sizeof(pipe_event_msg_t)); TEST_ASSERT_NOT_NULL(pipe_evt_queue); hcd_pipe_config_t pipe_config = { @@ -251,22 +252,22 @@ hcd_pipe_handle_t test_hcd_pipe_alloc(hcd_port_handle_t port_hdl, const usb_ep_d void test_hcd_pipe_free(hcd_pipe_handle_t pipe_hdl) { - //Get the pipe's event queue from its context variable + // Get the pipe's event queue from its context variable QueueHandle_t pipe_evt_queue = (QueueHandle_t)hcd_pipe_get_context(pipe_hdl); TEST_ASSERT_NOT_NULL(pipe_evt_queue); - //Free the pipe and queue + // Free the pipe and queue TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_free(pipe_hdl)); vQueueDelete(pipe_evt_queue); } urb_t *test_hcd_alloc_urb(int num_isoc_packets, size_t data_buffer_size) { - //Allocate a URB and data buffer + // Allocate a URB and data buffer urb_t *urb = heap_caps_calloc(1, sizeof(urb_t) + (num_isoc_packets * sizeof(usb_isoc_packet_desc_t)), MALLOC_CAP_DEFAULT); uint8_t *data_buffer = heap_caps_malloc(data_buffer_size, MALLOC_CAP_DMA); TEST_ASSERT_NOT_NULL(urb); TEST_ASSERT_NOT_NULL(data_buffer); - //Initialize URB and underlying transfer structure. Need to cast to dummy due to const fields + // Initialize URB and underlying transfer structure. Need to cast to dummy due to const fields usb_transfer_dummy_t *transfer_dummy = (usb_transfer_dummy_t *)&urb->transfer; transfer_dummy->data_buffer = data_buffer; transfer_dummy->num_isoc_packets = num_isoc_packets; @@ -275,19 +276,19 @@ urb_t *test_hcd_alloc_urb(int num_isoc_packets, size_t data_buffer_size) void test_hcd_free_urb(urb_t *urb) { - //Free data buffer of the transfer + // Free data buffer of the transfer heap_caps_free(urb->transfer.data_buffer); - //Free the URB + // Free the URB heap_caps_free(urb); } uint8_t test_hcd_enum_device(hcd_pipe_handle_t default_pipe) { - //We need to create a URB for the enumeration control transfers + // We need to create a URB for the enumeration control transfers urb_t *urb = test_hcd_alloc_urb(0, sizeof(usb_setup_packet_t) + 256); usb_setup_packet_t *setup_pkt = (usb_setup_packet_t *)urb->transfer.data_buffer; - //Get the device descriptor (note that device might only return 8 bytes) + // Get the device descriptor (note that device might only return 8 bytes) USB_SETUP_PACKET_INIT_GET_DEVICE_DESC(setup_pkt); urb->transfer.num_bytes = sizeof(usb_setup_packet_t) + sizeof(usb_device_desc_t); TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb)); @@ -295,22 +296,22 @@ uint8_t test_hcd_enum_device(hcd_pipe_handle_t default_pipe) TEST_ASSERT_EQUAL(urb, hcd_urb_dequeue(default_pipe)); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); - //Update the MPS of the default pipe + // Update the MPS of the default pipe usb_device_desc_t *device_desc = (usb_device_desc_t *)(urb->transfer.data_buffer + sizeof(usb_setup_packet_t)); TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_update_mps(default_pipe, device_desc->bMaxPacketSize0)); - //Send a set address request - USB_SETUP_PACKET_INIT_SET_ADDR(setup_pkt, ENUM_ADDR); //We only support one device for now so use address 1 + // Send a set address request + USB_SETUP_PACKET_INIT_SET_ADDR(setup_pkt, ENUM_ADDR); // We only support one device for now so use address 1 urb->transfer.num_bytes = sizeof(usb_setup_packet_t); TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb)); test_hcd_expect_pipe_event(default_pipe, HCD_PIPE_EVENT_URB_DONE); TEST_ASSERT_EQUAL(urb, hcd_urb_dequeue(default_pipe)); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); - //Update address of default pipe + // Update address of default pipe TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_update_dev_addr(default_pipe, ENUM_ADDR)); - //Send a set configuration request + // Send a set configuration request USB_SETUP_PACKET_INIT_SET_CONFIG(setup_pkt, ENUM_CONFIG); urb->transfer.num_bytes = sizeof(usb_setup_packet_t); TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb)); @@ -318,7 +319,7 @@ uint8_t test_hcd_enum_device(hcd_pipe_handle_t default_pipe) TEST_ASSERT_EQUAL(urb, hcd_urb_dequeue(default_pipe)); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); - //Free URB + // Free URB test_hcd_free_urb(urb); return ENUM_ADDR; } diff --git a/components/usb/test_apps/hcd/main/test_hcd_ctrl.c b/components/usb/test_apps/hcd/main/test_hcd_ctrl.c index 789d8b3c662d..75190e41c863 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_ctrl.c +++ b/components/usb/test_apps/hcd/main/test_hcd_ctrl.c @@ -13,7 +13,7 @@ #define TEST_DEV_ADDR 0 #define NUM_URBS 3 #define TRANSFER_MAX_BYTES 256 -#define URB_DATA_BUFF_SIZE (sizeof(usb_setup_packet_t) + TRANSFER_MAX_BYTES) //256 is worst case size for configuration descriptors +#define URB_DATA_BUFF_SIZE (sizeof(usb_setup_packet_t) + TRANSFER_MAX_BYTES) // 256 is worst case size for configuration descriptors /* Test HCD control pipe URBs (normal completion and early abort) @@ -35,36 +35,36 @@ Test HCD control pipe URBs (normal completion and early abort) */ TEST_CASE("Test HCD control pipe URBs", "[ctrl][low_speed][full_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Allocate some URBs and initialize their data buffers with control transfers - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); //Create a default pipe (using a NULL EP descriptor) + // Allocate some URBs and initialize their data buffers with control transfers + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); // Create a default pipe (using a NULL EP descriptor) urb_t *urb_list[NUM_URBS]; for (int i = 0; i < NUM_URBS; i++) { urb_list[i] = test_hcd_alloc_urb(0, URB_DATA_BUFF_SIZE); - //Initialize with a "Get Config Descriptor request" + // Initialize with a "Get Config Descriptor request" urb_list[i]->transfer.num_bytes = sizeof(usb_setup_packet_t) + TRANSFER_MAX_BYTES; USB_SETUP_PACKET_INIT_GET_CONFIG_DESC((usb_setup_packet_t *)urb_list[i]->transfer.data_buffer, 0, TRANSFER_MAX_BYTES); urb_list[i]->transfer.context = URB_CONTEXT_VAL; } - //Enqueue URBs but immediately suspend the port + // Enqueue URBs but immediately suspend the port printf("Enqueuing URBs\n"); for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb_list[i])); } - //Wait for each done event of each URB + // Wait for each done event of each URB for (int i = 0; i < NUM_URBS; i++) { test_hcd_expect_pipe_event(default_pipe, HCD_PIPE_EVENT_URB_DONE); } - //Dequeue URBs, check, and print + // Dequeue URBs, check, and print for (int i = 0; i < NUM_URBS; i++) { urb_t *urb = hcd_urb_dequeue(default_pipe); TEST_ASSERT_EQUAL(urb_list[i], urb); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); - //We must have transmitted at least the setup packet, but device may return less than bytes requested + // We must have transmitted at least the setup packet, but device may return less than bytes requested TEST_ASSERT_GREATER_OR_EQUAL(sizeof(usb_setup_packet_t), urb->transfer.actual_num_bytes); TEST_ASSERT_LESS_OR_EQUAL(urb->transfer.num_bytes, urb->transfer.actual_num_bytes); usb_config_desc_t *config_desc = (usb_config_desc_t *)(urb->transfer.data_buffer + sizeof(usb_setup_packet_t)); @@ -72,38 +72,38 @@ TEST_CASE("Test HCD control pipe URBs", "[ctrl][low_speed][full_speed]") printf("Config Desc wTotalLength %d\n", config_desc->wTotalLength); } - //Enqueue URBs again but abort them short after + // Enqueue URBs again but abort them short after for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb_list[i])); } for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_abort(urb_list[i])); } - vTaskDelay(pdMS_TO_TICKS(100)); //Give some time for any inflight transfers to complete + vTaskDelay(pdMS_TO_TICKS(100)); // Give some time for any inflight transfers to complete - //Wait for the URBs to complete and dequeue them, then check results - //Dequeue URBs + // Wait for the URBs to complete and dequeue them, then check results + // Dequeue URBs for (int i = 0; i < NUM_URBS; i++) { urb_t *urb = hcd_urb_dequeue(default_pipe); - //No need to check for URB pointer address as they may be out of order + // No need to check for URB pointer address as they may be out of order TEST_ASSERT(urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED || urb->transfer.status == USB_TRANSFER_STATUS_CANCELED); if (urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED) { - //We must have transmitted at least the setup packet, but device may return less than bytes requested + // We must have transmitted at least the setup packet, but device may return less than bytes requested TEST_ASSERT_GREATER_OR_EQUAL(sizeof(usb_setup_packet_t), urb->transfer.actual_num_bytes); TEST_ASSERT_LESS_OR_EQUAL(urb->transfer.num_bytes, urb->transfer.actual_num_bytes); } else { - //A failed transfer should 0 actual number of bytes transmitted + // A failed transfer should 0 actual number of bytes transmitted TEST_ASSERT_EQUAL(0, urb->transfer.actual_num_bytes); } TEST_ASSERT_EQUAL(urb->transfer.context, URB_CONTEXT_VAL); } - //Free URB list and pipe + // Free URB list and pipe for (int i = 0; i < NUM_URBS; i++) { test_hcd_free_urb(urb_list[i]); } test_hcd_pipe_free(default_pipe); - //Cleanup + // Cleanup test_hcd_wait_for_disconn(port_hdl, false); } @@ -130,27 +130,27 @@ Test HCD control pipe STALL condition, abort, and clear */ TEST_CASE("Test HCD control pipe STALL", "[ctrl][full_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Allocate some URBs and initialize their data buffers with control transfers - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); //Create a default pipe (using a NULL EP descriptor) + // Allocate some URBs and initialize their data buffers with control transfers + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); // Create a default pipe (using a NULL EP descriptor) urb_t *urb_list[NUM_URBS]; for (int i = 0; i < NUM_URBS; i++) { urb_list[i] = test_hcd_alloc_urb(0, URB_DATA_BUFF_SIZE); - //Initialize with a "Get Config Descriptor request" + // Initialize with a "Get Config Descriptor request" urb_list[i]->transfer.num_bytes = sizeof(usb_setup_packet_t) + TRANSFER_MAX_BYTES; USB_SETUP_PACKET_INIT_GET_CONFIG_DESC((usb_setup_packet_t *)urb_list[i]->transfer.data_buffer, 0, TRANSFER_MAX_BYTES); urb_list[i]->transfer.context = URB_CONTEXT_VAL; } - //Corrupt the first URB so that it triggers a STALL + // Corrupt the first URB so that it triggers a STALL ((usb_setup_packet_t *)urb_list[0]->transfer.data_buffer)->bRequest = 0xAA; - //Enqueue URBs. A STALL should occur + // Enqueue URBs. A STALL should occur int num_enqueued = 0; for (int i = 0; i < NUM_URBS; i++) { if (hcd_urb_enqueue(default_pipe, urb_list[i]) != ESP_OK) { - //STALL may occur before we are done enqueing + // STALL may occur before we are done enqueuing break; } num_enqueued++; @@ -160,7 +160,7 @@ TEST_CASE("Test HCD control pipe STALL", "[ctrl][full_speed]") test_hcd_expect_pipe_event(default_pipe, HCD_PIPE_EVENT_ERROR_STALL); TEST_ASSERT_EQUAL(HCD_PIPE_STATE_HALTED, hcd_pipe_get_state(default_pipe)); - //Call the pipe abort command to retire all URBs then dequeue them all + // Call the pipe abort command to retire all URBs then dequeue them all TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(default_pipe, HCD_PIPE_CMD_FLUSH)); test_hcd_expect_pipe_event(default_pipe, HCD_PIPE_EVENT_URB_DONE); for (int i = 0; i < num_enqueued; i++) { @@ -168,36 +168,36 @@ TEST_CASE("Test HCD control pipe STALL", "[ctrl][full_speed]") TEST_ASSERT_EQUAL(urb_list[i], urb); TEST_ASSERT(urb->transfer.status == USB_TRANSFER_STATUS_STALL || urb->transfer.status == USB_TRANSFER_STATUS_CANCELED); if (urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED) { - //We must have transmitted at least the setup packet, but device may return less than bytes requested + // We must have transmitted at least the setup packet, but device may return less than bytes requested TEST_ASSERT_GREATER_OR_EQUAL(sizeof(usb_setup_packet_t), urb->transfer.actual_num_bytes); TEST_ASSERT_LESS_OR_EQUAL(urb->transfer.num_bytes, urb->transfer.actual_num_bytes); } else { - //A failed transfer should 0 actual number of bytes transmitted + // A failed transfer should 0 actual number of bytes transmitted TEST_ASSERT_EQUAL(0, urb->transfer.actual_num_bytes); } TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); } - //Call the clear command to un-stall the pipe + // Call the clear command to un-stall the pipe TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(default_pipe, HCD_PIPE_CMD_CLEAR)); TEST_ASSERT_EQUAL(HCD_PIPE_STATE_ACTIVE, hcd_pipe_get_state(default_pipe)); printf("Retrying\n"); - //Correct first URB then requeue + // Correct first URB then requeue USB_SETUP_PACKET_INIT_GET_CONFIG_DESC((usb_setup_packet_t *)urb_list[0]->transfer.data_buffer, 0, TRANSFER_MAX_BYTES); for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb_list[i])); } - //Wait for each URB to be done, deequeue, and check results + // Wait for each URB to be done, deequeue, and check results for (int i = 0; i < NUM_URBS; i++) { test_hcd_expect_pipe_event(default_pipe, HCD_PIPE_EVENT_URB_DONE); - //expect_pipe_event(pipe_evt_queue, default_pipe, HCD_PIPE_EVENT_URB_DONE); + // expect_pipe_event(pipe_evt_queue, default_pipe, HCD_PIPE_EVENT_URB_DONE); urb_t *urb = hcd_urb_dequeue(default_pipe); TEST_ASSERT_EQUAL(urb_list[i], urb); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); - //We must have transmitted at least the setup packet, but device may return less than bytes requested + // We must have transmitted at least the setup packet, but device may return less than bytes requested TEST_ASSERT_GREATER_OR_EQUAL(sizeof(usb_setup_packet_t), urb->transfer.actual_num_bytes); TEST_ASSERT_LESS_OR_EQUAL(urb->transfer.num_bytes, urb->transfer.actual_num_bytes); usb_config_desc_t *config_desc = (usb_config_desc_t *)(urb->transfer.data_buffer + sizeof(usb_setup_packet_t)); @@ -205,12 +205,12 @@ TEST_CASE("Test HCD control pipe STALL", "[ctrl][full_speed]") printf("Config Desc wTotalLength %d\n", config_desc->wTotalLength); } - //Free URB list and pipe + // Free URB list and pipe for (int i = 0; i < NUM_URBS; i++) { test_hcd_free_urb(urb_list[i]); } test_hcd_pipe_free(default_pipe); - //Cleanup + // Cleanup test_hcd_wait_for_disconn(port_hdl, false); } @@ -234,21 +234,21 @@ Test control pipe run-time halt and clear */ TEST_CASE("Test HCD control pipe runtime halt and clear", "[ctrl][low_speed][full_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Allocate some URBs and initialize their data buffers with control transfers - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); //Create a default pipe (using a NULL EP descriptor) + // Allocate some URBs and initialize their data buffers with control transfers + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); // Create a default pipe (using a NULL EP descriptor) urb_t *urb_list[NUM_URBS]; for (int i = 0; i < NUM_URBS; i++) { urb_list[i] = test_hcd_alloc_urb(0, URB_DATA_BUFF_SIZE); - //Initialize with a "Get Config Descriptor request" + // Initialize with a "Get Config Descriptor request" urb_list[i]->transfer.num_bytes = sizeof(usb_setup_packet_t) + TRANSFER_MAX_BYTES; USB_SETUP_PACKET_INIT_GET_CONFIG_DESC((usb_setup_packet_t *)urb_list[i]->transfer.data_buffer, 0, TRANSFER_MAX_BYTES); urb_list[i]->transfer.context = URB_CONTEXT_VAL; } - //Enqueue URBs but immediately halt the pipe + // Enqueue URBs but immediately halt the pipe printf("Enqueuing URBs\n"); for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb_list[i])); @@ -258,36 +258,36 @@ TEST_CASE("Test HCD control pipe runtime halt and clear", "[ctrl][low_speed][ful TEST_ASSERT_EQUAL(HCD_PIPE_STATE_HALTED, hcd_pipe_get_state(default_pipe)); printf("Pipe halted\n"); - //Un-halt the pipe + // Un-halt the pipe TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(default_pipe, HCD_PIPE_CMD_CLEAR)); TEST_ASSERT_EQUAL(HCD_PIPE_STATE_ACTIVE, hcd_pipe_get_state(default_pipe)); printf("Pipe cleared\n"); - vTaskDelay(pdMS_TO_TICKS(100)); //Give some time pending for transfers to restart and complete + vTaskDelay(pdMS_TO_TICKS(100)); // Give some time pending for transfers to restart and complete - //Wait for each URB to be done, dequeue, and check results + // Wait for each URB to be done, dequeue, and check results for (int i = 0; i < NUM_URBS; i++) { urb_t *urb = hcd_urb_dequeue(default_pipe); TEST_ASSERT_EQUAL_PTR(urb_list[i], urb); TEST_ASSERT(urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED || urb->transfer.status == USB_TRANSFER_STATUS_CANCELED); if (urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED) { - //We must have transmitted at least the setup packet, but device may return less than bytes requested + // We must have transmitted at least the setup packet, but device may return less than bytes requested TEST_ASSERT_GREATER_OR_EQUAL(sizeof(usb_setup_packet_t), urb->transfer.actual_num_bytes); TEST_ASSERT_LESS_OR_EQUAL(urb->transfer.num_bytes, urb->transfer.actual_num_bytes); usb_config_desc_t *config_desc = (usb_config_desc_t *)(urb->transfer.data_buffer + sizeof(usb_setup_packet_t)); TEST_ASSERT_EQUAL(USB_B_DESCRIPTOR_TYPE_CONFIGURATION, config_desc->bDescriptorType); printf("Config Desc wTotalLength %d\n", config_desc->wTotalLength); } else { - //A failed transfer should 0 actual number of bytes transmitted + // A failed transfer should 0 actual number of bytes transmitted TEST_ASSERT_EQUAL(0, urb->transfer.actual_num_bytes); } TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); } - //Free URB list and pipe + // Free URB list and pipe for (int i = 0; i < NUM_URBS; i++) { test_hcd_free_urb(urb_list[i]); } test_hcd_pipe_free(default_pipe); - //Cleanup + // Cleanup test_hcd_wait_for_disconn(port_hdl, false); } diff --git a/components/usb/test_apps/hcd/main/test_hcd_intr.c b/components/usb/test_apps/hcd/main/test_hcd_intr.c index cf300d269351..7c772c9ee3b9 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_intr.c +++ b/components/usb/test_apps/hcd/main/test_hcd_intr.c @@ -8,8 +8,8 @@ #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" #include "unity.h" -#include "test_usb_mock_msc.h" -#include "test_usb_mock_hid.h" +#include "mock_msc.h" +#include "mock_hid.h" #include "test_hcd_common.h" // --------------------------------------------------- Test Cases ------------------------------------------------------ @@ -41,14 +41,14 @@ Note: Some mice will NAK until it is moved, so try moving the mouse around if th TEST_CASE("Test HCD interrupt pipe URBs", "[intr][low_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection TEST_ASSERT_EQUAL_MESSAGE(TEST_HID_DEV_SPEED, port_speed, "Connected device is not Low Speed!"); - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); //Create a default pipe (using a NULL EP descriptor) + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); // Create a default pipe (using a NULL EP descriptor) uint8_t dev_addr = test_hcd_enum_device(default_pipe); - //Allocate interrupt pipe and URBS + // Allocate interrupt pipe and URBS hcd_pipe_handle_t intr_pipe = test_hcd_pipe_alloc(port_hdl, &mock_hid_mouse_in_ep_desc, dev_addr, port_speed); urb_t *urb_list[NUM_URBS]; for (int i = 0; i < NUM_URBS; i++) { @@ -57,31 +57,31 @@ TEST_CASE("Test HCD interrupt pipe URBs", "[intr][low_speed]") urb_list[i]->transfer.context = URB_CONTEXT_VAL; } - //Enqueue URBs + // Enqueue URBs for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(intr_pipe, urb_list[i])); } int iter_count = NUM_URB_ITERS; for (iter_count = NUM_URB_ITERS; iter_count > 0; iter_count--) { - //Wait for an URB to be done + // Wait for an URB to be done test_hcd_expect_pipe_event(intr_pipe, HCD_PIPE_EVENT_URB_DONE); - //Dequeue the URB and check results + // Dequeue the URB and check results urb_t *urb = hcd_urb_dequeue(intr_pipe); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); mock_hid_process_report((mock_hid_mouse_report_t *)urb->transfer.data_buffer, iter_count); - //Requeue URB + // Requeue URB if (iter_count > NUM_URBS) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(intr_pipe, urb)); } } - //Free URB list and pipe + // Free URB list and pipe for (int i = 0; i < NUM_URBS; i++) { test_hcd_free_urb(urb_list[i]); } test_hcd_pipe_free(intr_pipe); test_hcd_pipe_free(default_pipe); - //Clearnup + // Clearnup test_hcd_wait_for_disconn(port_hdl, false); } diff --git a/components/usb/test_apps/hcd/main/test_hcd_isoc.c b/components/usb/test_apps/hcd/main/test_hcd_isoc.c index aff0440b499b..87364c44d1ba 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_isoc.c +++ b/components/usb/test_apps/hcd/main/test_hcd_isoc.c @@ -10,7 +10,7 @@ #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" #include "unity.h" -#include "test_usb_mock_msc.h" +#include "mock_msc.h" #include "test_usb_common.h" #include "test_hcd_common.h" @@ -43,57 +43,57 @@ Test HCD ISOC pipe URBs TEST_CASE("Test HCD isochronous pipe URBs", "[isoc][full_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection - //The MPS of the ISOC OUT pipe is quite large, so we need to bias the FIFO sizing + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection + // The MPS of the ISOC OUT pipe is quite large, so we need to bias the FIFO sizing TEST_ASSERT_EQUAL(ESP_OK, hcd_port_set_fifo_bias(port_hdl, HCD_PORT_FIFO_BIAS_PTX)); - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Enumerate and reset device - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); //Create a default pipe (using a NULL EP descriptor) + // Enumerate and reset device + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); // Create a default pipe (using a NULL EP descriptor) uint8_t dev_addr = test_hcd_enum_device(default_pipe); - //Create ISOC OUT pipe to non-existent device + // Create ISOC OUT pipe to non-existent device hcd_pipe_handle_t isoc_out_pipe = test_hcd_pipe_alloc(port_hdl, &mock_isoc_out_ep_desc, dev_addr + 1, port_speed); - //Create URBs + // Create URBs urb_t *urb_list[NUM_URBS]; - //Initialize URBs + // Initialize URBs for (int urb_idx = 0; urb_idx < NUM_URBS; urb_idx++) { urb_list[urb_idx] = test_hcd_alloc_urb(NUM_PACKETS_PER_URB, URB_DATA_BUFF_SIZE); urb_list[urb_idx]->transfer.num_bytes = URB_DATA_BUFF_SIZE; urb_list[urb_idx]->transfer.context = URB_CONTEXT_VAL; for (int pkt_idx = 0; pkt_idx < NUM_PACKETS_PER_URB; pkt_idx++) { urb_list[urb_idx]->transfer.isoc_packet_desc[pkt_idx].num_bytes = ISOC_PACKET_SIZE; - //Each packet will consist of the same byte, but each subsequent packet's byte will increment (i.e., packet 0 transmits all 0x0, packet 1 transmits all 0x1) + // Each packet will consist of the same byte, but each subsequent packet's byte will increment (i.e., packet 0 transmits all 0x0, packet 1 transmits all 0x1) memset(&urb_list[urb_idx]->transfer.data_buffer[pkt_idx * ISOC_PACKET_SIZE], (urb_idx * NUM_URBS) + pkt_idx, ISOC_PACKET_SIZE); } } - //Enqueue URBs + // Enqueue URBs for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(isoc_out_pipe, urb_list[i])); } - //Wait for each done event from each URB + // Wait for each done event from each URB for (int i = 0; i < NUM_URBS; i++) { test_hcd_expect_pipe_event(isoc_out_pipe, HCD_PIPE_EVENT_URB_DONE); } - //Dequeue URBs + // Dequeue URBs for (int urb_idx = 0; urb_idx < NUM_URBS; urb_idx++) { urb_t *urb = hcd_urb_dequeue(isoc_out_pipe); TEST_ASSERT_EQUAL(urb_list[urb_idx], urb); TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); - //Overall URB status and overall number of bytes + // Overall URB status and overall number of bytes TEST_ASSERT_EQUAL(URB_DATA_BUFF_SIZE, urb->transfer.actual_num_bytes); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); for (int pkt_idx = 0; pkt_idx < NUM_PACKETS_PER_URB; pkt_idx++) { TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.isoc_packet_desc[pkt_idx].status, "Transfer NOT completed"); } } - //Free URB list and pipe + // Free URB list and pipe for (int i = 0; i < NUM_URBS; i++) { test_hcd_free_urb(urb_list[i]); } test_hcd_pipe_free(isoc_out_pipe); test_hcd_pipe_free(default_pipe); - //Cleanup + // Cleanup test_hcd_wait_for_disconn(port_hdl, false); } @@ -116,13 +116,13 @@ Test HCD ISOC pipe URBs with all channels and intervals combinations */ TEST_CASE("Test HCD isochronous pipe URBs all", "[isoc][full_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection - //The MPS of the ISOC OUT pipe is quite large, so we need to bias the FIFO sizing + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection + // The MPS of the ISOC OUT pipe is quite large, so we need to bias the FIFO sizing TEST_ASSERT_EQUAL(ESP_OK, hcd_port_set_fifo_bias(port_hdl, HCD_PORT_FIFO_BIAS_PTX)); - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Enumerate and reset device - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); //Create a default pipe (using a NULL EP descriptor) + // Enumerate and reset device + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); // Create a default pipe (using a NULL EP descriptor) uint8_t dev_addr = test_hcd_enum_device(default_pipe); urb_t *urb_list[NUM_URBS]; @@ -141,20 +141,20 @@ TEST_CASE("Test HCD isochronous pipe URBs all", "[isoc][full_speed]") vTaskDelay(5); unsigned num_packets_per_urb = 32; // This is maximum number of packets if interval = 1. This is limited by FRAME_LIST_LEN num_packets_per_urb >>= (interval - 1); - //Create ISOC OUT pipe + // Create ISOC OUT pipe usb_ep_desc_t isoc_out_ep = mock_isoc_out_ep_desc; // Implicit copy isoc_out_ep.bInterval = interval; isoc_out_ep.bEndpointAddress = interval; // So you can see the bInterval value in trace hcd_pipe_handle_t isoc_out_pipe = test_hcd_pipe_alloc(port_hdl, &isoc_out_ep, channel + 1, port_speed); // Channel number represented in dev_num, so you can see it in trace - //Initialize URBs + // Initialize URBs for (int urb_idx = 0; urb_idx < NUM_URBS; urb_idx++) { urb_list[urb_idx] = test_hcd_alloc_urb(num_packets_per_urb, num_packets_per_urb * ISOC_PACKET_SIZE); urb_list[urb_idx]->transfer.num_bytes = num_packets_per_urb * ISOC_PACKET_SIZE; urb_list[urb_idx]->transfer.context = URB_CONTEXT_VAL; for (int pkt_idx = 0; pkt_idx < num_packets_per_urb; pkt_idx++) { urb_list[urb_idx]->transfer.isoc_packet_desc[pkt_idx].num_bytes = ISOC_PACKET_SIZE; - //Each packet will consist of the same byte, but each subsequent packet's byte will increment (i.e., packet 0 transmits all 0x0, packet 1 transmits all 0x1) + // Each packet will consist of the same byte, but each subsequent packet's byte will increment (i.e., packet 0 transmits all 0x0, packet 1 transmits all 0x1) memset(&urb_list[urb_idx]->transfer.data_buffer[pkt_idx * ISOC_PACKET_SIZE], (urb_idx * num_packets_per_urb) + pkt_idx, ISOC_PACKET_SIZE); } } @@ -162,27 +162,27 @@ TEST_CASE("Test HCD isochronous pipe URBs all", "[isoc][full_speed]") // Add a delay so we start scheduling the transactions at different time in USB frame esp_rom_delay_us(ENQUEUE_DELAY * interval + ENQUEUE_DELAY * channel); - //Enqueue URBs + // Enqueue URBs for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(isoc_out_pipe, urb_list[i])); } - //Wait for each done event from each URB + // Wait for each done event from each URB for (int i = 0; i < NUM_URBS; i++) { test_hcd_expect_pipe_event(isoc_out_pipe, HCD_PIPE_EVENT_URB_DONE); } - //Dequeue URBs + // Dequeue URBs for (int urb_idx = 0; urb_idx < NUM_URBS; urb_idx++) { urb_t *urb = hcd_urb_dequeue(isoc_out_pipe); TEST_ASSERT_EQUAL(urb_list[urb_idx], urb); TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); - //Overall URB status and overall number of bytes + // Overall URB status and overall number of bytes TEST_ASSERT_EQUAL(num_packets_per_urb * ISOC_PACKET_SIZE, urb->transfer.actual_num_bytes); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); for (int pkt_idx = 0; pkt_idx < num_packets_per_urb; pkt_idx++) { TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.isoc_packet_desc[pkt_idx].status, "Transfer NOT completed"); } } - //Free URB list and pipe + // Free URB list and pipe for (int i = 0; i < NUM_URBS; i++) { test_hcd_free_urb(urb_list[i]); } @@ -195,7 +195,7 @@ TEST_CASE("Test HCD isochronous pipe URBs all", "[isoc][full_speed]") } } test_hcd_pipe_free(default_pipe); - //Cleanup + // Cleanup test_hcd_wait_for_disconn(port_hdl, false); } @@ -225,65 +225,65 @@ Purpose: Test that when sudden disconnection happens on an HCD port, the ISOC pi */ TEST_CASE("Test HCD isochronous pipe sudden disconnect", "[isoc][full_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection - //The MPS of the ISOC OUT pipe is quite large, so we need to bias the FIFO sizing + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection + // The MPS of the ISOC OUT pipe is quite large, so we need to bias the FIFO sizing TEST_ASSERT_EQUAL(ESP_OK, hcd_port_set_fifo_bias(port_hdl, HCD_PORT_FIFO_BIAS_PTX)); - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Enumerate and reset device - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); //Create a default pipe (using a NULL EP descriptor) + // Enumerate and reset device + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); // Create a default pipe (using a NULL EP descriptor) uint8_t dev_addr = test_hcd_enum_device(default_pipe); - //Create ISOC OUT pipe to non-existent device + // Create ISOC OUT pipe to non-existent device hcd_pipe_handle_t isoc_out_pipe = test_hcd_pipe_alloc(port_hdl, &mock_isoc_out_ep_desc, dev_addr + 1, port_speed); - //Create URBs + // Create URBs urb_t *urb_list[NUM_URBS]; - //Initialize URBs + // Initialize URBs for (int urb_idx = 0; urb_idx < NUM_URBS; urb_idx++) { urb_list[urb_idx] = test_hcd_alloc_urb(NUM_PACKETS_PER_URB, URB_DATA_BUFF_SIZE); urb_list[urb_idx]->transfer.num_bytes = URB_DATA_BUFF_SIZE; urb_list[urb_idx]->transfer.context = URB_CONTEXT_VAL; for (int pkt_idx = 0; pkt_idx < NUM_PACKETS_PER_URB; pkt_idx++) { urb_list[urb_idx]->transfer.isoc_packet_desc[pkt_idx].num_bytes = ISOC_PACKET_SIZE; - //Each packet will consist of the same byte, but each subsequent packet's byte will increment (i.e., packet 0 transmits all 0x0, packet 1 transmits all 0x1) + // Each packet will consist of the same byte, but each subsequent packet's byte will increment (i.e., packet 0 transmits all 0x0, packet 1 transmits all 0x1) memset(&urb_list[urb_idx]->transfer.data_buffer[pkt_idx * ISOC_PACKET_SIZE], (urb_idx * NUM_URBS) + pkt_idx, ISOC_PACKET_SIZE); } } - //Enqueue URBs + // Enqueue URBs for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(isoc_out_pipe, urb_list[i])); } - //Add a short delay to let the transfers run for a bit + // Add a short delay to let the transfers run for a bit esp_rom_delay_us(POST_ENQUEUE_DELAY_US); test_usb_set_phy_state(false, 0); - //Disconnect event should have occurred. Handle the port event + // Disconnect event should have occurred. Handle the port event test_hcd_expect_port_event(port_hdl, HCD_PORT_EVENT_DISCONNECTION); TEST_ASSERT_EQUAL(HCD_PORT_EVENT_DISCONNECTION, hcd_port_handle_event(port_hdl)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_RECOVERY, hcd_port_get_state(port_hdl)); printf("Sudden disconnect\n"); - //Both pipes should still be active + // Both pipes should still be active TEST_ASSERT_EQUAL(HCD_PIPE_STATE_ACTIVE, hcd_pipe_get_state(default_pipe)); TEST_ASSERT_EQUAL(HCD_PIPE_STATE_ACTIVE, hcd_pipe_get_state(isoc_out_pipe)); - //Halt both pipes + // Halt both pipes TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(default_pipe, HCD_PIPE_CMD_HALT)); TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(isoc_out_pipe, HCD_PIPE_CMD_HALT)); TEST_ASSERT_EQUAL(HCD_PIPE_STATE_HALTED, hcd_pipe_get_state(default_pipe)); TEST_ASSERT_EQUAL(HCD_PIPE_STATE_HALTED, hcd_pipe_get_state(isoc_out_pipe)); - //Flush both pipes. ISOC pipe should return completed URBs + // Flush both pipes. ISOC pipe should return completed URBs TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(default_pipe, HCD_PIPE_CMD_FLUSH)); TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(isoc_out_pipe, HCD_PIPE_CMD_FLUSH)); - //Dequeue ISOC URBs + // Dequeue ISOC URBs for (int urb_idx = 0; urb_idx < NUM_URBS; urb_idx++) { urb_t *urb = hcd_urb_dequeue(isoc_out_pipe); TEST_ASSERT_EQUAL(urb_list[urb_idx], urb); TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); - //The URB has either completed entirely or is marked as no_device + // The URB has either completed entirely or is marked as no_device TEST_ASSERT(urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED || urb->transfer.status == USB_TRANSFER_STATUS_NO_DEVICE); } - //Free URB list and pipe + // Free URB list and pipe for (int i = 0; i < NUM_URBS; i++) { test_hcd_free_urb(urb_list[i]); } diff --git a/components/usb/test_apps/hcd/main/test_hcd_port.c b/components/usb/test_apps/hcd/main/test_hcd_port.c index 3b44623cba75..67f502335b0a 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_port.c +++ b/components/usb/test_apps/hcd/main/test_hcd_port.c @@ -15,7 +15,7 @@ #define TEST_DEV_ADDR 0 #define NUM_URBS 3 #define TRANSFER_MAX_BYTES 256 -#define URB_DATA_BUFF_SIZE (sizeof(usb_setup_packet_t) + TRANSFER_MAX_BYTES) //256 is worst case size for configuration descriptors +#define URB_DATA_BUFF_SIZE (sizeof(usb_setup_packet_t) + TRANSFER_MAX_BYTES) // 256 is worst case size for configuration descriptors #define POST_ENQUEUE_DELAY_US 10 /* @@ -43,35 +43,35 @@ Purpose: Test that when sudden disconnection happens on an HCD port, the port wi TEST_CASE("Test HCD port sudden disconnect", "[port][low_speed][full_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Allocate some URBs and initialize their data buffers with control transfers - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); //Create a default pipe (using a NULL EP descriptor) + // Allocate some URBs and initialize their data buffers with control transfers + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); // Create a default pipe (using a NULL EP descriptor) urb_t *urb_list[NUM_URBS]; for (int i = 0; i < NUM_URBS; i++) { urb_list[i] = test_hcd_alloc_urb(0, URB_DATA_BUFF_SIZE); - //Initialize with a "Get Config Descriptor request" + // Initialize with a "Get Config Descriptor request" urb_list[i]->transfer.num_bytes = sizeof(usb_setup_packet_t) + TRANSFER_MAX_BYTES; USB_SETUP_PACKET_INIT_GET_CONFIG_DESC((usb_setup_packet_t *)urb_list[i]->transfer.data_buffer, 0, TRANSFER_MAX_BYTES); urb_list[i]->transfer.context = (void *)0xDEADBEEF; } - //Enqueue URBs but immediately trigger a disconnect + // Enqueue URBs but immediately trigger a disconnect printf("Enqueuing URBs\n"); for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb_list[i])); } - //Add a short delay to let the transfers run for a bit + // Add a short delay to let the transfers run for a bit esp_rom_delay_us(POST_ENQUEUE_DELAY_US); test_usb_set_phy_state(false, 0); - //Disconnect event should have occurred. Handle the port event + // Disconnect event should have occurred. Handle the port event test_hcd_expect_port_event(port_hdl, HCD_PORT_EVENT_DISCONNECTION); TEST_ASSERT_EQUAL(HCD_PORT_EVENT_DISCONNECTION, hcd_port_handle_event(port_hdl)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_RECOVERY, hcd_port_get_state(port_hdl)); printf("Sudden disconnect\n"); - //We should be able to halt then flush the pipe + // We should be able to halt then flush the pipe TEST_ASSERT_EQUAL(HCD_PIPE_STATE_ACTIVE, hcd_pipe_get_state(default_pipe)); TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(default_pipe, HCD_PIPE_CMD_HALT)); printf("Pipe halted\n"); @@ -80,32 +80,32 @@ TEST_CASE("Test HCD port sudden disconnect", "[port][low_speed][full_speed]") test_hcd_expect_pipe_event(default_pipe, HCD_PIPE_EVENT_URB_DONE); printf("Pipe flushed\n"); - //Dequeue URBs + // Dequeue URBs for (int i = 0; i < NUM_URBS; i++) { urb_t *urb = hcd_urb_dequeue(default_pipe); TEST_ASSERT_EQUAL(urb_list[i], urb); TEST_ASSERT(urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED || urb->transfer.status == USB_TRANSFER_STATUS_NO_DEVICE); if (urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED) { - //We must have transmitted at least the setup packet, but device may return less than bytes requested + // We must have transmitted at least the setup packet, but device may return less than bytes requested TEST_ASSERT_GREATER_OR_EQUAL(sizeof(usb_setup_packet_t), urb->transfer.actual_num_bytes); TEST_ASSERT_LESS_OR_EQUAL(urb->transfer.num_bytes, urb->transfer.actual_num_bytes); } else { - //A failed transfer should 0 actual number of bytes transmitted + // A failed transfer should 0 actual number of bytes transmitted TEST_ASSERT_EQUAL(0, urb->transfer.actual_num_bytes); } TEST_ASSERT_EQUAL(0xDEADBEEF, urb->transfer.context); } - //Free URB list and pipe + // Free URB list and pipe for (int i = 0; i < NUM_URBS; i++) { test_hcd_free_urb(urb_list[i]); } test_hcd_pipe_free(default_pipe); - //Recover the port should return to the to NOT POWERED state + // Recover the port should return to the to NOT POWERED state TEST_ASSERT_EQUAL(ESP_OK, hcd_port_recover(port_hdl)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_NOT_POWERED, hcd_port_get_state(port_hdl)); - //Recovered port should be able to connect and disconnect again + // Recovered port should be able to connect and disconnect again test_hcd_wait_for_conn(port_hdl); test_hcd_wait_for_disconn(port_hdl, false); } @@ -132,38 +132,38 @@ Test port suspend and resume with active pipes */ TEST_CASE("Test HCD port suspend and resume", "[port][low_speed][full_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Allocate some URBs and initialize their data buffers with control transfers - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); //Create a default pipe (using a NULL EP descriptor) + // Allocate some URBs and initialize their data buffers with control transfers + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); // Create a default pipe (using a NULL EP descriptor) - //Test that suspending the port now fails as there is an active pipe + // Test that suspending the port now fails as there is an active pipe TEST_ASSERT_NOT_EQUAL(ESP_OK, hcd_port_command(port_hdl, HCD_PORT_CMD_SUSPEND)); - //Halt the default pipe before suspending + // Halt the default pipe before suspending TEST_ASSERT_EQUAL(HCD_PIPE_STATE_ACTIVE, hcd_pipe_get_state(default_pipe)); TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(default_pipe, HCD_PIPE_CMD_HALT)); TEST_ASSERT_EQUAL(HCD_PIPE_STATE_HALTED, hcd_pipe_get_state(default_pipe)); - //Suspend the port + // Suspend the port TEST_ASSERT_EQUAL(ESP_OK, hcd_port_command(port_hdl, HCD_PORT_CMD_SUSPEND)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_SUSPENDED, hcd_port_get_state(port_hdl)); printf("Suspended\n"); - vTaskDelay(pdMS_TO_TICKS(100)); //Give some time for bus to remain suspended + vTaskDelay(pdMS_TO_TICKS(100)); // Give some time for bus to remain suspended - //Resume the port + // Resume the port TEST_ASSERT_EQUAL(ESP_OK, hcd_port_command(port_hdl, HCD_PORT_CMD_RESUME)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_ENABLED, hcd_port_get_state(port_hdl)); printf("Resumed\n"); - //Clear the default pipe's halt + // Clear the default pipe's halt TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(default_pipe, HCD_PIPE_CMD_CLEAR)); TEST_ASSERT_EQUAL(HCD_PIPE_STATE_ACTIVE, hcd_pipe_get_state(default_pipe)); - vTaskDelay(pdMS_TO_TICKS(100)); //Give some time for resumed URBs to complete + vTaskDelay(pdMS_TO_TICKS(100)); // Give some time for resumed URBs to complete test_hcd_pipe_free(default_pipe); - //Cleanup + // Cleanup test_hcd_wait_for_disconn(port_hdl, false); } @@ -186,65 +186,65 @@ Test HCD port disable and disconnection */ TEST_CASE("Test HCD port disable", "[port][low_speed][full_speed]") { - usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); //Trigger a connection - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + usb_speed_t port_speed = test_hcd_wait_for_conn(port_hdl); // Trigger a connection + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Allocate some URBs and initialize their data buffers with control transfers - hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); //Create a default pipe (using a NULL EP descriptor) + // Allocate some URBs and initialize their data buffers with control transfers + hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, TEST_DEV_ADDR, port_speed); // Create a default pipe (using a NULL EP descriptor) urb_t *urb_list[NUM_URBS]; for (int i = 0; i < NUM_URBS; i++) { urb_list[i] = test_hcd_alloc_urb(0, URB_DATA_BUFF_SIZE); - //Initialize with a "Get Config Descriptor request" + // Initialize with a "Get Config Descriptor request" urb_list[i]->transfer.num_bytes = sizeof(usb_setup_packet_t) + TRANSFER_MAX_BYTES; USB_SETUP_PACKET_INIT_GET_CONFIG_DESC((usb_setup_packet_t *)urb_list[i]->transfer.data_buffer, 0, TRANSFER_MAX_BYTES); urb_list[i]->transfer.context = (void *)0xDEADBEEF; } - //Enqueue URBs but immediately disable the port + // Enqueue URBs but immediately disable the port printf("Enqueuing URBs\n"); for (int i = 0; i < NUM_URBS; i++) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb_list[i])); - //Add a short delay to let the transfers run for a bit + // Add a short delay to let the transfers run for a bit esp_rom_delay_us(POST_ENQUEUE_DELAY_US); } - //Halt the default pipe before suspending + // Halt the default pipe before suspending TEST_ASSERT_EQUAL(HCD_PIPE_STATE_ACTIVE, hcd_pipe_get_state(default_pipe)); TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(default_pipe, HCD_PIPE_CMD_HALT)); TEST_ASSERT_EQUAL(HCD_PIPE_STATE_HALTED, hcd_pipe_get_state(default_pipe)); - //Check that port can be disabled + // Check that port can be disabled TEST_ASSERT_EQUAL(ESP_OK, hcd_port_command(port_hdl, HCD_PORT_CMD_DISABLE)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_DISABLED, hcd_port_get_state(port_hdl)); printf("Disabled\n"); - //Flush pipe + // Flush pipe TEST_ASSERT_EQUAL(ESP_OK, hcd_pipe_command(default_pipe, HCD_PIPE_CMD_FLUSH)); - //Dequeue URBs + // Dequeue URBs for (int i = 0; i < NUM_URBS; i++) { urb_t *urb = hcd_urb_dequeue(default_pipe); TEST_ASSERT_EQUAL(urb_list[i], urb); - TEST_ASSERT(urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED || //The transfer completed before the pipe halted - urb->transfer.status == USB_TRANSFER_STATUS_CANCELED || //The transfer was stopped mid-way by the halt - urb->transfer.status == USB_TRANSFER_STATUS_NO_DEVICE); //The transfer was never started + TEST_ASSERT(urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED || // The transfer completed before the pipe halted + urb->transfer.status == USB_TRANSFER_STATUS_CANCELED || // The transfer was stopped mid-way by the halt + urb->transfer.status == USB_TRANSFER_STATUS_NO_DEVICE); // The transfer was never started if (urb->transfer.status == USB_TRANSFER_STATUS_COMPLETED) { - //We must have transmitted at least the setup packet, but device may return less than bytes requested + // We must have transmitted at least the setup packet, but device may return less than bytes requested TEST_ASSERT_GREATER_OR_EQUAL(sizeof(usb_setup_packet_t), urb->transfer.actual_num_bytes); TEST_ASSERT_LESS_OR_EQUAL(urb->transfer.num_bytes, urb->transfer.actual_num_bytes); } else { - //A failed transfer should 0 actual number of bytes transmitted + // A failed transfer should 0 actual number of bytes transmitted TEST_ASSERT_EQUAL(0, urb->transfer.actual_num_bytes); } TEST_ASSERT_EQUAL(0xDEADBEEF, urb->transfer.context); } - //Free URB list and pipe + // Free URB list and pipe for (int i = 0; i < NUM_URBS; i++) { test_hcd_free_urb(urb_list[i]); } test_hcd_pipe_free(default_pipe); - //Trigger a disconnection and cleanup + // Trigger a disconnection and cleanup test_hcd_wait_for_disconn(port_hdl, true); } @@ -266,40 +266,40 @@ static void concurrent_task(void *arg) { SemaphoreHandle_t sync_sem = (SemaphoreHandle_t) arg; xSemaphoreTake(sync_sem, portMAX_DELAY); - vTaskDelay(pdMS_TO_TICKS(10)); //Give a short delay let reset command start in main thread - //Force a disconnection + vTaskDelay(pdMS_TO_TICKS(10)); // Give a short delay let reset command start in main thread + // Force a disconnection test_usb_set_phy_state(false, 0); - vTaskDelay(portMAX_DELAY); //Block forever and wait to be deleted + vTaskDelay(portMAX_DELAY); // Block forever and wait to be deleted } TEST_CASE("Test HCD port command bailout", "[port][low_speed][full_speed]") { - test_hcd_wait_for_conn(port_hdl); //Trigger a connection - vTaskDelay(pdMS_TO_TICKS(100)); //Short delay send of SOF (for FS) or EOPs (for LS) + test_hcd_wait_for_conn(port_hdl); // Trigger a connection + vTaskDelay(pdMS_TO_TICKS(100)); // Short delay send of SOF (for FS) or EOPs (for LS) - //Create task to run port commands concurrently + // Create task to run port commands concurrently SemaphoreHandle_t sync_sem = xSemaphoreCreateBinary(); TaskHandle_t task_handle; TEST_ASSERT_NOT_NULL(sync_sem); TEST_ASSERT_EQUAL(pdTRUE, xTaskCreatePinnedToCore(concurrent_task, "tsk", 4096, (void *) sync_sem, uxTaskPriorityGet(NULL) + 1, &task_handle, 0)); - //Suspend the device + // Suspend the device printf("Suspending\n"); TEST_ASSERT_EQUAL(ESP_OK, hcd_port_command(port_hdl, HCD_PORT_CMD_SUSPEND)); - vTaskDelay(pdMS_TO_TICKS(20)); //Short delay for device to enter suspend state + vTaskDelay(pdMS_TO_TICKS(20)); // Short delay for device to enter suspend state - //Attempt to resume the port. But the concurrent task should override this with a disconnection event + // Attempt to resume the port. But the concurrent task should override this with a disconnection event printf("Attempting to resume\n"); - xSemaphoreGive(sync_sem); //Trigger concurrent task + xSemaphoreGive(sync_sem); // Trigger concurrent task TEST_ASSERT_EQUAL(ESP_ERR_INVALID_RESPONSE, hcd_port_command(port_hdl, HCD_PORT_CMD_RESUME)); - //Check that concurrent task triggered a sudden disconnection + // Check that concurrent task triggered a sudden disconnection test_hcd_expect_port_event(port_hdl, HCD_PORT_EVENT_DISCONNECTION); TEST_ASSERT_EQUAL(HCD_PORT_EVENT_DISCONNECTION, hcd_port_handle_event(port_hdl)); TEST_ASSERT_EQUAL(HCD_PORT_STATE_RECOVERY, hcd_port_get_state(port_hdl)); - //Cleanup task and semaphore - vTaskDelay(pdMS_TO_TICKS(10)); //Short delay for concurrent task finish running + // Cleanup task and semaphore + vTaskDelay(pdMS_TO_TICKS(10)); // Short delay for concurrent task finish running vTaskDelete(task_handle); vSemaphoreDelete(sync_sem); } diff --git a/components/usb/test_apps/hcd/main/test_usb_helpers.c b/components/usb/test_apps/hcd/main/test_usb_helpers.c index 1d589118d96a..7ef3631b288d 100644 --- a/components/usb/test_apps/hcd/main/test_usb_helpers.c +++ b/components/usb/test_apps/hcd/main/test_usb_helpers.c @@ -333,7 +333,7 @@ static uint8_t config_desc_bytes [] = { }; _Static_assert(sizeof(config_desc_bytes) == 0x0185, "Configuration Descriptor size does not match"); -#define TEST_NUM_INTF_DESC 3 //Total number of interface descriptors (including alternate) +#define TEST_NUM_INTF_DESC 3 // Total number of interface descriptors (including alternate) // --------------------- Sub-Test 1 ------------------------ @@ -348,7 +348,7 @@ static void test_walk_desc(const usb_config_desc_t *config_desc) cur_desc = usb_parse_next_descriptor_of_type(cur_desc, config_desc->wTotalLength, USB_B_DESCRIPTOR_TYPE_INTERFACE, &offset); TEST_ASSERT_NOT_NULL(cur_desc); } - //Attempting to look for another interface descriptor should result in NULL + // Attempting to look for another interface descriptor should result in NULL cur_desc = usb_parse_next_descriptor_of_type(cur_desc, config_desc->wTotalLength, USB_B_DESCRIPTOR_TYPE_INTERFACE, &offset); TEST_ASSERT_NULL(cur_desc); } @@ -358,11 +358,11 @@ Test if the count of number of alternate descriptors is correct */ static void test_alt_intf_desc_count(const usb_config_desc_t *config_desc) { - //bInterface 0 has no alternate interfaces + // bInterface 0 has no alternate interfaces TEST_ASSERT_EQUAL(0, usb_parse_interface_number_of_alternate(config_desc, 0)); - //bInterface 1 has 1 alternate interface + // bInterface 1 has 1 alternate interface TEST_ASSERT_EQUAL(1, usb_parse_interface_number_of_alternate(config_desc, 1)); - //Non existent bInterface 2 should return -1 + // Non existent bInterface 2 should return -1 TEST_ASSERT_EQUAL(-1, usb_parse_interface_number_of_alternate(config_desc, 2)); } @@ -370,10 +370,10 @@ static void test_parse_intf_and_ep(const usb_config_desc_t *config_desc) { int offset_intf = 0; - //Get bInterfaceNumber 0 (index 0) + // Get bInterfaceNumber 0 (index 0) const usb_intf_desc_t *intf_desc = usb_parse_interface_descriptor(config_desc, 0, 0, &offset_intf); TEST_ASSERT_NOT_NULL(intf_desc); - //Should only have one endpoint + // Should only have one endpoint int offset_ep = offset_intf; const usb_ep_desc_t *ep_desc = usb_parse_endpoint_descriptor_by_index(intf_desc, 0, config_desc->wTotalLength, &offset_ep); TEST_ASSERT_NOT_NULL(ep_desc); @@ -382,20 +382,20 @@ static void test_parse_intf_and_ep(const usb_config_desc_t *config_desc) ep_desc = usb_parse_endpoint_descriptor_by_index(intf_desc, 1, config_desc->wTotalLength, &offset_ep); TEST_ASSERT_NULL(ep_desc); - //Get bInterfaceNumber 1 alternate setting 0 + // Get bInterfaceNumber 1 alternate setting 0 offset_intf = 0; intf_desc = usb_parse_interface_descriptor(config_desc, 1, 0, &offset_intf); TEST_ASSERT_NOT_NULL(intf_desc); - //Should have no endpoints + // Should have no endpoints offset_ep = offset_intf; ep_desc = usb_parse_endpoint_descriptor_by_index(intf_desc, 0, config_desc->wTotalLength, &offset_ep); TEST_ASSERT_NULL(ep_desc); - //Get bInterfaceNumber 1 alternate setting 1 + // Get bInterfaceNumber 1 alternate setting 1 offset_intf = 0; intf_desc = usb_parse_interface_descriptor(config_desc, 1, 1, &offset_intf); TEST_ASSERT_NOT_NULL(intf_desc); - //Should only have one endpoint + // Should only have one endpoint offset_ep = offset_intf; ep_desc = usb_parse_endpoint_descriptor_by_index(intf_desc, 0, config_desc->wTotalLength, &offset_ep); TEST_ASSERT_NOT_NULL(ep_desc); @@ -408,21 +408,21 @@ static void test_parse_intf_and_ep(const usb_config_desc_t *config_desc) static void test_parse_ep_by_address(const usb_config_desc_t *config_desc) { int offset_ep = 0; - //Get bInterface 0 bAlternateSetting 0 EP 0x83 + // Get bInterface 0 bAlternateSetting 0 EP 0x83 const usb_ep_desc_t *ep_desc = usb_parse_endpoint_descriptor_by_address(config_desc, 0, 0, 0x83, &offset_ep); TEST_ASSERT_NOT_NULL(ep_desc); TEST_ASSERT_EQUAL(0x83, ep_desc->bEndpointAddress); - //Getting same EP address under different interface should return NULL + // Getting same EP address under different interface should return NULL offset_ep = 0; ep_desc = usb_parse_endpoint_descriptor_by_address(config_desc, 1, 0, 0x83, &offset_ep); TEST_ASSERT_NULL(ep_desc); - //Get bInterface 1 bAlternateSetting 1 EP 0x81 + // Get bInterface 1 bAlternateSetting 1 EP 0x81 offset_ep = 0; ep_desc = usb_parse_endpoint_descriptor_by_address(config_desc, 1, 1, 0x81, &offset_ep); TEST_ASSERT_NOT_NULL(ep_desc); TEST_ASSERT_EQUAL(0x81, ep_desc->bEndpointAddress); - //Getting same EP address under different interface should return NULL + // Getting same EP address under different interface should return NULL offset_ep = 0; ep_desc = usb_parse_endpoint_descriptor_by_address(config_desc, 1, 0, 0x81, &offset_ep); TEST_ASSERT_NULL(ep_desc); diff --git a/components/usb/test_apps/usb_host/README.md b/components/usb/test_apps/usb_host/README.md index 98dda595dc89..94f6139d8e17 100644 --- a/components/usb/test_apps/usb_host/README.md +++ b/components/usb/test_apps/usb_host/README.md @@ -7,5 +7,5 @@ There are two sets of tests in this application: 1. Low-speed: Expects low-speed USB mouse with interrupt endpoint to be connected 2. Full-speed: Expects full-speed USB flash disk with 2 bulk endpoints to be connected -For running these tests locally, you will have to update device definitions (VID, PID, ...) in [test_usb_mock_msc.h](../common/test_usb_mock_msc.h) and [test_usb_mock_hid.h](../common/test_usb_mock_hid.h). +For running these tests locally, you will have to update device definitions (VID, PID, ...) in [mock_msc.h](../common/mock_msc.h) and [mock_hid.h](../common/mock_hid.h). diff --git a/components/usb/test_apps/usb_host/main/ctrl_client_async_seq.c b/components/usb/test_apps/usb_host/main/ctrl_client_async_seq.c index b163dc20fbcb..48b0937739fb 100644 --- a/components/usb/test_apps/usb_host/main/ctrl_client_async_seq.c +++ b/components/usb/test_apps/usb_host/main/ctrl_client_async_seq.c @@ -61,7 +61,7 @@ typedef struct { static void ctrl_transfer_cb(usb_transfer_t *transfer) { ctrl_client_obj_t *ctrl_obj = (ctrl_client_obj_t *)transfer->context; - //Check the completed control transfer + // Check the completed control transfer TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, transfer->status, "Transfer NOT completed"); TEST_ASSERT_EQUAL(ctrl_obj->config_desc_cached->wTotalLength, transfer->actual_num_bytes - sizeof(usb_setup_packet_t)); ctrl_obj->num_xfer_done++; @@ -82,7 +82,7 @@ static void ctrl_client_event_cb(const usb_host_client_event_msg_t *event_msg, v ctrl_obj->dev_addr_to_open = event_msg->new_dev.address; break; default: - abort(); //Should never occur in this test + abort(); // Should never occur in this test break; } } @@ -94,7 +94,7 @@ void ctrl_client_async_seq_task(void *arg) ctrl_obj.cur_stage = TEST_STAGE_WAIT_CONN; ctrl_obj.next_stage = TEST_STAGE_WAIT_CONN; - //Register client + // Register client usb_host_client_config_t client_config = { .is_synchronous = false, .max_num_event_msg = CTRL_CLIENT_MAX_EVENT_MSGS, @@ -105,7 +105,7 @@ void ctrl_client_async_seq_task(void *arg) }; TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_register(&client_config, &ctrl_obj.client_hdl)); - //Allocate transfers + // Allocate transfers usb_transfer_t *ctrl_xfer[NUM_TRANSFER_OBJ] = {NULL}; for (int i = 0; i < NUM_TRANSFER_OBJ; i++) { TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_alloc(sizeof(usb_setup_packet_t) + MAX_TRANSFER_BYTES, 0, &ctrl_xfer[i])); @@ -113,7 +113,7 @@ void ctrl_client_async_seq_task(void *arg) ctrl_xfer[i]->context = (void *)&ctrl_obj; } - //Wait to be started by main thread + // Wait to be started by main thread ulTaskNotifyTake(pdTRUE, portMAX_DELAY); ESP_LOGD(CTRL_CLIENT_TAG, "Starting"); @@ -132,18 +132,18 @@ void ctrl_client_async_seq_task(void *arg) switch (ctrl_obj.next_stage) { case TEST_STAGE_DEV_OPEN: { ESP_LOGD(CTRL_CLIENT_TAG, "Open"); - //Open the device + // Open the device TEST_ASSERT_EQUAL_MESSAGE(ESP_OK, usb_host_device_open(ctrl_obj.client_hdl, ctrl_obj.dev_addr_to_open, &ctrl_obj.dev_hdl), "Failed to open the device"); - //Target our transfers to the device + // Target our transfers to the device for (int i = 0; i < NUM_TRANSFER_OBJ; i++) { ctrl_xfer[i]->device_handle = ctrl_obj.dev_hdl; } - //Check the VID/PID of the opened device + // Check the VID/PID of the opened device const usb_device_desc_t *device_desc; TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_device_descriptor(ctrl_obj.dev_hdl, &device_desc)); TEST_ASSERT_EQUAL(ctrl_obj.test_param.idVendor, device_desc->idVendor); TEST_ASSERT_EQUAL(ctrl_obj.test_param.idProduct, device_desc->idProduct); - //Cache the active configuration descriptor for later comparison + // Cache the active configuration descriptor for later comparison TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_active_config_descriptor(ctrl_obj.dev_hdl, &ctrl_obj.config_desc_cached)); ctrl_obj.next_stage = TEST_STAGE_CTRL_XFER; skip_event_handling = true; @@ -151,7 +151,7 @@ void ctrl_client_async_seq_task(void *arg) } case TEST_STAGE_CTRL_XFER: { ESP_LOGD(CTRL_CLIENT_TAG, "Transfer"); - //Send a control transfer to get the device's configuration descriptor + // Send a control transfer to get the device's configuration descriptor usb_transfer_t *transfer = ctrl_xfer[ctrl_obj.num_xfer_sent % NUM_TRANSFER_OBJ]; USB_SETUP_PACKET_INIT_GET_CONFIG_DESC((usb_setup_packet_t *)transfer->data_buffer, 0, MAX_TRANSFER_BYTES); transfer->num_bytes = sizeof(usb_setup_packet_t) + MAX_TRANSFER_BYTES; @@ -163,12 +163,12 @@ void ctrl_client_async_seq_task(void *arg) break; } case TEST_STAGE_CTRL_XFER_WAIT: { - //Nothing to do but wait + // Nothing to do but wait break; } case TEST_STAGE_DEV_CLOSE: { ESP_LOGD(CTRL_CLIENT_TAG, "Close"); - vTaskDelay(10); // Give USB Host Lib some time to process all trnsfers + vTaskDelay(10); // Give USB Host Lib some time to process all transfers TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_close(ctrl_obj.client_hdl, ctrl_obj.dev_hdl)); exit_loop = true; break; @@ -178,7 +178,7 @@ void ctrl_client_async_seq_task(void *arg) break; } } - //Free transfers and deregister client + // Free transfers and deregister client for (int i = 0; i < NUM_TRANSFER_OBJ; i++) { TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_free(ctrl_xfer[i])); } diff --git a/components/usb/test_apps/usb_host/main/msc_client_async_dconn.c b/components/usb/test_apps/usb_host/main/msc_client_async_dconn.c index 4f1e96b8d99e..7cbf6813bafc 100644 --- a/components/usb/test_apps/usb_host/main/msc_client_async_dconn.c +++ b/components/usb/test_apps/usb_host/main/msc_client_async_dconn.c @@ -12,7 +12,7 @@ #include "freertos/task.h" #include "esp_err.h" #include "esp_log.h" -#include "test_usb_mock_msc.h" +#include "mock_msc.h" #include "test_usb_common.h" #include "msc_client.h" #include "usb/usb_host.h" @@ -60,7 +60,7 @@ typedef struct { static void msc_reset_cbw_transfer_cb(usb_transfer_t *transfer) { msc_client_obj_t *msc_obj = (msc_client_obj_t *)transfer->context; - //We expect the reset and CBW transfers to complete with no issues + // We expect the reset and CBW transfers to complete with no issues TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, transfer->status, "Transfer NOT completed"); TEST_ASSERT_EQUAL(transfer->num_bytes, transfer->actual_num_bytes); switch (msc_obj->cur_stage) { @@ -78,7 +78,7 @@ static void msc_reset_cbw_transfer_cb(usb_transfer_t *transfer) static void msc_data_transfer_cb(usb_transfer_t *transfer) { - //The data stage should have either completed, or failed due to the disconnection. + // The data stage should have either completed, or failed due to the disconnection. TEST_ASSERT(transfer->status == USB_TRANSFER_STATUS_COMPLETED || transfer->status == USB_TRANSFER_STATUS_NO_DEVICE); if (transfer->status == USB_TRANSFER_STATUS_COMPLETED) { TEST_ASSERT_EQUAL(transfer->num_bytes, transfer->actual_num_bytes); @@ -87,7 +87,7 @@ static void msc_data_transfer_cb(usb_transfer_t *transfer) } msc_client_obj_t *msc_obj = (msc_client_obj_t *)transfer->context; msc_obj->event_count++; - //If all transfers dequeued and device gone event occurred. Go to next stage + // If all transfers dequeued and device gone event occurred. Go to next stage if (msc_obj->event_count >= msc_obj->num_data_transfers + 1) { msc_obj->next_stage = TEST_STAGE_DEV_CLOSE; } @@ -104,13 +104,13 @@ static void msc_client_event_cb(const usb_host_client_event_msg_t *event_msg, vo break; case USB_HOST_CLIENT_EVENT_DEV_GONE: msc_obj->event_count++; - //If all transfers dequeued and device gone event occurred. Go to next stage + // If all transfers dequeued and device gone event occurred. Go to next stage if (msc_obj->event_count >= msc_obj->num_data_transfers + 1) { msc_obj->next_stage = TEST_STAGE_DEV_CLOSE; } break; default: - abort(); //Should never occur in this test + abort(); // Should never occur in this test break; } } @@ -127,7 +127,7 @@ void msc_client_async_dconn_task(void *arg) msc_obj.num_data_transfers = msc_obj.test_param.num_sectors_per_xfer / MOCK_MSC_SCSI_SECTOR_SIZE; msc_obj.event_count = 0; - //Register client + // Register client usb_host_client_config_t client_config = { .is_synchronous = false, .max_num_event_msg = MSC_ASYNC_CLIENT_MAX_EVENT_MSGS, @@ -138,9 +138,9 @@ void msc_client_async_dconn_task(void *arg) }; TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_register(&client_config, &msc_obj.client_hdl)); - //Allocate transfers - usb_transfer_t *xfer_out; //Must be large enough to contain CBW and MSC reset control transfer - usb_transfer_t *xfer_in[msc_obj.num_data_transfers]; //We manually split the data stage into multiple transfers + // Allocate transfers + usb_transfer_t *xfer_out; // Must be large enough to contain CBW and MSC reset control transfer + usb_transfer_t *xfer_in[msc_obj.num_data_transfers]; // We manually split the data stage into multiple transfers size_t xfer_out_size = MAX(sizeof(mock_msc_bulk_cbw_t), sizeof(usb_setup_packet_t)); size_t xfer_in_size = MOCK_MSC_SCSI_SECTOR_SIZE; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_alloc(xfer_out_size, 0, &xfer_out)); @@ -150,7 +150,7 @@ void msc_client_async_dconn_task(void *arg) xfer_in[i]->context = (void *)&msc_obj; } - //Wait to be started by main thread + // Wait to be started by main thread ulTaskNotifyTake(pdTRUE, portMAX_DELAY); ESP_LOGD(MSC_CLIENT_TAG, "Starting"); @@ -169,39 +169,39 @@ void msc_client_async_dconn_task(void *arg) switch (msc_obj.cur_stage) { case TEST_STAGE_WAIT_CONN: { - //Nothing to do while waiting for connection + // Nothing to do while waiting for connection break; } case TEST_STAGE_DEV_OPEN: { ESP_LOGD(MSC_CLIENT_TAG, "Open"); - //Open the device + // Open the device TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_open(msc_obj.client_hdl, msc_obj.dev_addr_to_open, &msc_obj.dev_hdl)); - //Target our transfers to the device + // Target our transfers to the device xfer_out->device_handle = msc_obj.dev_hdl; xfer_out->callback = msc_reset_cbw_transfer_cb; for (int i = 0; i < msc_obj.num_data_transfers; i++) { xfer_in[i]->device_handle = msc_obj.dev_hdl; xfer_in[i]->callback = msc_data_transfer_cb; } - //Check the VID/PID of the opened device + // Check the VID/PID of the opened device const usb_device_desc_t *device_desc; TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_device_descriptor(msc_obj.dev_hdl, &device_desc)); TEST_ASSERT_EQUAL(msc_obj.test_param.idVendor, device_desc->idVendor); TEST_ASSERT_EQUAL(msc_obj.test_param.idProduct, device_desc->idProduct); - //Claim the MSC interface + // Claim the MSC interface TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_claim(msc_obj.client_hdl, msc_obj.dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER, MOCK_MSC_SCSI_INTF_ALT_SETTING)); msc_obj.next_stage = TEST_STAGE_MSC_RESET; - skip_event_handling = true; //Need to execute TEST_STAGE_MSC_RESET + skip_event_handling = true; // Need to execute TEST_STAGE_MSC_RESET break; } case TEST_STAGE_MSC_RESET: { ESP_LOGD(MSC_CLIENT_TAG, "MSC Reset"); - //Send an MSC SCSI interface reset + // Send an MSC SCSI interface reset MOCK_MSC_SCSI_REQ_INIT_RESET((usb_setup_packet_t *)xfer_out->data_buffer, MOCK_MSC_SCSI_INTF_NUMBER); xfer_out->num_bytes = sizeof(usb_setup_packet_t); xfer_out->bEndpointAddress = 0; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit_control(msc_obj.client_hdl, xfer_out)); - //Next stage set from transfer callback + // Next stage set from transfer callback break; } case TEST_STAGE_MSC_CBW: { @@ -210,23 +210,23 @@ void msc_client_async_dconn_task(void *arg) xfer_out->num_bytes = sizeof(mock_msc_bulk_cbw_t); xfer_out->bEndpointAddress = MOCK_MSC_SCSI_BULK_OUT_EP_ADDR; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit(xfer_out)); - //Next stage set from transfer callback + // Next stage set from transfer callback break; } case TEST_STAGE_MSC_DATA_DCONN: { ESP_LOGD(MSC_CLIENT_TAG, "Data and disconnect"); - //Setup the Data IN transfers + // Setup the Data IN transfers for (int i = 0; i < msc_obj.num_data_transfers; i++) { xfer_in[i]->num_bytes = usb_round_up_to_mps(MOCK_MSC_SCSI_SECTOR_SIZE, MOCK_MSC_SCSI_BULK_EP_MPS); xfer_in[i]->bEndpointAddress = MOCK_MSC_SCSI_BULK_IN_EP_ADDR; } - //Submit those transfers + // Submit those transfers for (int i = 0; i < msc_obj.num_data_transfers; i++) { TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit(xfer_in[i])); } - //Trigger a disconnect + // Trigger a disconnect test_usb_set_phy_state(false, 0); - //Next stage set from transfer callback + // Next stage set from transfer callback break; } case TEST_STAGE_DEV_CLOSE: { @@ -235,9 +235,9 @@ void msc_client_async_dconn_task(void *arg) TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_close(msc_obj.client_hdl, msc_obj.dev_hdl)); dconn_iter++; if (dconn_iter < TEST_DCONN_ITERATIONS) { - //Start the next test iteration by going back to TEST_STAGE_WAIT_CONN and reenabling connections + // Start the next test iteration by going back to TEST_STAGE_WAIT_CONN and reenabling connections msc_obj.next_stage = TEST_STAGE_WAIT_CONN; - skip_event_handling = true; //Need to execute TEST_STAGE_WAIT_CONN + skip_event_handling = true; // Need to execute TEST_STAGE_WAIT_CONN test_usb_set_phy_state(true, 0); } else { exit_loop = true; @@ -249,12 +249,12 @@ void msc_client_async_dconn_task(void *arg) break; } } - //Free transfers + // Free transfers TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_free(xfer_out)); for (int i = 0; i < msc_obj.num_data_transfers; i++) { TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_free(xfer_in[i])); } - //Deregister the client + // Deregister the client TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_deregister(msc_obj.client_hdl)); ESP_LOGD(MSC_CLIENT_TAG, "Done"); vTaskDelete(NULL); diff --git a/components/usb/test_apps/usb_host/main/msc_client_async_enum.c b/components/usb/test_apps/usb_host/main/msc_client_async_enum.c index f0a72bd69c5d..ee2161da6c79 100644 --- a/components/usb/test_apps/usb_host/main/msc_client_async_enum.c +++ b/components/usb/test_apps/usb_host/main/msc_client_async_enum.c @@ -12,7 +12,7 @@ #include "freertos/task.h" #include "esp_err.h" #include "esp_log.h" -#include "test_usb_mock_msc.h" +#include "mock_msc.h" #include "test_usb_common.h" #include "msc_client.h" #include "usb/usb_host.h" @@ -60,7 +60,7 @@ static void msc_client_event_cb(const usb_host_client_event_msg_t *event_msg, vo msc_obj->dev_addr_to_open = event_msg->new_dev.address; break; default: - abort(); //Should never occur in this test + abort(); // Should never occur in this test break; } @@ -75,7 +75,7 @@ void msc_client_async_enum_task(void *arg) msc_obj.dev_addr_to_open = 0; msc_obj.dev_hdl = NULL; - //Register client + // Register client usb_host_client_config_t client_config = { .is_synchronous = false, .max_num_event_msg = MSC_ASYNC_CLIENT_MAX_EVENT_MSGS, @@ -86,7 +86,7 @@ void msc_client_async_enum_task(void *arg) }; TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_register(&client_config, &msc_obj.client_hdl)); - //Wait to be started by main thread + // Wait to be started by main thread ulTaskNotifyTake(pdTRUE, portMAX_DELAY); ESP_LOGD(MSC_CLIENT_TAG, "Starting"); @@ -105,44 +105,44 @@ void msc_client_async_enum_task(void *arg) switch (msc_obj.cur_stage) { case TEST_STAGE_WAIT_CONN: { - //Wait for connection, nothing to do + // Wait for connection, nothing to do break; } case TEST_STAGE_DEV_OPEN: { ESP_LOGD(MSC_CLIENT_TAG, "Open"); - //Open the device + // Open the device TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_open(msc_obj.client_hdl, msc_obj.dev_addr_to_open, &msc_obj.dev_hdl)); msc_obj.next_stage = TEST_STAGE_CHECK_DEV_DESC; - skip_event_handling = true; //Need to execute TEST_STAGE_CHECK_DEV_DESC + skip_event_handling = true; // Need to execute TEST_STAGE_CHECK_DEV_DESC break; } case TEST_STAGE_CHECK_DEV_DESC: { - //Check the device descriptor + // Check the device descriptor const usb_device_desc_t *device_desc; const usb_device_desc_t *device_desc_ref = &mock_msc_scsi_dev_desc; TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_device_descriptor(msc_obj.dev_hdl, &device_desc)); TEST_ASSERT_EQUAL(device_desc_ref->bLength, device_desc->bLength); TEST_ASSERT_EQUAL_MEMORY_MESSAGE(device_desc_ref, device_desc, device_desc_ref->bLength, "Device descriptors do not match."); msc_obj.next_stage = TEST_STAGE_CHECK_CONFIG_DESC; - skip_event_handling = true; //Need to execute TEST_STAGE_CHECK_CONFIG_DESC + skip_event_handling = true; // Need to execute TEST_STAGE_CHECK_CONFIG_DESC break; } case TEST_STAGE_CHECK_CONFIG_DESC: { - //Check the configuration descriptor + // Check the configuration descriptor const usb_config_desc_t *config_desc; const usb_config_desc_t *config_desc_ref = (const usb_config_desc_t *)mock_msc_scsi_config_desc; TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_active_config_descriptor(msc_obj.dev_hdl, &config_desc)); - TEST_ASSERT_EQUAL_MESSAGE(config_desc_ref->wTotalLength, config_desc->wTotalLength, "Incorrent length of CFG descriptor"); + TEST_ASSERT_EQUAL_MESSAGE(config_desc_ref->wTotalLength, config_desc->wTotalLength, "Incorrect length of CFG descriptor"); TEST_ASSERT_EQUAL_MEMORY_MESSAGE(config_desc_ref, config_desc, config_desc_ref->wTotalLength, "Configuration descriptors do not match"); msc_obj.next_stage = TEST_STAGE_CHECK_STR_DESC; - skip_event_handling = true; //Need to execute TEST_STAGE_CHECK_STR_DESC + skip_event_handling = true; // Need to execute TEST_STAGE_CHECK_STR_DESC break; } case TEST_STAGE_CHECK_STR_DESC: { usb_device_info_t dev_info; TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_info(msc_obj.dev_hdl, &dev_info)); - //Check manufacturer string descriptors + // Check manufacturer string descriptors const usb_str_desc_t *manu_str_desc_ref = (const usb_str_desc_t *)mock_msc_scsi_str_desc_manu; const usb_str_desc_t *product_str_desc_ref = (const usb_str_desc_t *)mock_msc_scsi_str_desc_prod; const usb_str_desc_t *ser_num_str_desc_ref = (const usb_str_desc_t *)mock_msc_scsi_str_desc_ser_num; @@ -151,10 +151,10 @@ void msc_client_async_enum_task(void *arg) TEST_ASSERT_EQUAL(ser_num_str_desc_ref->bLength, dev_info.str_desc_serial_num->bLength); TEST_ASSERT_EQUAL_MEMORY_MESSAGE(manu_str_desc_ref, dev_info.str_desc_manufacturer, manu_str_desc_ref->bLength, "Manufacturer string descriptors do not match."); TEST_ASSERT_EQUAL_MEMORY_MESSAGE(product_str_desc_ref, dev_info.str_desc_product, manu_str_desc_ref->bLength, "Product string descriptors do not match."); - //TEST_ASSERT_EQUAL_MEMORY_MESSAGE(ser_num_str_desc_ref, dev_info.str_desc_serial_num , manu_str_desc_ref->bLength, "Serial number string descriptors do not match."); - //Get dev info and compare + // TEST_ASSERT_EQUAL_MEMORY_MESSAGE(ser_num_str_desc_ref, dev_info.str_desc_serial_num , manu_str_desc_ref->bLength, "Serial number string descriptors do not match."); + // Get dev info and compare msc_obj.next_stage = TEST_STAGE_DEV_CLOSE; - skip_event_handling = true; //Need to execute TEST_STAGE_DEV_CLOSE + skip_event_handling = true; // Need to execute TEST_STAGE_DEV_CLOSE break; } @@ -163,11 +163,11 @@ void msc_client_async_enum_task(void *arg) TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_close(msc_obj.client_hdl, msc_obj.dev_hdl)); enum_iter++; if (enum_iter < TEST_ENUM_ITERATIONS) { - //Start the next test iteration by disconnecting the device, then going back to TEST_STAGE_WAIT_CONN stage + // Start the next test iteration by disconnecting the device, then going back to TEST_STAGE_WAIT_CONN stage test_usb_set_phy_state(false, 0); test_usb_set_phy_state(true, 0); msc_obj.next_stage = TEST_STAGE_WAIT_CONN; - skip_event_handling = true; //Need to execute TEST_STAGE_WAIT_CONN + skip_event_handling = true; // Need to execute TEST_STAGE_WAIT_CONN } else { exit_loop = true; } @@ -178,7 +178,7 @@ void msc_client_async_enum_task(void *arg) break; } } - //Free transfers and deregister the client + // Free transfers and deregister the client TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_deregister(msc_obj.client_hdl)); ESP_LOGD(MSC_CLIENT_TAG, "Done"); vTaskDelete(NULL); diff --git a/components/usb/test_apps/usb_host/main/msc_client_async_seq.c b/components/usb/test_apps/usb_host/main/msc_client_async_seq.c index 6eff7d3d3d3a..4db69f4fff1a 100644 --- a/components/usb/test_apps/usb_host/main/msc_client_async_seq.c +++ b/components/usb/test_apps/usb_host/main/msc_client_async_seq.c @@ -13,7 +13,7 @@ #include "esp_err.h" #include "esp_log.h" #include "test_usb_common.h" -#include "test_usb_mock_msc.h" +#include "mock_msc.h" #include "msc_client.h" #include "usb/usb_host.h" #include "unity.h" @@ -60,28 +60,28 @@ static void msc_transfer_cb(usb_transfer_t *transfer) msc_client_obj_t *msc_obj = (msc_client_obj_t *)transfer->context; switch (msc_obj->cur_stage) { case TEST_STAGE_MSC_RESET: { - //Check MSC SCSI interface reset + // Check MSC SCSI interface reset TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, transfer->status, "Transfer NOT completed"); TEST_ASSERT_EQUAL(transfer->num_bytes, transfer->actual_num_bytes); msc_obj->next_stage = TEST_STAGE_MSC_CBW; break; } case TEST_STAGE_MSC_CBW: { - //Check MSC SCSI CBW transfer + // Check MSC SCSI CBW transfer TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, transfer->status, "Transfer NOT completed"); TEST_ASSERT_EQUAL(sizeof(mock_msc_bulk_cbw_t), transfer->actual_num_bytes); msc_obj->next_stage = TEST_STAGE_MSC_DATA; break; } case TEST_STAGE_MSC_DATA: { - //Check MSC SCSI data IN transfer + // Check MSC SCSI data IN transfer TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, transfer->status, "Transfer NOT completed"); TEST_ASSERT_EQUAL(MOCK_MSC_SCSI_SECTOR_SIZE * msc_obj->test_param.num_sectors_per_xfer, transfer->actual_num_bytes); msc_obj->next_stage = TEST_STAGE_MSC_CSW; break; } case TEST_STAGE_MSC_CSW: { - //Check MSC SCSI CSW transfer + // Check MSC SCSI CSW transfer TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, transfer->status, "Transfer NOT completed"); TEST_ASSERT_TRUE(mock_msc_scsi_check_csw((mock_msc_bulk_csw_t *)transfer->data_buffer, msc_obj->test_param.msc_scsi_xfer_tag)); msc_obj->num_sectors_read += msc_obj->test_param.num_sectors_per_xfer; @@ -109,7 +109,7 @@ static void msc_client_event_cb(const usb_host_client_event_msg_t *event_msg, vo msc_obj->dev_addr_to_open = event_msg->new_dev.address; break; default: - abort(); //Should never occur in this test + abort(); // Should never occur in this test break; } @@ -126,7 +126,7 @@ void msc_client_async_seq_task(void *arg) msc_obj.dev_hdl = NULL; msc_obj.num_sectors_read = 0; - //Register client + // Register client usb_host_client_config_t client_config = { .is_synchronous = false, .max_num_event_msg = MSC_ASYNC_CLIENT_MAX_EVENT_MSGS, @@ -137,9 +137,9 @@ void msc_client_async_seq_task(void *arg) }; TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_register(&client_config, &msc_obj.client_hdl)); - //Allocate transfers - usb_transfer_t *xfer_out = NULL; //Must be large enough to contain CBW and MSC reset control transfer - usb_transfer_t *xfer_in = NULL; //Must be large enough to contain CSW and Data + // Allocate transfers + usb_transfer_t *xfer_out = NULL; // Must be large enough to contain CBW and MSC reset control transfer + usb_transfer_t *xfer_in = NULL; // Must be large enough to contain CSW and Data size_t out_worst_case_size = MAX(sizeof(mock_msc_bulk_cbw_t), sizeof(usb_setup_packet_t)); size_t in_worst_case_size = usb_round_up_to_mps(MAX(MOCK_MSC_SCSI_SECTOR_SIZE * msc_obj.test_param.num_sectors_per_xfer, sizeof(mock_msc_bulk_csw_t)), MOCK_MSC_SCSI_BULK_EP_MPS); TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_alloc(out_worst_case_size, 0, &xfer_out)); @@ -149,7 +149,7 @@ void msc_client_async_seq_task(void *arg) xfer_out->context = (void *)&msc_obj; xfer_in->context = (void *)&msc_obj; - //Wait to be started by main thread + // Wait to be started by main thread ulTaskNotifyTake(pdTRUE, portMAX_DELAY); ESP_LOGD(MSC_CLIENT_TAG, "Starting"); @@ -168,32 +168,32 @@ void msc_client_async_seq_task(void *arg) switch (msc_obj.cur_stage) { case TEST_STAGE_DEV_OPEN: { ESP_LOGD(MSC_CLIENT_TAG, "Open"); - //Open the device + // Open the device TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_open(msc_obj.client_hdl, msc_obj.dev_addr_to_open, &msc_obj.dev_hdl)); - //Target our transfers to the device + // Target our transfers to the device xfer_out->device_handle = msc_obj.dev_hdl; xfer_in->device_handle = msc_obj.dev_hdl; - //Check the VID/PID of the opened device + // Check the VID/PID of the opened device const usb_device_desc_t *device_desc; TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_device_descriptor(msc_obj.dev_hdl, &device_desc)); TEST_ASSERT_EQUAL(msc_obj.test_param.idVendor, device_desc->idVendor); TEST_ASSERT_EQUAL(msc_obj.test_param.idProduct, device_desc->idProduct); - //Claim the MSC interface + // Claim the MSC interface TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_claim(msc_obj.client_hdl, msc_obj.dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER, MOCK_MSC_SCSI_INTF_ALT_SETTING)); msc_obj.next_stage = TEST_STAGE_MSC_RESET; - skip_event_handling = true; //Need to execute TEST_STAGE_MSC_RESET + skip_event_handling = true; // Need to execute TEST_STAGE_MSC_RESET break; } case TEST_STAGE_MSC_RESET: { ESP_LOGD(MSC_CLIENT_TAG, "MSC Reset"); - //Send an MSC SCSI interface reset + // Send an MSC SCSI interface reset MOCK_MSC_SCSI_REQ_INIT_RESET((usb_setup_packet_t *)xfer_out->data_buffer, MOCK_MSC_SCSI_INTF_NUMBER); xfer_out->num_bytes = sizeof(usb_setup_packet_t); xfer_out->bEndpointAddress = 0; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit_control(msc_obj.client_hdl, xfer_out)); - //Test that an inflight control transfer cannot be resubmitted + // Test that an inflight control transfer cannot be resubmitted TEST_ASSERT_EQUAL(ESP_ERR_NOT_FINISHED, usb_host_transfer_submit_control(msc_obj.client_hdl, xfer_out)); - //Next stage set from transfer callback + // Next stage set from transfer callback break; } case TEST_STAGE_MSC_CBW: { @@ -202,9 +202,9 @@ void msc_client_async_seq_task(void *arg) xfer_out->num_bytes = sizeof(mock_msc_bulk_cbw_t); xfer_out->bEndpointAddress = MOCK_MSC_SCSI_BULK_OUT_EP_ADDR; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit(xfer_out)); - //Test that an inflight transfer cannot be resubmitted + // Test that an inflight transfer cannot be resubmitted TEST_ASSERT_EQUAL(ESP_ERR_NOT_FINISHED, usb_host_transfer_submit(xfer_out)); - //Next stage set from transfer callback + // Next stage set from transfer callback break; } case TEST_STAGE_MSC_DATA: { @@ -212,9 +212,9 @@ void msc_client_async_seq_task(void *arg) xfer_in->num_bytes = usb_round_up_to_mps(MOCK_MSC_SCSI_SECTOR_SIZE * msc_obj.test_param.num_sectors_per_xfer, MOCK_MSC_SCSI_BULK_EP_MPS); xfer_in->bEndpointAddress = MOCK_MSC_SCSI_BULK_IN_EP_ADDR; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit(xfer_in)); - //Test that an inflight transfer cannot be resubmitted + // Test that an inflight transfer cannot be resubmitted TEST_ASSERT_EQUAL(ESP_ERR_NOT_FINISHED, usb_host_transfer_submit(xfer_in)); - //Next stage set from transfer callback + // Next stage set from transfer callback break; } case TEST_STAGE_MSC_CSW: { @@ -222,9 +222,9 @@ void msc_client_async_seq_task(void *arg) xfer_in->num_bytes = usb_round_up_to_mps(sizeof(mock_msc_bulk_csw_t), MOCK_MSC_SCSI_BULK_EP_MPS); xfer_in->bEndpointAddress = MOCK_MSC_SCSI_BULK_IN_EP_ADDR; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit(xfer_in)); - //Test that an inflight transfer cannot be resubmitted + // Test that an inflight transfer cannot be resubmitted TEST_ASSERT_EQUAL(ESP_ERR_NOT_FINISHED, usb_host_transfer_submit(xfer_in)); - //Next stage set from transfer callback + // Next stage set from transfer callback break; } case TEST_STAGE_DEV_CLOSE: { @@ -239,7 +239,7 @@ void msc_client_async_seq_task(void *arg) break; } } - //Free transfers and deregister the client + // Free transfers and deregister the client TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_free(xfer_out)); TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_free(xfer_in)); TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_deregister(msc_obj.client_hdl)); diff --git a/components/usb/test_apps/usb_host/main/test_app_main.c b/components/usb/test_apps/usb_host/main/test_app_main.c index 6a2363359549..3301425ab1ed 100644 --- a/components/usb/test_apps/usb_host/main/test_app_main.c +++ b/components/usb/test_apps/usb_host/main/test_app_main.c @@ -11,17 +11,17 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "test_usb_common.h" -#include "test_usb_mock_msc.h" +#include "mock_msc.h" #include "usb/usb_host.h" void setUp(void) { mock_msc_scsi_init_reference_descriptors(); unity_utils_record_free_mem(); - test_usb_init_phy(); //Initialize the internal USB PHY and USB Controller for testing - //Install USB Host + test_usb_init_phy(); // Initialize the internal USB PHY and USB Controller for testing + // Install USB Host usb_host_config_t host_config = { - .skip_phy_setup = true, //test_usb_init_phy() will already have setup the internal USB PHY for us + .skip_phy_setup = true, // test_usb_init_phy() will already have setup the internal USB PHY for us .intr_flags = ESP_INTR_FLAG_LEVEL1, }; ESP_ERROR_CHECK(usb_host_install(&host_config)); @@ -30,11 +30,11 @@ void setUp(void) void tearDown(void) { - //Short delay to allow task to be cleaned up + // Short delay to allow task to be cleaned up vTaskDelay(10); - //Clean up USB Host + // Clean up USB Host ESP_ERROR_CHECK(usb_host_uninstall()); - test_usb_deinit_phy(); //Deinitialize the internal USB PHY after testing + test_usb_deinit_phy(); // Deinitialize the internal USB PHY after testing unity_utils_evaluate_leaks(); } diff --git a/components/usb/test_apps/usb_host/main/test_usb_host_async.c b/components/usb/test_apps/usb_host/main/test_usb_host_async.c index 6e5b9cef0ef8..dbd9bad90318 100644 --- a/components/usb/test_apps/usb_host/main/test_usb_host_async.c +++ b/components/usb/test_apps/usb_host/main/test_usb_host_async.c @@ -11,7 +11,7 @@ #include "esp_err.h" #include "esp_intr_alloc.h" #include "test_usb_common.h" -#include "test_usb_mock_msc.h" +#include "mock_msc.h" #include "msc_client.h" #include "ctrl_client.h" #include "usb/usb_host.h" @@ -46,7 +46,7 @@ Requires: This test requires an MSC SCSI device to be attached (see the MSC mock TEST_CASE("Test USB Host async client (single client)", "[usb_host][full_speed]") { - //Create task to run client that communicates with MSC SCSI interface + // Create task to run client that communicates with MSC SCSI interface msc_client_test_param_t params = { .num_sectors_to_read = TEST_MSC_NUM_SECTORS_TOTAL, .num_sectors_per_xfer = TEST_MSC_NUM_SECTORS_PER_XFER, @@ -57,11 +57,11 @@ TEST_CASE("Test USB Host async client (single client)", "[usb_host][full_speed]" TaskHandle_t task_hdl; xTaskCreatePinnedToCore(msc_client_async_seq_task, "async", 4096, (void *)¶ms, 2, &task_hdl, 0); TEST_ASSERT_NOT_NULL_MESSAGE(task_hdl, "Failed to create async task"); - //Start the task + // Start the task xTaskNotifyGive(task_hdl); while (1) { - //Start handling system events + // Start handling system events uint32_t event_flags; usb_host_lib_handle_events(portMAX_DELAY, &event_flags); if (event_flags & USB_HOST_LIB_EVENT_FLAGS_NO_CLIENTS) { @@ -96,7 +96,7 @@ Requires: This test requires an MSC SCSI device to be attached (see the MSC mock */ TEST_CASE("Test USB Host async client (multi client)", "[usb_host][full_speed]") { - //Create task to run the MSC client + // Create task to run the MSC client msc_client_test_param_t msc_params = { .num_sectors_to_read = TEST_MSC_NUM_SECTORS_TOTAL, .num_sectors_per_xfer = TEST_MSC_NUM_SECTORS_PER_XFER, @@ -108,7 +108,7 @@ TEST_CASE("Test USB Host async client (multi client)", "[usb_host][full_speed]") xTaskCreatePinnedToCore(msc_client_async_seq_task, "msc", 4096, (void *)&msc_params, 2, &msc_task_hdl, 0); TEST_ASSERT_NOT_NULL_MESSAGE(msc_task_hdl, "Failed to create MSC task"); - //Create task a control transfer client + // Create task a control transfer client ctrl_client_test_param_t ctrl_params = { .num_ctrl_xfer_to_send = TEST_CTRL_NUM_TRANSFERS, .idVendor = MOCK_MSC_SCSI_DEV_ID_VENDOR, @@ -118,12 +118,12 @@ TEST_CASE("Test USB Host async client (multi client)", "[usb_host][full_speed]") xTaskCreatePinnedToCore(ctrl_client_async_seq_task, "ctrl", 4096, (void *)&ctrl_params, 2, &ctrl_task_hdl, 0); TEST_ASSERT_NOT_NULL_MESSAGE(ctrl_task_hdl, "Failed to create CTRL task"); - //Start both tasks + // Start both tasks xTaskNotifyGive(msc_task_hdl); xTaskNotifyGive(ctrl_task_hdl); while (1) { - //Start handling system events + // Start handling system events uint32_t event_flags; usb_host_lib_handle_events(portMAX_DELAY, &event_flags); if (event_flags & USB_HOST_LIB_EVENT_FLAGS_NO_CLIENTS) { @@ -188,7 +188,7 @@ static void test_async_client_cb(const usb_host_client_event_msg_t *event_msg, v TEST_CASE("Test USB Host async API", "[usb_host][full_speed][low_speed]") { - //Register two clients + // Register two clients client_test_stage_t client0_stage = CLIENT_TEST_STAGE_NONE; client_test_stage_t client1_stage = CLIENT_TEST_STAGE_NONE; @@ -206,7 +206,7 @@ TEST_CASE("Test USB Host async API", "[usb_host][full_speed][low_speed]") client_config.async.callback_arg = (void *)&client1_stage; TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_register(&client_config, &client1_hdl)); - //Wait until the device connects and the clients receive the event + // Wait until the device connects and the clients receive the event while (!(client0_stage == CLIENT_TEST_STAGE_CONN && client1_stage == CLIENT_TEST_STAGE_CONN)) { usb_host_lib_handle_events(0, NULL); usb_host_client_handle_events(client0_hdl, 0); @@ -214,35 +214,35 @@ TEST_CASE("Test USB Host async API", "[usb_host][full_speed][low_speed]") vTaskDelay(pdMS_TO_TICKS(10)); } - //Check that both clients can open the device + // Check that both clients can open the device TEST_ASSERT_NOT_EQUAL(0, dev_addr); usb_device_handle_t client0_dev_hdl; usb_device_handle_t client1_dev_hdl; printf("Opening device\n"); TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_open(client0_hdl, dev_addr, &client0_dev_hdl)); TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_open(client1_hdl, dev_addr, &client1_dev_hdl)); - TEST_ASSERT_EQUAL_PTR(client0_dev_hdl, client1_dev_hdl); //Check that its the same device - //Check that a client cannot open a non-existent device + TEST_ASSERT_EQUAL_PTR(client0_dev_hdl, client1_dev_hdl); // Check that its the same device + // Check that a client cannot open a non-existent device TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_device_open(client0_hdl, 0, &client0_dev_hdl)); - //Check that the device cannot be opened again by the same client + // Check that the device cannot be opened again by the same client usb_device_handle_t dummy_dev_hdl; TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_device_open(client0_hdl, dev_addr, &dummy_dev_hdl)); TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_device_open(client1_hdl, dev_addr, &dummy_dev_hdl)); printf("Claiming interface\n"); - //Check that both clients cannot claim the same interface + // Check that both clients cannot claim the same interface TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_claim(client0_hdl, client0_dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER, MOCK_MSC_SCSI_INTF_ALT_SETTING)); TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_interface_claim(client1_hdl, client1_dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER, MOCK_MSC_SCSI_INTF_ALT_SETTING)); - //Check that client0 cannot claim the same interface multiple times + // Check that client0 cannot claim the same interface multiple times TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_interface_claim(client0_hdl, client0_dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER, MOCK_MSC_SCSI_INTF_ALT_SETTING)); printf("Releasing interface\n"); - //Check that client0 can release the interface + // Check that client0 can release the interface TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_release(client0_hdl, client0_dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER)); - //Check that client0 cannot release interface it has not claimed + // Check that client0 cannot release interface it has not claimed TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_interface_release(client0_hdl, client0_dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER)); - //Wait until the device disconnects and the clients receive the event + // Wait until the device disconnects and the clients receive the event test_usb_set_phy_state(false, 0); while (!(client0_stage == CLIENT_TEST_STAGE_DCONN && client1_stage == CLIENT_TEST_STAGE_DCONN)) { usb_host_lib_handle_events(0, NULL); @@ -254,7 +254,7 @@ TEST_CASE("Test USB Host async API", "[usb_host][full_speed][low_speed]") TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_close(client0_hdl, client0_dev_hdl)); TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_close(client1_hdl, client1_dev_hdl)); - //Deregister the clients + // Deregister the clients TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_deregister(client0_hdl)); TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_deregister(client1_hdl)); diff --git a/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c b/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c index 5851988f4215..6be17aa848a1 100644 --- a/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c +++ b/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c @@ -10,7 +10,7 @@ #include "esp_err.h" #include "esp_intr_alloc.h" #include "test_usb_common.h" -#include "test_usb_mock_msc.h" +#include "mock_msc.h" #include "msc_client.h" #include "ctrl_client.h" #include "usb/usb_host.h" @@ -38,24 +38,24 @@ TEST_CASE("Test USB Host sudden disconnection (no client)", "[usb_host][full_spe bool connected = false; int dconn_iter = 0; while (1) { - //Start handling system events + // Start handling system events uint32_t event_flags; usb_host_lib_handle_events(portMAX_DELAY, &event_flags); if (!connected) { usb_host_lib_info_t lib_info; TEST_ASSERT_EQUAL(ESP_OK, usb_host_lib_info(&lib_info)); if (lib_info.num_devices == 1) { - //We've just connected. Trigger a disconnect + // We've just connected. Trigger a disconnect connected = true; printf("Forcing Sudden Disconnect\n"); test_usb_set_phy_state(false, 0); } } if (event_flags & USB_HOST_LIB_EVENT_FLAGS_ALL_FREE) { - //The device has disconnected and it's disconnection has been handled + // The device has disconnected and it's disconnection has been handled printf("Dconn iter %d done\n", dconn_iter); if (++dconn_iter < TEST_DCONN_NO_CLIENT_ITERATIONS) { - //Start next iteration + // Start next iteration connected = false; test_usb_set_phy_state(true, 0); } else { @@ -83,9 +83,9 @@ Test USB Host Library Sudden Disconnection Handling (with client) TEST_CASE("Test USB Host sudden disconnection (single client)", "[usb_host][full_speed]") { - //Create task to run client that communicates with MSC SCSI interface + // Create task to run client that communicates with MSC SCSI interface msc_client_test_param_t params = { - .num_sectors_to_read = 1, //Unused by disconnect MSC client + .num_sectors_to_read = 1, // Unused by disconnect MSC client .num_sectors_per_xfer = TEST_FORCE_DCONN_NUM_TRANSFERS * MOCK_MSC_SCSI_SECTOR_SIZE, .msc_scsi_xfer_tag = TEST_MSC_SCSI_TAG, .idVendor = MOCK_MSC_SCSI_DEV_ID_VENDOR, @@ -93,13 +93,13 @@ TEST_CASE("Test USB Host sudden disconnection (single client)", "[usb_host][full }; TaskHandle_t task_hdl; xTaskCreatePinnedToCore(msc_client_async_dconn_task, "async", 4096, (void *)¶ms, 2, &task_hdl, 0); - //Start the task + // Start the task xTaskNotifyGive(task_hdl); bool all_clients_gone = false; bool all_dev_free = false; while (!all_clients_gone || !all_dev_free) { - //Start handling system events + // Start handling system events uint32_t event_flags; usb_host_lib_handle_events(portMAX_DELAY, &event_flags); if (event_flags & USB_HOST_LIB_EVENT_FLAGS_NO_CLIENTS) { @@ -133,16 +133,16 @@ Test USB Host Library Enumeration TEST_CASE("Test USB Host enumeration", "[usb_host][full_speed]") { - //Create task to run client that checks the enumeration of the device + // Create task to run client that checks the enumeration of the device TaskHandle_t task_hdl; xTaskCreatePinnedToCore(msc_client_async_enum_task, "async", 6144, NULL, 2, &task_hdl, 0); - //Start the task + // Start the task xTaskNotifyGive(task_hdl); bool all_clients_gone = false; bool all_dev_free = false; while (!all_clients_gone || !all_dev_free) { - //Start handling system events + // Start handling system events uint32_t event_flags; usb_host_lib_handle_events(portMAX_DELAY, &event_flags); if (event_flags & USB_HOST_LIB_EVENT_FLAGS_NO_CLIENTS) { From c66f46cb7713a8f9c009f9b7b11936171a3f70a1 Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Wed, 8 May 2024 02:56:16 +0800 Subject: [PATCH 03/56] refactor(usb): Split test device descriptors from mock class files Previously, descriptors of the test devices were stored direclty in the mock device files (e.g., "mock_[hid|msc].[h|c]"). This commit splits out the device descriptors to separate files (e.g., "dev_[hid|msc].c") along with getter functions. Users that want to run the tests locally on a different device simply need to update the "dev_[hid|msc].c" file for their device. --- .../usb/test_apps/common/CMakeLists.txt | 4 +- components/usb/test_apps/common/dev_hid.c | 232 ++++++++++++ components/usb/test_apps/common/dev_hid.h | 80 ++++ components/usb/test_apps/common/dev_isoc.c | 27 ++ components/usb/test_apps/common/dev_isoc.h | 36 ++ components/usb/test_apps/common/dev_msc.c | 354 ++++++++++++++++++ components/usb/test_apps/common/dev_msc.h | 118 ++++++ components/usb/test_apps/common/mock_hid.c | 42 --- components/usb/test_apps/common/mock_hid.h | 112 ------ components/usb/test_apps/common/mock_msc.c | 112 +----- components/usb/test_apps/common/mock_msc.h | 137 +------ .../usb/test_apps/hcd/main/test_app_main.c | 7 +- .../usb/test_apps/hcd/main/test_hcd_bulk.c | 29 +- .../usb/test_apps/hcd/main/test_hcd_intr.c | 17 +- .../usb/test_apps/hcd/main/test_hcd_isoc.c | 48 +-- .../usb/test_apps/usb_host/main/ctrl_client.h | 2 - .../usb_host/main/ctrl_client_async_seq.c | 29 +- .../usb/test_apps/usb_host/main/msc_client.h | 2 - .../usb_host/main/msc_client_async_dconn.c | 69 ++-- .../usb_host/main/msc_client_async_enum.c | 24 +- .../usb_host/main/msc_client_async_seq.c | 109 ++++-- .../test_apps/usb_host/main/test_app_main.c | 7 +- .../usb_host/main/test_usb_host_async.c | 34 +- .../usb_host/main/test_usb_host_plugging.c | 8 +- 24 files changed, 1123 insertions(+), 516 deletions(-) create mode 100644 components/usb/test_apps/common/dev_hid.c create mode 100644 components/usb/test_apps/common/dev_hid.h create mode 100644 components/usb/test_apps/common/dev_isoc.c create mode 100644 components/usb/test_apps/common/dev_isoc.h create mode 100644 components/usb/test_apps/common/dev_msc.c create mode 100644 components/usb/test_apps/common/dev_msc.h delete mode 100644 components/usb/test_apps/common/mock_hid.c delete mode 100644 components/usb/test_apps/common/mock_hid.h diff --git a/components/usb/test_apps/common/CMakeLists.txt b/components/usb/test_apps/common/CMakeLists.txt index ce2bfb32b3a6..047989446dad 100644 --- a/components/usb/test_apps/common/CMakeLists.txt +++ b/components/usb/test_apps/common/CMakeLists.txt @@ -1,4 +1,6 @@ -idf_component_register(SRCS "mock_hid.c" +idf_component_register(SRCS "dev_hid.c" + "dev_isoc.c" + "dev_msc.c" "mock_msc.c" "test_usb_common.c" INCLUDE_DIRS "." diff --git a/components/usb/test_apps/common/dev_hid.c b/components/usb/test_apps/common/dev_hid.c new file mode 100644 index 000000000000..91d52a67b7cf --- /dev/null +++ b/components/usb/test_apps/common/dev_hid.c @@ -0,0 +1,232 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "usb/usb_types_ch9.h" +#include "usb/usb_types_stack.h" +#include "dev_hid.h" + +/* +Some tests where the ESP (acting as host) will require that a particular test +device acting as an HID mouse be connected. That test device's information and descriptors are defined in this file. + +If you are connecting a different HID mouse, please update the descriptor and +getter functions accordingly. + +------------------------------ Device Descriptor ------------------------------- +bLength : 0x12 (18 bytes) +bDescriptorType : 0x01 (Device Descriptor) +bcdUSB : 0x0210 (2.00) +bDeviceClass : 0x00 +bDeviceSubClass : 0x00 +bDeviceProtocol : 0x00 +bMaxPacketSize0 : 0x08 (8 bytes) +idVendor : 0x413C (Dell Computer Corp) +idProduct : 0x301A (Dell MS116 Optical Mouse) +bcdDevice : 0x0100 (1.00) +iManufacturer : 1 +iProduct : 2 +iSerial : 0 +bNumConfigurations : 1 + +--------------------------- Configuration Descriptor --------------------------- +bLength : 0x09 (9 bytes) +bDescriptorType : 0x02 (Configuration Descriptor) +wTotalLength : 0x0022 (34 bytes) +bNumInterfaces : 0x01 (1 Interface) +bConfigurationValue : 0x01 (Configuration 1) +iConfiguration : 0x00 (No String Descriptor) +bmAttributes : 0xA0 + D7: Reserved, set 1 : 0x01 + D6: Self Powered : 0x00 (no) + D5: Remote Wakeup : 0x01 (yes) + D4..0: Reserved, set 0 : 0x00 +MaxPower : 0x32 (100 mA) + +Data (HexDump) : 09 02 3B 00 02 01 00 A0 32 09 04 00 00 01 03 01 + 02 00 09 21 00 02 00 01 22 4D 00 07 05 81 03 08 + 00 0A 09 04 01 00 01 03 01 01 00 09 21 00 02 00 + 01 22 31 00 07 05 82 03 08 00 0A + +----------------------------- Interface Descriptor ----------------------------- +bLength : 0x09 (9 bytes) +bDescriptorType : 0x04 (Interface Descriptor) +bInterfaceNumber : 0x00 +bAlternateSetting : 0x00 +bNumEndpoints : 0x01 (1 Endpoint) +bInterfaceClass : 0x03 (HID - Human Interface Device) +bInterfaceSubClass : 0x01 (Boot Interface) +bInterfaceProtocol : 0x02 (Mouse) +iInterface : 0x00 (No String Descriptor) + +-------------------------------- HID Descriptor -------------------------------- +bLength : 0x09 (9 bytes) +bDescriptorType : 0x21 (HID Descriptor) +bcdHID : 0x0200 (HID Version 2.00) +bCountryCode : 0x00 (00 = not localized) +bNumDescriptors : 0x01 +Descriptor 1: +bDescriptorType : 0x22 (Class=Report) +wDescriptorLength : 0x004D (77 bytes) + +------------------------------ Endpoint Descriptor ----------------------------- +bLength : 0x07 (7 bytes) +bDescriptorType : 0x05 (Endpoint Descriptor) +bEndpointAddress : 0x81 (Direction=IN EndpointID=1) +bmAttributes : 0x03 (TransferType=Interrupt) +wMaxPacketSize : 0x0008 +bInterval : 0x0A (10 ms) + +---------------------------- String Descriptor Manu ---------------------------- +bLength : 0x0E (14 bytes) +bDescriptorType : 0x03 (String Descriptor) +wData : "PixArt" + +---------------------------- String Descriptor Prod ---------------------------- +bLength : 0x3A (58 bytes) +bDescriptorType : 0x03 (String Descriptor) +wData : "Dell MS116 USB Optical Mouse" +*/ + +// ------------------------------- Descriptors --------------------------------- + +static const usb_device_desc_t dev_desc = { + .bLength = USB_DEVICE_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_DEVICE, + .bcdUSB = 0x0210, // 2.10 + .bDeviceClass = USB_CLASS_PER_INTERFACE, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .bMaxPacketSize0 = 64, + .idVendor = 0x413C, // Dell Computer Corp + .idProduct = 0x301A, // Dell MS116 Optical Mouse + .bcdDevice = 0x0100, // 1.00 + .iManufacturer = 1, + .iProduct = 2, + .iSerialNumber = 0, + .bNumConfigurations = 1, +}; + +static const usb_config_desc_t config_desc = { + .bLength = USB_CONFIG_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_CONFIGURATION, + .wTotalLength = 0x0022, // 34 bytes + .bNumInterfaces = 1, + .bConfigurationValue = 1, + .iConfiguration = 0, + .bmAttributes = 0xA0, + .bMaxPower = 0x32, // 100 mA +}; + +static const usb_intf_desc_t intf_desc = { + .bLength = USB_INTF_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_INTERFACE, + .bInterfaceNumber = 0, + .bAlternateSetting = 0, + .bNumEndpoints = 1, + .bInterfaceClass = USB_CLASS_HID, + .bInterfaceSubClass = 0x01, // Boot Interface + .bInterfaceProtocol = 0x02, // Mouse + .iInterface = 0, // (No String Descriptor) +}; + +const usb_ep_desc_t in_ep_desc = { + .bLength = USB_EP_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, + .bEndpointAddress = 0x81, // EP 1 IN + .bmAttributes = USB_BM_ATTRIBUTES_XFER_INT, + .wMaxPacketSize = 0x0008, + .bInterval = 0x0A, // 10 ms +}; + +/* +String descriptors are dynamically initialized due to issues with static +initialization of variable length array members. See IDF-9886. +*/ + +static const usb_str_desc_t str_desc_manu_base = { + .bLength = sizeof(usb_str_desc_t) + (6 * sizeof(uint16_t)), + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_STRING, +}; +static const uint16_t str_desc_manu_data[] = { + 0x0050, // 'P' + 0x0069, // 'i' + 0x0078, // 'x' + 0x0041, // 'A' + 0x0072, // 'r' + 0x0074, // 't' +}; +static uint8_t *str_desc_manu[sizeof(str_desc_manu_base) + sizeof(str_desc_manu_data)]; + +static const usb_str_desc_t str_desc_prod_base = { + .bLength = sizeof(usb_str_desc_t) + (28 * sizeof(uint16_t)), + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_STRING, +}; +static const uint16_t str_desc_prod_data[] = { + /* + The following string encoded in UTF-16LE + + "Dell MS116 USB Optical Mouse" + */ + 0x0044, 0x0065, 0x006c, 0x006c, 0x0020, 0x004d, 0x0053, 0x0031, 0x0031, + 0x0036, 0x0020, 0x0055, 0x0053, 0x0042, 0x0020, 0x004f, 0x0070, 0x0074, + 0x0069, 0x0063, 0x0061, 0x006c, 0x0020, 0x004d, 0x006f, 0x0075, 0x0073, + 0x0065, +}; +static uint8_t *str_desc_prod[sizeof(str_desc_prod_base) + sizeof(str_desc_prod_data)]; + +// -------------------------------- Functions ---------------------------------- + +void dev_hid_init(void) +{ + // Dynamically initialize string descriptors due to compiler limitations (see IDF-9886) + uint8_t *ptr; + + // Initialize manufacturer string descriptor + ptr = (uint8_t *)str_desc_manu; + memcpy(ptr, &str_desc_manu_base, sizeof(str_desc_manu_base)); + ptr += sizeof(str_desc_manu_base); + memcpy(ptr, &str_desc_manu_data, sizeof(str_desc_manu_data)); + + // Initialize product string descriptor + ptr = (uint8_t *)str_desc_prod; + memcpy(ptr, &str_desc_prod_base, sizeof(str_desc_prod_base)); + ptr += sizeof(str_desc_prod_base); + memcpy(ptr, &str_desc_prod_data, sizeof(str_desc_prod_data)); + + // No serial string descriptor +} + +const usb_device_desc_t *dev_hid_get_dev_desc(usb_speed_t speed) +{ + return &dev_desc; +} + +const usb_config_desc_t *dev_hid_get_config_desc(usb_speed_t speed) +{ + return &config_desc; +} + +const usb_intf_desc_t *dev_hid_get_intf_desc(usb_speed_t speed) +{ + return &intf_desc; +} + +const usb_ep_desc_t *dev_hid_get_in_ep_desc(usb_speed_t speed) +{ + return &in_ep_desc; +} + +const usb_str_desc_t *dev_hid_get_str_desc_manu(void) +{ + return (const usb_str_desc_t *)str_desc_manu; +} + +const usb_str_desc_t *dev_hid_get_str_desc_prod(void) +{ + return (const usb_str_desc_t *)str_desc_prod; +} diff --git a/components/usb/test_apps/common/dev_hid.h b/components/usb/test_apps/common/dev_hid.h new file mode 100644 index 000000000000..a0eb581e3d24 --- /dev/null +++ b/components/usb/test_apps/common/dev_hid.h @@ -0,0 +1,80 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include "usb/usb_types_ch9.h" +#include "usb/usb_types_stack.h" + +/* +Some tests where the ESP (acting as host) will require that a particular test +device acting as an HID mouse be connected. That test device's information and descriptors are defined in this file. + +If you are connecting a different device, please update the descriptors in +dev_hid.c accordingly. +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initialize the test device + * + * @note Call this before running tests. This is necessary due to IDF-9886 + */ +void dev_hid_init(void); + +/** + * @brief Get the test device's descriptor + * + * @param[in] speed Test device's current speed + * @return Device descriptor + */ +const usb_device_desc_t *dev_hid_get_dev_desc(usb_speed_t speed); + +/** + * @brief Get the test device's configuration descriptor + * + * @param[in] speed Test device's current speed + * @return Configuration descriptor + */ +const usb_config_desc_t *dev_hid_get_config_desc(usb_speed_t speed); + +/** + * @brief Get the test device's HID interface descriptor + * + * @param[in] speed Test device's current speed + * @return HID interface descriptor + */ +const usb_intf_desc_t *dev_hid_get_intf_desc(usb_speed_t speed); + +/** + * @brief Get the test device's HID interrupt IN endpoint descriptor + * + * @param[in] speed Test device's current speed + * @return Interrupt IN endpoint descriptor + */ +const usb_ep_desc_t *dev_hid_get_in_ep_desc(usb_speed_t speed); + +/** + * @brief Get the test device's manufacturer string descriptor + * + * @return Manufacturer string descriptor + */ +const usb_str_desc_t *dev_hid_get_str_desc_manu(void); + +/** + * @brief Get the test device's product string descriptor + * + * @return Product string descriptor + */ +const usb_str_desc_t *dev_hid_get_str_desc_prod(void); + +#ifdef __cplusplus +} +#endif diff --git a/components/usb/test_apps/common/dev_isoc.c b/components/usb/test_apps/common/dev_isoc.c new file mode 100644 index 000000000000..6cf1eb52f6d5 --- /dev/null +++ b/components/usb/test_apps/common/dev_isoc.c @@ -0,0 +1,27 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "usb/usb_types_ch9.h" +#include "usb/usb_types_stack.h" +#include "dev_isoc.h" + +// ------------------------------- Descriptors --------------------------------- + +static const usb_ep_desc_t isoc_out_ep_desc = { + .bLength = sizeof(usb_ep_desc_t), + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, + .bEndpointAddress = 0x02, // EP 2 OUT + .bmAttributes = USB_BM_ATTRIBUTES_XFER_ISOC, + .wMaxPacketSize = 512, + .bInterval = 1, // Isoc interval is (2 ^ (bInterval - 1)) which means an interval of 1ms +}; + +// -------------------------------- Functions ---------------------------------- + +const usb_ep_desc_t *dev_isoc_get_out_ep_desc(usb_speed_t speed) +{ + return &isoc_out_ep_desc; +} diff --git a/components/usb/test_apps/common/dev_isoc.h b/components/usb/test_apps/common/dev_isoc.h new file mode 100644 index 000000000000..9096179ac373 --- /dev/null +++ b/components/usb/test_apps/common/dev_isoc.h @@ -0,0 +1,36 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include "usb/usb_types_ch9.h" +#include "usb/usb_types_stack.h" + +/* +Some tests where the ESP (acting as host) will require that a particular test +device containing an ISOC endpoint be connected. This header contains +functions to get information and descriptors about that test device. + +If you are connecting a different device, please update the descriptors in +dev_isoc.c accordingly. +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get the test device's ISOC OUT endpoint descriptor + * + * @param[in] speed Test device's current speed + * @return ISOC OUT endpoint descriptor + */ +const usb_ep_desc_t *dev_isoc_get_out_ep_desc(usb_speed_t speed); + +#ifdef __cplusplus +} +#endif diff --git a/components/usb/test_apps/common/dev_msc.c b/components/usb/test_apps/common/dev_msc.c new file mode 100644 index 000000000000..6d5d93d2246e --- /dev/null +++ b/components/usb/test_apps/common/dev_msc.c @@ -0,0 +1,354 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "usb/usb_types_ch9.h" +#include "dev_msc.h" + +/* +Some tests where the ESP (acting as host) will require that a particular test +device acting as a MSC SCSI flash drive be connected. That test device's +information and descriptors are defined in this file. + +If you are connecting a different MSC SCSI flash drive, please update +the descriptor and getter functions accordingly. + +------------------------------ Device Descriptor ------------------------------- +bLength : 0x12 (18 bytes) +bDescriptorType : 0x01 (Device Descriptor) +bcdUSB : 0x0210 (2.10) +bDeviceClass : 0x00 +bDeviceSubClass : 0x00 +bDeviceProtocol : 0x00 +bMaxPacketSize0 : 0x40 (64 bytes) +idVendor : 0x0781 (SanDisk Corp) +idProduct : 0x5595 +bcdDevice : 0x0100 (1.00) +iManufacturer : 1 +iProduct : 2 +iSerial : 3 +bNumConfigurations : 1 + +--------------------------- Configuration Descriptor --------------------------- +bLength : 0x09 (9 bytes) +bDescriptorType : 0x02 (Configuration Descriptor) +wTotalLength : 0x0020 (32 bytes) +bNumInterfaces : 0x01 (1 Interface) +bConfigurationValue : 0x01 (Configuration 1) +iConfiguration : 0x00 (No String Descriptor) +bmAttributes : 0x80 + D7: Reserved, set 1 : 0x01 + D6: Self Powered : 0x00 (no) + D5: Remote Wakeup : 0x00 (no) + D4..0: Reserved, set 0 : 0x00 +MaxPower : 0x70 (224 mA) + +Data (HexDump) : 09 02 20 00 01 01 00 80 70 09 04 00 00 02 08 06 + 50 00 07 05 81 02 00 02 00 07 05 02 02 00 02 00 + +----------------------------- Interface Descriptor ----------------------------- +bLength : 0x09 (9 bytes) +bDescriptorType : 0x04 (Interface Descriptor) +bInterfaceNumber : 0x00 +bAlternateSetting : 0x00 +bNumEndpoints : 0x02 (2 Endpoints) +bInterfaceClass : 0x08 (Mass Storage) +bInterfaceSubClass : 0x06 (SCSI transparent command set) +bInterfaceProtocol : 0x50 (Bulk-Only Transport) +iInterface : 0x00 (No String Descriptor) + +------------------------------ Endpoint Descriptor ----------------------------- +bLength : 0x07 (7 bytes) +bDescriptorType : 0x05 (Endpoint Descriptor) +bEndpointAddress : 0x81 (Direction=IN EndpointID=1) +bmAttributes : 0x02 (TransferType=Bulk) +wMaxPacketSize : 0x0040 (max 64 bytes for FS, 512 bytes for HS) +bInterval : 0x00 (never NAKs) + +------------------------------ Endpoint Descriptor ----------------------------- +bLength : 0x07 (7 bytes) +bDescriptorType : 0x05 (Endpoint Descriptor) +bEndpointAddress : 0x02 (Direction=OUT EndpointID=2) +bmAttributes : 0x02 (TransferType=Bulk) +wMaxPacketSize : 0x0040 (max 64 bytes for FS, 512 bytes for HS) +bInterval : 0x00 (never NAKs) + +---------------------------- String Descriptor Manu ---------------------------- +bLength : 0x0A (10 bytes) +bDescriptorType : 0x03 (String Descriptor) +wData : " USB" + +---------------------------- String Descriptor Prod ---------------------------- +bLength : 0x22 (34 bytes) +bDescriptorType : 0x03 (String Descriptor) +wData : " SanDisk 3.2Gen1" + +----------------------------- String Descriptor Ser ---------------------------- +bLength : 0xF2 (242 bytes) +bDescriptorType : 0x03 (String Descriptor) +wData : "0101cdd1e856b427bbb796f870561a4b2b817af9da9872c8d75217cccdd5d5eccb3a0000000000000000000096abe1a3ff83610095558107aea948b4" +*/ + +// --------------------------- Device Information ------------------------------ + +static const dev_msc_info_t dev_info = { + .bInterfaceNumber = 0x00, + .bAlternateSetting = 0x00, + .in_ep_addr = 0x81, + .out_up_addr = 0x02, + .scsi_sector_size = 512, +}; + +// ------------------------------- Descriptors --------------------------------- + +static const usb_device_desc_t dev_desc = { + .bLength = USB_DEVICE_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_DEVICE, + .bcdUSB = 0x0210, // 2.10 + .bDeviceClass = USB_CLASS_PER_INTERFACE, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .bMaxPacketSize0 = 64, + .idVendor = 0x0781, // SanDisk Corp + .idProduct = 0x5595, + .bcdDevice = 0x0100, // 1.00 + .iManufacturer = 1, + .iProduct = 2, + .iSerialNumber = 3, + .bNumConfigurations = 1, +}; + +static const usb_config_desc_t config_desc = { + .bLength = USB_CONFIG_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_CONFIGURATION, + .wTotalLength = 0x0020, // 32 bytes + .bNumInterfaces = 1, + .bConfigurationValue = 1, + .iConfiguration = 0, + .bmAttributes = 0x80, + .bMaxPower = 0x70, // 224 mA +}; + +static const usb_intf_desc_t intf_desc = { + .bLength = USB_INTF_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_INTERFACE, + .bInterfaceNumber = 0, + .bAlternateSetting = 0, + .bNumEndpoints = 2, + .bInterfaceClass = USB_CLASS_MASS_STORAGE, + .bInterfaceSubClass = 0x06, //SCSI + .bInterfaceProtocol = 0x50, //Bulk only + .iInterface = 0, +}; + +static const usb_ep_desc_t in_ep_desc_fs = { + .bLength = USB_EP_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, + .bEndpointAddress = 0x81, // EP 1 IN + .bmAttributes = USB_BM_ATTRIBUTES_XFER_BULK, + .wMaxPacketSize = 64, + .bInterval = 0, +}; + +static const usb_ep_desc_t in_ep_desc_hs = { + .bLength = USB_EP_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, + .bEndpointAddress = 0x81, // EP 1 IN + .bmAttributes = USB_BM_ATTRIBUTES_XFER_BULK, + .wMaxPacketSize = 512, + .bInterval = 0, +}; + +static const usb_ep_desc_t out_ep_desc_fs = { + .bLength = USB_EP_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, + .bEndpointAddress = 0x02, // EP 2 OUT + .bmAttributes = USB_BM_ATTRIBUTES_XFER_BULK, + .wMaxPacketSize = 64, + .bInterval = 0, +}; + +static const usb_ep_desc_t out_ep_desc_hs = { + .bLength = USB_EP_DESC_SIZE, + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, + .bEndpointAddress = 0x02, // EP 2 OUT + .bmAttributes = USB_BM_ATTRIBUTES_XFER_BULK, + .wMaxPacketSize = 512, + .bInterval = 0, +}; + +/* +String descriptors are dynamically initialized due to issues with static +initialization of variable length array members. See IDF-9886. +*/ + +static const usb_str_desc_t str_desc_manu_base = { + .bLength = sizeof(usb_str_desc_t) + (4 * sizeof(uint16_t)), + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_STRING, +}; +static const uint16_t str_desc_manu_data[] = { + 0x0020, // ' ' + 0x0055, // 'U' + 0x0053, // 'S' + 0x0042, // 'B' +}; +static uint8_t *str_desc_manu[sizeof(str_desc_manu_base) + sizeof(str_desc_manu_data)]; + +static const usb_str_desc_t str_desc_prod_base = { + .bLength = sizeof(usb_str_desc_t) + (16 * sizeof(uint16_t)), + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_STRING, +}; +static const uint16_t str_desc_prod_data[] = { + 0x0020, // ' ' + 0x0053, // 'S' + 0x0061, // 'a' + 0x006e, // 'n' + 0x0044, // 'D' + 0x0069, // 'i' + 0x0073, // 's' + 0x006b, // 'k' + 0x0020, // ' ' + 0x0033, // '3' + 0x002e, // '.' + 0x0032, // '2' + 0x0047, // 'G' + 0x0065, // 'e' + 0x006e, // 'n' + 0x0031, // '1' +}; +static uint8_t *str_desc_prod[sizeof(str_desc_prod_base) + sizeof(str_desc_prod_data)]; + +static const usb_str_desc_t str_desc_ser_base = { + .bLength = sizeof(usb_str_desc_t) + (120 * sizeof(uint16_t)), + .bDescriptorType = USB_B_DESCRIPTOR_TYPE_STRING, +}; +static const uint16_t str_desc_ser_data[] = { + /* + The following string encoded in UTF-16LE + + "0101cdd1e856b427bbb796f870561a4b2b817af9da9872c8d75217cccdd5d5eccb3a0000000 + 000000000000096abe1a3ff83610095558107aea948b4" + */ + 0x0030, 0x0031, 0x0030, 0x0031, 0x0063, 0x0064, 0x0064, 0x0031, 0x0065, + 0x0038, 0x0035, 0x0036, 0x0062, 0x0034, 0x0032, 0x0037, 0x0062, 0x0062, + 0x0062, 0x0037, 0x0039, 0x0036, 0x0066, 0x0038, 0x0037, 0x0030, 0x0035, + 0x0036, 0x0031, 0x0061, 0x0034, 0x0062, 0x0032, 0x0062, 0x0038, 0x0031, + 0x0037, 0x0061, 0x0066, 0x0039, 0x0064, 0x0061, 0x0039, 0x0038, 0x0037, + 0x0032, 0x0063, 0x0038, 0x0064, 0x0037, 0x0035, 0x0032, 0x0031, 0x0037, + 0x0063, 0x0063, 0x0063, 0x0064, 0x0064, 0x0035, 0x0064, 0x0035, 0x0065, + 0x0063, 0x0063, 0x0062, 0x0033, 0x0061, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0039, 0x0036, + 0x0061, 0x0062, 0x0065, 0x0031, 0x0061, 0x0033, 0x0066, 0x0066, 0x0038, + 0x0033, 0x0036, 0x0031, 0x0030, 0x0030, 0x0039, 0x0035, 0x0035, 0x0035, + 0x0038, 0x0031, 0x0030, 0x0037, 0x0061, 0x0065, 0x0061, 0x0039, 0x0034, + 0x0038, 0x0062, 0x0034, +}; +static uint8_t *str_desc_ser[sizeof(str_desc_ser_base) + sizeof(str_desc_ser_data)]; + +// -------------------------------- Functions ---------------------------------- + +void dev_msc_init(void) +{ + // Dynamically initialize string descriptors due to compiler limitations (see IDF-9886) + uint8_t *ptr; + + // Initialize manufacturer string descriptor + ptr = (uint8_t *)str_desc_manu; + memcpy(ptr, &str_desc_manu_base, sizeof(str_desc_manu_base)); + ptr += sizeof(str_desc_manu_base); + memcpy(ptr, &str_desc_manu_data, sizeof(str_desc_manu_data)); + + // Initialize product string descriptor + ptr = (uint8_t *)str_desc_prod; + memcpy(ptr, &str_desc_prod_base, sizeof(str_desc_prod_base)); + ptr += sizeof(str_desc_prod_base); + memcpy(ptr, &str_desc_prod_data, sizeof(str_desc_prod_data)); + + // Initialize serial string descriptor + ptr = (uint8_t *)str_desc_ser; + memcpy(ptr, &str_desc_ser_base, sizeof(str_desc_ser_base)); + ptr += sizeof(str_desc_ser_base); + memcpy(ptr, &str_desc_ser_data, sizeof(str_desc_ser_data)); +} + +const dev_msc_info_t *dev_msc_get_info(void) +{ + return &dev_info; +} + +const usb_device_desc_t *dev_msc_get_dev_desc(usb_speed_t speed) +{ + return &dev_desc; +} + +const usb_config_desc_t *dev_msc_get_config_desc(usb_speed_t speed) +{ + return &config_desc; +} + +const usb_intf_desc_t *dev_msc_get_intf_desc(usb_speed_t speed) +{ + return &intf_desc; +} + +const usb_ep_desc_t *dev_msc_get_in_ep_desc(usb_speed_t speed) +{ + const usb_ep_desc_t *ret; + + // EP descriptor differs by speed due to MPS + switch (speed) { + case USB_SPEED_FULL: + ret = &in_ep_desc_fs; + break; + case USB_SPEED_HIGH: + ret = &in_ep_desc_hs; + break; + default: + ret = NULL; + abort(); // Should never occur + break; + } + + return ret; +} + +const usb_ep_desc_t *dev_msc_get_out_ep_desc(usb_speed_t speed) +{ + const usb_ep_desc_t *ret; + + // EP descriptor differs by speed due to MPS + switch (speed) { + case USB_SPEED_FULL: + ret = &out_ep_desc_fs; + break; + case USB_SPEED_HIGH: + ret = &out_ep_desc_hs; + break; + default: + ret = NULL; + abort(); // Should never occur + break; + } + + return ret; +} + +const usb_str_desc_t *dev_msc_get_str_desc_manu(void) +{ + return (const usb_str_desc_t *)str_desc_manu; +} + +const usb_str_desc_t *dev_msc_get_str_desc_prod(void) +{ + return (const usb_str_desc_t *)str_desc_prod; +} + +const usb_str_desc_t *dev_msc_get_str_desc_ser(void) +{ + return (const usb_str_desc_t *)str_desc_ser; +} diff --git a/components/usb/test_apps/common/dev_msc.h b/components/usb/test_apps/common/dev_msc.h new file mode 100644 index 000000000000..ac21ca952e29 --- /dev/null +++ b/components/usb/test_apps/common/dev_msc.h @@ -0,0 +1,118 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include "usb/usb_types_ch9.h" +#include "usb/usb_types_stack.h" + +/* +Some tests where the ESP (acting as host) will require that a particular test +device acting as a MSC SCSI flash drive be connected. This header contains +functions to get information and descriptors about that test device. + +If you are connecting a different MSC SCSI flash drive, please update +the descriptors in dev_msc.c accordingly. +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief MSC SCSI test device information + * + * Structure containing basic information about the the MSC SCSI interface on + * the test device. + */ +typedef struct { + uint8_t bInterfaceNumber; + uint8_t bAlternateSetting; + uint8_t in_ep_addr; + uint8_t out_up_addr; + unsigned int scsi_sector_size; +} dev_msc_info_t; + +/** + * @brief Initialize the test device + * + * @note Call this before running tests. This is necessary due to IDF-9886 + */ +void dev_msc_init(void); + +/** + * @brief Get information about the test device's MSC SCSI interface + * + * @return Information object + */ +const dev_msc_info_t *dev_msc_get_info(void); + +/** + * @brief Get the test device's descriptor + * + * @param[in] speed Test device's current speed + * @return Device descriptor + */ +const usb_device_desc_t *dev_msc_get_dev_desc(usb_speed_t speed); + +/** + * @brief Get the test device's configuration descriptor + * + * @param[in] speed Test device's current speed + * @return Configuration descriptor + */ +const usb_config_desc_t *dev_msc_get_config_desc(usb_speed_t speed); + +/** + * @brief Get the test device's MSC interface descriptor + * + * @param[in] speed Test device's current speed + * @return MSC interface descriptor + */ +const usb_intf_desc_t *dev_msc_get_intf_desc(usb_speed_t speed); + +/** + * @brief Get the test device's MSC IN endpoint descriptor + * + * @param[in] speed Test device's current speed + * @return MSC IN endpoint descriptor + */ +const usb_ep_desc_t *dev_msc_get_in_ep_desc(usb_speed_t speed); + +/** + * @brief Get the test device's MSC OUT endpoint descriptor + * + * @param[in] speed Test device's current speed + * @return MSC OUT endpoint descriptor + */ +const usb_ep_desc_t *dev_msc_get_out_ep_desc(usb_speed_t speed); + +/** + * @brief Get the test device's manufacturer string descriptor + * + * @return Manufacturer string descriptor + */ +const usb_str_desc_t *dev_msc_get_str_desc_manu(void); + +/** + * @brief Get the test device's product string descriptor + * + * @return Product string descriptor + */ +const usb_str_desc_t *dev_msc_get_str_desc_prod(void); + +/** + * @brief Get the test device's serial number string descriptor + * + * @return Serial number string descriptor + */ +const usb_str_desc_t *dev_msc_get_str_desc_ser(void); + +#ifdef __cplusplus +} +#endif diff --git a/components/usb/test_apps/common/mock_hid.c b/components/usb/test_apps/common/mock_hid.c deleted file mode 100644 index 4f91e7b29457..000000000000 --- a/components/usb/test_apps/common/mock_hid.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include "usb/usb_types_ch9.h" -#include "mock_hid.h" - -// ---------------------------------------------------- HID Mouse ------------------------------------------------------ - -const usb_ep_desc_t mock_hid_mouse_in_ep_desc = { - .bLength = sizeof(usb_ep_desc_t), - .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, - .bEndpointAddress = MOCK_HID_MOUSE_INTR_IN_EP_ADDR, // EP 1 IN - .bmAttributes = USB_BM_ATTRIBUTES_XFER_INT, - .wMaxPacketSize = MOCK_HID_MOUSE_INTR_IN_MPS, - .bInterval = 10, // Interval of 10ms -}; - -void mock_hid_process_report(mock_hid_mouse_report_t *report, int iter) -{ - static int x_pos = 0; - static int y_pos = 0; - // Update X position - if (report->x_movement & 0x80) { // Positive movement - x_pos += report->x_movement & 0x7F; - } else { // Negative movement - x_pos -= report->x_movement & 0x7F; - } - // Update Y position - if (report->y_movement & 0x80) { // Positive movement - y_pos += report->y_movement & 0x7F; - } else { // Negative movement - y_pos -= report->y_movement & 0x7F; - } - printf("\rX:%d\tY:%d\tIter: %d\n", x_pos, y_pos, iter); -} diff --git a/components/usb/test_apps/common/mock_hid.h b/components/usb/test_apps/common/mock_hid.h deleted file mode 100644 index a9a145fbdfc2..000000000000 --- a/components/usb/test_apps/common/mock_hid.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* -This header contains bare-bone mock implementations of some device classes in order to test various layers of the USB -Host stack. -*/ - -#pragma once - -#include -#include -#include "esp_assert.h" -#include "usb/usb_types_ch9.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// ---------------------------------------------------- HID Mouse ------------------------------------------------------ - -/* -Note: The mock HID mouse tests require that USB low speed mouse be connected. The mouse should... - -- Be implement the HID with standard report format used by mice -- It's configuration 1 should have the following endpoint - - ------------------ Configuration Descriptor ------------------- -bLength : 0x09 (9 bytes) -bDescriptorType : 0x02 (Configuration Descriptor) -wTotalLength : 0x003B (59 bytes) -bNumInterfaces : 0x02 (2 Interfaces) -bConfigurationValue : 0x01 (Configuration 1) -iConfiguration : 0x00 (No String Descriptor) -bmAttributes : 0xA0 - D7: Reserved, set 1 : 0x01 - D6: Self Powered : 0x00 (no) - D5: Remote Wakeup : 0x01 (yes) - D4..0: Reserved, set 0 : 0x00 -MaxPower : 0x32 (100 mA) -Data (HexDump) : 09 02 3B 00 02 01 00 A0 32 09 04 00 00 01 03 01 - 02 00 09 21 00 02 00 01 22 4D 00 07 05 81 03 08 - 00 0A 09 04 01 00 01 03 01 01 00 09 21 00 02 00 - 01 22 31 00 07 05 82 03 08 00 0A - - ---------------- Interface Descriptor ----------------- -bLength : 0x09 (9 bytes) -bDescriptorType : 0x04 (Interface Descriptor) -bInterfaceNumber : 0x00 -bAlternateSetting : 0x00 -bNumEndpoints : 0x01 (1 Endpoint) -bInterfaceClass : 0x03 (HID - Human Interface Device) -bInterfaceSubClass : 0x01 (Boot Interface) -bInterfaceProtocol : 0x02 (Mouse) -iInterface : 0x00 (No String Descriptor) -Data (HexDump) : 09 04 00 00 01 03 01 02 00 - - ------------------- HID Descriptor -------------------- -bLength : 0x09 (9 bytes) -bDescriptorType : 0x21 (HID Descriptor) -bcdHID : 0x0200 (HID Version 2.00) -bCountryCode : 0x00 (00 = not localized) -bNumDescriptors : 0x01 -Data (HexDump) : 09 21 00 02 00 01 22 4D 00 -Descriptor 1: -bDescriptorType : 0x22 (Class=Report) -wDescriptorLength : 0x004D (77 bytes) -Error reading descriptor : ERROR_INVALID_PARAMETER (due to a obscure limitation of the Win32 USB API, see UsbTreeView.txt) - - ----------------- Endpoint Descriptor ----------------- -bLength : 0x07 (7 bytes) -bDescriptorType : 0x05 (Endpoint Descriptor) -bEndpointAddress : 0x81 (Direction=IN EndpointID=1) -bmAttributes : 0x03 (TransferType=Interrupt) -wMaxPacketSize : 0x0008 -bInterval : 0x0A (10 ms) -Data (HexDump) : 07 05 81 03 08 00 0A - -If you're using another mice with different endpoints, modify the endpoint descriptor below -*/ - -extern const usb_ep_desc_t mock_hid_mouse_in_ep_desc; - -#define MOCK_HID_MOUSE_DEV_ID_VENDOR 0x03F0 -#define MOCK_HID_MOUSE_DEV_ID_PRODUCT 0x1198 -#define MOCK_HID_MOUSE_DEV_DFLT_EP_MPS 8 -#define MOCK_HID_MOUSE_INTF_NUMBER 0 -#define MOCK_HID_MOUSE_INTF_ALT_SETTING 0 -#define MOCK_HID_MOUSE_INTR_IN_EP_ADDR 0x81 -#define MOCK_HID_MOUSE_INTR_IN_MPS 8 - -typedef union { - struct { - uint32_t left_button: 1; - uint32_t right_button: 1; - uint32_t middle_button: 1; - uint32_t reserved5: 5; - uint8_t x_movement; - uint8_t y_movement; - } __attribute__((packed)); - uint8_t val[3]; -} mock_hid_mouse_report_t; -ESP_STATIC_ASSERT(sizeof(mock_hid_mouse_report_t) == 3, "Size of HID mouse report incorrect"); - -void mock_hid_process_report(mock_hid_mouse_report_t *report, int iter); - -#ifdef __cplusplus -} -#endif diff --git a/components/usb/test_apps/common/mock_msc.c b/components/usb/test_apps/common/mock_msc.c index 7420e8492872..30538f0f7f63 100644 --- a/components/usb/test_apps/common/mock_msc.c +++ b/components/usb/test_apps/common/mock_msc.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -15,77 +15,18 @@ const char *MSC_CLIENT_TAG = "MSC Client"; -const usb_device_desc_t mock_msc_scsi_dev_desc = { - .bLength = USB_DEVICE_DESC_SIZE, - .bDescriptorType = USB_B_DESCRIPTOR_TYPE_DEVICE, - .bcdUSB = MOCK_MSC_SCSI_USB_VERSION, - .bDeviceClass = USB_CLASS_PER_INTERFACE, - .bDeviceSubClass = 0, - .bDeviceProtocol = 0, - .bMaxPacketSize0 = MOCK_MSC_SCSI_DEV_DFLT_EP_MPS, - .idVendor = MOCK_MSC_SCSI_DEV_ID_VENDOR, - .idProduct = MOCK_MSC_SCSI_DEV_ID_PRODUCT, - .bcdDevice = MOCK_MSC_SCSI_DEV_VERSION, - .iManufacturer = 1, - .iProduct = 2, - .iSerialNumber = 3, - .bNumConfigurations = 1, -}; - -#define MOCK_MSC_SCSI_WTOTALLENGTH (USB_CONFIG_DESC_SIZE + USB_INTF_DESC_SIZE + 2*USB_EP_DESC_SIZE) -static const usb_config_desc_t mock_msc_config_desc = { - .bLength = USB_CONFIG_DESC_SIZE, - .bDescriptorType = USB_B_DESCRIPTOR_TYPE_CONFIGURATION, - .wTotalLength = MOCK_MSC_SCSI_WTOTALLENGTH, - .bNumInterfaces = 1, - .bConfigurationValue = 1, - .iConfiguration = 0, - .bmAttributes = 0x80, - .bMaxPower = 0x70, // 224mA -}; - -static const usb_intf_desc_t mock_msc_intf_desc = { - .bLength = USB_INTF_DESC_SIZE, - .bDescriptorType = USB_B_DESCRIPTOR_TYPE_INTERFACE, - .bInterfaceNumber = MOCK_MSC_SCSI_INTF_NUMBER, - .bAlternateSetting = MOCK_MSC_SCSI_INTF_ALT_SETTING, - .bNumEndpoints = 2, - .bInterfaceClass = USB_CLASS_MASS_STORAGE, - .bInterfaceSubClass = 0x06, // SCSI - .bInterfaceProtocol = 0x50, // Bulk only - .iInterface = 0, -}; - -uint8_t mock_msc_scsi_config_desc[255]; -uint16_t mock_msc_scsi_str_desc_manu[128]; -uint16_t mock_msc_scsi_str_desc_prod[128]; -uint16_t mock_msc_scsi_str_desc_ser_num[128]; - -const usb_ep_desc_t mock_msc_scsi_bulk_out_ep_desc = { - .bLength = sizeof(usb_ep_desc_t), - .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, - .bEndpointAddress = MOCK_MSC_SCSI_BULK_OUT_EP_ADDR, // EP 1 OUT - .bmAttributes = USB_BM_ATTRIBUTES_XFER_BULK, - .wMaxPacketSize = MOCK_MSC_SCSI_BULK_EP_MPS, // MPS of 64 bytes - .bInterval = 0, -}; - -const usb_ep_desc_t mock_msc_scsi_bulk_in_ep_desc = { - .bLength = sizeof(usb_ep_desc_t), - .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, - .bEndpointAddress = MOCK_MSC_SCSI_BULK_IN_EP_ADDR, - .bmAttributes = USB_BM_ATTRIBUTES_XFER_BULK, - .wMaxPacketSize = MOCK_MSC_SCSI_BULK_EP_MPS, // MPS of 64 bytes - .bInterval = 0, -}; - -void mock_msc_scsi_init_cbw(mock_msc_bulk_cbw_t *cbw, bool is_read, int offset, int num_sectors, uint32_t tag) +void mock_msc_scsi_init_cbw(mock_msc_bulk_cbw_t *cbw, + bool is_read, + unsigned int offset, + unsigned int num_sectors, + unsigned int sector_size, + uint32_t tag) { cbw->dCBWSignature = 0x43425355; // Fixed value cbw->dCBWTag = tag; // Random value that is echoed back - cbw->dCBWDataTransferLength = num_sectors * MOCK_MSC_SCSI_SECTOR_SIZE; + cbw->dCBWDataTransferLength = num_sectors * sector_size; cbw->bmCBWFlags = (is_read) ? (1 << 7) : 0; // If this is a read, set the direction flag - cbw->bCBWLUN = MOCK_MSC_SCSI_LUN; + cbw->bCBWLUN = 0; cbw->bCBWCBLength = 10; // The length of the SCSI command // Initialize SCSI CMD as READ10 or WRITE 10 cbw->CBWCB.opcode = (is_read) ? 0x28 : 0x2A; // SCSI CMD READ10 or WRITE10 @@ -121,38 +62,3 @@ bool mock_msc_scsi_check_csw(mock_msc_bulk_csw_t *csw, uint32_t tag_expect) } return no_issues; } - -void mock_msc_scsi_init_reference_descriptors(void) -{ - // Configuration descriptor - uint8_t *dest_ptr = mock_msc_scsi_config_desc; - memcpy(dest_ptr, (void*)&mock_msc_config_desc, sizeof(mock_msc_config_desc)); - dest_ptr += USB_CONFIG_DESC_SIZE; - memcpy(dest_ptr, (void*)&mock_msc_intf_desc, sizeof(mock_msc_intf_desc)); - dest_ptr += USB_INTF_DESC_SIZE; - memcpy(dest_ptr, (void*)&mock_msc_scsi_bulk_in_ep_desc, sizeof(mock_msc_scsi_bulk_in_ep_desc)); - dest_ptr += USB_EP_DESC_SIZE; - memcpy(dest_ptr, (void*)&mock_msc_scsi_bulk_out_ep_desc, sizeof(mock_msc_scsi_bulk_out_ep_desc)); - - // String descriptors - const char *str = MOCK_MSC_SCSI_STRING_1; - uint8_t chr_count = strlen(str); - mock_msc_scsi_str_desc_manu[0] = (USB_B_DESCRIPTOR_TYPE_STRING << 8) | (2 * chr_count + 2); // first byte is length (including header), second byte is string type - for (uint8_t i = 0; i < chr_count; i++) { - mock_msc_scsi_str_desc_manu[1 + i] = str[i]; - } - - str = MOCK_MSC_SCSI_STRING_2; - chr_count = strlen(str); - mock_msc_scsi_str_desc_prod[0] = (USB_B_DESCRIPTOR_TYPE_STRING << 8) | (2 * chr_count + 2); // first byte is length (including header), second byte is string type - for (uint8_t i = 0; i < chr_count; i++) { - mock_msc_scsi_str_desc_prod[1 + i] = str[i]; - } - - str = MOCK_MSC_SCSI_STRING_3; - chr_count = strlen(str); - mock_msc_scsi_str_desc_ser_num[0] = (USB_B_DESCRIPTOR_TYPE_STRING << 8) | (2 * chr_count + 2); // first byte is length (including header), second byte is string type - for (uint8_t i = 0; i < chr_count; i++) { - mock_msc_scsi_str_desc_ser_num[1 + i] = str[i]; - } -} diff --git a/components/usb/test_apps/common/mock_msc.h b/components/usb/test_apps/common/mock_msc.h index accd78e82e2a..17e347d49abb 100644 --- a/components/usb/test_apps/common/mock_msc.h +++ b/components/usb/test_apps/common/mock_msc.h @@ -1,14 +1,9 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ -/* -This header contains bare-bone mock implementations of some device classes in order to test various layers of the USB -Host stack. -*/ - #pragma once #include @@ -16,94 +11,16 @@ Host stack. #include "esp_assert.h" #include "usb/usb_types_ch9.h" +/* +This header contains bare-bone mock implementations of the MSC SCSI class +*/ + #ifdef __cplusplus extern "C" { #endif -// ---------------------------------------------------- MSC SCSI ------------------------------------------------------- - extern const char *MSC_CLIENT_TAG; -/* -Note: The mock MSC SCSI tests requires that USB flash drive be connected. The flash drive should... - -- Be implement the Mass Storage class supporting BULK only transfers using SCSI commands -- It's configuration 1 should have the following endpoints - - ------------------ Configuration Descriptor ------------------- -bLength : 0x09 (9 bytes) -bDescriptorType : 0x02 (Configuration Descriptor) -wTotalLength : 0x0020 (32 bytes) -bNumInterfaces : 0x01 (1 Interface) -bConfigurationValue : 0x01 (Configuration 1) -iConfiguration : 0x00 (No String Descriptor) -bmAttributes : 0x80 - D7: Reserved, set 1 : 0x01 - D6: Self Powered : 0x00 (no) - D5: Remote Wakeup : 0x00 (no) - D4..0: Reserved, set 0 : 0x00 -MaxPower : 0x70 (224 mA) -Data (HexDump) : 09 02 20 00 01 01 00 80 70 09 04 00 00 02 08 06 - 50 00 07 05 81 02 00 02 00 07 05 02 02 00 02 00 - - ---------------- Interface Descriptor ----------------- -bLength : 0x09 (9 bytes) -bDescriptorType : 0x04 (Interface Descriptor) -bInterfaceNumber : 0x00 -bAlternateSetting : 0x00 -bNumEndpoints : 0x02 (2 Endpoints) -bInterfaceClass : 0x08 (Mass Storage) -bInterfaceSubClass : 0x06 (SCSI transparent command set) -bInterfaceProtocol : 0x50 (Bulk-Only Transport) -iInterface : 0x00 (No String Descriptor) -Data (HexDump) : 09 04 00 00 02 08 06 50 00 - - ----------------- Endpoint Descriptor ----------------- -bLength : 0x07 (7 bytes) -bDescriptorType : 0x05 (Endpoint Descriptor) -bEndpointAddress : 0x81 (Direction=IN EndpointID=1) -bmAttributes : 0x02 (TransferType=Bulk) -wMaxPacketSize : 0x0040 (max 64 bytes) -bInterval : 0x00 (never NAKs) -Data (HexDump) : 07 05 81 02 40 00 00 - - ----------------- Endpoint Descriptor ----------------- -bLength : 0x07 (7 bytes) -bDescriptorType : 0x05 (Endpoint Descriptor) -bEndpointAddress : 0x02 (Direction=OUT EndpointID=2) -bmAttributes : 0x02 (TransferType=Bulk) -wMaxPacketSize : 0x0040 (max 64 bytes) -bInterval : 0x00 (never NAKs) -Data (HexDump) : 07 05 02 02 40 00 00 - -If you're using a flash driver with different endpoints, modify the endpoint descriptors below. -*/ - -//Constant descriptors -extern const usb_device_desc_t mock_msc_scsi_dev_desc; -extern uint8_t mock_msc_scsi_config_desc[255]; -extern uint16_t mock_msc_scsi_str_desc_manu[128]; -extern uint16_t mock_msc_scsi_str_desc_prod[128]; -extern uint16_t mock_msc_scsi_str_desc_ser_num[128]; -extern const usb_ep_desc_t mock_msc_scsi_bulk_out_ep_desc; -extern const usb_ep_desc_t mock_msc_scsi_bulk_in_ep_desc; - -#define MOCK_MSC_SCSI_DEV_ID_VENDOR 0x0781 // Western Digital, Sandisk -#define MOCK_MSC_SCSI_DEV_ID_PRODUCT 0x5595 -#define MOCK_MSC_SCSI_DEV_VERSION 0x0100 //1.00 -#define MOCK_MSC_SCSI_USB_VERSION 0x0210 //2.10 -#define MOCK_MSC_SCSI_DEV_DFLT_EP_MPS 64 -#define MOCK_MSC_SCSI_SECTOR_SIZE 512 -#define MOCK_MSC_SCSI_LUN 0 -#define MOCK_MSC_SCSI_INTF_NUMBER 0 -#define MOCK_MSC_SCSI_INTF_ALT_SETTING 0 -#define MOCK_MSC_SCSI_BULK_OUT_EP_ADDR 0x02 -#define MOCK_MSC_SCSI_BULK_IN_EP_ADDR 0x81 -#define MOCK_MSC_SCSI_BULK_EP_MPS 64 -#define MOCK_MSC_SCSI_STRING_1 (" USB") -#define MOCK_MSC_SCSI_STRING_2 (" SanDisk 3.2Gen1") -#define MOCK_MSC_SCSI_STRING_3 ("0101cdd1e856b427bbb796f870561a4b2b817af9da9872c8d75217cccdd5d5eccb3a0000000000000000000096abe1a3ff83610095558107aea948b4") // This string is NOT checked by the enum test - #define MOCK_MSC_SCSI_REQ_INIT_RESET(setup_pkt_ptr, intf_num) ({ \ (setup_pkt_ptr)->bmRequestType = USB_BM_REQUEST_TYPE_DIR_OUT | USB_BM_REQUEST_TYPE_TYPE_CLASS | USB_BM_REQUEST_TYPE_RECIP_INTERFACE; \ (setup_pkt_ptr)->bRequest = 0xFF; \ @@ -150,21 +67,26 @@ typedef struct __attribute__((packed)) /** * @brief Initialize a MSC Command Block Wrapper (CBW) as an SCSI command * - * @param cbw CBW structure - * @param is_read Is a read command - * @param offset Block offset - * @param num_sectors Number of sectors to read - * @param tag Tag (this is simply echoed back + * @param[in] cbw CBW structure + * @param[in] is_read Is a read command + * @param[in] offset Block offset + * @param[in] num_sectors Number of sectors to read + * @param[in] sector_size Size of each sector in bytes + * @param[in] tag Tag (this is simply echoed back */ -void mock_msc_scsi_init_cbw(mock_msc_bulk_cbw_t *cbw, bool is_read, int offset, int num_sectors, uint32_t tag); +void mock_msc_scsi_init_cbw(mock_msc_bulk_cbw_t *cbw, + bool is_read, + unsigned int offset, + unsigned int num_sectors, + unsigned int sector_size, + uint32_t tag); /** * @brief Check that returned Command Status Wrapper (CSW) is valid * - * @param csw CSW structure - * @param tag_expect Expected tag - * @return true CSW is valid - * @return false CSW is not valid + * @param[in] csw CSW structure + * @param[in] tag_expect Expected tag + * @return True if CSW is valid, false otherwise */ bool mock_msc_scsi_check_csw(mock_msc_bulk_csw_t *csw, uint32_t tag_expect); @@ -173,25 +95,6 @@ bool mock_msc_scsi_check_csw(mock_msc_bulk_csw_t *csw, uint32_t tag_expect); */ void mock_msc_scsi_init_reference_descriptors(void); -// ---------------------------------------------------- Mock ISOC ------------------------------------------------------ - -/* -Note: ISOC test rely on communicating with a non existent endpoint using ISOC OUT transfers. Since no ACK is given for -ISOC, transferring to a non-existent endpoint should work. The non-existent endpoint descriptor is described below: -*/ - -#define MOCK_ISOC_EP_NUM 2 -#define MOCK_ISOC_EP_MPS 512 - -static const usb_ep_desc_t mock_isoc_out_ep_desc = { - .bLength = sizeof(usb_ep_desc_t), - .bDescriptorType = USB_B_DESCRIPTOR_TYPE_ENDPOINT, - .bEndpointAddress = MOCK_ISOC_EP_NUM, - .bmAttributes = USB_BM_ATTRIBUTES_XFER_ISOC, - .wMaxPacketSize = MOCK_ISOC_EP_MPS, //MPS of 512 bytes - .bInterval = 1, //Isoc interval is (2 ^ (bInterval - 1)) which means an interval of 1ms -}; - #ifdef __cplusplus } #endif diff --git a/components/usb/test_apps/hcd/main/test_app_main.c b/components/usb/test_apps/hcd/main/test_app_main.c index d9a01d71e819..f38514e81349 100644 --- a/components/usb/test_apps/hcd/main/test_app_main.c +++ b/components/usb/test_apps/hcd/main/test_app_main.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: CC0-1.0 */ @@ -7,14 +7,17 @@ #include "unity.h" #include "unity_test_runner.h" #include "unity_test_utils_memory.h" - #include "freertos/FreeRTOS.h" #include "freertos/task.h" +#include "dev_msc.h" +#include "dev_hid.h" #include "test_hcd_common.h" void setUp(void) { unity_utils_record_free_mem(); + dev_msc_init(); + dev_hid_init(); port_hdl = test_hcd_setup(); } diff --git a/components/usb/test_apps/hcd/main/test_hcd_bulk.c b/components/usb/test_apps/hcd/main/test_hcd_bulk.c index 39731b568db7..8d7202001222 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_bulk.c +++ b/components/usb/test_apps/hcd/main/test_hcd_bulk.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,16 +10,17 @@ #include "freertos/semphr.h" #include "unity.h" #include "mock_msc.h" +#include "dev_msc.h" #include "test_hcd_common.h" // --------------------------------------------------- Test Cases ------------------------------------------------------ -static void mock_msc_reset_req(hcd_pipe_handle_t default_pipe) +static void mock_msc_reset_req(hcd_pipe_handle_t default_pipe, uint8_t bInterfaceNumber) { // Create URB urb_t *urb = test_hcd_alloc_urb(0, sizeof(usb_setup_packet_t)); usb_setup_packet_t *setup_pkt = (usb_setup_packet_t *)urb->transfer.data_buffer; - MOCK_MSC_SCSI_REQ_INIT_RESET(setup_pkt, MOCK_MSC_SCSI_INTF_NUMBER); + MOCK_MSC_SCSI_REQ_INIT_RESET(setup_pkt, bInterfaceNumber); urb->transfer.num_bytes = sizeof(usb_setup_packet_t); // Enqueue, wait, dequeue, and check URB TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(default_pipe, urb)); @@ -60,23 +61,31 @@ TEST_CASE("Test HCD bulk pipe URBs", "[bulk][full_speed]") // Enumerate and reset MSC SCSI device hcd_pipe_handle_t default_pipe = test_hcd_pipe_alloc(port_hdl, NULL, 0, port_speed); // Create a default pipe (using a NULL EP descriptor) uint8_t dev_addr = test_hcd_enum_device(default_pipe); - mock_msc_reset_req(default_pipe); + const dev_msc_info_t *dev_info = dev_msc_get_info(); + mock_msc_reset_req(default_pipe, dev_info->bInterfaceNumber); // Create BULK IN and BULK OUT pipes for SCSI - hcd_pipe_handle_t bulk_out_pipe = test_hcd_pipe_alloc(port_hdl, &mock_msc_scsi_bulk_out_ep_desc, dev_addr, port_speed); - hcd_pipe_handle_t bulk_in_pipe = test_hcd_pipe_alloc(port_hdl, &mock_msc_scsi_bulk_in_ep_desc, dev_addr, port_speed); + const usb_ep_desc_t *out_ep_desc = dev_msc_get_out_ep_desc(port_speed); + const usb_ep_desc_t *in_ep_desc = dev_msc_get_in_ep_desc(port_speed); + const uint16_t mps = USB_EP_DESC_GET_MPS(in_ep_desc) ; + hcd_pipe_handle_t bulk_out_pipe = test_hcd_pipe_alloc(port_hdl, out_ep_desc, dev_addr, port_speed); + hcd_pipe_handle_t bulk_in_pipe = test_hcd_pipe_alloc(port_hdl, in_ep_desc, dev_addr, port_speed); // Create URBs for CBW, Data, and CSW transport. IN Buffer sizes are rounded up to nearest MPS urb_t *urb_cbw = test_hcd_alloc_urb(0, sizeof(mock_msc_bulk_cbw_t)); - urb_t *urb_data = test_hcd_alloc_urb(0, TEST_NUM_SECTORS_PER_XFER * MOCK_MSC_SCSI_SECTOR_SIZE); - const uint16_t mps = USB_EP_DESC_GET_MPS(&mock_msc_scsi_bulk_in_ep_desc) ; + urb_t *urb_data = test_hcd_alloc_urb(0, TEST_NUM_SECTORS_PER_XFER * dev_info->scsi_sector_size); urb_t *urb_csw = test_hcd_alloc_urb(0, sizeof(mock_msc_bulk_csw_t) + (mps - (sizeof(mock_msc_bulk_csw_t) % mps))); urb_cbw->transfer.num_bytes = sizeof(mock_msc_bulk_cbw_t); - urb_data->transfer.num_bytes = TEST_NUM_SECTORS_PER_XFER * MOCK_MSC_SCSI_SECTOR_SIZE; + urb_data->transfer.num_bytes = TEST_NUM_SECTORS_PER_XFER * dev_info->scsi_sector_size; urb_csw->transfer.num_bytes = sizeof(mock_msc_bulk_csw_t) + (mps - (sizeof(mock_msc_bulk_csw_t) % mps)); for (int block_num = 0; block_num < TEST_NUM_SECTORS_TOTAL; block_num += TEST_NUM_SECTORS_PER_XFER) { // Initialize CBW URB, then send it on the BULK OUT pipe - mock_msc_scsi_init_cbw((mock_msc_bulk_cbw_t *)urb_cbw->transfer.data_buffer, true, block_num, TEST_NUM_SECTORS_PER_XFER, 0xAAAAAAAA); + mock_msc_scsi_init_cbw((mock_msc_bulk_cbw_t *)urb_cbw->transfer.data_buffer, + true, + block_num, + TEST_NUM_SECTORS_PER_XFER, + dev_info->scsi_sector_size, + 0xAAAAAAAA); TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(bulk_out_pipe, urb_cbw)); test_hcd_expect_pipe_event(bulk_out_pipe, HCD_PIPE_EVENT_URB_DONE); TEST_ASSERT_EQUAL_PTR(urb_cbw, hcd_urb_dequeue(bulk_out_pipe)); diff --git a/components/usb/test_apps/hcd/main/test_hcd_intr.c b/components/usb/test_apps/hcd/main/test_hcd_intr.c index 7c772c9ee3b9..4416967c1bd1 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_intr.c +++ b/components/usb/test_apps/hcd/main/test_hcd_intr.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,8 +8,7 @@ #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" #include "unity.h" -#include "mock_msc.h" -#include "mock_hid.h" +#include "dev_hid.h" #include "test_hcd_common.h" // --------------------------------------------------- Test Cases ------------------------------------------------------ @@ -36,7 +35,6 @@ Note: Some mice will NAK until it is moved, so try moving the mouse around if th #define TEST_HID_DEV_SPEED USB_SPEED_LOW #define NUM_URBS 3 -#define URB_DATA_BUFF_SIZE MOCK_HID_MOUSE_INTR_IN_MPS #define NUM_URB_ITERS (NUM_URBS * 100) TEST_CASE("Test HCD interrupt pipe URBs", "[intr][low_speed]") @@ -49,11 +47,13 @@ TEST_CASE("Test HCD interrupt pipe URBs", "[intr][low_speed]") uint8_t dev_addr = test_hcd_enum_device(default_pipe); // Allocate interrupt pipe and URBS - hcd_pipe_handle_t intr_pipe = test_hcd_pipe_alloc(port_hdl, &mock_hid_mouse_in_ep_desc, dev_addr, port_speed); + const usb_ep_desc_t *in_ep_desc = dev_hid_get_in_ep_desc(port_speed); + const int data_buff_size = USB_EP_DESC_GET_MPS(in_ep_desc); + hcd_pipe_handle_t intr_pipe = test_hcd_pipe_alloc(port_hdl, in_ep_desc, dev_addr, port_speed); urb_t *urb_list[NUM_URBS]; for (int i = 0; i < NUM_URBS; i++) { - urb_list[i] = test_hcd_alloc_urb(0, URB_DATA_BUFF_SIZE); - urb_list[i]->transfer.num_bytes = URB_DATA_BUFF_SIZE; + urb_list[i] = test_hcd_alloc_urb(0, data_buff_size); + urb_list[i]->transfer.num_bytes = data_buff_size; urb_list[i]->transfer.context = URB_CONTEXT_VAL; } @@ -69,7 +69,8 @@ TEST_CASE("Test HCD interrupt pipe URBs", "[intr][low_speed]") urb_t *urb = hcd_urb_dequeue(intr_pipe); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); - mock_hid_process_report((mock_hid_mouse_report_t *)urb->transfer.data_buffer, iter_count); + // Byte 1 and 2 contains x and y movement respectively + printf("X mov %d, Y mov %d\n", urb->transfer.data_buffer[1], urb->transfer.data_buffer[2]); // Requeue URB if (iter_count > NUM_URBS) { TEST_ASSERT_EQUAL(ESP_OK, hcd_urb_enqueue(intr_pipe, urb)); diff --git a/components/usb/test_apps/hcd/main/test_hcd_isoc.c b/components/usb/test_apps/hcd/main/test_hcd_isoc.c index 87364c44d1ba..20c4c63ab582 100644 --- a/components/usb/test_apps/hcd/main/test_hcd_isoc.c +++ b/components/usb/test_apps/hcd/main/test_hcd_isoc.c @@ -10,14 +10,13 @@ #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" #include "unity.h" -#include "mock_msc.h" +#include "dev_isoc.h" +#include "usb/usb_types_ch9.h" #include "test_usb_common.h" #include "test_hcd_common.h" #define NUM_URBS 3 #define NUM_PACKETS_PER_URB 3 -#define ISOC_PACKET_SIZE MOCK_ISOC_EP_MPS -#define URB_DATA_BUFF_SIZE (NUM_PACKETS_PER_URB * ISOC_PACKET_SIZE) #define POST_ENQUEUE_DELAY_US 20 #define ENQUEUE_DELAY (OTG_HSPHY_INTERFACE ? 100 : 500) // With this delay we want to enqueue the URBs at different times @@ -53,18 +52,20 @@ TEST_CASE("Test HCD isochronous pipe URBs", "[isoc][full_speed]") uint8_t dev_addr = test_hcd_enum_device(default_pipe); // Create ISOC OUT pipe to non-existent device - hcd_pipe_handle_t isoc_out_pipe = test_hcd_pipe_alloc(port_hdl, &mock_isoc_out_ep_desc, dev_addr + 1, port_speed); + const usb_ep_desc_t *out_ep_desc = dev_isoc_get_out_ep_desc(port_speed); + const int isoc_packet_size = USB_EP_DESC_GET_MPS(out_ep_desc); + hcd_pipe_handle_t isoc_out_pipe = test_hcd_pipe_alloc(port_hdl, out_ep_desc, dev_addr + 1, port_speed); // Create URBs urb_t *urb_list[NUM_URBS]; // Initialize URBs for (int urb_idx = 0; urb_idx < NUM_URBS; urb_idx++) { - urb_list[urb_idx] = test_hcd_alloc_urb(NUM_PACKETS_PER_URB, URB_DATA_BUFF_SIZE); - urb_list[urb_idx]->transfer.num_bytes = URB_DATA_BUFF_SIZE; + urb_list[urb_idx] = test_hcd_alloc_urb(NUM_PACKETS_PER_URB, NUM_PACKETS_PER_URB * isoc_packet_size); + urb_list[urb_idx]->transfer.num_bytes = NUM_PACKETS_PER_URB * isoc_packet_size; urb_list[urb_idx]->transfer.context = URB_CONTEXT_VAL; for (int pkt_idx = 0; pkt_idx < NUM_PACKETS_PER_URB; pkt_idx++) { - urb_list[urb_idx]->transfer.isoc_packet_desc[pkt_idx].num_bytes = ISOC_PACKET_SIZE; + urb_list[urb_idx]->transfer.isoc_packet_desc[pkt_idx].num_bytes = isoc_packet_size; // Each packet will consist of the same byte, but each subsequent packet's byte will increment (i.e., packet 0 transmits all 0x0, packet 1 transmits all 0x1) - memset(&urb_list[urb_idx]->transfer.data_buffer[pkt_idx * ISOC_PACKET_SIZE], (urb_idx * NUM_URBS) + pkt_idx, ISOC_PACKET_SIZE); + memset(&urb_list[urb_idx]->transfer.data_buffer[pkt_idx * isoc_packet_size], (urb_idx * NUM_URBS) + pkt_idx, isoc_packet_size); } } // Enqueue URBs @@ -81,7 +82,7 @@ TEST_CASE("Test HCD isochronous pipe URBs", "[isoc][full_speed]") TEST_ASSERT_EQUAL(urb_list[urb_idx], urb); TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); // Overall URB status and overall number of bytes - TEST_ASSERT_EQUAL(URB_DATA_BUFF_SIZE, urb->transfer.actual_num_bytes); + TEST_ASSERT_EQUAL(NUM_PACKETS_PER_URB * isoc_packet_size, urb->transfer.actual_num_bytes); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); for (int pkt_idx = 0; pkt_idx < NUM_PACKETS_PER_URB; pkt_idx++) { TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.isoc_packet_desc[pkt_idx].status, "Transfer NOT completed"); @@ -127,12 +128,14 @@ TEST_CASE("Test HCD isochronous pipe URBs all", "[isoc][full_speed]") urb_t *urb_list[NUM_URBS]; hcd_pipe_handle_t unused_pipes[OTG_NUM_HOST_CHAN]; + const usb_ep_desc_t *out_ep_desc = dev_isoc_get_out_ep_desc(port_speed); + const int isoc_packet_size = USB_EP_DESC_GET_MPS(out_ep_desc); // For all channels for (int channel = 0; channel < OTG_NUM_HOST_CHAN - 1; channel++) { // Allocate unused pipes, so the active isoc_out_pipe uses different channel index for (int ch = 0; ch < channel; ch++) { - unused_pipes[ch] = test_hcd_pipe_alloc(port_hdl, &mock_isoc_out_ep_desc, dev_addr + 1, port_speed); + unused_pipes[ch] = test_hcd_pipe_alloc(port_hdl, out_ep_desc, dev_addr + 1, port_speed); } // For all intervals @@ -142,20 +145,21 @@ TEST_CASE("Test HCD isochronous pipe URBs all", "[isoc][full_speed]") unsigned num_packets_per_urb = 32; // This is maximum number of packets if interval = 1. This is limited by FRAME_LIST_LEN num_packets_per_urb >>= (interval - 1); // Create ISOC OUT pipe - usb_ep_desc_t isoc_out_ep = mock_isoc_out_ep_desc; // Implicit copy + usb_ep_desc_t isoc_out_ep; + memcpy(&isoc_out_ep, out_ep_desc, sizeof(usb_ep_desc_t)); isoc_out_ep.bInterval = interval; isoc_out_ep.bEndpointAddress = interval; // So you can see the bInterval value in trace hcd_pipe_handle_t isoc_out_pipe = test_hcd_pipe_alloc(port_hdl, &isoc_out_ep, channel + 1, port_speed); // Channel number represented in dev_num, so you can see it in trace // Initialize URBs for (int urb_idx = 0; urb_idx < NUM_URBS; urb_idx++) { - urb_list[urb_idx] = test_hcd_alloc_urb(num_packets_per_urb, num_packets_per_urb * ISOC_PACKET_SIZE); - urb_list[urb_idx]->transfer.num_bytes = num_packets_per_urb * ISOC_PACKET_SIZE; + urb_list[urb_idx] = test_hcd_alloc_urb(num_packets_per_urb, num_packets_per_urb * isoc_packet_size); + urb_list[urb_idx]->transfer.num_bytes = num_packets_per_urb * isoc_packet_size; urb_list[urb_idx]->transfer.context = URB_CONTEXT_VAL; for (int pkt_idx = 0; pkt_idx < num_packets_per_urb; pkt_idx++) { - urb_list[urb_idx]->transfer.isoc_packet_desc[pkt_idx].num_bytes = ISOC_PACKET_SIZE; + urb_list[urb_idx]->transfer.isoc_packet_desc[pkt_idx].num_bytes = isoc_packet_size; // Each packet will consist of the same byte, but each subsequent packet's byte will increment (i.e., packet 0 transmits all 0x0, packet 1 transmits all 0x1) - memset(&urb_list[urb_idx]->transfer.data_buffer[pkt_idx * ISOC_PACKET_SIZE], (urb_idx * num_packets_per_urb) + pkt_idx, ISOC_PACKET_SIZE); + memset(&urb_list[urb_idx]->transfer.data_buffer[pkt_idx * isoc_packet_size], (urb_idx * num_packets_per_urb) + pkt_idx, isoc_packet_size); } } @@ -176,7 +180,7 @@ TEST_CASE("Test HCD isochronous pipe URBs all", "[isoc][full_speed]") TEST_ASSERT_EQUAL(urb_list[urb_idx], urb); TEST_ASSERT_EQUAL(URB_CONTEXT_VAL, urb->transfer.context); // Overall URB status and overall number of bytes - TEST_ASSERT_EQUAL(num_packets_per_urb * ISOC_PACKET_SIZE, urb->transfer.actual_num_bytes); + TEST_ASSERT_EQUAL(num_packets_per_urb * isoc_packet_size, urb->transfer.actual_num_bytes); TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.status, "Transfer NOT completed"); for (int pkt_idx = 0; pkt_idx < num_packets_per_urb; pkt_idx++) { TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, urb->transfer.isoc_packet_desc[pkt_idx].status, "Transfer NOT completed"); @@ -235,18 +239,20 @@ TEST_CASE("Test HCD isochronous pipe sudden disconnect", "[isoc][full_speed]") uint8_t dev_addr = test_hcd_enum_device(default_pipe); // Create ISOC OUT pipe to non-existent device - hcd_pipe_handle_t isoc_out_pipe = test_hcd_pipe_alloc(port_hdl, &mock_isoc_out_ep_desc, dev_addr + 1, port_speed); + const usb_ep_desc_t *out_ep_desc = dev_isoc_get_out_ep_desc(port_speed); + const int isoc_packet_size = USB_EP_DESC_GET_MPS(out_ep_desc); + hcd_pipe_handle_t isoc_out_pipe = test_hcd_pipe_alloc(port_hdl, out_ep_desc, dev_addr + 1, port_speed); // Create URBs urb_t *urb_list[NUM_URBS]; // Initialize URBs for (int urb_idx = 0; urb_idx < NUM_URBS; urb_idx++) { - urb_list[urb_idx] = test_hcd_alloc_urb(NUM_PACKETS_PER_URB, URB_DATA_BUFF_SIZE); - urb_list[urb_idx]->transfer.num_bytes = URB_DATA_BUFF_SIZE; + urb_list[urb_idx] = test_hcd_alloc_urb(NUM_PACKETS_PER_URB, NUM_PACKETS_PER_URB * isoc_packet_size); + urb_list[urb_idx]->transfer.num_bytes = NUM_PACKETS_PER_URB * isoc_packet_size; urb_list[urb_idx]->transfer.context = URB_CONTEXT_VAL; for (int pkt_idx = 0; pkt_idx < NUM_PACKETS_PER_URB; pkt_idx++) { - urb_list[urb_idx]->transfer.isoc_packet_desc[pkt_idx].num_bytes = ISOC_PACKET_SIZE; + urb_list[urb_idx]->transfer.isoc_packet_desc[pkt_idx].num_bytes = isoc_packet_size; // Each packet will consist of the same byte, but each subsequent packet's byte will increment (i.e., packet 0 transmits all 0x0, packet 1 transmits all 0x1) - memset(&urb_list[urb_idx]->transfer.data_buffer[pkt_idx * ISOC_PACKET_SIZE], (urb_idx * NUM_URBS) + pkt_idx, ISOC_PACKET_SIZE); + memset(&urb_list[urb_idx]->transfer.data_buffer[pkt_idx * isoc_packet_size], (urb_idx * NUM_URBS) + pkt_idx, isoc_packet_size); } } // Enqueue URBs diff --git a/components/usb/test_apps/usb_host/main/ctrl_client.h b/components/usb/test_apps/usb_host/main/ctrl_client.h index 4cfeccc53d79..b780571f6b98 100644 --- a/components/usb/test_apps/usb_host/main/ctrl_client.h +++ b/components/usb/test_apps/usb_host/main/ctrl_client.h @@ -8,8 +8,6 @@ typedef struct { int num_ctrl_xfer_to_send; - uint16_t idVendor; - uint16_t idProduct; } ctrl_client_test_param_t; void ctrl_client_async_seq_task(void *arg); diff --git a/components/usb/test_apps/usb_host/main/ctrl_client_async_seq.c b/components/usb/test_apps/usb_host/main/ctrl_client_async_seq.c index 48b0937739fb..657cf8759506 100644 --- a/components/usb/test_apps/usb_host/main/ctrl_client_async_seq.c +++ b/components/usb/test_apps/usb_host/main/ctrl_client_async_seq.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -11,6 +11,7 @@ #include "esp_err.h" #include "esp_log.h" #include "test_usb_common.h" +#include "dev_msc.h" #include "ctrl_client.h" #include "usb/usb_host.h" #include "unity.h" @@ -47,14 +48,19 @@ typedef enum { } test_stage_t; typedef struct { + // Test parameters ctrl_client_test_param_t test_param; + // MSC device info + uint8_t dev_addr; + usb_speed_t dev_speed; + // Client variables + usb_host_client_handle_t client_hdl; + usb_device_handle_t dev_hdl; + // Test state test_stage_t cur_stage; test_stage_t next_stage; uint8_t num_xfer_done; uint8_t num_xfer_sent; - uint8_t dev_addr_to_open; - usb_host_client_handle_t client_hdl; - usb_device_handle_t dev_hdl; const usb_config_desc_t *config_desc_cached; } ctrl_client_obj_t; @@ -79,7 +85,7 @@ static void ctrl_client_event_cb(const usb_host_client_event_msg_t *event_msg, v case USB_HOST_CLIENT_EVENT_NEW_DEV: TEST_ASSERT_EQUAL(TEST_STAGE_WAIT_CONN, ctrl_obj->cur_stage); ctrl_obj->next_stage = TEST_STAGE_DEV_OPEN; - ctrl_obj->dev_addr_to_open = event_msg->new_dev.address; + ctrl_obj->dev_addr = event_msg->new_dev.address; break; default: abort(); // Should never occur in this test @@ -133,16 +139,21 @@ void ctrl_client_async_seq_task(void *arg) case TEST_STAGE_DEV_OPEN: { ESP_LOGD(CTRL_CLIENT_TAG, "Open"); // Open the device - TEST_ASSERT_EQUAL_MESSAGE(ESP_OK, usb_host_device_open(ctrl_obj.client_hdl, ctrl_obj.dev_addr_to_open, &ctrl_obj.dev_hdl), "Failed to open the device"); + TEST_ASSERT_EQUAL_MESSAGE(ESP_OK, usb_host_device_open(ctrl_obj.client_hdl, ctrl_obj.dev_addr, &ctrl_obj.dev_hdl), "Failed to open the device"); + // Get device info to get device speed + usb_device_info_t dev_info; + TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_info(ctrl_obj.dev_hdl, &dev_info)); + ctrl_obj.dev_speed = dev_info.speed; // Target our transfers to the device for (int i = 0; i < NUM_TRANSFER_OBJ; i++) { ctrl_xfer[i]->device_handle = ctrl_obj.dev_hdl; } - // Check the VID/PID of the opened device + // Check that the device descriptor matches our expected MSC device const usb_device_desc_t *device_desc; + const usb_device_desc_t *device_desc_ref = dev_msc_get_dev_desc(ctrl_obj.dev_speed); TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_device_descriptor(ctrl_obj.dev_hdl, &device_desc)); - TEST_ASSERT_EQUAL(ctrl_obj.test_param.idVendor, device_desc->idVendor); - TEST_ASSERT_EQUAL(ctrl_obj.test_param.idProduct, device_desc->idProduct); + TEST_ASSERT_EQUAL(device_desc_ref->bLength, device_desc->bLength); + TEST_ASSERT_EQUAL_MEMORY_MESSAGE(device_desc_ref, device_desc, sizeof(usb_device_desc_t), "Device descriptors do not match."); // Cache the active configuration descriptor for later comparison TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_active_config_descriptor(ctrl_obj.dev_hdl, &ctrl_obj.config_desc_cached)); ctrl_obj.next_stage = TEST_STAGE_CTRL_XFER; diff --git a/components/usb/test_apps/usb_host/main/msc_client.h b/components/usb/test_apps/usb_host/main/msc_client.h index c3bf2063f27f..6a816547bdd9 100644 --- a/components/usb/test_apps/usb_host/main/msc_client.h +++ b/components/usb/test_apps/usb_host/main/msc_client.h @@ -12,8 +12,6 @@ typedef struct { int num_sectors_to_read; int num_sectors_per_xfer; uint32_t msc_scsi_xfer_tag; - uint16_t idVendor; - uint16_t idProduct; } msc_client_test_param_t; void msc_client_async_seq_task(void *arg); diff --git a/components/usb/test_apps/usb_host/main/msc_client_async_dconn.c b/components/usb/test_apps/usb_host/main/msc_client_async_dconn.c index 7cbf6813bafc..5f1df1cf1512 100644 --- a/components/usb/test_apps/usb_host/main/msc_client_async_dconn.c +++ b/components/usb/test_apps/usb_host/main/msc_client_async_dconn.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -13,8 +13,10 @@ #include "esp_err.h" #include "esp_log.h" #include "mock_msc.h" +#include "dev_msc.h" #include "test_usb_common.h" #include "msc_client.h" +#include "usb/usb_types_ch9.h" #include "usb/usb_host.h" #include "unity.h" @@ -47,12 +49,18 @@ typedef enum { } test_stage_t; typedef struct { + // Test parameters msc_client_test_param_t test_param; - test_stage_t cur_stage; - test_stage_t next_stage; - uint8_t dev_addr_to_open; + // MSC device info + const dev_msc_info_t *dev_info; + usb_speed_t dev_speed; + uint8_t dev_addr; + // Client variables usb_host_client_handle_t client_hdl; usb_device_handle_t dev_hdl; + // Test state + test_stage_t cur_stage; + test_stage_t next_stage; int num_data_transfers; int event_count; } msc_client_obj_t; @@ -100,7 +108,7 @@ static void msc_client_event_cb(const usb_host_client_event_msg_t *event_msg, vo case USB_HOST_CLIENT_EVENT_NEW_DEV: TEST_ASSERT_EQUAL(TEST_STAGE_WAIT_CONN, msc_obj->cur_stage); msc_obj->next_stage = TEST_STAGE_DEV_OPEN; - msc_obj->dev_addr_to_open = event_msg->new_dev.address; + msc_obj->dev_addr = event_msg->new_dev.address; break; case USB_HOST_CLIENT_EVENT_DEV_GONE: msc_obj->event_count++; @@ -118,13 +126,17 @@ static void msc_client_event_cb(const usb_host_client_event_msg_t *event_msg, vo void msc_client_async_dconn_task(void *arg) { msc_client_obj_t msc_obj; + // Initialize test params memcpy(&msc_obj.test_param, arg, sizeof(msc_client_test_param_t)); - msc_obj.cur_stage = TEST_STAGE_WAIT_CONN; - msc_obj.next_stage = TEST_STAGE_WAIT_CONN; - msc_obj.dev_addr_to_open = 0; + // Initialize MSC device info + msc_obj.dev_info = dev_msc_get_info(); + // Initialize client variables msc_obj.client_hdl = NULL; msc_obj.dev_hdl = NULL; - msc_obj.num_data_transfers = msc_obj.test_param.num_sectors_per_xfer / MOCK_MSC_SCSI_SECTOR_SIZE; + // Initialize test state + msc_obj.cur_stage = TEST_STAGE_WAIT_CONN; + msc_obj.next_stage = TEST_STAGE_WAIT_CONN; + msc_obj.num_data_transfers = msc_obj.test_param.num_sectors_per_xfer / msc_obj.dev_info->scsi_sector_size; msc_obj.event_count = 0; // Register client @@ -142,7 +154,7 @@ void msc_client_async_dconn_task(void *arg) usb_transfer_t *xfer_out; // Must be large enough to contain CBW and MSC reset control transfer usb_transfer_t *xfer_in[msc_obj.num_data_transfers]; // We manually split the data stage into multiple transfers size_t xfer_out_size = MAX(sizeof(mock_msc_bulk_cbw_t), sizeof(usb_setup_packet_t)); - size_t xfer_in_size = MOCK_MSC_SCSI_SECTOR_SIZE; + size_t xfer_in_size = msc_obj.dev_info->scsi_sector_size; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_alloc(xfer_out_size, 0, &xfer_out)); xfer_out->context = (void *)&msc_obj; for (int i = 0; i < msc_obj.num_data_transfers; i++) { @@ -175,7 +187,7 @@ void msc_client_async_dconn_task(void *arg) case TEST_STAGE_DEV_OPEN: { ESP_LOGD(MSC_CLIENT_TAG, "Open"); // Open the device - TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_open(msc_obj.client_hdl, msc_obj.dev_addr_to_open, &msc_obj.dev_hdl)); + TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_open(msc_obj.client_hdl, msc_obj.dev_addr, &msc_obj.dev_hdl)); // Target our transfers to the device xfer_out->device_handle = msc_obj.dev_hdl; xfer_out->callback = msc_reset_cbw_transfer_cb; @@ -183,13 +195,21 @@ void msc_client_async_dconn_task(void *arg) xfer_in[i]->device_handle = msc_obj.dev_hdl; xfer_in[i]->callback = msc_data_transfer_cb; } - // Check the VID/PID of the opened device + // Get device info to get device speed + usb_device_info_t dev_info; + TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_info(msc_obj.dev_hdl, &dev_info)); + msc_obj.dev_speed = dev_info.speed; + // Check the device descriptor of the opened device const usb_device_desc_t *device_desc; + const usb_device_desc_t *device_desc_ref = dev_msc_get_dev_desc(msc_obj.dev_speed); TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_device_descriptor(msc_obj.dev_hdl, &device_desc)); - TEST_ASSERT_EQUAL(msc_obj.test_param.idVendor, device_desc->idVendor); - TEST_ASSERT_EQUAL(msc_obj.test_param.idProduct, device_desc->idProduct); + TEST_ASSERT_EQUAL(device_desc_ref->bLength, device_desc->bLength); + TEST_ASSERT_EQUAL_MEMORY_MESSAGE(device_desc_ref, device_desc, device_desc_ref->bLength, "Device descriptors do not match."); // Claim the MSC interface - TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_claim(msc_obj.client_hdl, msc_obj.dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER, MOCK_MSC_SCSI_INTF_ALT_SETTING)); + TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_claim(msc_obj.client_hdl, + msc_obj.dev_hdl, + msc_obj.dev_info->bInterfaceNumber, + msc_obj.dev_info->bAlternateSetting)); msc_obj.next_stage = TEST_STAGE_MSC_RESET; skip_event_handling = true; // Need to execute TEST_STAGE_MSC_RESET break; @@ -197,7 +217,7 @@ void msc_client_async_dconn_task(void *arg) case TEST_STAGE_MSC_RESET: { ESP_LOGD(MSC_CLIENT_TAG, "MSC Reset"); // Send an MSC SCSI interface reset - MOCK_MSC_SCSI_REQ_INIT_RESET((usb_setup_packet_t *)xfer_out->data_buffer, MOCK_MSC_SCSI_INTF_NUMBER); + MOCK_MSC_SCSI_REQ_INIT_RESET((usb_setup_packet_t *)xfer_out->data_buffer, msc_obj.dev_info->bInterfaceNumber); xfer_out->num_bytes = sizeof(usb_setup_packet_t); xfer_out->bEndpointAddress = 0; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit_control(msc_obj.client_hdl, xfer_out)); @@ -206,9 +226,14 @@ void msc_client_async_dconn_task(void *arg) } case TEST_STAGE_MSC_CBW: { ESP_LOGD(MSC_CLIENT_TAG, "CBW"); - mock_msc_scsi_init_cbw((mock_msc_bulk_cbw_t *)xfer_out->data_buffer, true, 0, msc_obj.test_param.num_sectors_per_xfer, msc_obj.test_param.msc_scsi_xfer_tag); + mock_msc_scsi_init_cbw((mock_msc_bulk_cbw_t *)xfer_out->data_buffer, + true, + 0, + msc_obj.test_param.num_sectors_per_xfer, + msc_obj.dev_info->scsi_sector_size, + msc_obj.test_param.msc_scsi_xfer_tag); xfer_out->num_bytes = sizeof(mock_msc_bulk_cbw_t); - xfer_out->bEndpointAddress = MOCK_MSC_SCSI_BULK_OUT_EP_ADDR; + xfer_out->bEndpointAddress = msc_obj.dev_info->out_up_addr; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit(xfer_out)); // Next stage set from transfer callback break; @@ -216,9 +241,11 @@ void msc_client_async_dconn_task(void *arg) case TEST_STAGE_MSC_DATA_DCONN: { ESP_LOGD(MSC_CLIENT_TAG, "Data and disconnect"); // Setup the Data IN transfers + const usb_ep_desc_t *in_ep_desc = dev_msc_get_in_ep_desc(msc_obj.dev_speed); + const int bulk_ep_mps = USB_EP_DESC_GET_MPS(in_ep_desc); for (int i = 0; i < msc_obj.num_data_transfers; i++) { - xfer_in[i]->num_bytes = usb_round_up_to_mps(MOCK_MSC_SCSI_SECTOR_SIZE, MOCK_MSC_SCSI_BULK_EP_MPS); - xfer_in[i]->bEndpointAddress = MOCK_MSC_SCSI_BULK_IN_EP_ADDR; + xfer_in[i]->num_bytes = usb_round_up_to_mps(msc_obj.dev_info->scsi_sector_size, bulk_ep_mps); + xfer_in[i]->bEndpointAddress = msc_obj.dev_info->in_ep_addr; } // Submit those transfers for (int i = 0; i < msc_obj.num_data_transfers; i++) { @@ -231,7 +258,7 @@ void msc_client_async_dconn_task(void *arg) } case TEST_STAGE_DEV_CLOSE: { ESP_LOGD(MSC_CLIENT_TAG, "Close"); - TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_release(msc_obj.client_hdl, msc_obj.dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER)); + TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_release(msc_obj.client_hdl, msc_obj.dev_hdl, msc_obj.dev_info->bInterfaceNumber)); TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_close(msc_obj.client_hdl, msc_obj.dev_hdl)); dconn_iter++; if (dconn_iter < TEST_DCONN_ITERATIONS) { diff --git a/components/usb/test_apps/usb_host/main/msc_client_async_enum.c b/components/usb/test_apps/usb_host/main/msc_client_async_enum.c index ee2161da6c79..e33ad0ad3675 100644 --- a/components/usb/test_apps/usb_host/main/msc_client_async_enum.c +++ b/components/usb/test_apps/usb_host/main/msc_client_async_enum.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -12,6 +12,7 @@ #include "freertos/task.h" #include "esp_err.h" #include "esp_log.h" +#include "dev_msc.h" #include "mock_msc.h" #include "test_usb_common.h" #include "msc_client.h" @@ -48,6 +49,7 @@ typedef struct { uint8_t dev_addr_to_open; usb_host_client_handle_t client_hdl; usb_device_handle_t dev_hdl; + usb_speed_t dev_speed; } msc_client_obj_t; static void msc_client_event_cb(const usb_host_client_event_msg_t *event_msg, void *arg) @@ -113,16 +115,20 @@ void msc_client_async_enum_task(void *arg) // Open the device TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_open(msc_obj.client_hdl, msc_obj.dev_addr_to_open, &msc_obj.dev_hdl)); msc_obj.next_stage = TEST_STAGE_CHECK_DEV_DESC; + // Get device info to get device speed + usb_device_info_t dev_info; + TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_info(msc_obj.dev_hdl, &dev_info)); + msc_obj.dev_speed = dev_info.speed; skip_event_handling = true; // Need to execute TEST_STAGE_CHECK_DEV_DESC break; } case TEST_STAGE_CHECK_DEV_DESC: { // Check the device descriptor const usb_device_desc_t *device_desc; - const usb_device_desc_t *device_desc_ref = &mock_msc_scsi_dev_desc; + const usb_device_desc_t *device_desc_ref = dev_msc_get_dev_desc(msc_obj.dev_speed); TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_device_descriptor(msc_obj.dev_hdl, &device_desc)); TEST_ASSERT_EQUAL(device_desc_ref->bLength, device_desc->bLength); - TEST_ASSERT_EQUAL_MEMORY_MESSAGE(device_desc_ref, device_desc, device_desc_ref->bLength, "Device descriptors do not match."); + TEST_ASSERT_EQUAL_MEMORY_MESSAGE(device_desc_ref, device_desc, sizeof(usb_device_desc_t), "Device descriptors do not match."); msc_obj.next_stage = TEST_STAGE_CHECK_CONFIG_DESC; skip_event_handling = true; // Need to execute TEST_STAGE_CHECK_CONFIG_DESC break; @@ -131,10 +137,10 @@ void msc_client_async_enum_task(void *arg) case TEST_STAGE_CHECK_CONFIG_DESC: { // Check the configuration descriptor const usb_config_desc_t *config_desc; - const usb_config_desc_t *config_desc_ref = (const usb_config_desc_t *)mock_msc_scsi_config_desc; + const usb_config_desc_t *config_desc_ref = dev_msc_get_config_desc(msc_obj.dev_speed); TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_active_config_descriptor(msc_obj.dev_hdl, &config_desc)); TEST_ASSERT_EQUAL_MESSAGE(config_desc_ref->wTotalLength, config_desc->wTotalLength, "Incorrect length of CFG descriptor"); - TEST_ASSERT_EQUAL_MEMORY_MESSAGE(config_desc_ref, config_desc, config_desc_ref->wTotalLength, "Configuration descriptors do not match"); + TEST_ASSERT_EQUAL_MEMORY_MESSAGE(config_desc_ref, config_desc, sizeof(usb_config_desc_t), "Configuration descriptors do not match"); msc_obj.next_stage = TEST_STAGE_CHECK_STR_DESC; skip_event_handling = true; // Need to execute TEST_STAGE_CHECK_STR_DESC break; @@ -143,15 +149,15 @@ void msc_client_async_enum_task(void *arg) usb_device_info_t dev_info; TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_info(msc_obj.dev_hdl, &dev_info)); // Check manufacturer string descriptors - const usb_str_desc_t *manu_str_desc_ref = (const usb_str_desc_t *)mock_msc_scsi_str_desc_manu; - const usb_str_desc_t *product_str_desc_ref = (const usb_str_desc_t *)mock_msc_scsi_str_desc_prod; - const usb_str_desc_t *ser_num_str_desc_ref = (const usb_str_desc_t *)mock_msc_scsi_str_desc_ser_num; + const usb_str_desc_t *manu_str_desc_ref = dev_msc_get_str_desc_manu(); + const usb_str_desc_t *product_str_desc_ref = dev_msc_get_str_desc_prod(); + const usb_str_desc_t *ser_num_str_desc_ref = dev_msc_get_str_desc_ser(); TEST_ASSERT_EQUAL(manu_str_desc_ref->bLength, dev_info.str_desc_manufacturer->bLength); TEST_ASSERT_EQUAL(product_str_desc_ref->bLength, dev_info.str_desc_product->bLength); TEST_ASSERT_EQUAL(ser_num_str_desc_ref->bLength, dev_info.str_desc_serial_num->bLength); TEST_ASSERT_EQUAL_MEMORY_MESSAGE(manu_str_desc_ref, dev_info.str_desc_manufacturer, manu_str_desc_ref->bLength, "Manufacturer string descriptors do not match."); TEST_ASSERT_EQUAL_MEMORY_MESSAGE(product_str_desc_ref, dev_info.str_desc_product, manu_str_desc_ref->bLength, "Product string descriptors do not match."); - // TEST_ASSERT_EQUAL_MEMORY_MESSAGE(ser_num_str_desc_ref, dev_info.str_desc_serial_num , manu_str_desc_ref->bLength, "Serial number string descriptors do not match."); + TEST_ASSERT_EQUAL_MEMORY_MESSAGE(ser_num_str_desc_ref, dev_info.str_desc_serial_num, manu_str_desc_ref->bLength, "Serial number string descriptors do not match."); // Get dev info and compare msc_obj.next_stage = TEST_STAGE_DEV_CLOSE; skip_event_handling = true; // Need to execute TEST_STAGE_DEV_CLOSE diff --git a/components/usb/test_apps/usb_host/main/msc_client_async_seq.c b/components/usb/test_apps/usb_host/main/msc_client_async_seq.c index 4db69f4fff1a..192012fb3421 100644 --- a/components/usb/test_apps/usb_host/main/msc_client_async_seq.c +++ b/components/usb/test_apps/usb_host/main/msc_client_async_seq.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -14,6 +14,7 @@ #include "esp_log.h" #include "test_usb_common.h" #include "mock_msc.h" +#include "dev_msc.h" #include "msc_client.h" #include "usb/usb_host.h" #include "unity.h" @@ -46,12 +47,18 @@ typedef enum { } test_stage_t; typedef struct { + // Test parameters msc_client_test_param_t test_param; - test_stage_t cur_stage; - test_stage_t next_stage; - uint8_t dev_addr_to_open; + // MSC device info + const dev_msc_info_t *dev_info; + usb_speed_t dev_speed; + uint8_t dev_addr; + // Client variables usb_host_client_handle_t client_hdl; usb_device_handle_t dev_hdl; + // Test state + test_stage_t cur_stage; + test_stage_t next_stage; int num_sectors_read; } msc_client_obj_t; @@ -76,7 +83,7 @@ static void msc_transfer_cb(usb_transfer_t *transfer) case TEST_STAGE_MSC_DATA: { // Check MSC SCSI data IN transfer TEST_ASSERT_EQUAL_MESSAGE(USB_TRANSFER_STATUS_COMPLETED, transfer->status, "Transfer NOT completed"); - TEST_ASSERT_EQUAL(MOCK_MSC_SCSI_SECTOR_SIZE * msc_obj->test_param.num_sectors_per_xfer, transfer->actual_num_bytes); + TEST_ASSERT_EQUAL(msc_obj->dev_info->scsi_sector_size * msc_obj->test_param.num_sectors_per_xfer, transfer->actual_num_bytes); msc_obj->next_stage = TEST_STAGE_MSC_CSW; break; } @@ -106,7 +113,7 @@ static void msc_client_event_cb(const usb_host_client_event_msg_t *event_msg, vo case USB_HOST_CLIENT_EVENT_NEW_DEV: TEST_ASSERT_EQUAL(TEST_STAGE_WAIT_CONN, msc_obj->cur_stage); msc_obj->next_stage = TEST_STAGE_DEV_OPEN; - msc_obj->dev_addr_to_open = event_msg->new_dev.address; + msc_obj->dev_addr = event_msg->new_dev.address; break; default: abort(); // Should never occur in this test @@ -118,12 +125,17 @@ static void msc_client_event_cb(const usb_host_client_event_msg_t *event_msg, vo void msc_client_async_seq_task(void *arg) { msc_client_obj_t msc_obj; + // Initialize test params memcpy(&msc_obj.test_param, arg, sizeof(msc_client_test_param_t)); - msc_obj.cur_stage = TEST_STAGE_WAIT_CONN; - msc_obj.next_stage = TEST_STAGE_WAIT_CONN; + // Initialize MSC device info + msc_obj.dev_info = dev_msc_get_info(); + // Initialize client variables msc_obj.client_hdl = NULL; - msc_obj.dev_addr_to_open = 0; msc_obj.dev_hdl = NULL; + // Initialize test state + msc_obj.cur_stage = TEST_STAGE_WAIT_CONN; + msc_obj.next_stage = TEST_STAGE_WAIT_CONN; + msc_obj.dev_addr = 0; msc_obj.num_sectors_read = 0; // Register client @@ -137,17 +149,10 @@ void msc_client_async_seq_task(void *arg) }; TEST_ASSERT_EQUAL(ESP_OK, usb_host_client_register(&client_config, &msc_obj.client_hdl)); - // Allocate transfers - usb_transfer_t *xfer_out = NULL; // Must be large enough to contain CBW and MSC reset control transfer - usb_transfer_t *xfer_in = NULL; // Must be large enough to contain CSW and Data - size_t out_worst_case_size = MAX(sizeof(mock_msc_bulk_cbw_t), sizeof(usb_setup_packet_t)); - size_t in_worst_case_size = usb_round_up_to_mps(MAX(MOCK_MSC_SCSI_SECTOR_SIZE * msc_obj.test_param.num_sectors_per_xfer, sizeof(mock_msc_bulk_csw_t)), MOCK_MSC_SCSI_BULK_EP_MPS); - TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_alloc(out_worst_case_size, 0, &xfer_out)); - TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_alloc(in_worst_case_size, 0, &xfer_in)); - xfer_out->callback = msc_transfer_cb; - xfer_in->callback = msc_transfer_cb; - xfer_out->context = (void *)&msc_obj; - xfer_in->context = (void *)&msc_obj; + // IN MPS and transfers to be set/allocated later (after device connects and MPS is determined) + int in_ep_mps = 0; + usb_transfer_t *xfer_in = NULL; + usb_transfer_t *xfer_out = NULL; // Wait to be started by main thread ulTaskNotifyTake(pdTRUE, portMAX_DELAY); @@ -169,17 +174,44 @@ void msc_client_async_seq_task(void *arg) case TEST_STAGE_DEV_OPEN: { ESP_LOGD(MSC_CLIENT_TAG, "Open"); // Open the device - TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_open(msc_obj.client_hdl, msc_obj.dev_addr_to_open, &msc_obj.dev_hdl)); - // Target our transfers to the device - xfer_out->device_handle = msc_obj.dev_hdl; - xfer_in->device_handle = msc_obj.dev_hdl; - // Check the VID/PID of the opened device + TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_open(msc_obj.client_hdl, msc_obj.dev_addr, &msc_obj.dev_hdl)); + // Get device info to get device speed + usb_device_info_t dev_info; + TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_info(msc_obj.dev_hdl, &dev_info)); + msc_obj.dev_speed = dev_info.speed; + // Check that the device descriptor matches our expected MSC device const usb_device_desc_t *device_desc; + const usb_device_desc_t *device_desc_ref = dev_msc_get_dev_desc(msc_obj.dev_speed); TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_device_descriptor(msc_obj.dev_hdl, &device_desc)); - TEST_ASSERT_EQUAL(msc_obj.test_param.idVendor, device_desc->idVendor); - TEST_ASSERT_EQUAL(msc_obj.test_param.idProduct, device_desc->idProduct); + TEST_ASSERT_EQUAL(device_desc_ref->bLength, device_desc->bLength); + TEST_ASSERT_EQUAL_MEMORY_MESSAGE(device_desc_ref, device_desc, sizeof(usb_device_desc_t), "Device descriptors do not match."); // Claim the MSC interface - TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_claim(msc_obj.client_hdl, msc_obj.dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER, MOCK_MSC_SCSI_INTF_ALT_SETTING)); + TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_claim(msc_obj.client_hdl, + msc_obj.dev_hdl, + msc_obj.dev_info->bInterfaceNumber, + msc_obj.dev_info->bAlternateSetting)); + /* + Allocate transfers + + IN transfer must be large enough to contain CSW and Data + OUT transfer must be large enough to contain CBW and MSC reset control transfer + */ + const usb_ep_desc_t *in_ep_desc = dev_msc_get_in_ep_desc(msc_obj.dev_speed); + in_ep_mps = USB_EP_DESC_GET_MPS(in_ep_desc); + const size_t in_worst_case_size = usb_round_up_to_mps(MAX(msc_obj.dev_info->scsi_sector_size * msc_obj.test_param.num_sectors_per_xfer, + sizeof(mock_msc_bulk_csw_t)), + in_ep_mps); + const size_t out_worst_case_size = MAX(sizeof(mock_msc_bulk_cbw_t), sizeof(usb_setup_packet_t)); + TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_alloc(out_worst_case_size, 0, &xfer_out)); + TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_alloc(in_worst_case_size, 0, &xfer_in)); + xfer_out->callback = msc_transfer_cb; + xfer_in->callback = msc_transfer_cb; + xfer_out->context = (void *)&msc_obj; + xfer_in->context = (void *)&msc_obj; + // Target our transfers to the device + xfer_out->device_handle = msc_obj.dev_hdl; + xfer_in->device_handle = msc_obj.dev_hdl; + // Set next stage msc_obj.next_stage = TEST_STAGE_MSC_RESET; skip_event_handling = true; // Need to execute TEST_STAGE_MSC_RESET break; @@ -187,7 +219,7 @@ void msc_client_async_seq_task(void *arg) case TEST_STAGE_MSC_RESET: { ESP_LOGD(MSC_CLIENT_TAG, "MSC Reset"); // Send an MSC SCSI interface reset - MOCK_MSC_SCSI_REQ_INIT_RESET((usb_setup_packet_t *)xfer_out->data_buffer, MOCK_MSC_SCSI_INTF_NUMBER); + MOCK_MSC_SCSI_REQ_INIT_RESET((usb_setup_packet_t *)xfer_out->data_buffer, msc_obj.dev_info->bInterfaceNumber); xfer_out->num_bytes = sizeof(usb_setup_packet_t); xfer_out->bEndpointAddress = 0; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit_control(msc_obj.client_hdl, xfer_out)); @@ -198,9 +230,14 @@ void msc_client_async_seq_task(void *arg) } case TEST_STAGE_MSC_CBW: { ESP_LOGD(MSC_CLIENT_TAG, "CBW"); - mock_msc_scsi_init_cbw((mock_msc_bulk_cbw_t *)xfer_out->data_buffer, true, msc_obj.next_stage, msc_obj.test_param.num_sectors_per_xfer, msc_obj.test_param.msc_scsi_xfer_tag); + mock_msc_scsi_init_cbw((mock_msc_bulk_cbw_t *)xfer_out->data_buffer, + true, + msc_obj.next_stage, + msc_obj.test_param.num_sectors_per_xfer, + msc_obj.dev_info->scsi_sector_size, + msc_obj.test_param.msc_scsi_xfer_tag); xfer_out->num_bytes = sizeof(mock_msc_bulk_cbw_t); - xfer_out->bEndpointAddress = MOCK_MSC_SCSI_BULK_OUT_EP_ADDR; + xfer_out->bEndpointAddress = msc_obj.dev_info->out_up_addr; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit(xfer_out)); // Test that an inflight transfer cannot be resubmitted TEST_ASSERT_EQUAL(ESP_ERR_NOT_FINISHED, usb_host_transfer_submit(xfer_out)); @@ -209,8 +246,8 @@ void msc_client_async_seq_task(void *arg) } case TEST_STAGE_MSC_DATA: { ESP_LOGD(MSC_CLIENT_TAG, "Data"); - xfer_in->num_bytes = usb_round_up_to_mps(MOCK_MSC_SCSI_SECTOR_SIZE * msc_obj.test_param.num_sectors_per_xfer, MOCK_MSC_SCSI_BULK_EP_MPS); - xfer_in->bEndpointAddress = MOCK_MSC_SCSI_BULK_IN_EP_ADDR; + xfer_in->num_bytes = usb_round_up_to_mps(msc_obj.dev_info->scsi_sector_size * msc_obj.test_param.num_sectors_per_xfer, in_ep_mps); + xfer_in->bEndpointAddress = msc_obj.dev_info->in_ep_addr; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit(xfer_in)); // Test that an inflight transfer cannot be resubmitted TEST_ASSERT_EQUAL(ESP_ERR_NOT_FINISHED, usb_host_transfer_submit(xfer_in)); @@ -219,8 +256,8 @@ void msc_client_async_seq_task(void *arg) } case TEST_STAGE_MSC_CSW: { ESP_LOGD(MSC_CLIENT_TAG, "CSW"); - xfer_in->num_bytes = usb_round_up_to_mps(sizeof(mock_msc_bulk_csw_t), MOCK_MSC_SCSI_BULK_EP_MPS); - xfer_in->bEndpointAddress = MOCK_MSC_SCSI_BULK_IN_EP_ADDR; + xfer_in->num_bytes = usb_round_up_to_mps(sizeof(mock_msc_bulk_csw_t), in_ep_mps); + xfer_in->bEndpointAddress = msc_obj.dev_info->in_ep_addr; TEST_ASSERT_EQUAL(ESP_OK, usb_host_transfer_submit(xfer_in)); // Test that an inflight transfer cannot be resubmitted TEST_ASSERT_EQUAL(ESP_ERR_NOT_FINISHED, usb_host_transfer_submit(xfer_in)); @@ -229,7 +266,7 @@ void msc_client_async_seq_task(void *arg) } case TEST_STAGE_DEV_CLOSE: { ESP_LOGD(MSC_CLIENT_TAG, "Close"); - TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_release(msc_obj.client_hdl, msc_obj.dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER)); + TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_release(msc_obj.client_hdl, msc_obj.dev_hdl, msc_obj.dev_info->bInterfaceNumber)); TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_close(msc_obj.client_hdl, msc_obj.dev_hdl)); exit_loop = true; break; diff --git a/components/usb/test_apps/usb_host/main/test_app_main.c b/components/usb/test_apps/usb_host/main/test_app_main.c index 3301425ab1ed..93e2510374c7 100644 --- a/components/usb/test_apps/usb_host/main/test_app_main.c +++ b/components/usb/test_apps/usb_host/main/test_app_main.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: CC0-1.0 */ @@ -7,17 +7,16 @@ #include "unity.h" #include "unity_test_runner.h" #include "unity_test_utils_memory.h" - #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "test_usb_common.h" -#include "mock_msc.h" +#include "dev_msc.h" #include "usb/usb_host.h" void setUp(void) { - mock_msc_scsi_init_reference_descriptors(); unity_utils_record_free_mem(); + dev_msc_init(); test_usb_init_phy(); // Initialize the internal USB PHY and USB Controller for testing // Install USB Host usb_host_config_t host_config = { diff --git a/components/usb/test_apps/usb_host/main/test_usb_host_async.c b/components/usb/test_apps/usb_host/main/test_usb_host_async.c index dbd9bad90318..c649f7ce9504 100644 --- a/components/usb/test_apps/usb_host/main/test_usb_host_async.c +++ b/components/usb/test_apps/usb_host/main/test_usb_host_async.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +11,7 @@ #include "esp_err.h" #include "esp_intr_alloc.h" #include "test_usb_common.h" -#include "mock_msc.h" +#include "dev_msc.h" #include "msc_client.h" #include "ctrl_client.h" #include "usb/usb_host.h" @@ -51,8 +51,6 @@ TEST_CASE("Test USB Host async client (single client)", "[usb_host][full_speed]" .num_sectors_to_read = TEST_MSC_NUM_SECTORS_TOTAL, .num_sectors_per_xfer = TEST_MSC_NUM_SECTORS_PER_XFER, .msc_scsi_xfer_tag = TEST_MSC_SCSI_TAG, - .idVendor = MOCK_MSC_SCSI_DEV_ID_VENDOR, - .idProduct = MOCK_MSC_SCSI_DEV_ID_PRODUCT, }; TaskHandle_t task_hdl; xTaskCreatePinnedToCore(msc_client_async_seq_task, "async", 4096, (void *)¶ms, 2, &task_hdl, 0); @@ -101,8 +99,6 @@ TEST_CASE("Test USB Host async client (multi client)", "[usb_host][full_speed]") .num_sectors_to_read = TEST_MSC_NUM_SECTORS_TOTAL, .num_sectors_per_xfer = TEST_MSC_NUM_SECTORS_PER_XFER, .msc_scsi_xfer_tag = TEST_MSC_SCSI_TAG, - .idVendor = MOCK_MSC_SCSI_DEV_ID_VENDOR, - .idProduct = MOCK_MSC_SCSI_DEV_ID_PRODUCT, }; TaskHandle_t msc_task_hdl; xTaskCreatePinnedToCore(msc_client_async_seq_task, "msc", 4096, (void *)&msc_params, 2, &msc_task_hdl, 0); @@ -111,8 +107,6 @@ TEST_CASE("Test USB Host async client (multi client)", "[usb_host][full_speed]") // Create task a control transfer client ctrl_client_test_param_t ctrl_params = { .num_ctrl_xfer_to_send = TEST_CTRL_NUM_TRANSFERS, - .idVendor = MOCK_MSC_SCSI_DEV_ID_VENDOR, - .idProduct = MOCK_MSC_SCSI_DEV_ID_PRODUCT, }; TaskHandle_t ctrl_task_hdl; xTaskCreatePinnedToCore(ctrl_client_async_seq_task, "ctrl", 4096, (void *)&ctrl_params, 2, &ctrl_task_hdl, 0); @@ -226,21 +220,35 @@ TEST_CASE("Test USB Host async API", "[usb_host][full_speed][low_speed]") TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_device_open(client0_hdl, 0, &client0_dev_hdl)); // Check that the device cannot be opened again by the same client + const dev_msc_info_t *dev_info = dev_msc_get_info(); usb_device_handle_t dummy_dev_hdl; TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_device_open(client0_hdl, dev_addr, &dummy_dev_hdl)); TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_device_open(client1_hdl, dev_addr, &dummy_dev_hdl)); printf("Claiming interface\n"); // Check that both clients cannot claim the same interface - TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_claim(client0_hdl, client0_dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER, MOCK_MSC_SCSI_INTF_ALT_SETTING)); - TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_interface_claim(client1_hdl, client1_dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER, MOCK_MSC_SCSI_INTF_ALT_SETTING)); + TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_claim(client0_hdl, + client0_dev_hdl, + dev_info->bInterfaceNumber, + dev_info->bAlternateSetting)); + TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_interface_claim(client1_hdl, + client1_dev_hdl, + dev_info->bInterfaceNumber, + dev_info->bAlternateSetting)); // Check that client0 cannot claim the same interface multiple times - TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_interface_claim(client0_hdl, client0_dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER, MOCK_MSC_SCSI_INTF_ALT_SETTING)); + TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_interface_claim(client0_hdl, + client0_dev_hdl, + dev_info->bInterfaceNumber, + dev_info->bAlternateSetting)); printf("Releasing interface\n"); // Check that client0 can release the interface - TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_release(client0_hdl, client0_dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER)); + TEST_ASSERT_EQUAL(ESP_OK, usb_host_interface_release(client0_hdl, + client0_dev_hdl, + dev_info->bInterfaceNumber)); // Check that client0 cannot release interface it has not claimed - TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_interface_release(client0_hdl, client0_dev_hdl, MOCK_MSC_SCSI_INTF_NUMBER)); + TEST_ASSERT_NOT_EQUAL(ESP_OK, usb_host_interface_release(client0_hdl, + client0_dev_hdl, + dev_info->bInterfaceNumber)); // Wait until the device disconnects and the clients receive the event test_usb_set_phy_state(false, 0); diff --git a/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c b/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c index 6be17aa848a1..263898c0de95 100644 --- a/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c +++ b/components/usb/test_apps/usb_host/main/test_usb_host_plugging.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -11,6 +11,7 @@ #include "esp_intr_alloc.h" #include "test_usb_common.h" #include "mock_msc.h" +#include "dev_msc.h" #include "msc_client.h" #include "ctrl_client.h" #include "usb/usb_host.h" @@ -84,12 +85,11 @@ Test USB Host Library Sudden Disconnection Handling (with client) TEST_CASE("Test USB Host sudden disconnection (single client)", "[usb_host][full_speed]") { // Create task to run client that communicates with MSC SCSI interface + const dev_msc_info_t *dev_info = dev_msc_get_info(); msc_client_test_param_t params = { .num_sectors_to_read = 1, // Unused by disconnect MSC client - .num_sectors_per_xfer = TEST_FORCE_DCONN_NUM_TRANSFERS * MOCK_MSC_SCSI_SECTOR_SIZE, + .num_sectors_per_xfer = TEST_FORCE_DCONN_NUM_TRANSFERS * dev_info->scsi_sector_size, .msc_scsi_xfer_tag = TEST_MSC_SCSI_TAG, - .idVendor = MOCK_MSC_SCSI_DEV_ID_VENDOR, - .idProduct = MOCK_MSC_SCSI_DEV_ID_PRODUCT, }; TaskHandle_t task_hdl; xTaskCreatePinnedToCore(msc_client_async_dconn_task, "async", 4096, (void *)¶ms, 2, &task_hdl, 0); From ceb1c01cc5e8939ee1eb934d471d10a0d58a2dbc Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Thu, 30 May 2024 19:25:18 +0800 Subject: [PATCH 04/56] fix(usb): Make string descriptor checks in unit tests optional Checking for an exact match for product or serial and string descriptors can lead to test failures if the USB devices connected to the runner is changed. This commit adds some kconfig options to make the string descriptor checks optional, with the product and serial string checks being disabled by default. --- .../test_apps/usb_host/main/Kconfig.projbuild | 24 +++++++++++++++++++ .../usb_host/main/msc_client_async_enum.c | 17 +++++++++---- 2 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 components/usb/test_apps/usb_host/main/Kconfig.projbuild diff --git a/components/usb/test_apps/usb_host/main/Kconfig.projbuild b/components/usb/test_apps/usb_host/main/Kconfig.projbuild new file mode 100644 index 000000000000..8706cdd15da6 --- /dev/null +++ b/components/usb/test_apps/usb_host/main/Kconfig.projbuild @@ -0,0 +1,24 @@ +menu "USB Host Library Test" + + config USB_HOST_TEST_CHECK_MANU_STR + bool "Check manufacturer string descriptor" + default y + help + USB Host tests that check string descriptors will check the manufacturer string + descriptor of the connected device. + + config USB_HOST_TEST_CHECK_PROD_STR + bool "Check product string descriptor" + default n + help + USB Host tests that check string descriptors will check the product string descriptor + of the connected device. + + config USB_HOST_TEST_CHECK_SERIAL_STR + bool "Check serial string descriptor" + default n + help + USB Host tests that check string descriptors will check the serial string descriptor + of the connected device. + +endmenu diff --git a/components/usb/test_apps/usb_host/main/msc_client_async_enum.c b/components/usb/test_apps/usb_host/main/msc_client_async_enum.c index e33ad0ad3675..68c783864761 100644 --- a/components/usb/test_apps/usb_host/main/msc_client_async_enum.c +++ b/components/usb/test_apps/usb_host/main/msc_client_async_enum.c @@ -146,19 +146,26 @@ void msc_client_async_enum_task(void *arg) break; } case TEST_STAGE_CHECK_STR_DESC: { + // Get dev info and compare usb_device_info_t dev_info; TEST_ASSERT_EQUAL(ESP_OK, usb_host_device_info(msc_obj.dev_hdl, &dev_info)); +#if CONFIG_USB_HOST_TEST_CHECK_MANU_STR // Check manufacturer string descriptors const usb_str_desc_t *manu_str_desc_ref = dev_msc_get_str_desc_manu(); - const usb_str_desc_t *product_str_desc_ref = dev_msc_get_str_desc_prod(); - const usb_str_desc_t *ser_num_str_desc_ref = dev_msc_get_str_desc_ser(); TEST_ASSERT_EQUAL(manu_str_desc_ref->bLength, dev_info.str_desc_manufacturer->bLength); - TEST_ASSERT_EQUAL(product_str_desc_ref->bLength, dev_info.str_desc_product->bLength); - TEST_ASSERT_EQUAL(ser_num_str_desc_ref->bLength, dev_info.str_desc_serial_num->bLength); TEST_ASSERT_EQUAL_MEMORY_MESSAGE(manu_str_desc_ref, dev_info.str_desc_manufacturer, manu_str_desc_ref->bLength, "Manufacturer string descriptors do not match."); +#endif // CONFIG_USB_HOST_TEST_CHECK_MANU_STR +#if CONFIG_USB_HOST_TEST_CHECK_PROD_STR + const usb_str_desc_t *product_str_desc_ref = dev_msc_get_str_desc_prod(); + TEST_ASSERT_EQUAL(product_str_desc_ref->bLength, dev_info.str_desc_product->bLength); TEST_ASSERT_EQUAL_MEMORY_MESSAGE(product_str_desc_ref, dev_info.str_desc_product, manu_str_desc_ref->bLength, "Product string descriptors do not match."); +#endif // CONFIG_USB_HOST_TEST_CHECK_PROD_STR +#if CONFIG_USB_HOST_TEST_CHECK_SERIAL_STR + const usb_str_desc_t *ser_num_str_desc_ref = dev_msc_get_str_desc_ser(); + TEST_ASSERT_EQUAL(ser_num_str_desc_ref->bLength, dev_info.str_desc_serial_num->bLength); TEST_ASSERT_EQUAL_MEMORY_MESSAGE(ser_num_str_desc_ref, dev_info.str_desc_serial_num, manu_str_desc_ref->bLength, "Serial number string descriptors do not match."); - // Get dev info and compare +#endif // CONFIG_USB_HOST_TEST_CHECK_SERIAL_STR + (void) dev_info; // Unused if all string descriptor checks are disabled msc_obj.next_stage = TEST_STAGE_DEV_CLOSE; skip_event_handling = true; // Need to execute TEST_STAGE_DEV_CLOSE break; From fdc6a049432b6061305c829d9a974bd5f6abbdaa Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Fri, 11 Oct 2024 15:47:48 +0800 Subject: [PATCH 05/56] change(esp_hw_support): switch hp_sys default power mode with clock src selection --- components/esp_hw_support/port/esp32c6/pmu_sleep.c | 5 ----- .../esp_hw_support/port/esp32c6/private_include/pmu_param.h | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/components/esp_hw_support/port/esp32c6/pmu_sleep.c b/components/esp_hw_support/port/esp32c6/pmu_sleep.c index 5cf7aa1615e9..9f0d9def6270 100644 --- a/components/esp_hw_support/port/esp32c6/pmu_sleep.c +++ b/components/esp_hw_support/port/esp32c6/pmu_sleep.c @@ -201,11 +201,6 @@ const pmu_sleep_config_t* pmu_sleep_config_default( { pmu_sleep_power_config_t power_default = PMU_SLEEP_POWER_CONFIG_DEFAULT(pd_flags); - uint32_t iram_pd_flags = 0; - iram_pd_flags |= (pd_flags & PMU_SLEEP_PD_MEM_G0) ? BIT(0) : 0; - iram_pd_flags |= (pd_flags & PMU_SLEEP_PD_MEM_G1) ? BIT(1) : 0; - iram_pd_flags |= (pd_flags & PMU_SLEEP_PD_MEM_G2) ? BIT(2) : 0; - iram_pd_flags |= (pd_flags & PMU_SLEEP_PD_MEM_G3) ? BIT(3) : 0; config->power = power_default; pmu_sleep_param_config_t param_default = PMU_SLEEP_PARAM_CONFIG_DEFAULT(pd_flags); diff --git a/components/esp_hw_support/port/esp32c6/private_include/pmu_param.h b/components/esp_hw_support/port/esp32c6/private_include/pmu_param.h index 44ffce061a7c..edf3dcb29c2f 100644 --- a/components/esp_hw_support/port/esp32c6/private_include/pmu_param.h +++ b/components/esp_hw_support/port/esp32c6/private_include/pmu_param.h @@ -365,8 +365,8 @@ typedef struct { #define PMU_SLEEP_ANALOG_DSLP_CONFIG_DEFAULT(pd_flags) { \ .hp_sys = { \ .analog = { \ - .pd_cur = PMU_PD_CUR_SLEEP_ON, \ - .bias_sleep = PMU_BIASSLP_SLEEP_ON, \ + .pd_cur = PMU_PD_CUR_SLEEP_DEFAULT, \ + .bias_sleep = PMU_BIASSLP_SLEEP_DEFAULT, \ .xpd = PMU_HP_XPD_DEEPSLEEP, \ .dbg_atten = PMU_DBG_HP_DEEPSLEEP \ } \ From 6e17a9d8725a5cfadda02a4c79a184d9c35c1dda Mon Sep 17 00:00:00 2001 From: hongshuqing Date: Thu, 18 Apr 2024 14:52:08 +0800 Subject: [PATCH 06/56] fix(h2): modify wrong lslp drvb config --- .../esp_hw_support/port/esp32h2/private_include/pmu_param.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_hw_support/port/esp32h2/private_include/pmu_param.h b/components/esp_hw_support/port/esp32h2/private_include/pmu_param.h index 58fbf97ff48b..52ad70fa2135 100644 --- a/components/esp_hw_support/port/esp32h2/private_include/pmu_param.h +++ b/components/esp_hw_support/port/esp32h2/private_include/pmu_param.h @@ -340,7 +340,7 @@ typedef struct { }, \ .lp_sys[PMU_MODE_LP_SLEEP] = { \ .analog = { \ - .drv_b = PMU_LP_DRVB_DEEPSLEEP, \ + .drv_b = PMU_LP_DRVB_LIGHTSLEEP, \ .pd_cur = PMU_PD_CUR_SLEEP_DEFAULT, \ .bias_sleep = PMU_BIASSLP_SLEEP_DEFAULT, \ .slp_xpd = PMU_LP_SLP_XPD_SLEEP_DEFAULT, \ @@ -407,7 +407,7 @@ typedef struct { typedef struct pmu_sleep_machine_constant { struct { - uint16_t min_slp_time_us; /* Mininum sleep protection time (unit: microsecond) */ + uint16_t min_slp_time_us; /* Minimum sleep protection time (unit: microsecond) */ uint8_t reserved0; uint16_t reserved1; uint16_t analog_wait_time_us; /* LP LDO power up wait time (unit: microsecond) */ @@ -418,7 +418,7 @@ typedef struct pmu_sleep_machine_constant { uint16_t power_up_wait_time_us; /* (unit: microsecond) */ } lp; struct { - uint16_t min_slp_time_us; /* Mininum sleep protection time (unit: microsecond) */ + uint16_t min_slp_time_us; /* Minimum sleep protection time (unit: microsecond) */ uint16_t analog_wait_time_us; /* HP LDO power up wait time (unit: microsecond) */ uint16_t power_supply_wait_time_us; /* (unit: microsecond) */ uint16_t power_up_wait_time_us; /* (unit: microsecond) */ From 590335963c3e56a155f4f48c4377407ae8ff210f Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Thu, 24 Oct 2024 14:11:05 +0800 Subject: [PATCH 07/56] fix(esp_hw_support): enable all supported slow clock at pmu_init --- components/esp_hw_support/port/esp32c6/pmu_param.c | 11 ++--------- components/esp_hw_support/port/esp32h2/pmu_param.c | 11 ++--------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/components/esp_hw_support/port/esp32c6/pmu_param.c b/components/esp_hw_support/port/esp32c6/pmu_param.c index 41c15ab8d025..54c8dd70bc5a 100644 --- a/components/esp_hw_support/port/esp32c6/pmu_param.c +++ b/components/esp_hw_support/port/esp32c6/pmu_param.c @@ -367,21 +367,14 @@ const pmu_hp_system_retention_param_t * pmu_hp_system_retention_param_default(pm /** LP system default parameter */ - -#if CONFIG_ESP_SYSTEM_RTC_EXT_XTAL -# define PMU_SLOW_CLK_USE_EXT_XTAL (1) -#else -# define PMU_SLOW_CLK_USE_EXT_XTAL (0) -#endif - #define PMU_LP_ACTIVE_POWER_CONFIG_DEFAULT() { \ .dig_power = { \ .mem_dslp = 0, \ .peri_pd_en = 0, \ }, \ .clk_power = { \ - .xpd_xtal32k = PMU_SLOW_CLK_USE_EXT_XTAL, \ - .xpd_rc32k = 0, \ + .xpd_xtal32k = 1, \ + .xpd_rc32k = 1, \ .xpd_fosc = 1, \ .pd_osc = 0 \ } \ diff --git a/components/esp_hw_support/port/esp32h2/pmu_param.c b/components/esp_hw_support/port/esp32h2/pmu_param.c index b15e97b78e97..6120a1367ca1 100644 --- a/components/esp_hw_support/port/esp32h2/pmu_param.c +++ b/components/esp_hw_support/port/esp32h2/pmu_param.c @@ -366,21 +366,14 @@ const pmu_hp_system_retention_param_t * pmu_hp_system_retention_param_default(pm /** LP system default parameter */ - -#if CONFIG_ESP_SYSTEM_RTC_EXT_XTAL -# define PMU_SLOW_CLK_USE_EXT_XTAL (1) -#else -# define PMU_SLOW_CLK_USE_EXT_XTAL (0) -#endif - #define PMU_LP_ACTIVE_POWER_CONFIG_DEFAULT() { \ .dig_power = { \ .mem_dslp = 0, \ .peri_pd_en = 0, \ }, \ .clk_power = { \ - .xpd_xtal32k = PMU_SLOW_CLK_USE_EXT_XTAL, \ - .xpd_rc32k = 0, \ + .xpd_xtal32k = 1, \ + .xpd_rc32k = 1, \ .xpd_fosc = 1, \ .pd_osc = 0 \ } \ From b6076491eeb10010e333a7d50aa7e0531f75db82 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Thu, 24 Oct 2024 14:38:13 +0800 Subject: [PATCH 08/56] fix(esp_hw_support): disable unused clock sources after rtc clock switching complete --- components/esp_system/port/soc/esp32c6/clk.c | 11 ++++++++++- components/esp_system/port/soc/esp32h2/clk.c | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/components/esp_system/port/soc/esp32c6/clk.c b/components/esp_system/port/soc/esp32c6/clk.c index 606ec40d617f..eaeaa7a648d2 100644 --- a/components/esp_system/port/soc/esp32c6/clk.c +++ b/components/esp_system/port/soc/esp32c6/clk.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -163,6 +163,15 @@ static void select_rtc_slow_clk(soc_rtc_slow_clk_src_t rtc_slow_clk_src) } rtc_clk_slow_src_set(rtc_slow_clk_src); + // Disable unused clock sources after clock source switching is complete. + // Regardless of the clock source selection, the internal 136K clock source will always keep on. + if (rtc_slow_clk_src != SOC_RTC_SLOW_CLK_SRC_XTAL32K && rtc_slow_clk_src != SOC_RTC_SLOW_CLK_SRC_OSC_SLOW) { + rtc_clk_32k_enable(false); + } + if (rtc_slow_clk_src != SOC_RTC_SLOW_CLK_SRC_RC32K) { + rtc_clk_rc32k_enable(false); + } + if (SLOW_CLK_CAL_CYCLES > 0) { /* TODO: 32k XTAL oscillator has some frequency drift at startup. * Improve calibration routine to wait until the frequency is stable. diff --git a/components/esp_system/port/soc/esp32h2/clk.c b/components/esp_system/port/soc/esp32h2/clk.c index 39a781b6484c..4a6634d177b9 100644 --- a/components/esp_system/port/soc/esp32h2/clk.c +++ b/components/esp_system/port/soc/esp32h2/clk.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -165,6 +165,15 @@ static void select_rtc_slow_clk(soc_rtc_slow_clk_src_t rtc_slow_clk_src) } rtc_clk_slow_src_set(rtc_slow_clk_src); + // Disable unused clock sources after clock source switching is complete. + // Regardless of the clock source selection, the internal 136K clock source will always keep on. + if (rtc_slow_clk_src != SOC_RTC_SLOW_CLK_SRC_XTAL32K && rtc_slow_clk_src != SOC_RTC_SLOW_CLK_SRC_OSC_SLOW) { + rtc_clk_32k_enable(false); + } + if (rtc_slow_clk_src != SOC_RTC_SLOW_CLK_SRC_RC32K) { + rtc_clk_rc32k_enable(false); + } + if (SLOW_CLK_CAL_CYCLES > 0) { /* TODO: 32k XTAL oscillator has some frequency drift at startup. * Improve calibration routine to wait until the frequency is stable. From eedf7b24ec792696de81ddb33a8451da1064292e Mon Sep 17 00:00:00 2001 From: laokaiyao Date: Thu, 26 Sep 2024 15:38:25 +0800 Subject: [PATCH 09/56] fix(i2s): fix i2s half sample rate issue --- components/hal/esp32/include/hal/i2s_ll.h | 13 ++-- components/hal/esp32c3/include/hal/i2s_ll.h | 76 ++++++++++---------- components/hal/esp32c6/include/hal/i2s_ll.h | 52 +++++++------- components/hal/esp32h2/include/hal/i2s_ll.h | 52 +++++++------- components/hal/esp32s2/include/hal/i2s_ll.h | 13 ++-- components/hal/esp32s3/include/hal/i2s_ll.h | 78 ++++++++++----------- 6 files changed, 141 insertions(+), 143 deletions(-) diff --git a/components/hal/esp32/include/hal/i2s_ll.h b/components/hal/esp32/include/hal/i2s_ll.h index 5f33bf42778e..552cde83c863 100644 --- a/components/hal/esp32/include/hal/i2s_ll.h +++ b/components/hal/esp32/include/hal/i2s_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -81,7 +81,7 @@ static inline void i2s_ll_dma_enable_auto_write_back(i2s_dev_t *hw, bool en) } /** - * @brief I2S DMA generate EOF event on data in FIFO poped out + * @brief I2S DMA generate EOF event on data in FIFO popped out * * @param hw Peripheral I2S hardware instance address. * @param en True to enable, False to disable @@ -314,11 +314,6 @@ static inline void i2s_ll_set_raw_mclk_div(i2s_dev_t *hw, uint32_t mclk_div, uin */ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, const i2s_ll_mclk_div_t *mclk_div) { - /* Workaround for inaccurate clock while switching from a relatively low sample rate to a high sample rate - * Set to particular coefficients first then update to the target coefficients, - * otherwise the clock division might be inaccurate. - * the general idea is to set a value that unlike to calculate from the regular decimal */ - i2s_ll_set_raw_mclk_div(hw, 7, 47, 3); i2s_ll_set_raw_mclk_div(hw, mclk_div->integ, mclk_div->denom, mclk_div->numer); } @@ -623,7 +618,7 @@ static inline void i2s_ll_tx_set_bits_mod(i2s_dev_t *hw, uint32_t val) } /** - * @brief Congfigure TX chan bit and audio data bit, on ESP32, sample_bit should equals to data_bit + * @brief Configure TX chan bit and audio data bit, on ESP32, sample_bit should equals to data_bit * * @param hw Peripheral I2S hardware instance address. * @param chan_bit The chan bit width @@ -636,7 +631,7 @@ static inline void i2s_ll_tx_set_sample_bit(i2s_dev_t *hw, uint8_t chan_bit, int } /** - * @brief Congfigure RX chan bit and audio data bit, on ESP32, sample_bit should equals to data_bit + * @brief Configure RX chan bit and audio data bit, on ESP32, sample_bit should equals to data_bit * * @param hw Peripheral I2S hardware instance address. * @param chan_bit The chan bit width diff --git a/components/hal/esp32c3/include/hal/i2s_ll.h b/components/hal/esp32c3/include/hal/i2s_ll.h index e007248f490f..c64682a5679f 100644 --- a/components/hal/esp32c3/include/hal/i2s_ll.h +++ b/components/hal/esp32c3/include/hal/i2s_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -258,15 +258,21 @@ static inline void i2s_ll_tx_set_bck_div_num(i2s_dev_t *hw, uint32_t val) */ static inline void i2s_ll_tx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, uint32_t x, uint32_t y, uint32_t z, uint32_t yn1) { - /* Set the integer part of mclk division */ + /* Workaround for the double division issue. + * The division coefficients must be set in particular sequence. + * And it has to switch to a small division first before setting the target division. */ + HAL_FORCE_MODIFY_U32_REG_FIELD(hw->tx_clkm_conf, tx_clkm_div_num, 2); + hw->tx_clkm_div_conf.tx_clkm_div_yn1 = 0; + hw->tx_clkm_div_conf.tx_clkm_div_y = 1; + hw->tx_clkm_div_conf.tx_clkm_div_z = 0; + hw->tx_clkm_div_conf.tx_clkm_div_x = 0; + + /* Set the target mclk division coefficients */ + hw->tx_clkm_div_conf.tx_clkm_div_yn1 = yn1; + hw->tx_clkm_div_conf.tx_clkm_div_z = z; + hw->tx_clkm_div_conf.tx_clkm_div_y = y; + hw->tx_clkm_div_conf.tx_clkm_div_x = x; HAL_FORCE_MODIFY_U32_REG_FIELD(hw->tx_clkm_conf, tx_clkm_div_num, div_int); - /* Set the decimal part of the mclk division */ - typeof(hw->tx_clkm_div_conf) div = {}; - div.tx_clkm_div_x = x; - div.tx_clkm_div_y = y; - div.tx_clkm_div_z = z; - div.tx_clkm_div_yn1 = yn1; - hw->tx_clkm_div_conf.val = div.val; } /** @@ -281,15 +287,21 @@ static inline void i2s_ll_tx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, ui */ static inline void i2s_ll_rx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, uint32_t x, uint32_t y, uint32_t z, uint32_t yn1) { - /* Set the integer part of mclk division */ + /* Workaround for the double division issue. + * The division coefficients must be set in particular sequence. + * And it has to switch to a small division first before setting the target division. */ + HAL_FORCE_MODIFY_U32_REG_FIELD(hw->rx_clkm_conf, rx_clkm_div_num, 2); + hw->rx_clkm_div_conf.rx_clkm_div_yn1 = 0; + hw->rx_clkm_div_conf.rx_clkm_div_y = 1; + hw->rx_clkm_div_conf.rx_clkm_div_z = 0; + hw->rx_clkm_div_conf.rx_clkm_div_x = 0; + + /* Set the target mclk division coefficients */ + hw->rx_clkm_div_conf.rx_clkm_div_yn1 = yn1; + hw->rx_clkm_div_conf.rx_clkm_div_z = z; + hw->rx_clkm_div_conf.rx_clkm_div_y = y; + hw->rx_clkm_div_conf.rx_clkm_div_x = x; HAL_FORCE_MODIFY_U32_REG_FIELD(hw->rx_clkm_conf, rx_clkm_div_num, div_int); - /* Set the decimal part of the mclk division */ - typeof(hw->rx_clkm_div_conf) div = {}; - div.rx_clkm_div_x = x; - div.rx_clkm_div_y = y; - div.rx_clkm_div_z = z; - div.rx_clkm_div_yn1 = yn1; - hw->rx_clkm_div_conf.val = div.val; } /** @@ -300,12 +312,6 @@ static inline void i2s_ll_rx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, ui */ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, const i2s_ll_mclk_div_t *mclk_div) { - /* Workaround for inaccurate clock while switching from a relatively low sample rate to a high sample rate - * Set to particular coefficients first then update to the target coefficients, - * otherwise the clock division might be inaccurate. - * the general idea is to set a value that impossible to calculate from the regular decimal */ - i2s_ll_tx_set_raw_clk_div(hw, 7, 317, 7, 3, 0); - uint32_t div_x = 0; uint32_t div_y = 0; uint32_t div_z = 0; @@ -340,12 +346,6 @@ static inline void i2s_ll_rx_set_bck_div_num(i2s_dev_t *hw, uint32_t val) */ static inline void i2s_ll_rx_set_mclk(i2s_dev_t *hw, const i2s_ll_mclk_div_t *mclk_div) { - /* Workaround for inaccurate clock while switching from a relatively low sample rate to a high sample rate - * Set to particular coefficients first then update to the target coefficients, - * otherwise the clock division might be inaccurate. - * the general idea is to set a value that impossible to calculate from the regular decimal */ - i2s_ll_rx_set_raw_clk_div(hw, 7, 317, 7, 3, 0); - uint32_t div_x = 0; uint32_t div_y = 0; uint32_t div_z = 0; @@ -440,7 +440,7 @@ static inline void i2s_ll_rx_set_eof_num(i2s_dev_t *hw, int eof_num) } /** - * @brief Congfigure TX chan bit and audio data bit + * @brief Configure TX chan bit and audio data bit * * @param hw Peripheral I2S hardware instance address. * @param chan_bit The chan bit width @@ -453,7 +453,7 @@ static inline void i2s_ll_tx_set_sample_bit(i2s_dev_t *hw, uint8_t chan_bit, int } /** - * @brief Congfigure RX chan bit and audio data bit + * @brief Configure RX chan bit and audio data bit * * @param hw Peripheral I2S hardware instance address. * @param chan_bit The chan bit width @@ -853,11 +853,11 @@ static inline void i2s_ll_tx_set_pdm_fpfs(i2s_dev_t *hw, uint32_t fp, uint32_t f } /** - * @brief Get I2S TX PDM fp configuration paramater + * @brief Get I2S TX PDM fp configuration parameter * * @param hw Peripheral I2S hardware instance address. * @return - * - fp configuration paramater + * - fp configuration parameter */ static inline uint32_t i2s_ll_tx_get_pdm_fp(i2s_dev_t *hw) { @@ -865,11 +865,11 @@ static inline uint32_t i2s_ll_tx_get_pdm_fp(i2s_dev_t *hw) } /** - * @brief Get I2S TX PDM fs configuration paramater + * @brief Get I2S TX PDM fs configuration parameter * * @param hw Peripheral I2S hardware instance address. * @return - * - fs configuration paramater + * - fs configuration parameter */ static inline uint32_t i2s_ll_tx_get_pdm_fs(i2s_dev_t *hw) { @@ -895,7 +895,7 @@ static inline void i2s_ll_rx_enable_pdm(i2s_dev_t *hw, bool pdm_enable) * @brief Configura TX a/u-law decompress or compress * * @param hw Peripheral I2S hardware instance address. - * @param pcm_cfg PCM configuration paramater + * @param pcm_cfg PCM configuration parameter */ static inline void i2s_ll_tx_set_pcm_type(i2s_dev_t *hw, i2s_pcm_compress_t pcm_cfg) { @@ -907,7 +907,7 @@ static inline void i2s_ll_tx_set_pcm_type(i2s_dev_t *hw, i2s_pcm_compress_t pcm_ * @brief Configure RX a/u-law decompress or compress * * @param hw Peripheral I2S hardware instance address. - * @param pcm_cfg PCM configuration paramater + * @param pcm_cfg PCM configuration parameter */ static inline void i2s_ll_rx_set_pcm_type(i2s_dev_t *hw, i2s_pcm_compress_t pcm_cfg) { @@ -1079,7 +1079,7 @@ static inline void i2s_ll_tx_pdm_dma_take_mode(i2s_dev_t *hw, bool is_mono, bool * @param is_mono The DMA data only has one slot (mono) or contains two slots (stereo) * @param is_copy Whether the un-selected slot copies the data from the selected one * If not, the un-selected slot will transmit the data from 'conf_single_data' - * @param mask The slot mask to selet the slot + * @param mask The slot mask to select the slot */ static inline void i2s_ll_tx_pdm_slot_mode(i2s_dev_t *hw, bool is_mono, bool is_copy, i2s_pdm_slot_mask_t mask) { diff --git a/components/hal/esp32c6/include/hal/i2s_ll.h b/components/hal/esp32c6/include/hal/i2s_ll.h index c36e5d7ea641..5eea14b0af2f 100644 --- a/components/hal/esp32c6/include/hal/i2s_ll.h +++ b/components/hal/esp32c6/include/hal/i2s_ll.h @@ -270,13 +270,21 @@ static inline void i2s_ll_tx_set_bck_div_num(i2s_dev_t *hw, uint32_t val) static inline void i2s_ll_tx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, uint32_t x, uint32_t y, uint32_t z, uint32_t yn1) { (void)hw; + /* Workaround for the double division issue. + * The division coefficients must be set in particular sequence. + * And it has to switch to a small division first before setting the target division. */ + HAL_FORCE_MODIFY_U32_REG_FIELD(PCR.i2s_tx_clkm_conf, i2s_tx_clkm_div_num, 2); + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_yn1 = 0; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_y = 1; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_z = 0; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_x = 0; + + /* Set the target mclk division coefficients */ + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_yn1 = yn1; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_z = z; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_y = y; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_x = x; HAL_FORCE_MODIFY_U32_REG_FIELD(PCR.i2s_tx_clkm_conf, i2s_tx_clkm_div_num, div_int); - typeof(PCR.i2s_tx_clkm_div_conf) div = {}; - div.i2s_tx_clkm_div_x = x; - div.i2s_tx_clkm_div_y = y; - div.i2s_tx_clkm_div_z = z; - div.i2s_tx_clkm_div_yn1 = yn1; - PCR.i2s_tx_clkm_div_conf.val = div.val; } /** @@ -292,13 +300,21 @@ static inline void i2s_ll_tx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, ui static inline void i2s_ll_rx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, uint32_t x, uint32_t y, uint32_t z, uint32_t yn1) { (void)hw; + /* Workaround for the double division issue. + * The division coefficients must be set in particular sequence. + * And it has to switch to a small division first before setting the target division. */ + HAL_FORCE_MODIFY_U32_REG_FIELD(PCR.i2s_rx_clkm_conf, i2s_rx_clkm_div_num, 2); + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_yn1 = 0; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_y = 1; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_z = 0; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_x = 0; + + /* Set the target mclk division coefficients */ + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_yn1 = yn1; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_z = z; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_y = y; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_x = x; HAL_FORCE_MODIFY_U32_REG_FIELD(PCR.i2s_rx_clkm_conf, i2s_rx_clkm_div_num, div_int); - typeof(PCR.i2s_rx_clkm_div_conf) div = {}; - div.i2s_rx_clkm_div_x = x; - div.i2s_rx_clkm_div_y = y; - div.i2s_rx_clkm_div_z = z; - div.i2s_rx_clkm_div_yn1 = yn1; - PCR.i2s_rx_clkm_div_conf.val = div.val; } /** @@ -309,12 +325,6 @@ static inline void i2s_ll_rx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, ui */ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, const i2s_ll_mclk_div_t *mclk_div) { - /* Workaround for inaccurate clock while switching from a relatively low sample rate to a high sample rate - * Set to particular coefficients first then update to the target coefficients, - * otherwise the clock division might be inaccurate. - * the general idea is to set a value that impossible to calculate from the regular decimal */ - i2s_ll_tx_set_raw_clk_div(hw, 7, 317, 7, 3, 0); - uint32_t div_x = 0; uint32_t div_y = 0; uint32_t div_z = 0; @@ -349,12 +359,6 @@ static inline void i2s_ll_rx_set_bck_div_num(i2s_dev_t *hw, uint32_t val) */ static inline void i2s_ll_rx_set_mclk(i2s_dev_t *hw, const i2s_ll_mclk_div_t *mclk_div) { - /* Workaround for inaccurate clock while switching from a relatively low sample rate to a high sample rate - * Set to particular coefficients first then update to the target coefficients, - * otherwise the clock division might be inaccurate. - * the general idea is to set a value that impossible to calculate from the regular decimal */ - i2s_ll_rx_set_raw_clk_div(hw, 7, 317, 7, 3, 0); - uint32_t div_x = 0; uint32_t div_y = 0; uint32_t div_z = 0; diff --git a/components/hal/esp32h2/include/hal/i2s_ll.h b/components/hal/esp32h2/include/hal/i2s_ll.h index 2d7b4fce29e5..7ff1c1df584b 100644 --- a/components/hal/esp32h2/include/hal/i2s_ll.h +++ b/components/hal/esp32h2/include/hal/i2s_ll.h @@ -277,13 +277,21 @@ static inline void i2s_ll_tx_set_bck_div_num(i2s_dev_t *hw, uint32_t val) static inline void i2s_ll_tx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, uint32_t x, uint32_t y, uint32_t z, uint32_t yn1) { (void)hw; + /* Workaround for the double division issue. + * The division coefficients must be set in particular sequence. + * And it has to switch to a small division first before setting the target division. */ + HAL_FORCE_MODIFY_U32_REG_FIELD(PCR.i2s_tx_clkm_conf, i2s_tx_clkm_div_num, 2); + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_yn1 = 0; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_y = 1; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_z = 0; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_x = 0; + + /* Set the target mclk division coefficients */ + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_yn1 = yn1; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_z = z; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_y = y; + PCR.i2s_tx_clkm_div_conf.i2s_tx_clkm_div_x = x; HAL_FORCE_MODIFY_U32_REG_FIELD(PCR.i2s_tx_clkm_conf, i2s_tx_clkm_div_num, div_int); - typeof(PCR.i2s_tx_clkm_div_conf) div = {}; - div.i2s_tx_clkm_div_x = x; - div.i2s_tx_clkm_div_y = y; - div.i2s_tx_clkm_div_z = z; - div.i2s_tx_clkm_div_yn1 = yn1; - PCR.i2s_tx_clkm_div_conf.val = div.val; } /** @@ -299,13 +307,21 @@ static inline void i2s_ll_tx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, ui static inline void i2s_ll_rx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, uint32_t x, uint32_t y, uint32_t z, uint32_t yn1) { (void)hw; + /* Workaround for the double division issue. + * The division coefficients must be set in particular sequence. + * And it has to switch to a small division first before setting the target division. */ + HAL_FORCE_MODIFY_U32_REG_FIELD(PCR.i2s_rx_clkm_conf, i2s_rx_clkm_div_num, 2); + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_yn1 = 0; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_y = 1; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_z = 0; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_x = 0; + + /* Set the target mclk division coefficients */ + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_yn1 = yn1; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_z = z; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_y = y; + PCR.i2s_rx_clkm_div_conf.i2s_rx_clkm_div_x = x; HAL_FORCE_MODIFY_U32_REG_FIELD(PCR.i2s_rx_clkm_conf, i2s_rx_clkm_div_num, div_int); - typeof(PCR.i2s_rx_clkm_div_conf) div = {}; - div.i2s_rx_clkm_div_x = x; - div.i2s_rx_clkm_div_y = y; - div.i2s_rx_clkm_div_z = z; - div.i2s_rx_clkm_div_yn1 = yn1; - PCR.i2s_rx_clkm_div_conf.val = div.val; } /** @@ -316,12 +332,6 @@ static inline void i2s_ll_rx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, ui */ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, const i2s_ll_mclk_div_t *mclk_div) { - /* Workaround for inaccurate clock while switching from a relatively low sample rate to a high sample rate - * Set to particular coefficients first then update to the target coefficients, - * otherwise the clock division might be inaccurate. - * the general idea is to set a value that impossible to calculate from the regular decimal */ - i2s_ll_tx_set_raw_clk_div(hw, 8, 1, 1, 73, 1); - uint32_t div_x = 0; uint32_t div_y = 0; uint32_t div_z = 0; @@ -356,12 +366,6 @@ static inline void i2s_ll_rx_set_bck_div_num(i2s_dev_t *hw, uint32_t val) */ static inline void i2s_ll_rx_set_mclk(i2s_dev_t *hw, const i2s_ll_mclk_div_t *mclk_div) { - /* Workaround for inaccurate clock while switching from a relatively low sample rate to a high sample rate - * Set to particular coefficients first then update to the target coefficients, - * otherwise the clock division might be inaccurate. - * the general idea is to set a value that impossible to calculate from the regular decimal */ - i2s_ll_rx_set_raw_clk_div(hw, 8, 1, 1, 73, 1); - uint32_t div_x = 0; uint32_t div_y = 0; uint32_t div_z = 0; diff --git a/components/hal/esp32s2/include/hal/i2s_ll.h b/components/hal/esp32s2/include/hal/i2s_ll.h index 1329c9e5c63f..eb12347cb073 100644 --- a/components/hal/esp32s2/include/hal/i2s_ll.h +++ b/components/hal/esp32s2/include/hal/i2s_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -78,7 +78,7 @@ static inline void i2s_ll_dma_enable_auto_write_back(i2s_dev_t *hw, bool en) } /** - * @brief I2S DMA generate EOF event on data in FIFO poped out + * @brief I2S DMA generate EOF event on data in FIFO popped out * * @param hw Peripheral I2S hardware instance address. * @param en True to enable, False to disable @@ -305,11 +305,6 @@ static inline void i2s_ll_set_raw_mclk_div(i2s_dev_t *hw, uint32_t mclk_div, uin */ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, const i2s_ll_mclk_div_t *mclk_div) { - /* Workaround for inaccurate clock while switching from a relatively low sample rate to a high sample rate - * Set to particular coefficients first then update to the target coefficients, - * otherwise the clock division might be inaccurate. - * the general idea is to set a value that unlike to calculate from the regular decimal */ - i2s_ll_set_raw_mclk_div(hw, 7, 47, 3); i2s_ll_set_raw_mclk_div(hw, mclk_div->integ, mclk_div->denom, mclk_div->numer); } @@ -646,7 +641,7 @@ static inline void i2s_ll_rx_set_eof_num(i2s_dev_t *hw, uint32_t eof_num) } /** - * @brief Congfigure TX chan bit and audio data bit, on ESP32-S2, sample_bit should equals to data_bit + * @brief Configure TX chan bit and audio data bit, on ESP32-S2, sample_bit should equals to data_bit * * @param hw Peripheral I2S hardware instance address. * @param chan_bit The chan bit width @@ -659,7 +654,7 @@ static inline void i2s_ll_tx_set_sample_bit(i2s_dev_t *hw, uint8_t chan_bit, int } /** - * @brief Congfigure RX chan bit and audio data bit, on ESP32-S2, sample_bit should equals to data_bit + * @brief Configure RX chan bit and audio data bit, on ESP32-S2, sample_bit should equals to data_bit * * @param hw Peripheral I2S hardware instance address. * @param chan_bit The chan bit width diff --git a/components/hal/esp32s3/include/hal/i2s_ll.h b/components/hal/esp32s3/include/hal/i2s_ll.h index 02de004fbef2..3a00494435b9 100644 --- a/components/hal/esp32s3/include/hal/i2s_ll.h +++ b/components/hal/esp32s3/include/hal/i2s_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -258,15 +258,21 @@ static inline void i2s_ll_tx_set_bck_div_num(i2s_dev_t *hw, uint32_t val) */ static inline void i2s_ll_tx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, uint32_t x, uint32_t y, uint32_t z, uint32_t yn1) { - /* Set the integer part of mclk division */ + /* Workaround for the double division issue. + * The division coefficients must be set in particular sequence. + * And it has to switch to a small division first before setting the target division. */ + HAL_FORCE_MODIFY_U32_REG_FIELD(hw->tx_clkm_conf, tx_clkm_div_num, 2); + hw->tx_clkm_div_conf.tx_clkm_div_yn1 = 0; + hw->tx_clkm_div_conf.tx_clkm_div_y = 1; + hw->tx_clkm_div_conf.tx_clkm_div_z = 0; + hw->tx_clkm_div_conf.tx_clkm_div_x = 0; + + /* Set the target mclk division coefficients */ + hw->tx_clkm_div_conf.tx_clkm_div_yn1 = yn1; + hw->tx_clkm_div_conf.tx_clkm_div_z = z; + hw->tx_clkm_div_conf.tx_clkm_div_y = y; + hw->tx_clkm_div_conf.tx_clkm_div_x = x; HAL_FORCE_MODIFY_U32_REG_FIELD(hw->tx_clkm_conf, tx_clkm_div_num, div_int); - /* Set the decimal part of the mclk division */ - typeof(hw->tx_clkm_div_conf) div = {}; - div.tx_clkm_div_x = x; - div.tx_clkm_div_y = y; - div.tx_clkm_div_z = z; - div.tx_clkm_div_yn1 = yn1; - hw->tx_clkm_div_conf.val = div.val; } /** @@ -281,15 +287,21 @@ static inline void i2s_ll_tx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, ui */ static inline void i2s_ll_rx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, uint32_t x, uint32_t y, uint32_t z, uint32_t yn1) { - /* Set the integer part of mclk division */ + /* Workaround for the double division issue. + * The division coefficients must be set in particular sequence. + * And it has to switch to a small division first before setting the target division. */ + HAL_FORCE_MODIFY_U32_REG_FIELD(hw->rx_clkm_conf, rx_clkm_div_num, 2); + hw->rx_clkm_div_conf.rx_clkm_div_yn1 = 0; + hw->rx_clkm_div_conf.rx_clkm_div_y = 1; + hw->rx_clkm_div_conf.rx_clkm_div_z = 0; + hw->rx_clkm_div_conf.rx_clkm_div_x = 0; + + /* Set the target mclk division coefficients */ + hw->rx_clkm_div_conf.rx_clkm_div_yn1 = yn1; + hw->rx_clkm_div_conf.rx_clkm_div_z = z; + hw->rx_clkm_div_conf.rx_clkm_div_y = y; + hw->rx_clkm_div_conf.rx_clkm_div_x = x; HAL_FORCE_MODIFY_U32_REG_FIELD(hw->rx_clkm_conf, rx_clkm_div_num, div_int); - /* Set the decimal part of the mclk division */ - typeof(hw->rx_clkm_div_conf) div = {}; - div.rx_clkm_div_x = x; - div.rx_clkm_div_y = y; - div.rx_clkm_div_z = z; - div.rx_clkm_div_yn1 = yn1; - hw->rx_clkm_div_conf.val = div.val; } /** @@ -300,12 +312,6 @@ static inline void i2s_ll_rx_set_raw_clk_div(i2s_dev_t *hw, uint32_t div_int, ui */ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, const i2s_ll_mclk_div_t *mclk_div) { - /* Workaround for inaccurate clock while switching from a relatively low sample rate to a high sample rate - * Set to particular coefficients first then update to the target coefficients, - * otherwise the clock division might be inaccurate. - * the general idea is to set a value that impossible to calculate from the regular decimal */ - i2s_ll_tx_set_raw_clk_div(hw, 7, 317, 7, 3, 0); - uint32_t div_x = 0; uint32_t div_y = 0; uint32_t div_z = 0; @@ -340,12 +346,6 @@ static inline void i2s_ll_rx_set_bck_div_num(i2s_dev_t *hw, uint32_t val) */ static inline void i2s_ll_rx_set_mclk(i2s_dev_t *hw, const i2s_ll_mclk_div_t *mclk_div) { - /* Workaround for inaccurate clock while switching from a relatively low sample rate to a high sample rate - * Set to particular coefficients first then update to the target coefficients, - * otherwise the clock division might be inaccurate. - * the general idea is to set a value that impossible to calculate from the regular decimal */ - i2s_ll_rx_set_raw_clk_div(hw, 7, 317, 7, 3, 0); - uint32_t div_x = 0; uint32_t div_y = 0; uint32_t div_z = 0; @@ -441,7 +441,7 @@ static inline void i2s_ll_rx_set_eof_num(i2s_dev_t *hw, int eof_num) } /** - * @brief Congfigure TX chan bit and audio data bit + * @brief Configure TX chan bit and audio data bit * * @param hw Peripheral I2S hardware instance address. * @param chan_bit The chan bit width @@ -454,7 +454,7 @@ static inline void i2s_ll_tx_set_sample_bit(i2s_dev_t *hw, uint8_t chan_bit, int } /** - * @brief Congfigure RX chan bit and audio data bit + * @brief Configure RX chan bit and audio data bit * * @param hw Peripheral I2S hardware instance address. * @param chan_bit The chan bit width @@ -757,11 +757,11 @@ static inline void i2s_ll_tx_set_pdm_fpfs(i2s_dev_t *hw, uint32_t fp, uint32_t f } /** - * @brief Get I2S TX PDM fp configuration paramater + * @brief Get I2S TX PDM fp configuration parameter * * @param hw Peripheral I2S hardware instance address. * @return - * - fp configuration paramater + * - fp configuration parameter */ static inline uint32_t i2s_ll_tx_get_pdm_fp(i2s_dev_t *hw) { @@ -769,11 +769,11 @@ static inline uint32_t i2s_ll_tx_get_pdm_fp(i2s_dev_t *hw) } /** - * @brief Get I2S TX PDM fs configuration paramater + * @brief Get I2S TX PDM fs configuration parameter * * @param hw Peripheral I2S hardware instance address. * @return - * - fs configuration paramater + * - fs configuration parameter */ static inline uint32_t i2s_ll_tx_get_pdm_fs(i2s_dev_t *hw) { @@ -894,7 +894,7 @@ static inline void i2s_ll_tx_set_pdm_sd_dither2(i2s_dev_t *hw, uint32_t dither2) * @brief Configure RX PDM downsample * * @param hw Peripheral I2S hardware instance address. - * @param dsr PDM downsample configuration paramater + * @param dsr PDM downsample configuration parameter */ static inline void i2s_ll_rx_set_pdm_dsr(i2s_dev_t *hw, i2s_pdm_dsr_t dsr) { @@ -916,7 +916,7 @@ static inline void i2s_ll_rx_get_pdm_dsr(i2s_dev_t *hw, i2s_pdm_dsr_t *dsr) * @brief Configura TX a/u-law decompress or compress * * @param hw Peripheral I2S hardware instance address. - * @param pcm_cfg PCM configuration paramater + * @param pcm_cfg PCM configuration parameter */ static inline void i2s_ll_tx_set_pcm_type(i2s_dev_t *hw, i2s_pcm_compress_t pcm_cfg) { @@ -928,7 +928,7 @@ static inline void i2s_ll_tx_set_pcm_type(i2s_dev_t *hw, i2s_pcm_compress_t pcm_ * @brief Configure RX a/u-law decompress or compress * * @param hw Peripheral I2S hardware instance address. - * @param pcm_cfg PCM configuration paramater + * @param pcm_cfg PCM configuration parameter */ static inline void i2s_ll_rx_set_pcm_type(i2s_dev_t *hw, i2s_pcm_compress_t pcm_cfg) { @@ -1100,7 +1100,7 @@ static inline void i2s_ll_tx_pdm_dma_take_mode(i2s_dev_t *hw, bool is_mono, bool * @param is_mono The DMA data only has one slot (mono) or contains two slots (stereo) * @param is_copy Whether the un-selected slot copies the data from the selected one * If not, the un-selected slot will transmit the data from 'conf_single_data' - * @param mask The slot mask to selet the slot + * @param mask The slot mask to select the slot */ static inline void i2s_ll_tx_pdm_slot_mode(i2s_dev_t *hw, bool is_mono, bool is_copy, i2s_pdm_slot_mask_t mask) { From 1e5931287f273597873699696ecfe468d1e09bfb Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Sat, 12 Oct 2024 11:29:35 +0800 Subject: [PATCH 10/56] fix(esp_hw_support): skip some wakeup steps if sleep is rejected 1. Skip esp_timer time compensation to avoid introducing errors into rtc_timer 2. Ignore sleep_time_overhead_out measurements when sleep is rejected --- components/esp_hw_support/sleep_modes.c | 45 +++++++++++++------------ 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index e5ae10feb931..d65be3efb8df 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -970,12 +970,14 @@ static esp_err_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags, esp_sleep_mode_t m esp_sleep_execute_event_callbacks(SLEEP_EVENT_SW_CLK_READY, (void *)0); if (!deep_sleep) { - s_config.ccount_ticks_record = esp_cpu_get_cycle_count(); + if (result == ESP_OK) { + s_config.ccount_ticks_record = esp_cpu_get_cycle_count(); #if SOC_PM_RETENTION_SW_TRIGGER_REGDMA - if (pd_flags & PMU_SLEEP_PD_TOP) { - sleep_retention_do_system_retention(false); - } + if (pd_flags & PMU_SLEEP_PD_TOP) { + sleep_retention_do_system_retention(false); + } #endif + } misc_modules_wake_prepare(); } @@ -1129,7 +1131,7 @@ static esp_err_t esp_light_sleep_inner(uint32_t pd_flags, #endif // If SPI flash was powered down, wait for it to become ready - if (pd_flags & RTC_SLEEP_PD_VDDSDIO) { + if (!reject && (pd_flags & RTC_SLEEP_PD_VDDSDIO)) { #if SOC_PM_SUPPORT_TOP_PD if (pd_flags & PMU_SLEEP_PD_TOP) { uint32_t flash_ready_hw_waited_time_us = pmu_sleep_get_wakup_retention_cost(); @@ -1331,22 +1333,18 @@ esp_err_t esp_light_sleep_start(void) // System timer has been stopped for the duration of the sleep, correct for that. uint64_t rtc_ticks_at_end = rtc_time_get(); - uint64_t rtc_time_diff = rtc_time_slowclk_to_us(rtc_ticks_at_end - s_config.rtc_ticks_at_sleep_start, s_config.rtc_clk_cal_period); - -#if CONFIG_ESP_SLEEP_DEBUG - if (s_sleep_ctx != NULL) { - s_sleep_ctx->sleep_out_rtc_time_stamp = rtc_ticks_at_end; - } -#endif - /** - * If sleep duration is too small(less than 1 rtc_slow_clk cycle), rtc_time_diff will be zero. - * In this case, just ignore the time compensation and keep esp_timer monotonic. - */ - if (rtc_time_diff > 0) { - esp_timer_private_set(high_res_time_at_start + rtc_time_diff); + if (s_light_sleep_wakeup) { + uint64_t rtc_time_diff = rtc_time_slowclk_to_us(rtc_ticks_at_end - s_config.rtc_ticks_at_sleep_start, s_config.rtc_clk_cal_period); + /** + * If sleep duration is too small(less than 1 rtc_slow_clk cycle), rtc_time_diff will be zero. + * In this case, just ignore the time compensation and keep esp_timer monotonic. + */ + if (rtc_time_diff > 0) { + esp_timer_private_set(high_res_time_at_start + rtc_time_diff); + } + esp_set_time_from_rtc(); } - esp_set_time_from_rtc(); esp_clk_private_unlock(); esp_timer_private_unlock(); @@ -1356,7 +1354,6 @@ esp_err_t esp_light_sleep_start(void) wdt_hal_disable(&rtc_wdt_ctx); wdt_hal_write_protect_enable(&rtc_wdt_ctx); } - portEXIT_CRITICAL(&s_config.lock); #if CONFIG_ESP_TASK_WDT_USE_ESP_TIMER /* Restart the Task Watchdog timer as it was stopped before sleeping. */ @@ -1366,13 +1363,19 @@ esp_err_t esp_light_sleep_start(void) #endif // CONFIG_ESP_TASK_WDT_USE_ESP_TIMER esp_sleep_execute_event_callbacks(SLEEP_EVENT_SW_EXIT_SLEEP, (void *)0); - s_config.sleep_time_overhead_out = (esp_cpu_get_cycle_count() - s_config.ccount_ticks_record) / (esp_clk_cpu_freq() / 1000000ULL); #if CONFIG_ESP_SLEEP_DEBUG if (s_sleep_ctx != NULL) { + s_sleep_ctx->sleep_out_rtc_time_stamp = rtc_ticks_at_end; s_sleep_ctx->sleep_request_result = err; } #endif + + if (s_light_sleep_wakeup) { + s_config.sleep_time_overhead_out = (esp_cpu_get_cycle_count() - s_config.ccount_ticks_record) / (esp_clk_cpu_freq() / 1000000ULL); + } + + portEXIT_CRITICAL(&s_config.lock); return err; } From 5118e843284737519d7330b32ff1c6c65e0bb344 Mon Sep 17 00:00:00 2001 From: "nilesh.kale" Date: Tue, 15 Oct 2024 17:25:03 +0530 Subject: [PATCH 11/56] fix(esp_http_server): updated condition to verify http version Closes https://github.com/espressif/esp-idf/issues/14723 --- components/esp_http_server/src/httpd_parse.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/esp_http_server/src/httpd_parse.c b/components/esp_http_server/src/httpd_parse.c index aceb832f21db..7e69890964fd 100644 --- a/components/esp_http_server/src/httpd_parse.c +++ b/components/esp_http_server/src/httpd_parse.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -90,7 +90,7 @@ static esp_err_t verify_url (http_parser *parser) ESP_LOGD(TAG, LOG_FMT("received URI = %s"), r->uri); /* Make sure version is HTTP/1.1 */ - if ((parser->http_major != 1) && (parser->http_minor != 1)) { + if (!((parser->http_major == 1) && (parser->http_minor == 1))) { ESP_LOGW(TAG, LOG_FMT("unsupported HTTP version = %d.%d"), parser->http_major, parser->http_minor); parser_data->error = HTTPD_505_VERSION_NOT_SUPPORTED; @@ -110,7 +110,7 @@ static esp_err_t verify_url (http_parser *parser) } /* http_parser callback on finding url in HTTP request - * Will be invoked ATLEAST once every packet + * Will be invoked AT LEAST once every packet */ static esp_err_t cb_url(http_parser *parser, const char *at, size_t length) @@ -195,7 +195,7 @@ static size_t continue_parsing(http_parser *parser, size_t length) } /* http_parser callback on header field in HTTP request - * May be invoked ATLEAST once every header field + * May be invoked AT LEAST once every header field */ static esp_err_t cb_header_field(http_parser *parser, const char *at, size_t length) { @@ -254,7 +254,7 @@ static esp_err_t cb_header_field(http_parser *parser, const char *at, size_t len } /* http_parser callback on header value in HTTP request. - * May be invoked ATLEAST once every header value + * May be invoked AT LEAST once every header value */ static esp_err_t cb_header_value(http_parser *parser, const char *at, size_t length) { From 14e8d5296381ce64bb569a349a97ed6fa0fab9d3 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Fri, 11 Oct 2024 14:25:06 +0800 Subject: [PATCH 12/56] fix(ci): optimize an openthread ci case --- examples/openthread/ot_ci_function.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/openthread/ot_ci_function.py b/examples/openthread/ot_ci_function.py index 346f991d42cd..cb5385433efe 100644 --- a/examples/openthread/ot_ci_function.py +++ b/examples/openthread/ot_ci_function.py @@ -2,7 +2,6 @@ # SPDX-License-Identifier: Unlicense OR CC0-1.0 # !/usr/bin/env python3 # this file defines some functions for testing cli and br under pytest framework - import re import socket import struct @@ -392,12 +391,15 @@ def host_publish_service() -> None: def host_close_service() -> None: - command = "ps | grep avahi-publish-s | awk '{print $1}'" + command = 'ps aux | grep avahi-publish-s' out_bytes = subprocess.check_output(command, shell=True, timeout=5) out_str = out_bytes.decode('utf-8') - the_pid = re.findall(r'(\d+)\n', str(out_str)) - for pid in the_pid: + service_info = [line for line in out_str.splitlines() if 'testxxx _testxxx._udp' in line] + for line in service_info: + print('Process:', line) + pid = line.split()[1] command = 'kill -9 ' + pid + print('kill ', pid) subprocess.call(command, shell=True, timeout=5) time.sleep(1) From 1ddf2dd7559ff1aea6c2e3b8f358002c5c33e462 Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Mon, 26 Aug 2024 20:04:00 +0800 Subject: [PATCH 13/56] feat(bt/controller): Support controller code run in flash only --- components/bt/CMakeLists.txt | 12 +- components/bt/controller/esp32c3/Kconfig.in | 31 + components/bt/controller/esp32c3/bt.c | 8 + components/bt/controller/lib_esp32c3_family | 2 +- .../bt/host/bluedroid/hci/hci_packet_parser.c | 1 - .../bt/include/esp32c3/include/esp_bt.h | 64 +- components/esp_rom/CMakeLists.txt | 59 ++ .../esp_rom/esp32c3/ld/esp32c3.rom.ble_50.ld | 75 ++ .../esp_rom/esp32c3/ld/esp32c3.rom.ble_cca.ld | 32 + .../esp_rom/esp32c3/ld/esp32c3.rom.ble_dtm.ld | 22 + .../esp32c3/ld/esp32c3.rom.ble_master.ld | 20 + .../esp32c3/ld/esp32c3.rom.ble_scan.ld | 36 + .../esp_rom/esp32c3/ld/esp32c3.rom.ble_smp.ld | 44 + .../esp32c3/ld/esp32c3.rom.ble_test.ld | 37 + .../esp32c3/ld/esp32c3.rom.bt_funcs.ld | 844 +++++++++++++++++ .../esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld | 32 - .../esp32c3/ld/esp32c3.rom.eco3_bt_funcs.ld | 45 + .../esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld | 126 --- .../esp32c3/ld/esp32c3.rom.eco7_bt_funcs.ld | 130 +++ components/esp_rom/esp32c3/ld/esp32c3.rom.ld | 826 ----------------- .../esp_rom/esp32s3/ld/esp32s3.rom.ble_50.ld | 75 ++ .../esp_rom/esp32s3/ld/esp32s3.rom.ble_cca.ld | 32 + .../esp_rom/esp32s3/ld/esp32s3.rom.ble_dtm.ld | 22 + .../esp32s3/ld/esp32s3.rom.ble_master.ld | 20 + .../esp32s3/ld/esp32s3.rom.ble_scan.ld | 37 + .../esp_rom/esp32s3/ld/esp32s3.rom.ble_smp.ld | 44 + .../esp32s3/ld/esp32s3.rom.ble_test.ld | 37 + .../esp32s3/ld/esp32s3.rom.bt_funcs.ld | 874 ++++++++++++++++++ components/esp_rom/esp32s3/ld/esp32s3.rom.ld | 851 ----------------- 29 files changed, 2598 insertions(+), 1840 deletions(-) create mode 100644 components/esp_rom/esp32c3/ld/esp32c3.rom.ble_50.ld create mode 100644 components/esp_rom/esp32c3/ld/esp32c3.rom.ble_cca.ld create mode 100644 components/esp_rom/esp32c3/ld/esp32c3.rom.ble_dtm.ld create mode 100644 components/esp_rom/esp32c3/ld/esp32c3.rom.ble_master.ld create mode 100644 components/esp_rom/esp32c3/ld/esp32c3.rom.ble_scan.ld create mode 100644 components/esp_rom/esp32c3/ld/esp32c3.rom.ble_smp.ld create mode 100644 components/esp_rom/esp32c3/ld/esp32c3.rom.ble_test.ld create mode 100644 components/esp_rom/esp32c3/ld/esp32c3.rom.bt_funcs.ld create mode 100644 components/esp_rom/esp32c3/ld/esp32c3.rom.eco3_bt_funcs.ld create mode 100644 components/esp_rom/esp32c3/ld/esp32c3.rom.eco7_bt_funcs.ld create mode 100644 components/esp_rom/esp32s3/ld/esp32s3.rom.ble_50.ld create mode 100644 components/esp_rom/esp32s3/ld/esp32s3.rom.ble_cca.ld create mode 100644 components/esp_rom/esp32s3/ld/esp32s3.rom.ble_dtm.ld create mode 100644 components/esp_rom/esp32s3/ld/esp32s3.rom.ble_master.ld create mode 100644 components/esp_rom/esp32s3/ld/esp32s3.rom.ble_scan.ld create mode 100644 components/esp_rom/esp32s3/ld/esp32s3.rom.ble_smp.ld create mode 100644 components/esp_rom/esp32s3/ld/esp32s3.rom.ble_test.ld create mode 100644 components/esp_rom/esp32s3/ld/esp32s3.rom.bt_funcs.ld diff --git a/components/bt/CMakeLists.txt b/components/bt/CMakeLists.txt index ccad344834c4..ec1213bf0a29 100644 --- a/components/bt/CMakeLists.txt +++ b/components/bt/CMakeLists.txt @@ -781,11 +781,19 @@ if(CONFIG_BT_ENABLED) elseif(CONFIG_IDF_TARGET_ESP32C3) target_link_directories(${COMPONENT_LIB} INTERFACE "${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32c3") - target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app) + if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app_flash) + else() + target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app) + endif() elseif(CONFIG_IDF_TARGET_ESP32S3) target_link_directories(${COMPONENT_LIB} INTERFACE "${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32s3") - target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app) + if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app_flash) + else() + target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app) + endif() elseif(CONFIG_BT_CONTROLLER_ENABLED) if(CONFIG_IDF_TARGET_ESP32C6) add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/esp32c6/libble_app.a") diff --git a/components/bt/controller/esp32c3/Kconfig.in b/components/bt/controller/esp32c3/Kconfig.in index 5b7c1c8bee56..66645d0349c3 100644 --- a/components/bt/controller/esp32c3/Kconfig.in +++ b/components/bt/controller/esp32c3/Kconfig.in @@ -226,6 +226,7 @@ config BT_CTRL_DFT_TX_POWER_LEVEL_EFF config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP bool "BLE adv report flow control supported" + depends on (!BT_CTRL_RUN_IN_FLASH_ONLY) || (BT_CTRL_RUN_IN_FLASH_ONLY && BT_CTRL_BLE_SCAN) default y help The function is mainly used to enable flow control for advertising reports. When it is enabled, @@ -512,3 +513,33 @@ menu "BLE disconnect when instant passed" If this option is enabled, Controller will terminate the connection when instant passed in PHY update procedure. endmenu +config BT_CTRL_RUN_IN_FLASH_ONLY + bool "Put all BLE Controller code in flash" + default n + help + If this option is enabled, all code for the Bluetooth controller will be moved from ROM and IRAM + to flash, saving over 20K bytes of memory. However, it will require more flash resources and the + performance of Bluetooth will decrease If this option is enabled, Bluetooth may not work properly + during erasing flash. It is recommended to turn on the auto suspend function of flash. After auto + suspend is turned on, Bluetooth interrupts can be executed normally during erasing flash, with less + impact on Bluetooth performance. + +config BT_CTRL_DTM_ENABLE + depends on BT_CTRL_RUN_IN_FLASH_ONLY + bool "Enable direct test mode feature" + default n + +config BT_CTRL_BLE_MASTER + depends on BT_CTRL_RUN_IN_FLASH_ONLY + bool "Enable BLE master role feature" + default y + +config BT_CTRL_BLE_TEST + depends on BT_CTRL_RUN_IN_FLASH_ONLY + bool "Enable BLE QA test feature" + default n + +config BT_CTRL_BLE_SCAN + depends on BT_CTRL_RUN_IN_FLASH_ONLY + bool "Enable BLE scan feature" + default y diff --git a/components/bt/controller/esp32c3/bt.c b/components/bt/controller/esp32c3/bt.c index 55631f24657c..48da4da14626 100644 --- a/components/bt/controller/esp32c3/bt.c +++ b/components/bt/controller/esp32c3/bt.c @@ -497,7 +497,11 @@ static int interrupt_alloc_wrapper(int cpu_id, int source, intr_handler_t handle { btdm_isr_alloc_t p; p.source = source; +#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY + p.flags = ESP_INTR_FLAG_LEVEL3; +#else p.flags = ESP_INTR_FLAG_LEVEL3 | ESP_INTR_FLAG_IRAM; +#endif p.fn = handler; p.arg = arg; p.handle = (intr_handle_t *)ret_handle; @@ -1424,6 +1428,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) ESP_LOGI(BT_LOG_TAG, "BT controller compile version [%s]", btdm_controller_get_compile_version()); +#if (CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + ESP_LOGI(BT_LOG_TAG,"Put all controller code in flash"); +#endif + if ((err = btdm_low_power_mode_init(cfg)) != ESP_OK) { ESP_LOGE(BT_LOG_TAG, "Low power module initialization failed"); goto error; diff --git a/components/bt/controller/lib_esp32c3_family b/components/bt/controller/lib_esp32c3_family index eeb2782618e0..6470c01165cf 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit eeb2782618e0ab8cf0cf609c98c6a0c86d691a6c +Subproject commit 6470c01165cf4edeed5d826ce4082a90deb92efd diff --git a/components/bt/host/bluedroid/hci/hci_packet_parser.c b/components/bt/host/bluedroid/hci/hci_packet_parser.c index 1ee5033112f1..d25caf3506e2 100644 --- a/components/bt/host/bluedroid/hci/hci_packet_parser.c +++ b/components/bt/host/bluedroid/hci/hci_packet_parser.c @@ -219,7 +219,6 @@ static void parse_ble_read_adv_max_len_response( // Size: 2 Octets ; Value: 0x001F – 0x0672 ; Maximum supported advertising data length STREAM_TO_UINT16(*adv_max_len_ptr, stream); } - osi_free(response); } #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) diff --git a/components/bt/include/esp32c3/include/esp_bt.h b/components/bt/include/esp32c3/include/esp_bt.h index 6ce147befcf6..7531522cec99 100644 --- a/components/bt/include/esp32c3/include/esp_bt.h +++ b/components/bt/include/esp32c3/include/esp_bt.h @@ -19,7 +19,7 @@ extern "C" { #endif #define ESP_BT_CTRL_CONFIG_MAGIC_VAL 0x5A5AA5A5 -#define ESP_BT_CTRL_CONFIG_VERSION 0x02409260 +#define ESP_BT_CTRL_CONFIG_VERSION 0x02410230 #define ESP_BT_HCI_TL_MAGIC_VALUE 0xfadebead #define ESP_BT_HCI_TL_VERSION 0x00010000 @@ -236,6 +236,56 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status); #endif #define BT_CTRL_BLE_LLCP_DISC_FLAG (BT_CTRL_BLE_LLCP_CONN_UPDATE | BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE | BT_CTRL_BLE_LLCP_PHY_UPDATE) +#if defined(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) +#define BT_CTRL_RUN_IN_FLASH_ONLY CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY +#else +#define BT_CTRL_RUN_IN_FLASH_ONLY (0) +#endif + +#if (BT_CTRL_RUN_IN_FLASH_ONLY == 1) + +#if defined(CONFIG_BT_CTRL_DTM_ENABLE) +#define BT_CTRL_DTM_ENABLE CONFIG_BT_CTRL_DTM_ENABLE +#else +#define BT_CTRL_DTM_ENABLE (0) +#endif + +#if defined(CONFIG_BT_CTRL_BLE_MASTER) +#define BT_CTRL_BLE_MASTER CONFIG_BT_CTRL_BLE_MASTER +#else +#define BT_CTRL_BLE_MASTER (0) +#endif + +#if defined(CONFIG_BT_CTRL_BLE_TEST) +#define BT_CTRL_BLE_TEST CONFIG_BT_CTRL_BLE_TEST +#else +#define BT_CTRL_BLE_TEST (0) +#endif + +#if defined (CONFIG_BT_NIMBLE_SECURITY_ENABLE) || defined (CONFIG_BT_BLE_SMP_ENABLE) +#ifdef CONFIG_BT_NIMBLE_SECURITY_ENABLE +#define BLE_SECURITY_ENABLE (CONFIG_BT_NIMBLE_SECURITY_ENABLE) +#endif //CONFIG_BT_NIMBLE_SECURITY_ENABLE +#ifdef CONFIG_BT_BLE_SMP_ENABLE +#define BLE_SECURITY_ENABLE (CONFIG_BT_BLE_SMP_ENABLE) +#endif //CONFIG_BT_BLE_SMP_ENABLE +#else +#define BLE_SECURITY_ENABLE (0) +#endif // (CONFIG_BT_NIMBLE_SECURITY_ENABLE) || (CONFIG_BT_BLE_SMP_ENABLE) + +#if defined (CONFIG_BT_CTRL_BLE_SCAN) +#define BT_CTRL_BLE_SCAN CONFIG_BT_CTRL_BLE_SCAN +#else +#define BT_CTRL_BLE_SCAN (0) +#endif + +#else +#define BT_CTRL_BLE_MASTER (1) +#define BT_CTRL_DTM_ENABLE (1) +#define BT_CTRL_BLE_TEST (1) +#define BLE_SECURITY_ENABLE (1) +#define BT_CTRL_BLE_SCAN (1) +#endif // (BT_CTRL_RUN_IN_FLASH_ONLY == 1) #define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \ .magic = ESP_BT_CTRL_CONFIG_MAGIC_VAL, \ @@ -276,6 +326,12 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status); .ble_chan_ass_en = BT_CTRL_CHAN_ASS_EN, \ .ble_ping_en = BT_CTRL_LE_PING_EN, \ .ble_llcp_disc_flag = BT_CTRL_BLE_LLCP_DISC_FLAG, \ + .run_in_flash = BT_CTRL_RUN_IN_FLASH_ONLY, \ + .dtm_en = BT_CTRL_DTM_ENABLE, \ + .enc_en = BLE_SECURITY_ENABLE, \ + .qa_test = BT_CTRL_BLE_TEST, \ + .master_en = BT_CTRL_BLE_MASTER, \ + .scan_en = BT_CTRL_BLE_SCAN, \ } #else @@ -351,6 +407,12 @@ typedef struct { uint8_t ble_chan_ass_en; /*!< BLE channel assessment enable */ uint8_t ble_ping_en; /*!< BLE ping procedure enable */ uint8_t ble_llcp_disc_flag; /*!< BLE disconnect flag when instant passed */ + bool run_in_flash; /*!< Check if controller code is in flash */ + bool dtm_en; /*!< Controller DTM feature is enabled or not */ + bool enc_en; /*!< Controller encryption feature is enabled or not */ + bool qa_test; /*!< Controller QA test feature is enabled or not */ + bool master_en; /*!< Controller master feature is enabled or not */ + bool scan_en; /*!< Controller scan feature is enabled or not */ } esp_bt_controller_config_t; /** diff --git a/components/esp_rom/CMakeLists.txt b/components/esp_rom/CMakeLists.txt index e48d8c3371d6..af1f35938e9c 100644 --- a/components/esp_rom/CMakeLists.txt +++ b/components/esp_rom/CMakeLists.txt @@ -82,6 +82,11 @@ if(target STREQUAL "linux") else() target_linker_script(${COMPONENT_LIB} INTERFACE "${target}/${ld_folder}/${target}.rom.ld") rom_linker_script("api") + if(NOT CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + if(target STREQUAL "esp32s3" OR target STREQUAL "esp32c3") + rom_linker_script("bt_funcs") + endif() + endif() if(CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB) rom_linker_script("libgcc") @@ -183,6 +188,30 @@ else() # Regular app build rom_linker_script("newlib") rom_linker_script("version") + if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + if(NOT CONFIG_BT_CTRL_BLE_MASTER) + rom_linker_script("ble_master") + endif() + if(NOT CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT AND NOT CONFIG_BT_BLE_50_FEATURES_SUPPORTED) + rom_linker_script("ble_50") + endif() + if(CONFIG_BT_BLE_CCA_MODE_NONE) + rom_linker_script("ble_cca") + endif() + if(NOT CONFIG_BT_NIMBLE_SECURITY_ENABLE AND NOT CONFIG_BT_BLE_SMP_ENABLE) + rom_linker_script("ble_smp") + endif() + if(NOT CONFIG_BT_CTRL_DTM_ENABLE) + rom_linker_script("ble_dtm") + endif() + if(NOT CONFIG_BT_CTRL_BLE_TEST) + rom_linker_script("ble_test") + endif() + if(NOT CONFIG_BT_CTRL_BLE_SCAN) + rom_linker_script("ble_scan") + endif() + endif() + if(time_t_size EQUAL 4) # The ROM functions listed in this linker script depend on sizeof(time_t). # Since ROM for ESP32-S3 was compiled for 32-bit time_t, only link these functions @@ -199,6 +228,30 @@ else() # Regular app build rom_linker_script("newlib") rom_linker_script("version") + if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + if(NOT CONFIG_BT_CTRL_BLE_MASTER) + rom_linker_script("ble_master") + endif() + if(NOT CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT AND NOT CONFIG_BT_BLE_50_FEATURES_SUPPORTED) + rom_linker_script("ble_50") + endif() + if(CONFIG_BT_BLE_CCA_MODE_NONE) + rom_linker_script("ble_cca") + endif() + if(NOT CONFIG_BT_NIMBLE_SECURITY_ENABLE AND NOT CONFIG_BT_BLE_SMP_ENABLE) + rom_linker_script("ble_smp") + endif() + if(NOT CONFIG_BT_CTRL_DTM_ENABLE) + rom_linker_script("ble_dtm") + endif() + if(NOT CONFIG_BT_CTRL_BLE_TEST) + rom_linker_script("ble_test") + endif() + if(NOT CONFIG_BT_CTRL_BLE_SCAN) + rom_linker_script("ble_scan") + endif() + endif() + if(time_t_size EQUAL 4) # The ROM functions listed in this linker script depend on sizeof(time_t). # Since ROM for ESP32-C3 was compiled for 32-bit time_t, only link these functions @@ -213,10 +266,16 @@ else() # Regular app build if(CONFIG_ESP32C3_REV_MIN_FULL GREATER_EQUAL 3) rom_linker_script("eco3") + if(NOT CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + rom_linker_script("eco3_bt_funcs") + endif() endif() if(CONFIG_ESP32C3_REV_MIN_FULL GREATER_EQUAL 101) rom_linker_script("eco7") + if(NOT CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + rom_linker_script("eco7_bt_funcs") + endif() endif() elseif(target STREQUAL "esp32c2") diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_50.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_50.ld new file mode 100644 index 000000000000..cf9e0c3e1278 --- /dev/null +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_50.ld @@ -0,0 +1,75 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32c3.rom.ld for esp32c3 + * + * + * Generated from ./interface-esp32c3.yml md5sum 93b28a9e1fe42d212018eb4336849208 + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/* extend adv */ +f_hci_le_set_ext_adv_param_cmd_handler = 0; +f_hci_le_set_adv_set_rand_addr_cmd_handler = 0; +f_hci_le_set_ext_adv_data_cmd_handler = 0; +f_hci_le_set_ext_scan_rsp_data_cmd_handler = 0; +f_hci_le_set_ext_adv_en_cmd_handler = 0; +f_hci_le_rd_max_adv_data_len_cmd_handler = 0; +f_hci_le_rd_nb_supp_adv_sets_cmd_handler = 0; +f_hci_le_rmv_adv_set_cmd_handler = 0; +f_hci_le_clear_adv_sets_cmd_handler = 0; +r_lld_adv_sync_info_set = 0; + +r_lld_ext_adv_dynamic_pti_process = 0; +r_lld_adv_ext_chain_construct = 0; +r_lld_adv_aux_evt_canceled_cbk = 0; +r_lld_adv_aux_evt_start_cbk = 0; +r_lld_adv_aux_ch_idx_set = 0; + +/* periodic adv */ +f_hci_le_set_per_adv_param_cmd_handler = 0; +f_hci_le_set_per_adv_data_cmd_handler = 0; +f_hci_le_set_per_adv_en_cmd_handler = 0; +r_lld_per_adv_ch_map_update = 0; +r_lld_per_adv_init = 0; + +/* PA list */ +f_hci_le_add_dev_to_per_adv_list_cmd_handler = 0; +f_hci_le_rmv_dev_from_per_adv_list_cmd_handler = 0; +f_hci_le_clear_per_adv_list_cmd_handler = 0; +f_hci_le_rd_per_adv_list_size_cmd_handler = 0; + +/* extend scan */ +f_hci_le_set_ext_scan_param_cmd_handler = 0; +f_hci_le_set_ext_scan_en_cmd_handler = 0; +r_lld_scan_process_pkt_rx_ext_adv = 0; +r_lld_scan_trunc_ind = 0; + +/* extend con */ +f_hci_le_ext_create_con_cmd_handler = 0; +r_lld_init_process_pkt_rx_adv_ext_ind = 0; +r_lld_init_process_pkt_rx_aux_connect_rsp = 0; + +/* PA sync */ +f_hci_le_per_adv_create_sync_cmd_handler = 0; +f_hci_le_per_adv_create_sync_cancel_cmd_handler = 0; +f_hci_le_per_adv_term_sync_cmd_handler = 0; +f_lld_per_adv_rx_end_ind_handler_hack = 0; +f_lld_sync_start_req_handler = 0; +f_lld_per_adv_rep_ind_handler = 0; +r_lld_sync_init = 0; + +/* phy update*/ +r_phy_upd_proc_start = 0; +f_llc_op_phy_upd_ind_handler = 0; +f_ll_phy_req_handler = 0; +f_ll_phy_rsp_handler = 0; +f_ll_phy_update_ind_handler = 0; +f_lld_phy_upd_cfm_handler = 0; +f_hci_le_set_phy_cmd_handler = 0; +llc_llcp_phy_update_ind_ack = 0; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_cca.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_cca.ld new file mode 100644 index 000000000000..3bb147647223 --- /dev/null +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_cca.ld @@ -0,0 +1,32 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32c3.rom.ld for esp32c3 + * + * + * Generated from ./interface-esp32c3.yml md5sum 93b28a9e1fe42d212018eb4336849208 + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/* SW CCA */ +r_lld_cca_con_evt_start_handle = 0; +r_lld_hw_cca_end_isr = 0; +r_lld_hw_cca_isr_eco = 0; +r_lld_cca_bb_sync_found_handle = 0; +r_lld_cca_data_reset = 0; +r_lld_cca_sw_init = 0; +r_lld_cca_con_evt_end_handle = 0; +r_lld_cca_alloc = 0; +r_lld_cca_sw_alloc = 0; +r_lld_cca_sw_free = 0; +r_lld_cca_free = 0; +r_cca_init = 0; +r_lld_hw_cca_evt_handler = 0; +r_lld_sw_cca_evt_handler = 0; +r_ble_sw_cca_check_isr = 0; +bt_bb_tx_cca_set = 0; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_dtm.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_dtm.ld new file mode 100644 index 000000000000..aeede90250df --- /dev/null +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_dtm.ld @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32c3.rom.ld for esp32c3 + * + * + * Generated from ./interface-esp32c3.yml md5sum 93b28a9e1fe42d212018eb4336849208 + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/* DTM */ +f_hci_le_rx_test_cmd_handler = 0; +f_hci_le_tx_test_cmd_handler = 0; +f_hci_le_enh_rx_test_cmd_handler = 0; +f_hci_le_enh_tx_test_cmd_handler = 0; +f_hci_le_test_end_cmd_handler = 0; +r_lld_test_init = 0; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_master.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_master.ld new file mode 100644 index 000000000000..e7d2db0cbff1 --- /dev/null +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_master.ld @@ -0,0 +1,20 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32c3.rom.ld for esp32c3 + * + * + * Generated from ./interface-esp32c3.yml md5sum 93b28a9e1fe42d212018eb4336849208 + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/* master */ +f_hci_le_create_con_cmd_handler = 0; +f_hci_le_create_con_cancel_cmd_handler = 0; +lld_init_end_ind_handler = 0; +r_lld_init_init = 0; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_scan.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_scan.ld new file mode 100644 index 000000000000..b9a14d8e2b67 --- /dev/null +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_scan.ld @@ -0,0 +1,36 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32c3.rom.ld for esp32c3 + * + * + * Generated from ./interface-esp32c3.yml md5sum 93b28a9e1fe42d212018eb4336849208 + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + + +/* BLE scan */ +f_hci_le_set_scan_param_cmd_handler = 0; +f_hci_le_set_scan_en_cmd_handler = 0; +f_llm_scan_period_to_handler_hack = 1; +f_lld_adv_rep_ind_handler_hack = 0; +r_lld_scan_init = 0; +r_lld_scan_restart = 0; +f_lld_scan_end_ind_handler_hack = 0; +r_llm_env_adv_dup_filt_deinit_eco = 0; +llm_exception_list_init = 0; +llm_duplicate_list_init = 0; +f_hci_vendor_ble_update_duplicate_exceptional_list_cmd_handler = 0; +f_hci_vendor_ble_init_adv_flow_control_cmd_handler = 0; +f_hci_vendor_ble_update_adv_report_flow_control_cmd_handler = 0; +coex_schm_ble_scan_stop = 0; + +f_hci_le_set_ext_scan_param_cmd_handler = 0; +f_hci_le_set_ext_scan_en_cmd_handler = 0; +r_lld_scan_process_pkt_rx_ext_adv = 0; +r_lld_scan_trunc_ind = 0; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_smp.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_smp.ld new file mode 100644 index 000000000000..15436088d77f --- /dev/null +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_smp.ld @@ -0,0 +1,44 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32c3.rom.ld for esp32c3 + * + * + * Generated from ./interface-esp32c3.yml md5sum 93b28a9e1fe42d212018eb4336849208 + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/* SMP */ +f_ll_pause_enc_req_handler = 0; +f_ll_pause_enc_rsp_handler = 0; +f_ll_enc_req_handler = 0; +f_ll_enc_rsp_handler = 0; +f_ll_start_enc_req_handler = 0; +f_ll_start_enc_rsp_handler = 0; +f_hci_le_start_enc_cmd_handler = 0; +f_hci_le_ltk_req_reply_cmd_handler = 0; +f_hci_le_ltk_req_neg_reply_cmd_handler = 0; +f_llc_encrypt_ind_handler = 0; +f_llc_op_encrypt_ind_handler = 0; +f_hci_le_rd_local_p256_public_key_cmd_handler = 0; +f_hci_le_generate_dhkey_cmd_handler = 0; +f_hci_le_enc_cmd_handler = 0; +r_rwip_crypt_evt_handler = 0; + +/* LE ping */ +f_ll_ping_req_handler = 0; +f_ll_ping_rsp_handler = 0; +r_llc_le_ping_set = 0; +r_llc_le_ping_restart = 0; +f_llc_op_le_ping_ind_handler = 0; +f_llc_auth_payl_nearly_op_handler = 0; +f_llc_auth_payl_real_to_handler = 0; +f_llc_auth_payl_nearly_to_handler = 0; + +/* ecc */ +r_ecc_init = 0; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_test.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_test.ld new file mode 100644 index 000000000000..0c821cf5ba89 --- /dev/null +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ble_test.ld @@ -0,0 +1,37 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32c3.rom.ld for esp32c3 + * + * + * Generated from ./interface-esp32c3.yml md5sum 93b28a9e1fe42d212018eb4336849208 + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + + +/* overwrite */ +lld_acl_rx_ind_handler = 0; +lld_con_estab_ind_handler = 0; +lld_adv_rep_ind_handler = 0; +llm_rpa_renew_to_handler = 0; +lld_scan_end_ind_handler = 0; +llm_scan_period_to_handler = 0; + +/* nvds */ +r_nvds_init = 0; +f_nvds_get = 0; +f_nvds_del = 0; +f_nvds_put = 0; + +/* controller flash */ +r_flash_init = 0; +r_flash_env_init = 0; +r_flash_env_deinit = 0; + +/* QA test */ +f_hci_vendor_ble_qa_test_cmd_handler = 0; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.bt_funcs.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.bt_funcs.ld new file mode 100644 index 000000000000..89ea7c532ce8 --- /dev/null +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.bt_funcs.ld @@ -0,0 +1,844 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32c3.rom.ld for esp32c3 + * + * + * Generated from ./interface-esp32c3.yml md5sum 93b28a9e1fe42d212018eb4336849208 + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/*************************************** + Group bluetooth + ***************************************/ + +/* Functions */ +bt_rf_coex_get_dft_cfg = 0x400008dc; +bt_rf_coex_hooks_p_set = 0x400008e0; +btdm_con_maxevtime_cal_impl = 0x400008e4; +btdm_controller_get_compile_version_impl = 0x400008e8; +btdm_controller_rom_data_init = 0x400008ec; +btdm_dis_privacy_err_report_impl = 0x400008f0; +btdm_disable_adv_delay_impl = 0x400008f4; +btdm_enable_scan_continue_impl = 0x400008f8; +btdm_enable_scan_forever_impl = 0x400008fc; +btdm_get_power_state_impl = 0x40000900; +btdm_get_prevent_sleep_flag_impl = 0x40000904; +btdm_power_state_active_impl = 0x40000908; +btdm_switch_phy_coded_impl = 0x4000090c; +hci_acl_data_handler = 0x40000910; +hci_disconnect_cmd_handler = 0x40000914; +hci_le_con_upd_cmd_handler = 0x40000918; +hci_le_ltk_req_neg_reply_cmd_handler = 0x4000091c; +hci_le_ltk_req_reply_cmd_handler = 0x40000920; +hci_le_rd_chnl_map_cmd_handler = 0x40000924; +hci_le_rd_phy_cmd_handler = 0x40000928; +hci_le_rd_rem_feats_cmd_handler = 0x4000092c; +hci_le_rem_con_param_req_neg_reply_cmd_handler = 0x40000930; +hci_le_rem_con_param_req_reply_cmd_handler = 0x40000934; +hci_le_set_data_len_cmd_handler = 0x40000938; +hci_le_set_phy_cmd_handler = 0x4000093c; +hci_le_start_enc_cmd_handler = 0x40000940; +hci_rd_auth_payl_to_cmd_handler = 0x40000944; +hci_rd_rem_ver_info_cmd_handler = 0x40000948; +hci_rd_rssi_cmd_handler = 0x4000094c; +hci_rd_tx_pwr_lvl_cmd_handler = 0x40000950; +hci_vs_set_pref_slave_evt_dur_cmd_handler = 0x40000954; +hci_vs_set_pref_slave_latency_cmd_handler = 0x40000958; +hci_wr_auth_payl_to_cmd_handler = 0x4000095c; +ll_channel_map_ind_handler = 0x40000960; +ll_connection_param_req_handler = 0x40000964; +ll_connection_param_rsp_handler = 0x40000968; +ll_connection_update_ind_handler = 0x4000096c; +ll_enc_req_handler = 0x40000970; +ll_enc_rsp_handler = 0x40000974; +ll_feature_req_handler = 0x40000978; +ll_feature_rsp_handler = 0x4000097c; +ll_length_req_handler = 0x40000980; +ll_length_rsp_handler = 0x40000984; +ll_min_used_channels_ind_handler = 0x40000988; +ll_pause_enc_req_handler = 0x4000098c; +ll_pause_enc_rsp_handler = 0x40000990; +ll_phy_req_handler = 0x40000994; +ll_phy_rsp_handler = 0x40000998; +ll_phy_update_ind_handler = 0x4000099c; +ll_ping_req_handler = 0x400009a0; +ll_ping_rsp_handler = 0x400009a4; +ll_slave_feature_req_handler = 0x400009a8; +ll_start_enc_req_handler = 0x400009ac; +ll_start_enc_rsp_handler = 0x400009b0; +ll_terminate_ind_handler = 0x400009b4; +ll_version_ind_handler = 0x400009b8; +llc_auth_payl_nearly_to_handler = 0x400009bc; +llc_auth_payl_real_to_handler = 0x400009c0; +llc_encrypt_ind_handler = 0x400009c4; +llc_hci_command_handler_wrapper = 0x400009c8; +llc_ll_connection_param_req_pdu_send = 0x400009cc; +llc_ll_connection_param_rsp_pdu_send = 0x400009d0; +llc_ll_connection_update_ind_pdu_send = 0x400009d4; +llc_ll_enc_req_pdu_send = 0x400009d8; +llc_ll_enc_rsp_pdu_send = 0x400009dc; +llc_ll_feature_req_pdu_send = 0x400009e0; +llc_ll_feature_rsp_pdu_send = 0x400009e4; +llc_ll_length_req_pdu_send = 0x400009e8; +llc_ll_length_rsp_pdu_send = 0x400009ec; +llc_ll_pause_enc_req_pdu_send = 0x400009f0; +llc_ll_pause_enc_rsp_pdu_send = 0x400009f4; +llc_ll_phy_req_pdu_send = 0x400009f8; +llc_ll_phy_rsp_pdu_send = 0x400009fc; +llc_ll_ping_req_pdu_send = 0x40000a00; +llc_ll_ping_rsp_pdu_send = 0x40000a04; +llc_ll_start_enc_req_pdu_send = 0x40000a08; +llc_ll_start_enc_rsp_pdu_send = 0x40000a0c; +llc_ll_terminate_ind_pdu_send = 0x40000a10; +llc_ll_unknown_rsp_pdu_send = 0x40000a14; +llc_llcp_ch_map_update_ind_pdu_send = 0x40000a18; +llc_llcp_phy_upd_ind_pdu_send = 0x40000a1c; +llc_llcp_version_ind_pdu_send = 0x40000a20; +llc_op_ch_map_upd_ind_handler = 0x40000a24; +llc_op_con_upd_ind_handler = 0x40000a28; +llc_op_disconnect_ind_handler = 0x40000a2c; +llc_op_dl_upd_ind_handler = 0x40000a30; +llc_op_encrypt_ind_handler = 0x40000a34; +llc_op_feats_exch_ind_handler = 0x40000a38; +llc_op_le_ping_ind_handler = 0x40000a3c; +llc_op_phy_upd_ind_handler = 0x40000a40; +llc_op_ver_exch_ind_handler = 0x40000a44; +llc_stopped_ind_handler = 0x40000a48; +lld_acl_rx_ind_handler = 0x40000a4c; +lld_acl_tx_cfm_handler = 0x40000a50; +lld_adv_end_ind_handler = 0x40000a54; +lld_adv_rep_ind_handler = 0x40000a58; +lld_ch_map_upd_cfm_handler = 0x40000a5c; +lld_con_estab_ind_handler = 0x40000a60; +lld_con_evt_sd_evt_time_set = 0x40000a64; +lld_con_offset_upd_ind_handler = 0x40000a68; +lld_con_param_upd_cfm_handler = 0x40000a6c; +lld_disc_ind_handler = 0x40000a70; +lld_init_end_ind_handler = 0x40000a74; +lld_llcp_rx_ind_handler_wrapper = 0x40000a78; +lld_llcp_tx_cfm_handler = 0x40000a7c; +lld_per_adv_end_ind_handler = 0x40000a80; +lld_per_adv_rep_ind_handler = 0x40000a84; +lld_per_adv_rx_end_ind_handler = 0x40000a88; +lld_phy_coded_500k_get = 0x40000a8c; +lld_phy_upd_cfm_handler = 0x40000a90; +lld_scan_end_ind_handler = 0x40000a94; +lld_scan_req_ind_handler = 0x40000a98; +lld_sync_start_req_handler = 0x40000a9c; +lld_test_end_ind_handler = 0x40000aa0; +lld_update_rxbuf_handler = 0x40000aa4; +llm_ch_map_update_ind_handler = 0x40000aa8; +llm_hci_command_handler_wrapper = 0x40000aac; +llm_scan_period_to_handler = 0x40000ab0; +r_Add2SelfBigHex256 = 0x40000ab4; +r_AddBigHex256 = 0x40000ab8; +r_AddBigHexModP256 = 0x40000abc; +r_AddP256 = 0x40000ac0; +r_AddPdiv2_256 = 0x40000ac4; +r_GF_Jacobian_Point_Addition256 = 0x40000ac8; +r_GF_Jacobian_Point_Double256 = 0x40000acc; +r_GF_Point_Jacobian_To_Affine256 = 0x40000ad0; +r_MultiplyBigHexByUint32_256 = 0x40000ad4; +r_MultiplyBigHexModP256 = 0x40000ad8; +r_MultiplyByU16ModP256 = 0x40000adc; +r_SubtractBigHex256 = 0x40000ae0; +r_SubtractBigHexMod256 = 0x40000ae4; +r_SubtractBigHexUint32_256 = 0x40000ae8; +r_SubtractFromSelfBigHex256 = 0x40000aec; +r_SubtractFromSelfBigHexSign256 = 0x40000af0; +r_aes_alloc = 0x40000af4; +r_aes_ccm_continue = 0x40000af8; +r_aes_ccm_process_e = 0x40000afc; +r_aes_ccm_xor_128_lsb = 0x40000b00; +r_aes_ccm_xor_128_msb = 0x40000b04; +r_aes_cmac_continue = 0x40000b08; +r_aes_cmac_start = 0x40000b0c; +r_aes_k1_continue = 0x40000b10; +r_aes_k2_continue = 0x40000b14; +r_aes_k3_continue = 0x40000b18; +r_aes_k4_continue = 0x40000b1c; +r_aes_shift_left_128 = 0x40000b20; +r_aes_start = 0x40000b24; +r_aes_xor_128 = 0x40000b28; +r_assert_err = 0x40000b2c; +r_assert_param = 0x40000b30; +r_assert_warn = 0x40000b34; +r_bigHexInversion256 = 0x40000b38; +r_ble_sw_cca_check_isr = 0x40000b3c; +r_ble_util_buf_acl_tx_alloc = 0x40000b40; +r_ble_util_buf_acl_tx_elt_get = 0x40000b44; +r_ble_util_buf_acl_tx_free = 0x40000b48; +r_ble_util_buf_acl_tx_free_in_isr = 0x40000b4c; +r_ble_util_buf_adv_tx_alloc = 0x40000b50; +r_ble_util_buf_adv_tx_free = 0x40000b54; +r_ble_util_buf_adv_tx_free_in_isr = 0x40000b58; +r_ble_util_buf_env_deinit = 0x40000b5c; +r_ble_util_buf_env_init = 0x40000b60; +r_ble_util_buf_get_rx_buf_nb = 0x40000b64; +r_ble_util_buf_get_rx_buf_size = 0x40000b68; +r_ble_util_buf_llcp_tx_alloc = 0x40000b6c; +r_ble_util_buf_llcp_tx_free = 0x40000b70; +r_ble_util_buf_rx_alloc = 0x40000b74; +r_ble_util_buf_rx_alloc_in_isr = 0x40000b78; +r_ble_util_buf_rx_free = 0x40000b7c; +r_ble_util_buf_rx_free_in_isr = 0x40000b80; +r_ble_util_buf_set_rx_buf_nb = 0x40000b84; +r_ble_util_buf_set_rx_buf_size = 0x40000b88; +r_ble_util_data_rx_buf_reset = 0x40000b8c; +r_bt_bb_get_intr_mask = 0x40000b90; +r_bt_bb_intr_clear = 0x40000b94; +r_bt_bb_intr_mask_set = 0x40000b98; +r_bt_rf_coex_cfg_set = 0x40000ba0; +r_bt_rf_coex_conn_dynamic_pti_en_get = 0x40000ba4; +r_bt_rf_coex_ext_adv_dynamic_pti_en_get = 0x40000bac; +r_bt_rf_coex_ext_scan_dynamic_pti_en_get = 0x40000bb0; +r_bt_rf_coex_legacy_adv_dynamic_pti_en_get = 0x40000bb4; +r_bt_rf_coex_per_adv_dynamic_pti_en_get = 0x40000bb8; +r_bt_rf_coex_pti_table_get = 0x40000bbc; +r_bt_rf_coex_st_param_get = 0x40000bc0; +r_bt_rf_coex_st_param_set = 0x40000bc4; +r_bt_rf_coex_sync_scan_dynamic_pti_en_get = 0x40000bc8; +r_bt_rma_apply_rule_cs_fmt = 0x40000bcc; +r_bt_rma_apply_rule_cs_idx = 0x40000bd0; +r_bt_rma_configure = 0x40000bd4; +r_bt_rma_deregister_rule_cs_fmt = 0x40000bd8; +r_bt_rma_deregister_rule_cs_idx = 0x40000bdc; +r_bt_rma_get_ant_by_act = 0x40000be0; +r_bt_rma_init = 0x40000be4; +r_bt_rma_register_rule_cs_fmt = 0x40000be8; +r_bt_rma_register_rule_cs_idx = 0x40000bec; +r_bt_rtp_apply_rule_cs_fmt = 0x40000bf0; +r_bt_rtp_apply_rule_cs_idx = 0x40000bf4; +r_bt_rtp_deregister_rule_cs_fmt = 0x40000bf8; +r_bt_rtp_deregister_rule_cs_idx = 0x40000bfc; +r_bt_rtp_init = 0x40000c04; +r_bt_rtp_register_rule_cs_fmt = 0x40000c08; +r_bt_rtp_register_rule_cs_idx = 0x40000c0c; +r_btdm_isr = 0x40000c10; +r_cali_phase_match_p = 0x40000c20; +r_cmp_abs_time = 0x40000c24; +r_cmp_dest_id = 0x40000c28; +r_cmp_timer_id = 0x40000c2c; +r_co_bdaddr_compare = 0x40000c30; +r_co_ble_pkt_dur_in_us = 0x40000c34; +r_co_list_extract = 0x40000c38; +r_co_list_extract_after = 0x40000c3c; +r_co_list_extract_sublist = 0x40000c40; +r_co_list_find = 0x40000c44; +r_co_list_init = 0x40000c48; +r_co_list_insert_after = 0x40000c4c; +r_co_list_insert_before = 0x40000c50; +r_co_list_merge = 0x40000c54; +r_co_list_pool_init = 0x40000c58; +r_co_list_pop_front = 0x40000c5c; +r_co_list_push_back = 0x40000c60; +r_co_list_push_back_sublist = 0x40000c64; +r_co_list_push_front = 0x40000c68; +r_co_list_size = 0x40000c6c; +r_co_nb_good_le_channels = 0x40000c70; +r_co_util_pack = 0x40000c74; +r_co_util_read_array_size = 0x40000c78; +r_co_util_unpack = 0x40000c7c; +r_dbg_env_deinit = 0x40000c80; +r_dbg_env_init = 0x40000c84; +r_dbg_platform_reset_complete = 0x40000c88; +r_dl_upd_proc_start = 0x40000c8c; +r_dump_data = 0x40000c90; +r_ecc_abort_key256_generation = 0x40000c94; +r_ecc_gen_new_public_key = 0x40000c98; +r_ecc_gen_new_secret_key = 0x40000c9c; +r_ecc_generate_key256 = 0x40000ca0; +r_ecc_get_debug_Keys = 0x40000ca4; +r_ecc_init = 0x40000ca8; +r_ecc_is_valid_point = 0x40000cac; +r_ecc_multiplication_event_handler = 0x40000cb0; +r_ecc_point_multiplication_win_256 = 0x40000cb4; +r_emi_alloc_em_mapping_by_offset = 0x40000cb8; +r_emi_base_reg_lut_show = 0x40000cbc; +r_emi_em_base_reg_show = 0x40000cc0; +r_emi_free_em_mapping_by_offset = 0x40000cc4; +r_emi_get_em_mapping_idx_by_offset = 0x40000cc8; +r_emi_get_mem_addr_by_offset = 0x40000ccc; +r_emi_overwrite_em_mapping_by_offset = 0x40000cd0; +r_esp_vendor_hci_command_handler = 0x40000cd4; +r_get_stack_usage = 0x40000cd8; +r_h4tl_acl_hdr_rx_evt_handler = 0x40000cdc; +r_h4tl_cmd_hdr_rx_evt_handler = 0x40000ce0; +r_h4tl_cmd_pld_rx_evt_handler = 0x40000ce4; +r_h4tl_eif_io_event_post = 0x40000ce8; +r_h4tl_eif_register = 0x40000cec; +r_h4tl_init = 0x40000cf0; +r_h4tl_out_of_sync = 0x40000cf4; +r_h4tl_out_of_sync_check = 0x40000cf8; +r_h4tl_read_hdr = 0x40000cfc; +r_h4tl_read_next_out_of_sync = 0x40000d00; +r_h4tl_read_payl = 0x40000d04; +r_h4tl_read_start = 0x40000d08; +r_h4tl_rx_acl_hdr_extract = 0x40000d0c; +r_h4tl_rx_cmd_hdr_extract = 0x40000d10; +r_h4tl_rx_done = 0x40000d14; +r_h4tl_start = 0x40000d18; +r_h4tl_stop = 0x40000d1c; +r_h4tl_tx_done = 0x40000d20; +r_h4tl_tx_evt_handler = 0x40000d24; +r_h4tl_write = 0x40000d28; +r_hci_acl_tx_data_alloc = 0x40000d2c; +r_hci_acl_tx_data_received = 0x40000d30; +r_hci_basic_cmd_send_2_controller = 0x40000d34; +r_hci_ble_adv_report_filter_check = 0x40000d38; +r_hci_ble_adv_report_tx_check = 0x40000d3c; +r_hci_ble_conhdl_register = 0x40000d40; +r_hci_ble_conhdl_unregister = 0x40000d44; +r_hci_build_acl_data = 0x40000d48; +r_hci_build_cc_evt = 0x40000d4c; +r_hci_build_cs_evt = 0x40000d50; +r_hci_build_evt = 0x40000d54; +r_hci_build_le_evt = 0x40000d58; +r_hci_cmd_get_max_param_size = 0x40000d5c; +r_hci_cmd_received = 0x40000d60; +r_hci_cmd_reject = 0x40000d64; +r_hci_evt_mask_check = 0x40000d68; +r_hci_evt_mask_set = 0x40000d6c; +r_hci_fc_acl_buf_size_set = 0x40000d70; +r_hci_fc_acl_en = 0x40000d74; +r_hci_fc_acl_packet_sent = 0x40000d78; +r_hci_fc_check_host_available_nb_acl_packets = 0x40000d7c; +r_hci_fc_host_nb_acl_pkts_complete = 0x40000d80; +r_hci_fc_init = 0x40000d84; +r_hci_look_for_cmd_desc = 0x40000d88; +r_hci_look_for_evt_desc = 0x40000d8c; +r_hci_look_for_le_evt_desc = 0x40000d90; +r_hci_look_for_le_evt_desc_esp = 0x40000d94; +r_hci_pack_bytes = 0x40000d98; +r_hci_send_2_controller = 0x40000da0; +r_hci_send_2_host = 0x40000da4; +r_hci_tl_c2h_data_flow_on = 0x40000da8; +r_hci_tl_cmd_hdr_rx_evt_handler = 0x40000dac; +r_hci_tl_cmd_pld_rx_evt_handler = 0x40000db0; +r_hci_tl_get_pkt = 0x40000db4; +r_hci_tl_hci_pkt_handler = 0x40000db8; +r_hci_tl_hci_tx_done_evt_handler = 0x40000dbc; +r_hci_tl_inc_nb_h2c_cmd_pkts = 0x40000dc0; +r_hci_tl_save_pkt = 0x40000dc4; +r_hci_tl_send = 0x40000dc8; +r_hci_tx_done = 0x40000dcc; +r_hci_tx_start = 0x40000dd0; +r_hci_tx_trigger = 0x40000dd4; +r_isValidSecretKey_256 = 0x40000dd8; +r_ke_check_malloc = 0x40000ddc; +r_ke_event_callback_set = 0x40000de0; +r_ke_event_clear = 0x40000de4; +r_ke_event_flush = 0x40000de8; +r_ke_event_get = 0x40000dec; +r_ke_event_get_all = 0x40000df0; +r_ke_event_init = 0x40000df4; +r_ke_event_schedule = 0x40000df8; +r_ke_event_set = 0x40000dfc; +r_ke_flush = 0x40000e00; +r_ke_free = 0x40000e04; +r_ke_handler_search = 0x40000e08; +r_ke_init = 0x40000e0c; +r_ke_is_free = 0x40000e10; +r_ke_malloc = 0x40000e14; +r_ke_mem_init = 0x40000e18; +r_ke_mem_is_empty = 0x40000e1c; +r_ke_mem_is_in_heap = 0x40000e20; +r_ke_msg_alloc = 0x40000e24; +r_ke_msg_dest_id_get = 0x40000e28; +r_ke_msg_discard = 0x40000e2c; +r_ke_msg_forward = 0x40000e30; +r_ke_msg_forward_new_id = 0x40000e34; +r_ke_msg_free = 0x40000e38; +r_ke_msg_in_queue = 0x40000e3c; +r_ke_msg_save = 0x40000e40; +r_ke_msg_send = 0x40000e44; +r_ke_msg_send_basic = 0x40000e48; +r_ke_msg_src_id_get = 0x40000e4c; +r_ke_queue_extract = 0x40000e50; +r_ke_queue_insert = 0x40000e54; +r_ke_sleep_check = 0x40000e58; +r_ke_state_get = 0x40000e5c; +r_ke_state_set = 0x40000e60; +r_ke_task_check = 0x40000e64; +r_ke_task_create = 0x40000e68; +r_ke_task_delete = 0x40000e6c; +r_ke_task_handler_get = 0x40000e70; +r_ke_task_init = 0x40000e74; +r_ke_task_msg_flush = 0x40000e78; +r_ke_task_saved_update = 0x40000e7c; +r_ke_time = 0x40000e84; +r_ke_time_cmp = 0x40000e88; +r_ke_time_past = 0x40000e8c; +r_ke_timer_active = 0x40000e90; +r_ke_timer_adjust_all = 0x40000e94; +r_ke_timer_clear = 0x40000e98; +r_ke_timer_init = 0x40000e9c; +r_ke_timer_schedule = 0x40000ea0; +r_ke_timer_set = 0x40000ea4; +r_led_init = 0x40000ea8; +r_led_set_all = 0x40000eac; +r_llc_aes_res_cb = 0x40000eb0; +r_llc_ch_map_up_proc_err_cb = 0x40000eb4; +r_llc_cleanup = 0x40000eb8; +r_llc_cmd_cmp_send = 0x40000ebc; +r_llc_cmd_stat_send = 0x40000ec0; +r_llc_con_move_cbk = 0x40000ec4; +r_llc_con_plan_set_update = 0x40000ec8; +r_llc_con_upd_param_in_range = 0x40000ecc; +r_llc_disconnect = 0x40000ed0; +r_llc_disconnect_end = 0x40000ed4; +r_llc_disconnect_proc_continue = 0x40000ed8; +r_llc_disconnect_proc_err_cb = 0x40000edc; +r_llc_dl_chg_check = 0x40000ee0; +r_llc_dle_proc_err_cb = 0x40000ee4; +r_llc_feats_exch_proc_err_cb = 0x40000ee8; +r_llc_hci_cmd_handler_tab_p_get = 0x40000eec; +r_llc_hci_con_param_req_evt_send = 0x40000ef4; +r_llc_hci_con_upd_info_send = 0x40000ef8; +r_llc_hci_disconnected_dis = 0x40000efc; +r_llc_hci_dl_upd_info_send = 0x40000f00; +r_llc_hci_enc_evt_send = 0x40000f04; +r_llc_hci_feats_info_send = 0x40000f08; +r_llc_hci_le_phy_upd_cmp_evt_send = 0x40000f0c; +r_llc_hci_ltk_request_evt_send = 0x40000f10; +r_llc_hci_nb_cmp_pkts_evt_send = 0x40000f14; +r_llc_hci_version_info_send = 0x40000f18; +r_llc_init_term_proc = 0x40000f1c; +r_llc_iv_skd_rand_gen = 0x40000f20; +r_llc_le_ping_proc_continue = 0x40000f24; +r_llc_le_ping_proc_err_cb = 0x40000f28; +/* r_llc_le_ping_restart = 0x40000f2c; */ +r_llc_le_ping_set = 0x40000f30; +r_llc_ll_pause_enc_rsp_ack_handler = 0x40000f34; +r_llc_ll_reject_ind_ack_handler = 0x40000f38; +r_llc_ll_reject_ind_pdu_send = 0x40000f3c; +r_llc_ll_start_enc_rsp_ack_handler = 0x40000f40; +r_llc_ll_terminate_ind_ack = 0x40000f44; +r_llc_ll_unknown_ind_handler = 0x40000f48; +r_llc_llcp_send = 0x40000f4c; +r_llc_llcp_state_set = 0x40000f50; +r_llc_llcp_trans_timer_set = 0x40000f54; +r_llc_llcp_tx_check = 0x40000f58; +r_llc_loc_con_upd_proc_err_cb = 0x40000f64; +r_llc_loc_dl_upd_proc_continue = 0x40000f68; +r_llc_loc_encrypt_proc_continue = 0x40000f6c; +r_llc_loc_encrypt_proc_err_cb = 0x40000f70; +r_llc_loc_feats_exch_proc_continue = 0x40000f74; +r_llc_loc_phy_upd_proc_err_cb = 0x40000f7c; +r_llc_msg_handler_tab_p_get = 0x40000f80; +r_llc_pref_param_compute = 0x40000f84; +r_llc_proc_collision_check = 0x40000f88; +r_llc_proc_err_ind = 0x40000f8c; +r_llc_proc_get = 0x40000f90; +r_llc_proc_id_get = 0x40000f94; +r_llc_proc_reg = 0x40000f98; +r_llc_proc_state_get = 0x40000f9c; +r_llc_proc_state_set = 0x40000fa0; +r_llc_proc_timer_pause_set = 0x40000fa4; +r_llc_proc_timer_set = 0x40000fa8; +r_llc_proc_unreg = 0x40000fac; +r_llc_rem_ch_map_proc_continue = 0x40000fb0; +r_llc_rem_con_upd_proc_err_cb = 0x40000fb8; +r_llc_rem_dl_upd_proc = 0x40000fbc; +r_llc_rem_encrypt_proc_continue = 0x40000fc0; +r_llc_rem_encrypt_proc_err_cb = 0x40000fc4; +r_llc_rem_phy_upd_proc_continue = 0x40000fc8; +r_llc_rem_phy_upd_proc_err_cb = 0x40000fcc; +r_llc_role_get = 0x40000fd0; +r_llc_sk_gen = 0x40000fd4; +r_llc_start = 0x40000fd8; +r_llc_stop = 0x40000fdc; +r_llc_ver_exch_loc_proc_continue = 0x40000fe0; +r_llc_ver_proc_err_cb = 0x40000fe4; +r_llcp_pdu_handler_tab_p_get = 0x40000fe8; +r_lld_aa_gen = 0x40000fec; +r_lld_adv_adv_data_set = 0x40000ff0; +r_lld_adv_adv_data_update = 0x40000ff4; +r_lld_adv_aux_ch_idx_set = 0x40000ff8; +r_lld_adv_aux_evt_canceled_cbk = 0x40000ffc; +r_lld_adv_aux_evt_start_cbk = 0x40001000; +r_lld_adv_coex_check_ext_adv_synced = 0x40001004; +r_lld_adv_coex_env_reset = 0x40001008; +r_lld_adv_duration_update = 0x4000100c; +r_lld_adv_dynamic_pti_process = 0x40001010; +r_lld_adv_end = 0x40001014; +r_lld_adv_evt_canceled_cbk = 0x40001018; +r_lld_adv_evt_start_cbk = 0x4000101c; +r_lld_adv_ext_chain_construct = 0x40001020; +r_lld_adv_ext_pkt_prepare = 0x40001024; +r_lld_adv_frm_cbk = 0x40001028; +r_lld_adv_frm_isr = 0x4000102c; +r_lld_adv_frm_skip_isr = 0x40001030; +r_lld_adv_init = 0x40001034; +r_lld_adv_pkt_rx = 0x40001038; +r_lld_adv_pkt_rx_connect_ind = 0x4000103c; +r_lld_adv_pkt_rx_send_scan_req_evt = 0x40001040; +r_lld_adv_rand_addr_update = 0x40001044; +r_lld_adv_restart = 0x40001048; +r_lld_adv_scan_rsp_data_set = 0x4000104c; +r_lld_adv_scan_rsp_data_update = 0x40001050; +r_lld_adv_set_tx_power = 0x40001054; +r_lld_adv_start = 0x40001058; +r_lld_adv_stop = 0x4000105c; +r_lld_adv_sync_info_set = 0x40001060; +r_lld_adv_sync_info_update = 0x40001064; +r_lld_calc_aux_rx = 0x40001068; +r_lld_cca_alloc = 0x4000106c; +r_lld_cca_data_reset = 0x40001070; +r_lld_cca_free = 0x40001074; +r_lld_ch_assess_data_get = 0x40001078; +r_lld_ch_idx_get = 0x4000107c; +r_lld_ch_map_set = 0x40001080; +r_lld_channel_assess = 0x40001084; +r_lld_con_activity_act_offset_compute = 0x40001088; +r_lld_con_activity_offset_compute = 0x4000108c; +r_lld_con_ch_map_update = 0x40001090; +r_lld_con_cleanup = 0x40001094; +r_lld_con_current_tx_power_get = 0x40001098; +r_lld_con_data_flow_set = 0x4000109c; +r_lld_con_data_len_update = 0x400010a0; +r_lld_con_data_tx = 0x400010a4; +r_lld_con_enc_key_load = 0x400010a8; +r_lld_con_event_counter_get = 0x400010ac; +r_lld_con_evt_canceled_cbk = 0x400010b0; +r_lld_con_evt_duration_min_get = 0x400010b4; +r_lld_con_evt_max_eff_time_cal = 0x400010b8; +r_lld_con_evt_sd_evt_time_get = 0x400010bc; +r_lld_con_evt_start_cbk = 0x400010c0; +r_lld_con_evt_time_update = 0x400010c4; +r_lld_con_free_all_tx_buf = 0x400010c8; +r_lld_con_frm_cbk = 0x400010cc; +r_lld_con_frm_isr = 0x400010d0; +r_lld_con_frm_skip_isr = 0x400010d4; +r_lld_con_init = 0x400010d8; +r_lld_con_llcp_tx = 0x400010dc; +r_lld_con_max_lat_calc = 0x400010e0; +r_lld_con_offset_get = 0x400010e4; +r_lld_con_param_update = 0x400010e8; +r_lld_con_phys_update = 0x400010ec; +r_lld_con_pref_slave_evt_dur_set = 0x400010f0; +r_lld_con_pref_slave_latency_set = 0x400010f4; +r_lld_con_rssi_get = 0x400010f8; +r_lld_con_rx = 0x400010fc; +/* r_lld_con_rx_channel_assess = 0x40001100; */ +r_lld_con_rx_enc = 0x40001104; +r_lld_con_rx_isr = 0x40001108; +r_lld_con_rx_link_info_check = 0x4000110c; +r_lld_con_rx_llcp_check = 0x40001110; +r_lld_con_rx_sync_time_update = 0x40001114; +r_lld_con_set_tx_power = 0x4000111c; +r_lld_con_start = 0x40001120; +r_lld_con_tx = 0x40001128; +r_lld_con_tx_enc = 0x4000112c; +r_lld_con_tx_isr = 0x40001130; +r_lld_con_tx_len_update = 0x40001134; +r_lld_con_tx_len_update_for_intv = 0x40001138; +r_lld_con_tx_len_update_for_rate = 0x4000113c; +r_lld_con_tx_prog = 0x40001140; +r_lld_conn_dynamic_pti_process = 0x40001144; +r_lld_continue_scan_rx_isr_end_process = 0x40001148; +r_lld_ext_scan_dynamic_pti_process = 0x4000114c; +r_lld_hw_cca_end_isr = 0x40001150; +r_lld_hw_cca_evt_handler = 0x40001154; +r_lld_hw_cca_isr = 0x40001158; +r_lld_init_cal_anchor_point = 0x4000115c; +r_lld_init_compute_winoffset = 0x40001160; +r_lld_init_connect_req_pack = 0x40001164; +r_lld_init_end = 0x40001168; +r_lld_init_evt_canceled_cbk = 0x4000116c; +r_lld_init_evt_start_cbk = 0x40001170; +r_lld_init_frm_cbk = 0x40001174; +r_lld_init_frm_eof_isr = 0x40001178; +r_lld_init_frm_skip_isr = 0x4000117c; +r_lld_init_init = 0x40001180; +r_lld_init_process_pkt_rx = 0x40001184; +r_lld_init_process_pkt_rx_adv_ext_ind = 0x40001188; +r_lld_init_process_pkt_rx_adv_ind_or_direct_ind = 0x4000118c; +r_lld_init_process_pkt_rx_aux_connect_rsp = 0x40001190; +r_lld_init_process_pkt_tx = 0x40001194; +r_lld_init_process_pkt_tx_cal_con_timestamp = 0x40001198; +r_lld_init_sched = 0x4000119c; +r_lld_init_set_tx_power = 0x400011a0; +r_lld_init_start = 0x400011a4; +r_lld_init_stop = 0x400011a8; +r_lld_instant_proc_end = 0x400011ac; +r_lld_per_adv_ch_map_update = 0x400011b4; +r_lld_per_adv_chain_construct = 0x400011b8; +r_lld_per_adv_cleanup = 0x400011bc; +r_lld_per_adv_coex_env_reset = 0x400011c0; +r_lld_per_adv_data_set = 0x400011c4; +r_lld_per_adv_data_update = 0x400011c8; +r_lld_per_adv_dynamic_pti_process = 0x400011cc; +r_lld_per_adv_evt_canceled_cbk = 0x400011d0; +r_lld_per_adv_evt_start_cbk = 0x400011d4; +r_lld_per_adv_ext_pkt_prepare = 0x400011d8; +r_lld_per_adv_frm_cbk = 0x400011dc; +r_lld_per_adv_frm_isr = 0x400011e0; +r_lld_per_adv_frm_skip_isr = 0x400011e4; +r_lld_per_adv_init = 0x400011e8; +r_lld_per_adv_init_info_get = 0x400011ec; +r_lld_per_adv_list_add = 0x400011f0; +r_lld_per_adv_list_rem = 0x400011f4; +r_lld_per_adv_set_tx_power = 0x400011fc; +r_lld_per_adv_start = 0x40001200; +r_lld_per_adv_stop = 0x40001204; +r_lld_per_adv_sync_info_get = 0x40001208; +r_lld_process_cca_data = 0x4000120c; +r_lld_ral_search = 0x40001210; +r_lld_read_clock = 0x40001214; +r_lld_res_list_add = 0x40001218; +r_lld_res_list_is_empty = 0x40001220; +r_lld_res_list_local_rpa_get = 0x40001224; +r_lld_res_list_peer_rpa_get = 0x40001228; +r_lld_res_list_peer_update = 0x4000122c; +/* r_lld_res_list_priv_mode_update = 0x40001230; */ +r_lld_reset_reg = 0x40001238; +r_lld_rpa_renew = 0x4000123c; +r_lld_rpa_renew_evt_canceled_cbk = 0x40001240; +r_lld_rpa_renew_evt_start_cbk = 0x40001244; +r_lld_rpa_renew_instant_cbk = 0x40001248; +r_lld_rxdesc_check = 0x4000124c; +r_lld_rxdesc_free = 0x40001250; +r_lld_scan_create_sync = 0x40001254; +r_lld_scan_create_sync_cancel = 0x40001258; +r_lld_scan_end = 0x4000125c; +r_lld_scan_evt_canceled_cbk = 0x40001260; +r_lld_scan_evt_start_cbk = 0x40001264; +r_lld_scan_frm_cbk = 0x40001268; +r_lld_scan_frm_eof_isr = 0x4000126c; +r_lld_scan_frm_rx_isr = 0x40001270; +r_lld_scan_frm_skip_isr = 0x40001274; +r_lld_scan_init = 0x40001278; +r_lld_scan_params_update = 0x4000127c; +r_lld_scan_process_pkt_rx_aux_adv_ind = 0x40001288; +r_lld_scan_process_pkt_rx_aux_chain_ind = 0x4000128c; +r_lld_scan_process_pkt_rx_aux_scan_rsp = 0x40001290; +r_lld_scan_process_pkt_rx_ext_adv = 0x40001294; +r_lld_scan_process_pkt_rx_ext_adv_ind = 0x40001298; +r_lld_scan_process_pkt_rx_legacy_adv = 0x4000129c; +r_lld_scan_restart = 0x400012a0; +r_lld_scan_sched = 0x400012a4; +r_lld_scan_set_tx_power = 0x400012a8; +r_lld_scan_start = 0x400012ac; +r_lld_scan_stop = 0x400012b0; +r_lld_scan_sync_accept = 0x400012b4; +r_lld_scan_sync_info_unpack = 0x400012b8; +r_lld_scan_trunc_ind = 0x400012bc; +r_lld_sw_cca_evt_handler = 0x400012c0; +r_lld_sw_cca_isr = 0x400012c4; +r_lld_sync_ch_map_update = 0x400012c8; +r_lld_sync_cleanup = 0x400012cc; +r_lld_sync_evt_canceled_cbk = 0x400012d0; +r_lld_sync_evt_start_cbk = 0x400012d4; +r_lld_sync_frm_cbk = 0x400012d8; +r_lld_sync_frm_eof_isr = 0x400012dc; +r_lld_sync_frm_rx_isr = 0x400012e0; +r_lld_sync_frm_skip_isr = 0x400012e4; +r_lld_sync_init = 0x400012e8; +r_lld_sync_process_pkt_rx = 0x400012ec; +r_lld_sync_process_pkt_rx_aux_sync_ind = 0x400012f0; +r_lld_sync_process_pkt_rx_pkt_check = 0x400012f4; +r_lld_sync_scan_dynamic_pti_process = 0x400012f8; +r_lld_sync_sched = 0x400012fc; +r_lld_sync_start = 0x40001300; +r_lld_sync_stop = 0x40001304; +r_lld_sync_trunc_ind = 0x40001308; +r_lld_test_cleanup = 0x4000130c; +r_lld_test_evt_canceled_cbk = 0x40001310; +r_lld_test_evt_start_cbk = 0x40001314; +r_lld_test_freq2chnl = 0x40001318; +r_lld_test_frm_cbk = 0x4000131c; +r_lld_test_frm_isr = 0x40001320; +r_lld_test_init = 0x40001324; +r_lld_test_rx_isr = 0x40001328; +r_lld_test_set_tx_power = 0x4000132c; +r_lld_test_start = 0x40001330; +/* r_lld_test_stop = 0x40001334; */ +r_lld_update_rxbuf = 0x40001338; +r_lld_update_rxbuf_isr = 0x4000133c; +r_lld_white_list_add = 0x40001340; +r_lld_white_list_rem = 0x40001344; +r_llm_activity_free_get = 0x40001348; +r_llm_activity_free_set = 0x4000134c; +r_llm_activity_syncing_get = 0x40001350; +r_llm_adv_con_len_check = 0x40001354; +r_llm_adv_hdl_to_id = 0x40001358; +r_llm_adv_rep_flow_control_check = 0x4000135c; +r_llm_adv_rep_flow_control_update = 0x40001360; +r_llm_adv_reports_list_check = 0x40001364; +r_llm_adv_set_all_release = 0x40001368; +r_llm_adv_set_dft_params = 0x4000136c; +r_llm_adv_set_release = 0x40001370; +r_llm_aes_res_cb = 0x40001374; +r_llm_ble_update_adv_flow_control = 0x40001378; +r_llm_ch_map_update = 0x4000137c; +r_llm_cmd_cmp_send = 0x40001380; +r_llm_cmd_stat_send = 0x40001384; +r_llm_dev_list_empty_entry = 0x40001388; +r_llm_dev_list_search = 0x4000138c; +r_llm_env_adv_dup_filt_deinit = 0x40001390; +r_llm_env_adv_dup_filt_init = 0x40001394; +r_llm_init_ble_adv_report_flow_contol = 0x40001398; +r_llm_is_dev_connected = 0x4000139c; +r_llm_is_dev_synced = 0x400013a0; +r_llm_is_non_con_act_ongoing_check = 0x400013a4; +r_llm_is_wl_accessible = 0x400013a8; +r_llm_le_evt_mask_check = 0x400013ac; +r_llm_link_disc = 0x400013b4; +r_llm_master_ch_map_get = 0x400013b8; +r_llm_msg_handler_tab_p_get = 0x400013bc; +r_llm_no_activity = 0x400013c0; +r_llm_per_adv_slot_dur = 0x400013c4; +r_llm_plan_elt_get = 0x400013c8; +r_llm_rx_path_comp_get = 0x400013cc; +r_llm_scan_start = 0x400013d0; +r_llm_scan_sync_acad_attach = 0x400013d4; +r_llm_scan_sync_acad_detach = 0x400013d8; +r_llm_send_adv_lost_event_to_host = 0x400013dc; +r_llm_tx_path_comp_get = 0x400013e0; +r_misc_deinit = 0x400013e4; +r_misc_free_em_buf_in_isr = 0x400013e8; +r_misc_init = 0x400013ec; +r_misc_msg_handler_tab_p_get = 0x400013f0; +r_notEqual256 = 0x400013f4; +r_phy_upd_proc_start = 0x400013f8; +r_platform_reset = 0x400013fc; +r_rf_em_init = 0x40001404; +r_rf_force_agc_enable = 0x40001408; +r_rf_reg_rd = 0x4000140c; +r_rf_reg_wr = 0x40001410; +r_rf_reset = 0x40001414; +r_rf_rssi_convert = 0x40001418; +r_rf_rw_v9_le_disable = 0x4000141c; +r_rf_rw_v9_le_enable = 0x40001420; +r_rf_sleep = 0x40001424; +r_rf_util_cs_fmt_convert = 0x40001430; +r_rw_crypto_aes_ccm = 0x40001434; +r_rw_crypto_aes_encrypt = 0x40001438; +r_rw_crypto_aes_init = 0x4000143c; +r_rw_crypto_aes_k1 = 0x40001440; +r_rw_crypto_aes_k2 = 0x40001444; +r_rw_crypto_aes_k3 = 0x40001448; +r_rw_crypto_aes_k4 = 0x4000144c; +r_rw_crypto_aes_rand = 0x40001450; +r_rw_crypto_aes_result_handler = 0x40001454; +r_rw_crypto_aes_s1 = 0x40001458; +r_rw_cryto_aes_cmac = 0x4000145c; +r_rw_v9_init_em_radio_table = 0x40001460; +r_rwble_sleep_enter = 0x40001468; +r_rwble_sleep_wakeup_end = 0x4000146c; +/* r_rwbtdm_isr_wrapper = 0x40001470; */ +r_rwip_active_check = 0x40001474; +r_rwip_aes_encrypt = 0x40001478; +/* r_rwip_assert = 0x4000147c; */ +r_rwip_crypt_evt_handler = 0x40001480; +r_rwip_crypt_isr_handler = 0x40001484; +r_rwip_eif_get = 0x40001488; +r_rwip_half_slot_2_lpcycles = 0x4000148c; +r_rwip_hus_2_lpcycles = 0x40001490; +r_rwip_isr = 0x40001494; +r_rwip_lpcycles_2_hus = 0x40001498; +r_rwip_prevent_sleep_clear = 0x4000149c; +r_rwip_prevent_sleep_set = 0x400014a0; +r_rwip_schedule = 0x400014a4; +r_rwip_sleep = 0x400014a8; +r_rwip_sw_int_handler = 0x400014ac; +r_rwip_sw_int_req = 0x400014b0; +r_rwip_time_get = 0x400014b4; +r_rwip_timer_10ms_handler = 0x400014b8; +r_rwip_timer_10ms_set = 0x400014bc; +r_rwip_timer_hs_handler = 0x400014c0; +r_rwip_timer_hs_set = 0x400014c4; +r_rwip_timer_hus_handler = 0x400014c8; +r_rwip_timer_hus_set = 0x400014cc; +r_rwip_wakeup = 0x400014d0; +/* r_rwip_wakeup_end = 0x400014d4; */ +r_rwip_wlcoex_set = 0x400014d8; +r_sch_alarm_clear = 0x400014dc; +r_sch_alarm_init = 0x400014e0; +r_sch_alarm_prog = 0x400014e4; +r_sch_alarm_set = 0x400014e8; +r_sch_alarm_timer_isr = 0x400014ec; +r_sch_arb_conflict_check = 0x400014f0; +r_sch_arb_elt_cancel = 0x400014f4; +r_sch_arb_init = 0x400014fc; +r_sch_arb_insert = 0x40001500; +r_sch_arb_prog_timer = 0x40001504; +r_sch_arb_remove = 0x40001508; +r_sch_arb_sw_isr = 0x4000150c; +r_sch_plan_chk = 0x40001510; +r_sch_plan_clock_wrap_offset_update = 0x40001514; +r_sch_plan_init = 0x40001518; +r_sch_plan_interval_req = 0x4000151c; +r_sch_plan_offset_max_calc = 0x40001520; +r_sch_plan_offset_req = 0x40001524; +r_sch_plan_position_range_compute = 0x40001528; +r_sch_plan_rem = 0x4000152c; +r_sch_plan_req = 0x40001530; +r_sch_prog_init = 0x4000153c; +r_sch_prog_push = 0x40001540; +r_sch_prog_rx_isr = 0x40001544; +r_sch_prog_skip_isr = 0x40001548; +r_sch_prog_tx_isr = 0x4000154c; +r_sch_slice_bg_add = 0x40001550; +r_sch_slice_bg_remove = 0x40001554; +r_sch_slice_compute = 0x40001558; +r_sch_slice_fg_add = 0x4000155c; +r_sch_slice_fg_remove = 0x40001560; +r_sch_slice_init = 0x40001564; +r_sch_slice_per_add = 0x40001568; +r_sch_slice_per_remove = 0x4000156c; +r_sdk_config_get_bt_sleep_enable = 0x40001570; +r_sdk_config_get_hl_derived_opts = 0x40001574; +r_sdk_config_get_opts = 0x40001578; +r_sdk_config_get_priv_opts = 0x4000157c; +r_sdk_config_set_bt_sleep_enable = 0x40001580; +r_sdk_config_set_hl_derived_opts = 0x40001584; +r_sdk_config_set_opts = 0x40001588; +r_specialModP256 = 0x4000158c; +r_unloaded_area_init = 0x40001590; +r_vhci_flow_off = 0x40001594; +r_vhci_flow_on = 0x40001598; +r_vhci_notify_host_send_available = 0x4000159c; +r_vhci_send_to_host = 0x400015a0; +r_vnd_hci_command_handler = 0x400015a4; +r_vshci_init = 0x400015a8; +vnd_hci_command_handler_wrapper = 0x400015ac; + +/* bluetooth hook funcs */ +r_llc_loc_encrypt_proc_continue_hook = 0x40001c60; +r_llc_loc_phy_upd_proc_continue_hook = 0x40001c64; +r_llc_rem_phy_upd_proc_continue_hook = 0x40001c68; +r_lld_scan_frm_eof_isr_hook = 0x40001c6c; +r_lld_scan_evt_start_cbk_hook = 0x40001c70; +r_lld_scan_process_pkt_rx_ext_adv_hook = 0x40001c78; +r_lld_scan_sched_hook = 0x40001c7c; +r_lld_adv_evt_start_cbk_hook = 0x40001c84; +r_lld_adv_aux_evt_start_cbk_hook = 0x40001c88; +r_lld_adv_frm_isr_hook = 0x40001c8c; +r_lld_adv_start_init_evt_param_hook = 0x40001c90; +r_lld_con_evt_canceled_cbk_hook = 0x40001c94; +r_lld_con_frm_isr_hook = 0x40001c98; +r_lld_con_tx_hook = 0x40001c9c; +r_lld_con_rx_hook = 0x40001ca0; +r_lld_con_evt_start_cbk_hook = 0x40001ca4; +r_lld_con_tx_prog_new_packet_hook = 0x40001cac; +r_lld_init_frm_eof_isr_hook = 0x40001cb0; +r_lld_init_evt_start_cbk_hook = 0x40001cb4; +r_lld_init_sched_hook = 0x40001cbc; +r_lld_init_process_pkt_tx_hook = 0x40001cc0; +r_lld_per_adv_evt_start_cbk_hook = 0x40001cc4; +r_lld_per_adv_frm_isr_hook = 0x40001cc8; +r_lld_per_adv_start_hook = 0x40001ccc; +r_lld_sync_frm_eof_isr_hook = 0x40001cd0; +r_lld_sync_evt_start_cbk_hook = 0x40001cd4; +r_lld_sync_start_hook = 0x40001cd8; +r_lld_sync_process_pkt_rx_pkt_check_hook = 0x40001cdc; +r_sch_arb_insert_hook = 0x40001ce0; +r_sch_plan_offset_req_hook = 0x40001ce4; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld index 969dd372d8b1..edad2237dc73 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld @@ -44,38 +44,6 @@ ppProcTxCallback = 0x40001b30; ieee80211_gettid = 0x40001b34; -/*************************************** - Group eco3_bluetooth - ***************************************/ - -/* Functions */ -r_lld_legacy_adv_dynamic_pti_get = 0x40001b38; -r_lld_legacy_adv_dynamic_pti_process = 0x40001b3c; -r_lld_ext_adv_dynamic_pti_get = 0x40001b40; -r_lld_ext_adv_dynamic_aux_pti_process = 0x40001b44; -r_lld_ext_adv_dynamic_pti_process = 0x40001b48; -/* r_lld_adv_ext_pkt_prepare_set = 0x40001b4c; */ -r_lld_adv_ext_chain_connectable_construct = 0x40001b54; -r_lld_adv_pkt_rx_connect_post = 0x40001b5c; -r_lld_adv_start_init_evt_param = 0x40001b60; -r_lld_adv_start_set_cs = 0x40001b64; -/* r_lld_adv_start_update_filter_policy = 0x40001b68; */ -r_lld_adv_start_schedule_asap = 0x40001b6c; -r_lld_con_tx_prog_new_packet_coex = 0x40001b70; -r_lld_per_adv_dynamic_pti_get = 0x40001b78; -r_lld_per_adv_evt_start_chm_upd = 0x40001b7c; -r_lld_ext_scan_dynamic_pti_get = 0x40001b80; -r_lld_sync_insert = 0x40001b88; -r_sch_prog_ble_push = 0x40001b8c; -r_sch_prog_bt_push = 0x40001b90; -r_lld_init_evt_end_type_set = 0x40001b94; -r_lld_init_evt_end_type_get = 0x40001b98; -r_lld_adv_direct_adv_use_rpa_addr_state_set = 0x40001b9c; -r_lld_adv_direct_adv_use_rpa_addr_state_get = 0x40001ba0; -r_lld_init_evt_end_type_check_state_set = 0x40001ba4; -r_lld_init_evt_end_type_check_state_get = 0x40001ba8; - - /*************************************** Group eco3_phy ***************************************/ diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3_bt_funcs.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3_bt_funcs.ld new file mode 100644 index 000000000000..6f67b8ddc33c --- /dev/null +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3_bt_funcs.ld @@ -0,0 +1,45 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* +ESP32C3 ECO3 ROM address table +Version 3 API's imported from the ROM +*/ + + +/*************************************** + Group eco3_bluetooth + ***************************************/ + +/* Functions */ +r_lld_legacy_adv_dynamic_pti_get = 0x40001b38; +r_lld_legacy_adv_dynamic_pti_process = 0x40001b3c; +r_lld_ext_adv_dynamic_pti_get = 0x40001b40; +r_lld_ext_adv_dynamic_aux_pti_process = 0x40001b44; +r_lld_ext_adv_dynamic_pti_process = 0x40001b48; +/* +r_lld_adv_ext_pkt_prepare_set = 0x40001b4c; +*/ +r_lld_adv_ext_chain_connectable_construct = 0x40001b54; +r_lld_adv_pkt_rx_connect_post = 0x40001b5c; +r_lld_adv_start_init_evt_param = 0x40001b60; +r_lld_adv_start_set_cs = 0x40001b64; +/* r_lld_adv_start_update_filter_policy = 0x40001b68; */ +r_lld_adv_start_schedule_asap = 0x40001b6c; +r_lld_con_tx_prog_new_packet_coex = 0x40001b70; +r_lld_per_adv_dynamic_pti_get = 0x40001b78; +r_lld_per_adv_evt_start_chm_upd = 0x40001b7c; +r_lld_ext_scan_dynamic_pti_get = 0x40001b80; +r_lld_sync_insert = 0x40001b88; +/* +r_sch_prog_ble_push = 0x40001b8c; +*/ +r_sch_prog_bt_push = 0x40001b90; +r_lld_init_evt_end_type_set = 0x40001b94; +r_lld_init_evt_end_type_get = 0x40001b98; +r_lld_adv_direct_adv_use_rpa_addr_state_set = 0x40001b9c; +r_lld_adv_direct_adv_use_rpa_addr_state_get = 0x40001ba0; +r_lld_init_evt_end_type_check_state_set = 0x40001ba4; +r_lld_init_evt_end_type_check_state_get = 0x40001ba8; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld index fb6938026c04..41445a1b5431 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld @@ -93,132 +93,6 @@ rom1_phy_close_rf = 0x40001c18; uart_tx_switch = 0x40001c44; -/*************************************** - Group eco7_bluetooth - ***************************************/ - -/* Functions */ -r_lld_con_count_get = 0x40001c48; -r_lld_update_con_offset = 0x40001c4c; -r_lld_con_update_last_clock = 0x40001c50; -r_lld_con_llcp_ind_info_clear = 0x40001c54; -r_lld_con_update_terminte_info_init = 0x40001c58; -r_lld_con_terminate_max_evt_update = 0x40001c5c; -r_llc_pref_param_compute_eco = 0x40001ce8; -r_llc_hci_con_upd_info_send_eco = 0x40001cec; -r_llc_rem_encrypt_proc_continue_eco = 0x40001cf0; -r_llc_start_eco = 0x40001cf8; -r_lld_ext_adv_dynamic_aux_pti_process_eco = 0x40001cfc; -r_lld_adv_start_eco = 0x40001d04; -r_lld_con_evt_canceled_cbk_eco = 0x40001d08; -r_lld_con_evt_time_update_eco = 0x40001d0c; -r_lld_con_start_eco = 0x40001d10; -r_lld_con_frm_isr_eco = 0x40001d14; -r_lld_con_tx_eco = 0x40001d18; -r_lld_ext_scan_dynamic_pti_process_eco = 0x40001d28; -r_lld_scan_frm_eof_isr_eco = 0x40001d2c; -r_lld_sync_start_eco = 0x40001d30; -r_lld_sync_insert_eco = 0x40001d34; -r_llm_adv_rep_flow_control_update_eco = 0x40001d38; -r_llm_env_adv_dup_filt_init_eco = 0x40001d3c; -r_llm_env_adv_dup_filt_deinit_eco = 0x40001d40; -r_llm_adv_rep_flow_control_check_eco = 0x40001d44; -r_llm_scan_start_eco = 0x40001d48; -r_llm_update_duplicate_scan_count = 0x40001d4c; -r_llc_hci_command_handler_pre = 0x40001d50; -r_llc_hci_command_handler_get = 0x40001d54; -r_llc_hci_command_handler_search = 0x40001d58; -r_llc_llcp_pdu_handler_pre = 0x40001d60; -r_llc_llcp_pdu_handler_end = 0x40001d64; -r_llc_con_conflict_check = 0x40001d6c; -r_sch_prog_hw_reset_try = 0x40001d70; -r_sch_prog_et_state_reset = 0x40001d74; -r_sch_prog_end_isr_handler = 0x40001d78; -r_sch_plan_conflict_check = 0x40001d7c; -r_rwble_isr_hw_fixed = 0x40001d80; -r_bt_bb_recorrect_is_dead = 0x40001d84; -r_bt_bb_restart_hw_recorrect = 0x40001d88; -r_ke_task_handler_pre = 0x40001da0; -r_ke_task_handler_end = 0x40001da4; -r_lld_scan_frm_skip_isr_eco = 0x40001db0; -r_lld_ext_scan_dynamic_pti_reset = 0x40001db4; -r_llc_rem_phy_upd_proc_continue_eco = 0x40001db8; -r_llm_get_preferred_phys = 0x40001dbc; -r_lld_hw_cca_isr_eco = 0x40001dc0; -r_lld_sw_cca_isr_eco = 0x40001dc4; -r_lld_cca_chan_prn_e = 0x40001dc8; -r_lld_cca_chan_prn_s = 0x40001dcc; -r_lld_cca_chan_sel_remap = 0x40001dd0; -r_lld_cca_chan_sel_1 = 0x40001dd4; -r_lld_cca_chan_sel_2 = 0x40001dd8; -r_lld_cca_set_thresh = 0x40001ddc; -r_lld_cca_con_start = 0x40001de0; -r_lld_cca_con_end = 0x40001de4; -r_lld_cca_chm_restore = 0x40001de8; -r_lld_cca_chan_unused_check = 0x40001dec; -r_lld_cca_chm_update_check = 0x40001df0; -r_lld_cca_busy_mode_handle = 0x40001df4; -r_lld_cca_lbt_handle = 0x40001df8; -r_lld_cca_scst_timeout_check = 0x40001dfc; -r_lld_cca_chan_avl_timeout_check = 0x40001e00; - -r_lld_con_start_hook = 0x40001ca8; - -/* ble Functions eco */ -r_bt_bb_isr = 0x40000b9c; -r_bt_rf_coex_conn_phy_coded_data_time_limit_en_get = 0x40000ba8; -r_bt_rtp_get_txpwr_idx_by_act = 0x40000c00; -r_btdm_task_post = 0x40000c14; -r_btdm_task_post_from_isr = 0x40000c18; -r_btdm_task_recycle = 0x40000c1c; -r_ke_task_schedule = 0x40000e80; -r_llc_hci_command_handler = 0x40000ef0; -r_llc_loc_ch_map_proc_continue = 0x40000f5c; -r_llc_loc_con_upd_proc_continue = 0x40000f60; -r_llc_loc_phy_upd_proc_continue = 0x40000f78; -r_llc_rem_con_upd_proc_continue = 0x40000fb4; -r_lld_con_sched = 0x40001118; -r_lld_con_stop = 0x40001124; -r_lld_llcp_rx_ind_handler = 0x400011b0; -r_lld_per_adv_sched = 0x400011f8; -r_rf_txpwr_cs_get = 0x40001428; -r_rf_txpwr_dbm_get = 0x4000142c; -r_sch_arb_event_start_isr = 0x400014f8; -r_sch_plan_set = 0x40001534; -r_sch_prog_end_isr = 0x40001538; -r_lld_adv_ext_chain_scannable_construct = 0x40001b58; - -r_lld_scan_process_pkt_rx = 0x40001280; -r_llm_le_features_get = 0x400013b0; - -/* ble functions rename */ -r_lld_init_start_hack = 0x400011a4; - -/* ble functions disable */ -/* -r_lld_adv_frm_isr_eco = 0x40001d00; -r_lld_res_list_clear = 0x40004638; -r_lld_res_list_rem = 0x40004680; -r_lld_adv_start_hook = 0x40001c80; -r_lld_con_evt_start_cbk_eco = 0x40001d1c; -r_lld_con_tx_prog_new_packet = 0x40001b74; -r_lld_adv_ext_chain_none_construct = 0x40001b50; -r_llc_llcp_send_eco = 0x40001cf4; -r_llc_llcp_channel_map_ind_ack = 0x40001d68; -r_rwble_isr = 0x40001464; -r_lld_scan_start_eco = 0x40001d24; -r_lld_scan_try_sched_eco = 0x40001dac; -r_lld_scan_start_hook = 0x40001c74; -r_lld_init_start_hook = 0x40001cb8; -r_lld_scan_evt_start_cbk_eco = 0x40001d20; -r_ke_task_handler_get_overwrite = 0x40001da8; -r_hci_register_vendor_desc_tab = 0x40000d9c; -r_lld_scan_process_pkt_rx_adv_rep = 0x40001284; -r_register_esp_vendor_cmd_handler = 0x40001400; -r_llc_llcp_pdu_handler_get_overwrite = 0x40001d5c; -*/ - - /*************************************** Group eco7_phy ***************************************/ diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7_bt_funcs.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7_bt_funcs.ld new file mode 100644 index 000000000000..33b0ed595d6b --- /dev/null +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7_bt_funcs.ld @@ -0,0 +1,130 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/*************************************** + Group eco7_bluetooth + ***************************************/ + +/* Functions */ +r_lld_con_count_get = 0x40001c48; +r_lld_update_con_offset = 0x40001c4c; +r_lld_con_update_last_clock = 0x40001c50; +r_lld_con_llcp_ind_info_clear = 0x40001c54; +r_lld_con_update_terminte_info_init = 0x40001c58; +r_lld_con_terminate_max_evt_update = 0x40001c5c; +r_llc_pref_param_compute_eco = 0x40001ce8; +r_llc_hci_con_upd_info_send_eco = 0x40001cec; +r_llc_rem_encrypt_proc_continue_eco = 0x40001cf0; +r_llc_start_eco = 0x40001cf8; +r_lld_ext_adv_dynamic_aux_pti_process_eco = 0x40001cfc; +r_lld_adv_start_eco = 0x40001d04; +r_lld_con_evt_canceled_cbk_eco = 0x40001d08; +r_lld_con_evt_time_update_eco = 0x40001d0c; +r_lld_con_start_eco = 0x40001d10; +r_lld_con_frm_isr_eco = 0x40001d14; +r_lld_con_tx_eco = 0x40001d18; +r_lld_ext_scan_dynamic_pti_process_eco = 0x40001d28; +r_lld_scan_frm_eof_isr_eco = 0x40001d2c; +r_lld_sync_start_eco = 0x40001d30; +r_lld_sync_insert_eco = 0x40001d34; +r_llm_adv_rep_flow_control_update_eco = 0x40001d38; +r_llm_env_adv_dup_filt_init_eco = 0x40001d3c; +r_llm_env_adv_dup_filt_deinit_eco = 0x40001d40; +r_llm_adv_rep_flow_control_check_eco = 0x40001d44; +r_llm_scan_start_eco = 0x40001d48; +r_llm_update_duplicate_scan_count = 0x40001d4c; +r_llc_hci_command_handler_pre = 0x40001d50; +r_llc_hci_command_handler_get = 0x40001d54; +r_llc_hci_command_handler_search = 0x40001d58; +r_llc_llcp_pdu_handler_pre = 0x40001d60; +r_llc_llcp_pdu_handler_end = 0x40001d64; +r_llc_con_conflict_check = 0x40001d6c; +r_sch_prog_hw_reset_try = 0x40001d70; +r_sch_prog_et_state_reset = 0x40001d74; +r_sch_prog_end_isr_handler = 0x40001d78; +r_sch_plan_conflict_check = 0x40001d7c; +r_rwble_isr_hw_fixed = 0x40001d80; +r_bt_bb_recorrect_is_dead = 0x40001d84; +r_bt_bb_restart_hw_recorrect = 0x40001d88; +r_ke_task_handler_pre = 0x40001da0; +r_ke_task_handler_end = 0x40001da4; +r_lld_scan_frm_skip_isr_eco = 0x40001db0; +r_lld_ext_scan_dynamic_pti_reset = 0x40001db4; +r_llc_rem_phy_upd_proc_continue_eco = 0x40001db8; +r_llm_get_preferred_phys = 0x40001dbc; +r_lld_hw_cca_isr_eco = 0x40001dc0; +r_lld_sw_cca_isr_eco = 0x40001dc4; +r_lld_cca_chan_prn_e = 0x40001dc8; +r_lld_cca_chan_prn_s = 0x40001dcc; +r_lld_cca_chan_sel_remap = 0x40001dd0; +r_lld_cca_chan_sel_1 = 0x40001dd4; +r_lld_cca_chan_sel_2 = 0x40001dd8; +r_lld_cca_set_thresh = 0x40001ddc; +r_lld_cca_con_start = 0x40001de0; +r_lld_cca_con_end = 0x40001de4; +r_lld_cca_chm_restore = 0x40001de8; +r_lld_cca_chan_unused_check = 0x40001dec; +r_lld_cca_chm_update_check = 0x40001df0; +r_lld_cca_busy_mode_handle = 0x40001df4; +r_lld_cca_lbt_handle = 0x40001df8; +r_lld_cca_scst_timeout_check = 0x40001dfc; +r_lld_cca_chan_avl_timeout_check = 0x40001e00; + +r_lld_con_start_hook = 0x40001ca8; + +/* ble Functions eco */ +r_bt_bb_isr = 0x40000b9c; +r_bt_rf_coex_conn_phy_coded_data_time_limit_en_get = 0x40000ba8; +r_bt_rtp_get_txpwr_idx_by_act = 0x40000c00; +r_btdm_task_post = 0x40000c14; +r_btdm_task_post_from_isr = 0x40000c18; +r_btdm_task_recycle = 0x40000c1c; +r_ke_task_schedule = 0x40000e80; +r_llc_hci_command_handler = 0x40000ef0; +r_llc_loc_ch_map_proc_continue = 0x40000f5c; +r_llc_loc_con_upd_proc_continue = 0x40000f60; +r_llc_loc_phy_upd_proc_continue = 0x40000f78; +r_llc_rem_con_upd_proc_continue = 0x40000fb4; +r_lld_con_sched = 0x40001118; +r_lld_con_stop = 0x40001124; +r_lld_llcp_rx_ind_handler = 0x400011b0; +r_lld_per_adv_sched = 0x400011f8; +r_rf_txpwr_cs_get = 0x40001428; +r_rf_txpwr_dbm_get = 0x4000142c; +r_sch_arb_event_start_isr = 0x400014f8; +r_sch_plan_set = 0x40001534; +r_sch_prog_end_isr = 0x40001538; +r_lld_adv_ext_chain_scannable_construct = 0x40001b58; + +r_lld_scan_process_pkt_rx = 0x40001280; +r_llm_le_features_get = 0x400013b0; + +/* ble functions rename */ +r_lld_init_start_hack = 0x400011a4; + +/* ble functions disable */ +/* +r_lld_adv_frm_isr_eco = 0x40001d00; +r_lld_res_list_clear = 0x40004638; +r_lld_res_list_rem = 0x40004680; +r_lld_adv_start_hook = 0x40001c80; +r_lld_con_evt_start_cbk_eco = 0x40001d1c; +r_lld_con_tx_prog_new_packet = 0x40001b74; +r_lld_adv_ext_chain_none_construct = 0x40001b50; +r_llc_llcp_send_eco = 0x40001cf4; +r_llc_llcp_channel_map_ind_ack = 0x40001d68; +r_rwble_isr = 0x40001464; +r_lld_scan_start_eco = 0x40001d24; +r_lld_scan_try_sched_eco = 0x40001dac; +r_lld_scan_start_hook = 0x40001c74; +r_lld_init_start_hook = 0x40001cb8; +r_lld_scan_evt_start_cbk_eco = 0x40001d20; +r_ke_task_handler_get_overwrite = 0x40001da8; +r_hci_register_vendor_desc_tab = 0x40000d9c; +r_lld_scan_process_pkt_rx_adv_rep = 0x40001284; +r_register_esp_vendor_cmd_handler = 0x40001400; +r_llc_llcp_pdu_handler_get_overwrite = 0x40001d5c; +*/ diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld index 2c740355ffd0..92bb484f1646 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld @@ -525,800 +525,6 @@ PROVIDE( g_usb_print = 0x3fcdffd0 ); /*************************************** Group bluetooth ***************************************/ - -/* Functions */ -bt_rf_coex_get_dft_cfg = 0x400008dc; -bt_rf_coex_hooks_p_set = 0x400008e0; -btdm_con_maxevtime_cal_impl = 0x400008e4; -btdm_controller_get_compile_version_impl = 0x400008e8; -btdm_controller_rom_data_init = 0x400008ec; -btdm_dis_privacy_err_report_impl = 0x400008f0; -btdm_disable_adv_delay_impl = 0x400008f4; -btdm_enable_scan_continue_impl = 0x400008f8; -btdm_enable_scan_forever_impl = 0x400008fc; -btdm_get_power_state_impl = 0x40000900; -btdm_get_prevent_sleep_flag_impl = 0x40000904; -btdm_power_state_active_impl = 0x40000908; -btdm_switch_phy_coded_impl = 0x4000090c; -hci_acl_data_handler = 0x40000910; -hci_disconnect_cmd_handler = 0x40000914; -hci_le_con_upd_cmd_handler = 0x40000918; -hci_le_ltk_req_neg_reply_cmd_handler = 0x4000091c; -hci_le_ltk_req_reply_cmd_handler = 0x40000920; -hci_le_rd_chnl_map_cmd_handler = 0x40000924; -hci_le_rd_phy_cmd_handler = 0x40000928; -hci_le_rd_rem_feats_cmd_handler = 0x4000092c; -hci_le_rem_con_param_req_neg_reply_cmd_handler = 0x40000930; -hci_le_rem_con_param_req_reply_cmd_handler = 0x40000934; -hci_le_set_data_len_cmd_handler = 0x40000938; -hci_le_set_phy_cmd_handler = 0x4000093c; -hci_le_start_enc_cmd_handler = 0x40000940; -hci_rd_auth_payl_to_cmd_handler = 0x40000944; -hci_rd_rem_ver_info_cmd_handler = 0x40000948; -hci_rd_rssi_cmd_handler = 0x4000094c; -hci_rd_tx_pwr_lvl_cmd_handler = 0x40000950; -hci_vs_set_pref_slave_evt_dur_cmd_handler = 0x40000954; -hci_vs_set_pref_slave_latency_cmd_handler = 0x40000958; -hci_wr_auth_payl_to_cmd_handler = 0x4000095c; -ll_channel_map_ind_handler = 0x40000960; -ll_connection_param_req_handler = 0x40000964; -ll_connection_param_rsp_handler = 0x40000968; -ll_connection_update_ind_handler = 0x4000096c; -ll_enc_req_handler = 0x40000970; -ll_enc_rsp_handler = 0x40000974; -ll_feature_req_handler = 0x40000978; -ll_feature_rsp_handler = 0x4000097c; -ll_length_req_handler = 0x40000980; -ll_length_rsp_handler = 0x40000984; -ll_min_used_channels_ind_handler = 0x40000988; -ll_pause_enc_req_handler = 0x4000098c; -ll_pause_enc_rsp_handler = 0x40000990; -ll_phy_req_handler = 0x40000994; -ll_phy_rsp_handler = 0x40000998; -ll_phy_update_ind_handler = 0x4000099c; -ll_ping_req_handler = 0x400009a0; -ll_ping_rsp_handler = 0x400009a4; -ll_slave_feature_req_handler = 0x400009a8; -ll_start_enc_req_handler = 0x400009ac; -ll_start_enc_rsp_handler = 0x400009b0; -ll_terminate_ind_handler = 0x400009b4; -ll_version_ind_handler = 0x400009b8; -llc_auth_payl_nearly_to_handler = 0x400009bc; -llc_auth_payl_real_to_handler = 0x400009c0; -llc_encrypt_ind_handler = 0x400009c4; -llc_hci_command_handler_wrapper = 0x400009c8; -llc_ll_connection_param_req_pdu_send = 0x400009cc; -llc_ll_connection_param_rsp_pdu_send = 0x400009d0; -llc_ll_connection_update_ind_pdu_send = 0x400009d4; -llc_ll_enc_req_pdu_send = 0x400009d8; -llc_ll_enc_rsp_pdu_send = 0x400009dc; -llc_ll_feature_req_pdu_send = 0x400009e0; -llc_ll_feature_rsp_pdu_send = 0x400009e4; -llc_ll_length_req_pdu_send = 0x400009e8; -llc_ll_length_rsp_pdu_send = 0x400009ec; -llc_ll_pause_enc_req_pdu_send = 0x400009f0; -llc_ll_pause_enc_rsp_pdu_send = 0x400009f4; -llc_ll_phy_req_pdu_send = 0x400009f8; -llc_ll_phy_rsp_pdu_send = 0x400009fc; -llc_ll_ping_req_pdu_send = 0x40000a00; -llc_ll_ping_rsp_pdu_send = 0x40000a04; -llc_ll_start_enc_req_pdu_send = 0x40000a08; -llc_ll_start_enc_rsp_pdu_send = 0x40000a0c; -llc_ll_terminate_ind_pdu_send = 0x40000a10; -llc_ll_unknown_rsp_pdu_send = 0x40000a14; -llc_llcp_ch_map_update_ind_pdu_send = 0x40000a18; -llc_llcp_phy_upd_ind_pdu_send = 0x40000a1c; -llc_llcp_version_ind_pdu_send = 0x40000a20; -llc_op_ch_map_upd_ind_handler = 0x40000a24; -llc_op_con_upd_ind_handler = 0x40000a28; -llc_op_disconnect_ind_handler = 0x40000a2c; -llc_op_dl_upd_ind_handler = 0x40000a30; -llc_op_encrypt_ind_handler = 0x40000a34; -llc_op_feats_exch_ind_handler = 0x40000a38; -llc_op_le_ping_ind_handler = 0x40000a3c; -llc_op_phy_upd_ind_handler = 0x40000a40; -llc_op_ver_exch_ind_handler = 0x40000a44; -llc_stopped_ind_handler = 0x40000a48; -lld_acl_rx_ind_handler = 0x40000a4c; -lld_acl_tx_cfm_handler = 0x40000a50; -lld_adv_end_ind_handler = 0x40000a54; -lld_adv_rep_ind_handler = 0x40000a58; -lld_ch_map_upd_cfm_handler = 0x40000a5c; -lld_con_estab_ind_handler = 0x40000a60; -lld_con_evt_sd_evt_time_set = 0x40000a64; -lld_con_offset_upd_ind_handler = 0x40000a68; -lld_con_param_upd_cfm_handler = 0x40000a6c; -lld_disc_ind_handler = 0x40000a70; -lld_init_end_ind_handler = 0x40000a74; -lld_llcp_rx_ind_handler_wrapper = 0x40000a78; -lld_llcp_tx_cfm_handler = 0x40000a7c; -lld_per_adv_end_ind_handler = 0x40000a80; -lld_per_adv_rep_ind_handler = 0x40000a84; -lld_per_adv_rx_end_ind_handler = 0x40000a88; -lld_phy_coded_500k_get = 0x40000a8c; -lld_phy_upd_cfm_handler = 0x40000a90; -lld_scan_end_ind_handler = 0x40000a94; -lld_scan_req_ind_handler = 0x40000a98; -lld_sync_start_req_handler = 0x40000a9c; -lld_test_end_ind_handler = 0x40000aa0; -lld_update_rxbuf_handler = 0x40000aa4; -llm_ch_map_update_ind_handler = 0x40000aa8; -llm_hci_command_handler_wrapper = 0x40000aac; -llm_scan_period_to_handler = 0x40000ab0; -r_Add2SelfBigHex256 = 0x40000ab4; -r_AddBigHex256 = 0x40000ab8; -r_AddBigHexModP256 = 0x40000abc; -r_AddP256 = 0x40000ac0; -r_AddPdiv2_256 = 0x40000ac4; -r_GF_Jacobian_Point_Addition256 = 0x40000ac8; -r_GF_Jacobian_Point_Double256 = 0x40000acc; -r_GF_Point_Jacobian_To_Affine256 = 0x40000ad0; -r_MultiplyBigHexByUint32_256 = 0x40000ad4; -r_MultiplyBigHexModP256 = 0x40000ad8; -r_MultiplyByU16ModP256 = 0x40000adc; -r_SubtractBigHex256 = 0x40000ae0; -r_SubtractBigHexMod256 = 0x40000ae4; -r_SubtractBigHexUint32_256 = 0x40000ae8; -r_SubtractFromSelfBigHex256 = 0x40000aec; -r_SubtractFromSelfBigHexSign256 = 0x40000af0; -r_aes_alloc = 0x40000af4; -r_aes_ccm_continue = 0x40000af8; -r_aes_ccm_process_e = 0x40000afc; -r_aes_ccm_xor_128_lsb = 0x40000b00; -r_aes_ccm_xor_128_msb = 0x40000b04; -r_aes_cmac_continue = 0x40000b08; -r_aes_cmac_start = 0x40000b0c; -r_aes_k1_continue = 0x40000b10; -r_aes_k2_continue = 0x40000b14; -r_aes_k3_continue = 0x40000b18; -r_aes_k4_continue = 0x40000b1c; -r_aes_shift_left_128 = 0x40000b20; -r_aes_start = 0x40000b24; -r_aes_xor_128 = 0x40000b28; -r_assert_err = 0x40000b2c; -r_assert_param = 0x40000b30; -r_assert_warn = 0x40000b34; -r_bigHexInversion256 = 0x40000b38; -r_ble_sw_cca_check_isr = 0x40000b3c; -r_ble_util_buf_acl_tx_alloc = 0x40000b40; -r_ble_util_buf_acl_tx_elt_get = 0x40000b44; -r_ble_util_buf_acl_tx_free = 0x40000b48; -r_ble_util_buf_acl_tx_free_in_isr = 0x40000b4c; -r_ble_util_buf_adv_tx_alloc = 0x40000b50; -r_ble_util_buf_adv_tx_free = 0x40000b54; -r_ble_util_buf_adv_tx_free_in_isr = 0x40000b58; -r_ble_util_buf_env_deinit = 0x40000b5c; -r_ble_util_buf_env_init = 0x40000b60; -r_ble_util_buf_get_rx_buf_nb = 0x40000b64; -r_ble_util_buf_get_rx_buf_size = 0x40000b68; -r_ble_util_buf_llcp_tx_alloc = 0x40000b6c; -r_ble_util_buf_llcp_tx_free = 0x40000b70; -r_ble_util_buf_rx_alloc = 0x40000b74; -r_ble_util_buf_rx_alloc_in_isr = 0x40000b78; -r_ble_util_buf_rx_free = 0x40000b7c; -r_ble_util_buf_rx_free_in_isr = 0x40000b80; -r_ble_util_buf_set_rx_buf_nb = 0x40000b84; -r_ble_util_buf_set_rx_buf_size = 0x40000b88; -r_ble_util_data_rx_buf_reset = 0x40000b8c; -r_bt_bb_get_intr_mask = 0x40000b90; -r_bt_bb_intr_clear = 0x40000b94; -r_bt_bb_intr_mask_set = 0x40000b98; -r_bt_rf_coex_cfg_set = 0x40000ba0; -r_bt_rf_coex_conn_dynamic_pti_en_get = 0x40000ba4; -r_bt_rf_coex_ext_adv_dynamic_pti_en_get = 0x40000bac; -r_bt_rf_coex_ext_scan_dynamic_pti_en_get = 0x40000bb0; -r_bt_rf_coex_legacy_adv_dynamic_pti_en_get = 0x40000bb4; -r_bt_rf_coex_per_adv_dynamic_pti_en_get = 0x40000bb8; -r_bt_rf_coex_pti_table_get = 0x40000bbc; -r_bt_rf_coex_st_param_get = 0x40000bc0; -r_bt_rf_coex_st_param_set = 0x40000bc4; -r_bt_rf_coex_sync_scan_dynamic_pti_en_get = 0x40000bc8; -r_bt_rma_apply_rule_cs_fmt = 0x40000bcc; -r_bt_rma_apply_rule_cs_idx = 0x40000bd0; -r_bt_rma_configure = 0x40000bd4; -r_bt_rma_deregister_rule_cs_fmt = 0x40000bd8; -r_bt_rma_deregister_rule_cs_idx = 0x40000bdc; -r_bt_rma_get_ant_by_act = 0x40000be0; -r_bt_rma_init = 0x40000be4; -r_bt_rma_register_rule_cs_fmt = 0x40000be8; -r_bt_rma_register_rule_cs_idx = 0x40000bec; -r_bt_rtp_apply_rule_cs_fmt = 0x40000bf0; -r_bt_rtp_apply_rule_cs_idx = 0x40000bf4; -r_bt_rtp_deregister_rule_cs_fmt = 0x40000bf8; -r_bt_rtp_deregister_rule_cs_idx = 0x40000bfc; -r_bt_rtp_init = 0x40000c04; -r_bt_rtp_register_rule_cs_fmt = 0x40000c08; -r_bt_rtp_register_rule_cs_idx = 0x40000c0c; -r_btdm_isr = 0x40000c10; -r_cali_phase_match_p = 0x40000c20; -r_cmp_abs_time = 0x40000c24; -r_cmp_dest_id = 0x40000c28; -r_cmp_timer_id = 0x40000c2c; -r_co_bdaddr_compare = 0x40000c30; -r_co_ble_pkt_dur_in_us = 0x40000c34; -r_co_list_extract = 0x40000c38; -r_co_list_extract_after = 0x40000c3c; -r_co_list_extract_sublist = 0x40000c40; -r_co_list_find = 0x40000c44; -r_co_list_init = 0x40000c48; -r_co_list_insert_after = 0x40000c4c; -r_co_list_insert_before = 0x40000c50; -r_co_list_merge = 0x40000c54; -r_co_list_pool_init = 0x40000c58; -r_co_list_pop_front = 0x40000c5c; -r_co_list_push_back = 0x40000c60; -r_co_list_push_back_sublist = 0x40000c64; -r_co_list_push_front = 0x40000c68; -r_co_list_size = 0x40000c6c; -r_co_nb_good_le_channels = 0x40000c70; -r_co_util_pack = 0x40000c74; -r_co_util_read_array_size = 0x40000c78; -r_co_util_unpack = 0x40000c7c; -r_dbg_env_deinit = 0x40000c80; -r_dbg_env_init = 0x40000c84; -r_dbg_platform_reset_complete = 0x40000c88; -r_dl_upd_proc_start = 0x40000c8c; -r_dump_data = 0x40000c90; -r_ecc_abort_key256_generation = 0x40000c94; -r_ecc_gen_new_public_key = 0x40000c98; -r_ecc_gen_new_secret_key = 0x40000c9c; -r_ecc_generate_key256 = 0x40000ca0; -r_ecc_get_debug_Keys = 0x40000ca4; -r_ecc_init = 0x40000ca8; -r_ecc_is_valid_point = 0x40000cac; -r_ecc_multiplication_event_handler = 0x40000cb0; -r_ecc_point_multiplication_win_256 = 0x40000cb4; -r_emi_alloc_em_mapping_by_offset = 0x40000cb8; -r_emi_base_reg_lut_show = 0x40000cbc; -r_emi_em_base_reg_show = 0x40000cc0; -r_emi_free_em_mapping_by_offset = 0x40000cc4; -r_emi_get_em_mapping_idx_by_offset = 0x40000cc8; -r_emi_get_mem_addr_by_offset = 0x40000ccc; -r_emi_overwrite_em_mapping_by_offset = 0x40000cd0; -r_esp_vendor_hci_command_handler = 0x40000cd4; -r_get_stack_usage = 0x40000cd8; -r_h4tl_acl_hdr_rx_evt_handler = 0x40000cdc; -r_h4tl_cmd_hdr_rx_evt_handler = 0x40000ce0; -r_h4tl_cmd_pld_rx_evt_handler = 0x40000ce4; -r_h4tl_eif_io_event_post = 0x40000ce8; -r_h4tl_eif_register = 0x40000cec; -r_h4tl_init = 0x40000cf0; -r_h4tl_out_of_sync = 0x40000cf4; -r_h4tl_out_of_sync_check = 0x40000cf8; -r_h4tl_read_hdr = 0x40000cfc; -r_h4tl_read_next_out_of_sync = 0x40000d00; -r_h4tl_read_payl = 0x40000d04; -r_h4tl_read_start = 0x40000d08; -r_h4tl_rx_acl_hdr_extract = 0x40000d0c; -r_h4tl_rx_cmd_hdr_extract = 0x40000d10; -r_h4tl_rx_done = 0x40000d14; -r_h4tl_start = 0x40000d18; -r_h4tl_stop = 0x40000d1c; -r_h4tl_tx_done = 0x40000d20; -r_h4tl_tx_evt_handler = 0x40000d24; -r_h4tl_write = 0x40000d28; -r_hci_acl_tx_data_alloc = 0x40000d2c; -r_hci_acl_tx_data_received = 0x40000d30; -r_hci_basic_cmd_send_2_controller = 0x40000d34; -r_hci_ble_adv_report_filter_check = 0x40000d38; -r_hci_ble_adv_report_tx_check = 0x40000d3c; -r_hci_ble_conhdl_register = 0x40000d40; -r_hci_ble_conhdl_unregister = 0x40000d44; -r_hci_build_acl_data = 0x40000d48; -r_hci_build_cc_evt = 0x40000d4c; -r_hci_build_cs_evt = 0x40000d50; -r_hci_build_evt = 0x40000d54; -r_hci_build_le_evt = 0x40000d58; -r_hci_cmd_get_max_param_size = 0x40000d5c; -r_hci_cmd_received = 0x40000d60; -r_hci_cmd_reject = 0x40000d64; -r_hci_evt_mask_check = 0x40000d68; -r_hci_evt_mask_set = 0x40000d6c; -r_hci_fc_acl_buf_size_set = 0x40000d70; -r_hci_fc_acl_en = 0x40000d74; -r_hci_fc_acl_packet_sent = 0x40000d78; -r_hci_fc_check_host_available_nb_acl_packets = 0x40000d7c; -r_hci_fc_host_nb_acl_pkts_complete = 0x40000d80; -r_hci_fc_init = 0x40000d84; -r_hci_look_for_cmd_desc = 0x40000d88; -r_hci_look_for_evt_desc = 0x40000d8c; -r_hci_look_for_le_evt_desc = 0x40000d90; -r_hci_look_for_le_evt_desc_esp = 0x40000d94; -r_hci_pack_bytes = 0x40000d98; -r_hci_send_2_controller = 0x40000da0; -r_hci_send_2_host = 0x40000da4; -r_hci_tl_c2h_data_flow_on = 0x40000da8; -r_hci_tl_cmd_hdr_rx_evt_handler = 0x40000dac; -r_hci_tl_cmd_pld_rx_evt_handler = 0x40000db0; -r_hci_tl_get_pkt = 0x40000db4; -r_hci_tl_hci_pkt_handler = 0x40000db8; -r_hci_tl_hci_tx_done_evt_handler = 0x40000dbc; -r_hci_tl_inc_nb_h2c_cmd_pkts = 0x40000dc0; -r_hci_tl_save_pkt = 0x40000dc4; -r_hci_tl_send = 0x40000dc8; -r_hci_tx_done = 0x40000dcc; -r_hci_tx_start = 0x40000dd0; -r_hci_tx_trigger = 0x40000dd4; -r_isValidSecretKey_256 = 0x40000dd8; -r_ke_check_malloc = 0x40000ddc; -r_ke_event_callback_set = 0x40000de0; -r_ke_event_clear = 0x40000de4; -r_ke_event_flush = 0x40000de8; -r_ke_event_get = 0x40000dec; -r_ke_event_get_all = 0x40000df0; -r_ke_event_init = 0x40000df4; -r_ke_event_schedule = 0x40000df8; -r_ke_event_set = 0x40000dfc; -r_ke_flush = 0x40000e00; -r_ke_free = 0x40000e04; -r_ke_handler_search = 0x40000e08; -r_ke_init = 0x40000e0c; -r_ke_is_free = 0x40000e10; -r_ke_malloc = 0x40000e14; -r_ke_mem_init = 0x40000e18; -r_ke_mem_is_empty = 0x40000e1c; -r_ke_mem_is_in_heap = 0x40000e20; -r_ke_msg_alloc = 0x40000e24; -r_ke_msg_dest_id_get = 0x40000e28; -r_ke_msg_discard = 0x40000e2c; -r_ke_msg_forward = 0x40000e30; -r_ke_msg_forward_new_id = 0x40000e34; -r_ke_msg_free = 0x40000e38; -r_ke_msg_in_queue = 0x40000e3c; -r_ke_msg_save = 0x40000e40; -r_ke_msg_send = 0x40000e44; -r_ke_msg_send_basic = 0x40000e48; -r_ke_msg_src_id_get = 0x40000e4c; -r_ke_queue_extract = 0x40000e50; -r_ke_queue_insert = 0x40000e54; -r_ke_sleep_check = 0x40000e58; -r_ke_state_get = 0x40000e5c; -r_ke_state_set = 0x40000e60; -r_ke_task_check = 0x40000e64; -r_ke_task_create = 0x40000e68; -r_ke_task_delete = 0x40000e6c; -r_ke_task_handler_get = 0x40000e70; -r_ke_task_init = 0x40000e74; -r_ke_task_msg_flush = 0x40000e78; -r_ke_task_saved_update = 0x40000e7c; -r_ke_time = 0x40000e84; -r_ke_time_cmp = 0x40000e88; -r_ke_time_past = 0x40000e8c; -r_ke_timer_active = 0x40000e90; -r_ke_timer_adjust_all = 0x40000e94; -r_ke_timer_clear = 0x40000e98; -r_ke_timer_init = 0x40000e9c; -r_ke_timer_schedule = 0x40000ea0; -r_ke_timer_set = 0x40000ea4; -r_led_init = 0x40000ea8; -r_led_set_all = 0x40000eac; -r_llc_aes_res_cb = 0x40000eb0; -r_llc_ch_map_up_proc_err_cb = 0x40000eb4; -r_llc_cleanup = 0x40000eb8; -r_llc_cmd_cmp_send = 0x40000ebc; -r_llc_cmd_stat_send = 0x40000ec0; -r_llc_con_move_cbk = 0x40000ec4; -r_llc_con_plan_set_update = 0x40000ec8; -r_llc_con_upd_param_in_range = 0x40000ecc; -r_llc_disconnect = 0x40000ed0; -r_llc_disconnect_end = 0x40000ed4; -r_llc_disconnect_proc_continue = 0x40000ed8; -r_llc_disconnect_proc_err_cb = 0x40000edc; -r_llc_dl_chg_check = 0x40000ee0; -r_llc_dle_proc_err_cb = 0x40000ee4; -r_llc_feats_exch_proc_err_cb = 0x40000ee8; -r_llc_hci_cmd_handler_tab_p_get = 0x40000eec; -r_llc_hci_con_param_req_evt_send = 0x40000ef4; -r_llc_hci_con_upd_info_send = 0x40000ef8; -r_llc_hci_disconnected_dis = 0x40000efc; -r_llc_hci_dl_upd_info_send = 0x40000f00; -r_llc_hci_enc_evt_send = 0x40000f04; -r_llc_hci_feats_info_send = 0x40000f08; -r_llc_hci_le_phy_upd_cmp_evt_send = 0x40000f0c; -r_llc_hci_ltk_request_evt_send = 0x40000f10; -r_llc_hci_nb_cmp_pkts_evt_send = 0x40000f14; -r_llc_hci_version_info_send = 0x40000f18; -r_llc_init_term_proc = 0x40000f1c; -r_llc_iv_skd_rand_gen = 0x40000f20; -r_llc_le_ping_proc_continue = 0x40000f24; -r_llc_le_ping_proc_err_cb = 0x40000f28; -/* r_llc_le_ping_restart = 0x40000f2c; */ -r_llc_le_ping_set = 0x40000f30; -r_llc_ll_pause_enc_rsp_ack_handler = 0x40000f34; -r_llc_ll_reject_ind_ack_handler = 0x40000f38; -r_llc_ll_reject_ind_pdu_send = 0x40000f3c; -r_llc_ll_start_enc_rsp_ack_handler = 0x40000f40; -r_llc_ll_terminate_ind_ack = 0x40000f44; -r_llc_ll_unknown_ind_handler = 0x40000f48; -r_llc_llcp_send = 0x40000f4c; -r_llc_llcp_state_set = 0x40000f50; -r_llc_llcp_trans_timer_set = 0x40000f54; -r_llc_llcp_tx_check = 0x40000f58; -r_llc_loc_con_upd_proc_err_cb = 0x40000f64; -r_llc_loc_dl_upd_proc_continue = 0x40000f68; -r_llc_loc_encrypt_proc_continue = 0x40000f6c; -r_llc_loc_encrypt_proc_err_cb = 0x40000f70; -r_llc_loc_feats_exch_proc_continue = 0x40000f74; -r_llc_loc_phy_upd_proc_err_cb = 0x40000f7c; -r_llc_msg_handler_tab_p_get = 0x40000f80; -r_llc_pref_param_compute = 0x40000f84; -r_llc_proc_collision_check = 0x40000f88; -r_llc_proc_err_ind = 0x40000f8c; -r_llc_proc_get = 0x40000f90; -r_llc_proc_id_get = 0x40000f94; -r_llc_proc_reg = 0x40000f98; -r_llc_proc_state_get = 0x40000f9c; -r_llc_proc_state_set = 0x40000fa0; -r_llc_proc_timer_pause_set = 0x40000fa4; -r_llc_proc_timer_set = 0x40000fa8; -r_llc_proc_unreg = 0x40000fac; -r_llc_rem_ch_map_proc_continue = 0x40000fb0; -r_llc_rem_con_upd_proc_err_cb = 0x40000fb8; -r_llc_rem_dl_upd_proc = 0x40000fbc; -r_llc_rem_encrypt_proc_continue = 0x40000fc0; -r_llc_rem_encrypt_proc_err_cb = 0x40000fc4; -r_llc_rem_phy_upd_proc_continue = 0x40000fc8; -r_llc_rem_phy_upd_proc_err_cb = 0x40000fcc; -r_llc_role_get = 0x40000fd0; -r_llc_sk_gen = 0x40000fd4; -r_llc_start = 0x40000fd8; -r_llc_stop = 0x40000fdc; -r_llc_ver_exch_loc_proc_continue = 0x40000fe0; -r_llc_ver_proc_err_cb = 0x40000fe4; -r_llcp_pdu_handler_tab_p_get = 0x40000fe8; -r_lld_aa_gen = 0x40000fec; -r_lld_adv_adv_data_set = 0x40000ff0; -r_lld_adv_adv_data_update = 0x40000ff4; -r_lld_adv_aux_ch_idx_set = 0x40000ff8; -r_lld_adv_aux_evt_canceled_cbk = 0x40000ffc; -r_lld_adv_aux_evt_start_cbk = 0x40001000; -r_lld_adv_coex_check_ext_adv_synced = 0x40001004; -r_lld_adv_coex_env_reset = 0x40001008; -r_lld_adv_duration_update = 0x4000100c; -r_lld_adv_dynamic_pti_process = 0x40001010; -r_lld_adv_end = 0x40001014; -r_lld_adv_evt_canceled_cbk = 0x40001018; -r_lld_adv_evt_start_cbk = 0x4000101c; -r_lld_adv_ext_chain_construct = 0x40001020; -r_lld_adv_ext_pkt_prepare = 0x40001024; -r_lld_adv_frm_cbk = 0x40001028; -r_lld_adv_frm_isr = 0x4000102c; -r_lld_adv_frm_skip_isr = 0x40001030; -r_lld_adv_init = 0x40001034; -r_lld_adv_pkt_rx = 0x40001038; -r_lld_adv_pkt_rx_connect_ind = 0x4000103c; -r_lld_adv_pkt_rx_send_scan_req_evt = 0x40001040; -r_lld_adv_rand_addr_update = 0x40001044; -r_lld_adv_restart = 0x40001048; -r_lld_adv_scan_rsp_data_set = 0x4000104c; -r_lld_adv_scan_rsp_data_update = 0x40001050; -r_lld_adv_set_tx_power = 0x40001054; -r_lld_adv_start = 0x40001058; -r_lld_adv_stop = 0x4000105c; -r_lld_adv_sync_info_set = 0x40001060; -r_lld_adv_sync_info_update = 0x40001064; -r_lld_calc_aux_rx = 0x40001068; -r_lld_cca_alloc = 0x4000106c; -r_lld_cca_data_reset = 0x40001070; -r_lld_cca_free = 0x40001074; -r_lld_ch_assess_data_get = 0x40001078; -r_lld_ch_idx_get = 0x4000107c; -r_lld_ch_map_set = 0x40001080; -r_lld_channel_assess = 0x40001084; -r_lld_con_activity_act_offset_compute = 0x40001088; -r_lld_con_activity_offset_compute = 0x4000108c; -r_lld_con_ch_map_update = 0x40001090; -r_lld_con_cleanup = 0x40001094; -r_lld_con_current_tx_power_get = 0x40001098; -r_lld_con_data_flow_set = 0x4000109c; -r_lld_con_data_len_update = 0x400010a0; -r_lld_con_data_tx = 0x400010a4; -r_lld_con_enc_key_load = 0x400010a8; -r_lld_con_event_counter_get = 0x400010ac; -r_lld_con_evt_canceled_cbk = 0x400010b0; -r_lld_con_evt_duration_min_get = 0x400010b4; -r_lld_con_evt_max_eff_time_cal = 0x400010b8; -r_lld_con_evt_sd_evt_time_get = 0x400010bc; -r_lld_con_evt_start_cbk = 0x400010c0; -r_lld_con_evt_time_update = 0x400010c4; -r_lld_con_free_all_tx_buf = 0x400010c8; -r_lld_con_frm_cbk = 0x400010cc; -r_lld_con_frm_isr = 0x400010d0; -r_lld_con_frm_skip_isr = 0x400010d4; -r_lld_con_init = 0x400010d8; -r_lld_con_llcp_tx = 0x400010dc; -r_lld_con_max_lat_calc = 0x400010e0; -r_lld_con_offset_get = 0x400010e4; -r_lld_con_param_update = 0x400010e8; -r_lld_con_phys_update = 0x400010ec; -r_lld_con_pref_slave_evt_dur_set = 0x400010f0; -r_lld_con_pref_slave_latency_set = 0x400010f4; -r_lld_con_rssi_get = 0x400010f8; -r_lld_con_rx = 0x400010fc; -/* r_lld_con_rx_channel_assess = 0x40001100; */ -r_lld_con_rx_enc = 0x40001104; -r_lld_con_rx_isr = 0x40001108; -r_lld_con_rx_link_info_check = 0x4000110c; -r_lld_con_rx_llcp_check = 0x40001110; -r_lld_con_rx_sync_time_update = 0x40001114; -r_lld_con_set_tx_power = 0x4000111c; -r_lld_con_start = 0x40001120; -r_lld_con_tx = 0x40001128; -r_lld_con_tx_enc = 0x4000112c; -r_lld_con_tx_isr = 0x40001130; -r_lld_con_tx_len_update = 0x40001134; -r_lld_con_tx_len_update_for_intv = 0x40001138; -r_lld_con_tx_len_update_for_rate = 0x4000113c; -r_lld_con_tx_prog = 0x40001140; -r_lld_conn_dynamic_pti_process = 0x40001144; -r_lld_continue_scan_rx_isr_end_process = 0x40001148; -r_lld_ext_scan_dynamic_pti_process = 0x4000114c; -r_lld_hw_cca_end_isr = 0x40001150; -r_lld_hw_cca_evt_handler = 0x40001154; -r_lld_hw_cca_isr = 0x40001158; -r_lld_init_cal_anchor_point = 0x4000115c; -r_lld_init_compute_winoffset = 0x40001160; -r_lld_init_connect_req_pack = 0x40001164; -r_lld_init_end = 0x40001168; -r_lld_init_evt_canceled_cbk = 0x4000116c; -r_lld_init_evt_start_cbk = 0x40001170; -r_lld_init_frm_cbk = 0x40001174; -r_lld_init_frm_eof_isr = 0x40001178; -r_lld_init_frm_skip_isr = 0x4000117c; -r_lld_init_init = 0x40001180; -r_lld_init_process_pkt_rx = 0x40001184; -r_lld_init_process_pkt_rx_adv_ext_ind = 0x40001188; -r_lld_init_process_pkt_rx_adv_ind_or_direct_ind = 0x4000118c; -r_lld_init_process_pkt_rx_aux_connect_rsp = 0x40001190; -r_lld_init_process_pkt_tx = 0x40001194; -r_lld_init_process_pkt_tx_cal_con_timestamp = 0x40001198; -r_lld_init_sched = 0x4000119c; -r_lld_init_set_tx_power = 0x400011a0; -r_lld_init_start = 0x400011a4; -r_lld_init_stop = 0x400011a8; -r_lld_instant_proc_end = 0x400011ac; -r_lld_per_adv_ch_map_update = 0x400011b4; -r_lld_per_adv_chain_construct = 0x400011b8; -r_lld_per_adv_cleanup = 0x400011bc; -r_lld_per_adv_coex_env_reset = 0x400011c0; -r_lld_per_adv_data_set = 0x400011c4; -r_lld_per_adv_data_update = 0x400011c8; -r_lld_per_adv_dynamic_pti_process = 0x400011cc; -r_lld_per_adv_evt_canceled_cbk = 0x400011d0; -r_lld_per_adv_evt_start_cbk = 0x400011d4; -r_lld_per_adv_ext_pkt_prepare = 0x400011d8; -r_lld_per_adv_frm_cbk = 0x400011dc; -r_lld_per_adv_frm_isr = 0x400011e0; -r_lld_per_adv_frm_skip_isr = 0x400011e4; -r_lld_per_adv_init = 0x400011e8; -r_lld_per_adv_init_info_get = 0x400011ec; -r_lld_per_adv_list_add = 0x400011f0; -r_lld_per_adv_list_rem = 0x400011f4; -r_lld_per_adv_set_tx_power = 0x400011fc; -r_lld_per_adv_start = 0x40001200; -r_lld_per_adv_stop = 0x40001204; -r_lld_per_adv_sync_info_get = 0x40001208; -r_lld_process_cca_data = 0x4000120c; -r_lld_ral_search = 0x40001210; -r_lld_read_clock = 0x40001214; -r_lld_res_list_add = 0x40001218; -r_lld_res_list_is_empty = 0x40001220; -r_lld_res_list_local_rpa_get = 0x40001224; -r_lld_res_list_peer_rpa_get = 0x40001228; -r_lld_res_list_peer_update = 0x4000122c; -/* r_lld_res_list_priv_mode_update = 0x40001230; */ -r_lld_reset_reg = 0x40001238; -r_lld_rpa_renew = 0x4000123c; -r_lld_rpa_renew_evt_canceled_cbk = 0x40001240; -r_lld_rpa_renew_evt_start_cbk = 0x40001244; -r_lld_rpa_renew_instant_cbk = 0x40001248; -r_lld_rxdesc_check = 0x4000124c; -r_lld_rxdesc_free = 0x40001250; -r_lld_scan_create_sync = 0x40001254; -r_lld_scan_create_sync_cancel = 0x40001258; -r_lld_scan_end = 0x4000125c; -r_lld_scan_evt_canceled_cbk = 0x40001260; -r_lld_scan_evt_start_cbk = 0x40001264; -r_lld_scan_frm_cbk = 0x40001268; -r_lld_scan_frm_eof_isr = 0x4000126c; -r_lld_scan_frm_rx_isr = 0x40001270; -r_lld_scan_frm_skip_isr = 0x40001274; -r_lld_scan_init = 0x40001278; -r_lld_scan_params_update = 0x4000127c; -r_lld_scan_process_pkt_rx_aux_adv_ind = 0x40001288; -r_lld_scan_process_pkt_rx_aux_chain_ind = 0x4000128c; -r_lld_scan_process_pkt_rx_aux_scan_rsp = 0x40001290; -r_lld_scan_process_pkt_rx_ext_adv = 0x40001294; -r_lld_scan_process_pkt_rx_ext_adv_ind = 0x40001298; -r_lld_scan_process_pkt_rx_legacy_adv = 0x4000129c; -r_lld_scan_restart = 0x400012a0; -r_lld_scan_sched = 0x400012a4; -r_lld_scan_set_tx_power = 0x400012a8; -r_lld_scan_start = 0x400012ac; -r_lld_scan_stop = 0x400012b0; -r_lld_scan_sync_accept = 0x400012b4; -r_lld_scan_sync_info_unpack = 0x400012b8; -r_lld_scan_trunc_ind = 0x400012bc; -r_lld_sw_cca_evt_handler = 0x400012c0; -r_lld_sw_cca_isr = 0x400012c4; -r_lld_sync_ch_map_update = 0x400012c8; -r_lld_sync_cleanup = 0x400012cc; -r_lld_sync_evt_canceled_cbk = 0x400012d0; -r_lld_sync_evt_start_cbk = 0x400012d4; -r_lld_sync_frm_cbk = 0x400012d8; -r_lld_sync_frm_eof_isr = 0x400012dc; -r_lld_sync_frm_rx_isr = 0x400012e0; -r_lld_sync_frm_skip_isr = 0x400012e4; -r_lld_sync_init = 0x400012e8; -r_lld_sync_process_pkt_rx = 0x400012ec; -r_lld_sync_process_pkt_rx_aux_sync_ind = 0x400012f0; -r_lld_sync_process_pkt_rx_pkt_check = 0x400012f4; -r_lld_sync_scan_dynamic_pti_process = 0x400012f8; -r_lld_sync_sched = 0x400012fc; -r_lld_sync_start = 0x40001300; -r_lld_sync_stop = 0x40001304; -r_lld_sync_trunc_ind = 0x40001308; -r_lld_test_cleanup = 0x4000130c; -r_lld_test_evt_canceled_cbk = 0x40001310; -r_lld_test_evt_start_cbk = 0x40001314; -r_lld_test_freq2chnl = 0x40001318; -r_lld_test_frm_cbk = 0x4000131c; -r_lld_test_frm_isr = 0x40001320; -r_lld_test_init = 0x40001324; -r_lld_test_rx_isr = 0x40001328; -r_lld_test_set_tx_power = 0x4000132c; -r_lld_test_start = 0x40001330; -/* r_lld_test_stop = 0x40001334; */ -r_lld_update_rxbuf = 0x40001338; -r_lld_update_rxbuf_isr = 0x4000133c; -r_lld_white_list_add = 0x40001340; -r_lld_white_list_rem = 0x40001344; -r_llm_activity_free_get = 0x40001348; -r_llm_activity_free_set = 0x4000134c; -r_llm_activity_syncing_get = 0x40001350; -r_llm_adv_con_len_check = 0x40001354; -r_llm_adv_hdl_to_id = 0x40001358; -r_llm_adv_rep_flow_control_check = 0x4000135c; -r_llm_adv_rep_flow_control_update = 0x40001360; -r_llm_adv_reports_list_check = 0x40001364; -r_llm_adv_set_all_release = 0x40001368; -r_llm_adv_set_dft_params = 0x4000136c; -r_llm_adv_set_release = 0x40001370; -r_llm_aes_res_cb = 0x40001374; -r_llm_ble_update_adv_flow_control = 0x40001378; -r_llm_ch_map_update = 0x4000137c; -r_llm_cmd_cmp_send = 0x40001380; -r_llm_cmd_stat_send = 0x40001384; -r_llm_dev_list_empty_entry = 0x40001388; -r_llm_dev_list_search = 0x4000138c; -r_llm_env_adv_dup_filt_deinit = 0x40001390; -r_llm_env_adv_dup_filt_init = 0x40001394; -r_llm_init_ble_adv_report_flow_contol = 0x40001398; -r_llm_is_dev_connected = 0x4000139c; -r_llm_is_dev_synced = 0x400013a0; -r_llm_is_non_con_act_ongoing_check = 0x400013a4; -r_llm_is_wl_accessible = 0x400013a8; -r_llm_le_evt_mask_check = 0x400013ac; -r_llm_link_disc = 0x400013b4; -r_llm_master_ch_map_get = 0x400013b8; -r_llm_msg_handler_tab_p_get = 0x400013bc; -r_llm_no_activity = 0x400013c0; -r_llm_per_adv_slot_dur = 0x400013c4; -r_llm_plan_elt_get = 0x400013c8; -r_llm_rx_path_comp_get = 0x400013cc; -r_llm_scan_start = 0x400013d0; -r_llm_scan_sync_acad_attach = 0x400013d4; -r_llm_scan_sync_acad_detach = 0x400013d8; -r_llm_send_adv_lost_event_to_host = 0x400013dc; -r_llm_tx_path_comp_get = 0x400013e0; -r_misc_deinit = 0x400013e4; -r_misc_free_em_buf_in_isr = 0x400013e8; -r_misc_init = 0x400013ec; -r_misc_msg_handler_tab_p_get = 0x400013f0; -r_notEqual256 = 0x400013f4; -r_phy_upd_proc_start = 0x400013f8; -r_platform_reset = 0x400013fc; -r_rf_em_init = 0x40001404; -r_rf_force_agc_enable = 0x40001408; -r_rf_reg_rd = 0x4000140c; -r_rf_reg_wr = 0x40001410; -r_rf_reset = 0x40001414; -r_rf_rssi_convert = 0x40001418; -r_rf_rw_v9_le_disable = 0x4000141c; -r_rf_rw_v9_le_enable = 0x40001420; -r_rf_sleep = 0x40001424; -r_rf_util_cs_fmt_convert = 0x40001430; -r_rw_crypto_aes_ccm = 0x40001434; -r_rw_crypto_aes_encrypt = 0x40001438; -r_rw_crypto_aes_init = 0x4000143c; -r_rw_crypto_aes_k1 = 0x40001440; -r_rw_crypto_aes_k2 = 0x40001444; -r_rw_crypto_aes_k3 = 0x40001448; -r_rw_crypto_aes_k4 = 0x4000144c; -r_rw_crypto_aes_rand = 0x40001450; -r_rw_crypto_aes_result_handler = 0x40001454; -r_rw_crypto_aes_s1 = 0x40001458; -r_rw_cryto_aes_cmac = 0x4000145c; -r_rw_v9_init_em_radio_table = 0x40001460; -r_rwble_sleep_enter = 0x40001468; -r_rwble_sleep_wakeup_end = 0x4000146c; -/* r_rwbtdm_isr_wrapper = 0x40001470; */ -r_rwip_active_check = 0x40001474; -r_rwip_aes_encrypt = 0x40001478; -/* r_rwip_assert = 0x4000147c; */ -r_rwip_crypt_evt_handler = 0x40001480; -r_rwip_crypt_isr_handler = 0x40001484; -r_rwip_eif_get = 0x40001488; -r_rwip_half_slot_2_lpcycles = 0x4000148c; -r_rwip_hus_2_lpcycles = 0x40001490; -r_rwip_isr = 0x40001494; -r_rwip_lpcycles_2_hus = 0x40001498; -r_rwip_prevent_sleep_clear = 0x4000149c; -r_rwip_prevent_sleep_set = 0x400014a0; -r_rwip_schedule = 0x400014a4; -r_rwip_sleep = 0x400014a8; -r_rwip_sw_int_handler = 0x400014ac; -r_rwip_sw_int_req = 0x400014b0; -r_rwip_time_get = 0x400014b4; -r_rwip_timer_10ms_handler = 0x400014b8; -r_rwip_timer_10ms_set = 0x400014bc; -r_rwip_timer_hs_handler = 0x400014c0; -r_rwip_timer_hs_set = 0x400014c4; -r_rwip_timer_hus_handler = 0x400014c8; -r_rwip_timer_hus_set = 0x400014cc; -r_rwip_wakeup = 0x400014d0; -/* r_rwip_wakeup_end = 0x400014d4; */ -r_rwip_wlcoex_set = 0x400014d8; -r_sch_alarm_clear = 0x400014dc; -r_sch_alarm_init = 0x400014e0; -r_sch_alarm_prog = 0x400014e4; -r_sch_alarm_set = 0x400014e8; -r_sch_alarm_timer_isr = 0x400014ec; -r_sch_arb_conflict_check = 0x400014f0; -r_sch_arb_elt_cancel = 0x400014f4; -r_sch_arb_init = 0x400014fc; -r_sch_arb_insert = 0x40001500; -r_sch_arb_prog_timer = 0x40001504; -r_sch_arb_remove = 0x40001508; -r_sch_arb_sw_isr = 0x4000150c; -r_sch_plan_chk = 0x40001510; -r_sch_plan_clock_wrap_offset_update = 0x40001514; -r_sch_plan_init = 0x40001518; -r_sch_plan_interval_req = 0x4000151c; -r_sch_plan_offset_max_calc = 0x40001520; -r_sch_plan_offset_req = 0x40001524; -r_sch_plan_position_range_compute = 0x40001528; -r_sch_plan_rem = 0x4000152c; -r_sch_plan_req = 0x40001530; -r_sch_prog_init = 0x4000153c; -r_sch_prog_push = 0x40001540; -r_sch_prog_rx_isr = 0x40001544; -r_sch_prog_skip_isr = 0x40001548; -r_sch_prog_tx_isr = 0x4000154c; -r_sch_slice_bg_add = 0x40001550; -r_sch_slice_bg_remove = 0x40001554; -r_sch_slice_compute = 0x40001558; -r_sch_slice_fg_add = 0x4000155c; -r_sch_slice_fg_remove = 0x40001560; -r_sch_slice_init = 0x40001564; -r_sch_slice_per_add = 0x40001568; -r_sch_slice_per_remove = 0x4000156c; -r_sdk_config_get_bt_sleep_enable = 0x40001570; -r_sdk_config_get_hl_derived_opts = 0x40001574; -r_sdk_config_get_opts = 0x40001578; -r_sdk_config_get_priv_opts = 0x4000157c; -r_sdk_config_set_bt_sleep_enable = 0x40001580; -r_sdk_config_set_hl_derived_opts = 0x40001584; -r_sdk_config_set_opts = 0x40001588; -r_specialModP256 = 0x4000158c; -r_unloaded_area_init = 0x40001590; -r_vhci_flow_off = 0x40001594; -r_vhci_flow_on = 0x40001598; -r_vhci_notify_host_send_available = 0x4000159c; -r_vhci_send_to_host = 0x400015a0; -r_vnd_hci_command_handler = 0x400015a4; -r_vshci_init = 0x400015a8; -vnd_hci_command_handler_wrapper = 0x400015ac; /* Data (.data, .bss, .rodata) */ bt_rf_coex_cfg_p = 0x3fcdffcc; bt_rf_coex_hooks_p = 0x3fcdffc8; @@ -1462,38 +668,6 @@ rwip_coex_cfg = 0x3ff1eeac; rwip_priority = 0x3ff1ee94; veryBigHexP256 = 0x3ff1ee48; -/* bluetooth hook funcs */ -r_llc_loc_encrypt_proc_continue_hook = 0x40001c60; -r_llc_loc_phy_upd_proc_continue_hook = 0x40001c64; -r_llc_rem_phy_upd_proc_continue_hook = 0x40001c68; -r_lld_scan_frm_eof_isr_hook = 0x40001c6c; -r_lld_scan_evt_start_cbk_hook = 0x40001c70; -r_lld_scan_process_pkt_rx_ext_adv_hook = 0x40001c78; -r_lld_scan_sched_hook = 0x40001c7c; -r_lld_adv_evt_start_cbk_hook = 0x40001c84; -r_lld_adv_aux_evt_start_cbk_hook = 0x40001c88; -r_lld_adv_frm_isr_hook = 0x40001c8c; -r_lld_adv_start_init_evt_param_hook = 0x40001c90; -r_lld_con_evt_canceled_cbk_hook = 0x40001c94; -r_lld_con_frm_isr_hook = 0x40001c98; -r_lld_con_tx_hook = 0x40001c9c; -r_lld_con_rx_hook = 0x40001ca0; -r_lld_con_evt_start_cbk_hook = 0x40001ca4; -r_lld_con_tx_prog_new_packet_hook = 0x40001cac; -r_lld_init_frm_eof_isr_hook = 0x40001cb0; -r_lld_init_evt_start_cbk_hook = 0x40001cb4; -r_lld_init_sched_hook = 0x40001cbc; -r_lld_init_process_pkt_tx_hook = 0x40001cc0; -r_lld_per_adv_evt_start_cbk_hook = 0x40001cc4; -r_lld_per_adv_frm_isr_hook = 0x40001cc8; -r_lld_per_adv_start_hook = 0x40001ccc; -r_lld_sync_frm_eof_isr_hook = 0x40001cd0; -r_lld_sync_evt_start_cbk_hook = 0x40001cd4; -r_lld_sync_start_hook = 0x40001cd8; -r_lld_sync_process_pkt_rx_pkt_check_hook = 0x40001cdc; -r_sch_arb_insert_hook = 0x40001ce0; -r_sch_plan_offset_req_hook = 0x40001ce4; - /*************************************** Group rom_pp ***************************************/ diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_50.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_50.ld new file mode 100644 index 000000000000..10cc038cc3bf --- /dev/null +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_50.ld @@ -0,0 +1,75 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32s3.rom.ld for esp32s3 + * + * + * Generated from ./interface-esp32s3.yml md5sum 39c4ce259b11323b9404c192b01b712b + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/* extend adv */ +f_hci_le_set_ext_adv_param_cmd_handler = 0x40000000; +f_hci_le_set_adv_set_rand_addr_cmd_handler = 0x40000000; +f_hci_le_set_ext_adv_data_cmd_handler = 0x40000000; +f_hci_le_set_ext_scan_rsp_data_cmd_handler = 0x40000000; +f_hci_le_set_ext_adv_en_cmd_handler = 0x40000000; +f_hci_le_rd_max_adv_data_len_cmd_handler = 0x40000000; +f_hci_le_rd_nb_supp_adv_sets_cmd_handler = 0x40000000; +f_hci_le_rmv_adv_set_cmd_handler = 0x40000000; +f_hci_le_clear_adv_sets_cmd_handler = 0x40000000; +r_lld_adv_sync_info_set = 0x40000000; + +r_lld_ext_adv_dynamic_pti_process = 0x40000000; +r_lld_adv_ext_chain_construct = 0x40000000; +r_lld_adv_aux_evt_canceled_cbk = 0x40000000; +r_lld_adv_aux_evt_start_cbk = 0x40000000; +r_lld_adv_aux_ch_idx_set = 0x40000000; + +/* periodic adv */ +f_hci_le_set_per_adv_param_cmd_handler = 0x40000000; +f_hci_le_set_per_adv_data_cmd_handler = 0x40000000; +f_hci_le_set_per_adv_en_cmd_handler = 0x40000000; +r_lld_per_adv_ch_map_update = 0x40000000; +r_lld_per_adv_init = 0x40000000; + +/* PA list */ +f_hci_le_add_dev_to_per_adv_list_cmd_handler = 0x40000000; +f_hci_le_rmv_dev_from_per_adv_list_cmd_handler = 0x40000000; +f_hci_le_clear_per_adv_list_cmd_handler = 0x40000000; +f_hci_le_rd_per_adv_list_size_cmd_handler = 0x40000000; + +/* extend scan */ +f_hci_le_set_ext_scan_param_cmd_handler = 0x40000000; +f_hci_le_set_ext_scan_en_cmd_handler = 0x40000000; +r_lld_scan_process_pkt_rx_ext_adv = 0x40000000; +r_lld_scan_trunc_ind = 0x40000000; + +/* extend con */ +f_hci_le_ext_create_con_cmd_handler = 0x40000000; +r_lld_init_process_pkt_rx_adv_ext_ind = 0x40000000; +r_lld_init_process_pkt_rx_aux_connect_rsp = 0x40000000; + +/* PA sync */ +f_hci_le_per_adv_create_sync_cmd_handler = 0x40000000; +f_hci_le_per_adv_create_sync_cancel_cmd_handler = 0x40000000; +f_hci_le_per_adv_term_sync_cmd_handler = 0x40000000; +f_lld_per_adv_rx_end_ind_handler_hack = 0x40000000; +f_lld_sync_start_req_handler = 0x40000000; +f_lld_per_adv_rep_ind_handler = 0x40000000; +r_lld_sync_init = 0x40000000; + +/* phy update*/ +r_phy_upd_proc_start = 0x40000000; +f_llc_op_phy_upd_ind_handler = 0x40000000; +f_ll_phy_req_handler = 0x40000000; +f_ll_phy_rsp_handler = 0x40000000; +f_ll_phy_update_ind_handler = 0x40000000; +f_lld_phy_upd_cfm_handler = 0x40000000; +f_hci_le_set_phy_cmd_handler = 0x40000000; +llc_llcp_phy_update_ind_ack = 0x40000000; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_cca.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_cca.ld new file mode 100644 index 000000000000..74d2dca0e301 --- /dev/null +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_cca.ld @@ -0,0 +1,32 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32s3.rom.ld for esp32s3 + * + * + * Generated from ./interface-esp32s3.yml md5sum 39c4ce259b11323b9404c192b01b712b + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/* SW CCA */ +r_lld_cca_con_evt_start_handle = 0x40000000; +r_lld_hw_cca_end_isr = 0x40000000; +r_lld_hw_cca_isr_eco = 0x40000000; +r_lld_cca_bb_sync_found_handle = 0x40000000; +r_lld_cca_data_reset = 0x40000000; +r_lld_cca_sw_init = 0x40000000; +r_lld_cca_con_evt_end_handle = 0x40000000; +r_lld_cca_alloc = 0x40000000; +r_lld_cca_sw_alloc = 0x40000000; +r_lld_cca_sw_free = 0x40000000; +r_lld_cca_free = 0x40000000; +r_cca_init = 0x40000000; +r_lld_hw_cca_evt_handler = 0x40000000; +r_lld_sw_cca_evt_handler = 0x40000000; +r_ble_sw_cca_check_isr = 0x40000000; +bt_bb_tx_cca_set = 0x40000000; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_dtm.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_dtm.ld new file mode 100644 index 000000000000..e08545c7179a --- /dev/null +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_dtm.ld @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32s3.rom.ld for esp32s3 + * + * + * Generated from ./interface-esp32s3.yml md5sum 39c4ce259b11323b9404c192b01b712b + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/* DTM */ +f_hci_le_rx_test_cmd_handler = 0x40000000; +f_hci_le_tx_test_cmd_handler = 0x40000000; +f_hci_le_enh_rx_test_cmd_handler = 0x40000000; +f_hci_le_enh_tx_test_cmd_handler = 0x40000000; +f_hci_le_test_end_cmd_handler = 0x40000000; +r_lld_test_init = 0x40000000; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_master.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_master.ld new file mode 100644 index 000000000000..498330a68049 --- /dev/null +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_master.ld @@ -0,0 +1,20 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32s3.rom.ld for esp32s3 + * + * + * Generated from ./interface-esp32s3.yml md5sum 39c4ce259b11323b9404c192b01b712b + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/* master */ +f_hci_le_create_con_cmd_handler = 0x40000000; +f_hci_le_create_con_cancel_cmd_handler = 0x40000000; +lld_init_end_ind_handler = 0x40000000; +r_lld_init_init = 0x40000000; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_scan.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_scan.ld new file mode 100644 index 000000000000..c3c8414e516b --- /dev/null +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_scan.ld @@ -0,0 +1,37 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32s3.rom.ld for esp32s3 + * + * + * Generated from ./interface-esp32s3.yml md5sum 39c4ce259b11323b9404c192b01b712b + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + + +/* BLE scan */ + +f_hci_le_set_scan_param_cmd_handler = 0x40000000; +f_hci_le_set_scan_en_cmd_handler = 0x40000000; +f_llm_scan_period_to_handler_hack = 0x40000000; +f_lld_adv_rep_ind_handler_hack = 0x40000000; +r_lld_scan_init = 0x40000000; +r_lld_scan_restart = 0x40000000; +f_lld_scan_end_ind_handler_hack = 0x40000000; +r_llm_env_adv_dup_filt_deinit_eco = 0x40000000; +llm_exception_list_init = 0x40000000; +llm_duplicate_list_init = 0x40000000; +f_hci_vendor_ble_update_duplicate_exceptional_list_cmd_handler = 0x40000000; +f_hci_vendor_ble_init_adv_flow_control_cmd_handler = 0x40000000; +f_hci_vendor_ble_update_adv_report_flow_control_cmd_handler = 0x40000000; +coex_schm_ble_scan_stop = 0x40000000; + +f_hci_le_set_ext_scan_param_cmd_handler = 0x40000000; +f_hci_le_set_ext_scan_en_cmd_handler = 0x40000000; +r_lld_scan_process_pkt_rx_ext_adv = 0x40000000; +r_lld_scan_trunc_ind = 0x40000000; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_smp.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_smp.ld new file mode 100644 index 000000000000..78d1fb9784a7 --- /dev/null +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_smp.ld @@ -0,0 +1,44 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32s3.rom.ld for esp32s3 + * + * + * Generated from ./interface-esp32s3.yml md5sum 39c4ce259b11323b9404c192b01b712b + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/* SMP */ +f_ll_pause_enc_req_handler = 0x40000000; +f_ll_pause_enc_rsp_handler = 0x40000000; +f_ll_enc_req_handler = 0x40000000; +f_ll_enc_rsp_handler = 0x40000000; +f_ll_start_enc_req_handler = 0x40000000; +f_ll_start_enc_rsp_handler = 0x40000000; +f_hci_le_start_enc_cmd_handler = 0x40000000; +f_hci_le_ltk_req_reply_cmd_handler = 0x40000000; +f_hci_le_ltk_req_neg_reply_cmd_handler = 0x40000000; +f_llc_encrypt_ind_handler = 0x40000000; +f_llc_op_encrypt_ind_handler = 0x40000000; +f_hci_le_rd_local_p256_public_key_cmd_handler = 0x40000000; +f_hci_le_generate_dhkey_cmd_handler = 0x40000000; +f_hci_le_enc_cmd_handler = 0x40000000; +r_rwip_crypt_evt_handler = 0x40000000; + +/* LE ping */ +f_ll_ping_req_handler = 0x40000000; +f_ll_ping_rsp_handler = 0x40000000; +r_llc_le_ping_set = 0x40000000; +r_llc_le_ping_restart = 0x40000000; +f_llc_op_le_ping_ind_handler = 0x40000000; +f_llc_auth_payl_nearly_op_handler = 0x40000000; +f_llc_auth_payl_real_to_handler = 0x40000000; +f_llc_auth_payl_nearly_to_handler = 0x40000000; + +/* ecc */ +r_ecc_init = 0x40000000; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_test.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_test.ld new file mode 100644 index 000000000000..1c0a6b59f0a3 --- /dev/null +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ble_test.ld @@ -0,0 +1,37 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32s3.rom.ld for esp32s3 + * + * + * Generated from ./interface-esp32s3.yml md5sum 39c4ce259b11323b9404c192b01b712b + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + + +/* overwrite */ +lld_acl_rx_ind_handler = 0x40000000; +lld_con_estab_ind_handler = 0x40000000; +lld_adv_rep_ind_handler = 0x40000000; +llm_rpa_renew_to_handler = 0x40000000; +lld_scan_end_ind_handler = 0x40000000; +llm_scan_period_to_handler = 0x40000000; + +/* nvds */ +r_nvds_init = 0x40000000; +f_nvds_get = 0x40000000; +f_nvds_del = 0x40000000; +f_nvds_put = 0x40000000; + +/* controller flash */ +r_flash_init = 0x40000000; +r_flash_env_init = 0x40000000; +r_flash_env_deinit = 0x40000000; + +/* QA test */ +f_hci_vendor_ble_qa_test_cmd_handler = 0x40000000; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.bt_funcs.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.bt_funcs.ld new file mode 100644 index 000000000000..de1ad1875332 --- /dev/null +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.bt_funcs.ld @@ -0,0 +1,874 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* ROM function interface esp32s3.rom.ld for esp32s3 + * + * + * Generated from ./interface-esp32s3.yml md5sum 39c4ce259b11323b9404c192b01b712b + * + * Compatible with ROM where ECO version equal or greater to 0. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + +/*************************************** + Group bluetooth + ***************************************/ + +/* Functions */ +bt_rf_coex_get_dft_cfg = 0x40002a78; +bt_rf_coex_hooks_p_set = 0x40002a84; +btdm_con_maxevtime_cal_impl = 0x40002a90; +btdm_controller_get_compile_version_impl = 0x40002a9c; +btdm_controller_rom_data_init = 0x40002aa8; +btdm_dis_privacy_err_report_impl = 0x40002ab4; +btdm_disable_adv_delay_impl = 0x40002ac0; +btdm_enable_scan_continue_impl = 0x40002acc; +btdm_enable_scan_forever_impl = 0x40002ad8; +btdm_get_power_state_impl = 0x40002ae4; +btdm_get_prevent_sleep_flag_impl = 0x40002af0; +btdm_power_state_active_impl = 0x40002afc; +btdm_switch_phy_coded_impl = 0x40002b08; +hci_acl_data_handler = 0x40002b14; +hci_disconnect_cmd_handler = 0x40002b20; +hci_le_con_upd_cmd_handler = 0x40002b2c; +hci_le_ltk_req_neg_reply_cmd_handler = 0x40002b38; +hci_le_ltk_req_reply_cmd_handler = 0x40002b44; +hci_le_rd_chnl_map_cmd_handler = 0x40002b50; +hci_le_rd_phy_cmd_handler = 0x40002b5c; +hci_le_rd_rem_feats_cmd_handler = 0x40002b68; +hci_le_rem_con_param_req_neg_reply_cmd_handler = 0x40002b74; +hci_le_rem_con_param_req_reply_cmd_handler = 0x40002b80; +hci_le_set_data_len_cmd_handler = 0x40002b8c; +hci_le_set_phy_cmd_handler = 0x40002b98; +hci_le_start_enc_cmd_handler = 0x40002ba4; +hci_rd_auth_payl_to_cmd_handler = 0x40002bb0; +hci_rd_rem_ver_info_cmd_handler = 0x40002bbc; +hci_rd_rssi_cmd_handler = 0x40002bc8; +hci_rd_tx_pwr_lvl_cmd_handler = 0x40002bd4; +hci_vs_set_pref_slave_evt_dur_cmd_handler = 0x40002be0; +hci_vs_set_pref_slave_latency_cmd_handler = 0x40002bec; +hci_wr_auth_payl_to_cmd_handler = 0x40002bf8; +ll_channel_map_ind_handler = 0x40002c04; +ll_connection_param_req_handler = 0x40002c10; +ll_connection_param_rsp_handler = 0x40002c1c; +ll_connection_update_ind_handler = 0x40002c28; +ll_enc_req_handler = 0x40002c34; +ll_enc_rsp_handler = 0x40002c40; +ll_feature_req_handler = 0x40002c4c; +ll_feature_rsp_handler = 0x40002c58; +ll_length_req_handler = 0x40002c64; +ll_length_rsp_handler = 0x40002c70; +ll_min_used_channels_ind_handler = 0x40002c7c; +ll_pause_enc_req_handler = 0x40002c88; +ll_pause_enc_rsp_handler = 0x40002c94; +ll_phy_req_handler = 0x40002ca0; +ll_phy_rsp_handler = 0x40002cac; +ll_phy_update_ind_handler = 0x40002cb8; +ll_ping_req_handler = 0x40002cc4; +ll_ping_rsp_handler = 0x40002cd0; +ll_slave_feature_req_handler = 0x40002cdc; +ll_start_enc_req_handler = 0x40002ce8; +ll_start_enc_rsp_handler = 0x40002cf4; +ll_terminate_ind_handler = 0x40002d00; +ll_version_ind_handler = 0x40002d0c; +llc_auth_payl_nearly_to_handler = 0x40002d18; +llc_auth_payl_real_to_handler = 0x40002d24; +llc_encrypt_ind_handler = 0x40002d30; +llc_hci_command_handler_wrapper = 0x40002d3c; +llc_ll_connection_param_req_pdu_send = 0x40002d48; +llc_ll_connection_param_rsp_pdu_send = 0x40002d54; +llc_ll_connection_update_ind_pdu_send = 0x40002d60; +llc_ll_enc_req_pdu_send = 0x40002d6c; +llc_ll_enc_rsp_pdu_send = 0x40002d78; +llc_ll_feature_req_pdu_send = 0x40002d84; +llc_ll_feature_rsp_pdu_send = 0x40002d90; +llc_ll_length_req_pdu_send = 0x40002d9c; +llc_ll_length_rsp_pdu_send = 0x40002da8; +llc_ll_pause_enc_req_pdu_send = 0x40002db4; +llc_ll_pause_enc_rsp_pdu_send = 0x40002dc0; +llc_ll_phy_req_pdu_send = 0x40002dcc; +llc_ll_phy_rsp_pdu_send = 0x40002dd8; +llc_ll_ping_req_pdu_send = 0x40002de4; +llc_ll_ping_rsp_pdu_send = 0x40002df0; +llc_ll_start_enc_req_pdu_send = 0x40002dfc; +llc_ll_start_enc_rsp_pdu_send = 0x40002e08; +llc_ll_terminate_ind_pdu_send = 0x40002e14; +llc_ll_unknown_rsp_pdu_send = 0x40002e20; +llc_llcp_ch_map_update_ind_pdu_send = 0x40002e2c; +llc_llcp_phy_upd_ind_pdu_send = 0x40002e38; +llc_llcp_version_ind_pdu_send = 0x40002e44; +llc_op_ch_map_upd_ind_handler = 0x40002e50; +llc_op_con_upd_ind_handler = 0x40002e5c; +llc_op_disconnect_ind_handler = 0x40002e68; +llc_op_dl_upd_ind_handler = 0x40002e74; +llc_op_encrypt_ind_handler = 0x40002e80; +llc_op_feats_exch_ind_handler = 0x40002e8c; +llc_op_le_ping_ind_handler = 0x40002e98; +llc_op_phy_upd_ind_handler = 0x40002ea4; +llc_op_ver_exch_ind_handler = 0x40002eb0; +llc_stopped_ind_handler = 0x40002ebc; +lld_acl_rx_ind_handler = 0x40002ec8; +lld_acl_tx_cfm_handler = 0x40002ed4; +lld_adv_end_ind_handler = 0x40002ee0; +lld_adv_rep_ind_handler = 0x40002eec; +lld_ch_map_upd_cfm_handler = 0x40002ef8; +lld_con_estab_ind_handler = 0x40002f04; +lld_con_evt_sd_evt_time_set = 0x40002f10; +lld_con_offset_upd_ind_handler = 0x40002f1c; +lld_con_param_upd_cfm_handler = 0x40002f28; +lld_disc_ind_handler = 0x40002f34; +lld_init_end_ind_handler = 0x40002f40; +lld_llcp_rx_ind_handler_wrapper = 0x40002f4c; +lld_llcp_tx_cfm_handler = 0x40002f58; +lld_per_adv_end_ind_handler = 0x40002f64; +lld_per_adv_rep_ind_handler = 0x40002f70; +lld_per_adv_rx_end_ind_handler = 0x40002f7c; +lld_phy_coded_500k_get = 0x40002f88; +lld_phy_upd_cfm_handler = 0x40002f94; +lld_scan_end_ind_handler = 0x40002fa0; +lld_scan_req_ind_handler = 0x40002fac; +lld_sync_start_req_handler = 0x40002fb8; +lld_test_end_ind_handler = 0x40002fc4; +lld_update_rxbuf_handler = 0x40002fd0; +llm_ch_map_update_ind_handler = 0x40002fdc; +llm_hci_command_handler_wrapper = 0x40002fe8; +llm_scan_period_to_handler = 0x40002ff4; +r_Add2SelfBigHex256 = 0x40003000; +r_AddBigHex256 = 0x4000300c; +r_AddBigHexModP256 = 0x40003018; +r_AddP256 = 0x40003024; +r_AddPdiv2_256 = 0x40003030; +r_GF_Jacobian_Point_Addition256 = 0x4000303c; +r_GF_Jacobian_Point_Double256 = 0x40003048; +r_GF_Point_Jacobian_To_Affine256 = 0x40003054; +r_MultiplyBigHexByUint32_256 = 0x40003060; +r_MultiplyBigHexModP256 = 0x4000306c; +r_MultiplyByU16ModP256 = 0x40003078; +r_SubtractBigHex256 = 0x40003084; +r_SubtractBigHexMod256 = 0x40003090; +r_SubtractBigHexUint32_256 = 0x4000309c; +r_SubtractFromSelfBigHex256 = 0x400030a8; +r_SubtractFromSelfBigHexSign256 = 0x400030b4; +r_aes_alloc = 0x400030c0; +r_aes_ccm_continue = 0x400030cc; +r_aes_ccm_process_e = 0x400030d8; +r_aes_ccm_xor_128_lsb = 0x400030e4; +r_aes_ccm_xor_128_msb = 0x400030f0; +r_aes_cmac_continue = 0x400030fc; +r_aes_cmac_start = 0x40003108; +r_aes_k1_continue = 0x40003114; +r_aes_k2_continue = 0x40003120; +r_aes_k3_continue = 0x4000312c; +r_aes_k4_continue = 0x40003138; +r_aes_shift_left_128 = 0x40003144; +r_aes_start = 0x40003150; +r_aes_xor_128 = 0x4000315c; +r_assert_err = 0x40003168; +r_assert_param = 0x40003174; +r_assert_warn = 0x40003180; +r_bigHexInversion256 = 0x4000318c; +r_ble_sw_cca_check_isr = 0x40003198; +r_ble_util_buf_acl_tx_alloc = 0x400031a4; +r_ble_util_buf_acl_tx_elt_get = 0x400031b0; +r_ble_util_buf_acl_tx_free = 0x400031bc; +r_ble_util_buf_acl_tx_free_in_isr = 0x400031c8; +r_ble_util_buf_adv_tx_alloc = 0x400031d4; +r_ble_util_buf_adv_tx_free = 0x400031e0; +r_ble_util_buf_adv_tx_free_in_isr = 0x400031ec; +r_ble_util_buf_env_deinit = 0x400031f8; +r_ble_util_buf_env_init = 0x40003204; +r_ble_util_buf_get_rx_buf_nb = 0x40003210; +r_ble_util_buf_get_rx_buf_size = 0x4000321c; +r_ble_util_buf_llcp_tx_alloc = 0x40003228; +r_ble_util_buf_llcp_tx_free = 0x40003234; +r_ble_util_buf_rx_alloc = 0x40003240; +r_ble_util_buf_rx_alloc_in_isr = 0x4000324c; +r_ble_util_buf_rx_free = 0x40003258; +r_ble_util_buf_rx_free_in_isr = 0x40003264; +r_ble_util_buf_set_rx_buf_nb = 0x40003270; +r_ble_util_buf_set_rx_buf_size = 0x4000327c; +r_ble_util_data_rx_buf_reset = 0x40003288; +r_bt_bb_get_intr_mask = 0x40003294; +r_bt_bb_intr_clear = 0x400032a0; +r_bt_bb_intr_mask_set = 0x400032ac; +r_bt_rf_coex_cfg_set = 0x400032c4; +r_bt_rf_coex_conn_dynamic_pti_en_get = 0x400032d0; +r_bt_rf_coex_ext_adv_dynamic_pti_en_get = 0x400032e8; +r_bt_rf_coex_ext_scan_dynamic_pti_en_get = 0x400032f4; +r_bt_rf_coex_legacy_adv_dynamic_pti_en_get = 0x40003300; +r_bt_rf_coex_per_adv_dynamic_pti_en_get = 0x4000330c; +r_bt_rf_coex_pti_table_get = 0x40003318; +r_bt_rf_coex_st_param_get = 0x40003324; +r_bt_rf_coex_st_param_set = 0x40003330; +r_bt_rf_coex_sync_scan_dynamic_pti_en_get = 0x4000333c; +r_bt_rma_apply_rule_cs_fmt = 0x40003348; +r_bt_rma_apply_rule_cs_idx = 0x40003354; +r_bt_rma_configure = 0x40003360; +r_bt_rma_deregister_rule_cs_fmt = 0x4000336c; +r_bt_rma_deregister_rule_cs_idx = 0x40003378; +r_bt_rma_get_ant_by_act = 0x40003384; +r_bt_rma_init = 0x40003390; +r_bt_rma_register_rule_cs_fmt = 0x4000339c; +r_bt_rma_register_rule_cs_idx = 0x400033a8; +r_bt_rtp_apply_rule_cs_fmt = 0x400033b4; +r_bt_rtp_apply_rule_cs_idx = 0x400033c0; +r_bt_rtp_deregister_rule_cs_fmt = 0x400033cc; +r_bt_rtp_deregister_rule_cs_idx = 0x400033d8; +r_bt_rtp_init = 0x400033f0; +r_bt_rtp_register_rule_cs_fmt = 0x400033fc; +r_bt_rtp_register_rule_cs_idx = 0x40003408; +r_btdm_isr = 0x40003414; +r_cali_phase_match_p = 0x40003444; +r_cmp_abs_time = 0x40003450; +r_cmp_dest_id = 0x4000345c; +r_cmp_timer_id = 0x40003468; +r_co_bdaddr_compare = 0x40003474; +r_co_ble_pkt_dur_in_us = 0x40003480; +r_co_list_extract = 0x4000348c; +r_co_list_extract_after = 0x40003498; +r_co_list_extract_sublist = 0x400034a4; +r_co_list_find = 0x400034b0; +r_co_list_init = 0x400034bc; +r_co_list_insert_after = 0x400034c8; +r_co_list_insert_before = 0x400034d4; +r_co_list_merge = 0x400034e0; +r_co_list_pool_init = 0x400034ec; +r_co_list_pop_front = 0x400034f8; +r_co_list_push_back = 0x40003504; +r_co_list_push_back_sublist = 0x40003510; +r_co_list_push_front = 0x4000351c; +r_co_list_size = 0x40003528; +r_co_nb_good_le_channels = 0x40003534; +r_co_util_pack = 0x40003540; +r_co_util_read_array_size = 0x4000354c; +r_co_util_unpack = 0x40003558; +r_dbg_env_deinit = 0x40003564; +r_dbg_env_init = 0x40003570; +r_dbg_platform_reset_complete = 0x4000357c; +r_dl_upd_proc_start = 0x40003588; +r_dump_data = 0x40003594; +r_ecc_abort_key256_generation = 0x400035a0; +r_ecc_gen_new_public_key = 0x400035ac; +r_ecc_gen_new_secret_key = 0x400035b8; +r_ecc_generate_key256 = 0x400035c4; +r_ecc_get_debug_Keys = 0x400035d0; +r_ecc_init = 0x400035dc; +r_ecc_is_valid_point = 0x400035e8; +r_ecc_multiplication_event_handler = 0x400035f4; +r_ecc_point_multiplication_win_256 = 0x40003600; +r_emi_alloc_em_mapping_by_offset = 0x4000360c; +r_emi_base_reg_lut_show = 0x40003618; +r_emi_em_base_reg_show = 0x40003624; +r_emi_free_em_mapping_by_offset = 0x40003630; +r_emi_get_em_mapping_idx_by_offset = 0x4000363c; +r_emi_get_mem_addr_by_offset = 0x40003648; +r_emi_overwrite_em_mapping_by_offset = 0x40003654; +r_esp_vendor_hci_command_handler = 0x40003660; +r_get_stack_usage = 0x4000366c; +r_h4tl_acl_hdr_rx_evt_handler = 0x40003678; +r_h4tl_cmd_hdr_rx_evt_handler = 0x40003684; +r_h4tl_cmd_pld_rx_evt_handler = 0x40003690; +r_h4tl_eif_io_event_post = 0x4000369c; +r_h4tl_eif_register = 0x400036a8; +r_h4tl_init = 0x400036b4; +r_h4tl_out_of_sync = 0x400036c0; +r_h4tl_out_of_sync_check = 0x400036cc; +r_h4tl_read_hdr = 0x400036d8; +r_h4tl_read_next_out_of_sync = 0x400036e4; +r_h4tl_read_payl = 0x400036f0; +r_h4tl_read_start = 0x400036fc; +r_h4tl_rx_acl_hdr_extract = 0x40003708; +r_h4tl_rx_cmd_hdr_extract = 0x40003714; +r_h4tl_rx_done = 0x40003720; +r_h4tl_start = 0x4000372c; +r_h4tl_stop = 0x40003738; +r_h4tl_tx_done = 0x40003744; +r_h4tl_tx_evt_handler = 0x40003750; +r_h4tl_write = 0x4000375c; +r_hci_acl_tx_data_alloc = 0x40003768; +r_hci_acl_tx_data_received = 0x40003774; +r_hci_basic_cmd_send_2_controller = 0x40003780; +r_hci_ble_adv_report_filter_check = 0x4000378c; +r_hci_ble_adv_report_tx_check = 0x40003798; +r_hci_ble_conhdl_register = 0x400037a4; +r_hci_ble_conhdl_unregister = 0x400037b0; +r_hci_build_acl_data = 0x400037bc; +r_hci_build_cc_evt = 0x400037c8; +r_hci_build_cs_evt = 0x400037d4; +r_hci_build_evt = 0x400037e0; +r_hci_build_le_evt = 0x400037ec; +r_hci_cmd_get_max_param_size = 0x400037f8; +r_hci_cmd_received = 0x40003804; +r_hci_cmd_reject = 0x40003810; +r_hci_evt_mask_check = 0x4000381c; +r_hci_evt_mask_set = 0x40003828; +r_hci_fc_acl_buf_size_set = 0x40003834; +r_hci_fc_acl_en = 0x40003840; +r_hci_fc_acl_packet_sent = 0x4000384c; +r_hci_fc_check_host_available_nb_acl_packets = 0x40003858; +r_hci_fc_host_nb_acl_pkts_complete = 0x40003864; +r_hci_fc_init = 0x40003870; +r_hci_look_for_cmd_desc = 0x4000387c; +r_hci_look_for_evt_desc = 0x40003888; +r_hci_look_for_le_evt_desc = 0x40003894; +r_hci_look_for_le_evt_desc_esp = 0x400038a0; +r_hci_pack_bytes = 0x400038ac; +r_hci_send_2_controller = 0x400038c4; +r_hci_send_2_host = 0x400038d0; +r_hci_tl_c2h_data_flow_on = 0x400038dc; +r_hci_tl_cmd_hdr_rx_evt_handler = 0x400038e8; +r_hci_tl_cmd_pld_rx_evt_handler = 0x400038f4; +r_hci_tl_get_pkt = 0x40003900; +r_hci_tl_hci_pkt_handler = 0x4000390c; +r_hci_tl_hci_tx_done_evt_handler = 0x40003918; +r_hci_tl_inc_nb_h2c_cmd_pkts = 0x40003924; +r_hci_tl_save_pkt = 0x40003930; +r_hci_tl_send = 0x4000393c; +r_hci_tx_done = 0x40003948; +r_hci_tx_start = 0x40003954; +r_hci_tx_trigger = 0x40003960; +r_isValidSecretKey_256 = 0x4000396c; +r_ke_check_malloc = 0x40003978; +r_ke_event_callback_set = 0x40003984; +r_ke_event_clear = 0x40003990; +r_ke_event_flush = 0x4000399c; +r_ke_event_get = 0x400039a8; +r_ke_event_get_all = 0x400039b4; +r_ke_event_init = 0x400039c0; +r_ke_event_schedule = 0x400039cc; +r_ke_event_set = 0x400039d8; +r_ke_flush = 0x400039e4; +r_ke_free = 0x400039f0; +r_ke_handler_search = 0x400039fc; +r_ke_init = 0x40003a08; +r_ke_is_free = 0x40003a14; +r_ke_malloc = 0x40003a20; +r_ke_mem_init = 0x40003a2c; +r_ke_mem_is_empty = 0x40003a38; +r_ke_mem_is_in_heap = 0x40003a44; +r_ke_msg_alloc = 0x40003a50; +r_ke_msg_dest_id_get = 0x40003a5c; +r_ke_msg_discard = 0x40003a68; +r_ke_msg_forward = 0x40003a74; +r_ke_msg_forward_new_id = 0x40003a80; +r_ke_msg_free = 0x40003a8c; +r_ke_msg_in_queue = 0x40003a98; +r_ke_msg_save = 0x40003aa4; +r_ke_msg_send = 0x40003ab0; +r_ke_msg_send_basic = 0x40003abc; +r_ke_msg_src_id_get = 0x40003ac8; +r_ke_queue_extract = 0x40003ad4; +r_ke_queue_insert = 0x40003ae0; +r_ke_sleep_check = 0x40003aec; +r_ke_state_get = 0x40003af8; +r_ke_state_set = 0x40003b04; +r_ke_task_check = 0x40003b10; +r_ke_task_create = 0x40003b1c; +r_ke_task_delete = 0x40003b28; +r_ke_task_handler_get = 0x40003b34; +r_ke_task_init = 0x40003b40; +r_ke_task_msg_flush = 0x40003b4c; +r_ke_task_saved_update = 0x40003b58; +r_ke_time = 0x40003b70; +r_ke_time_cmp = 0x40003b7c; +r_ke_time_past = 0x40003b88; +r_ke_timer_active = 0x40003b94; +r_ke_timer_adjust_all = 0x40003ba0; +r_ke_timer_clear = 0x40003bac; +r_ke_timer_init = 0x40003bb8; +r_ke_timer_schedule = 0x40003bc4; +r_ke_timer_set = 0x40003bd0; +r_led_init = 0x40003bdc; +r_led_set_all = 0x40003be8; +r_llc_aes_res_cb = 0x40003bf4; +r_llc_ch_map_up_proc_err_cb = 0x40003c00; +r_llc_cleanup = 0x40003c0c; +r_llc_cmd_cmp_send = 0x40003c18; +r_llc_cmd_stat_send = 0x40003c24; +r_llc_con_move_cbk = 0x40003c30; +r_llc_con_plan_set_update = 0x40003c3c; +r_llc_con_upd_param_in_range = 0x40003c48; +r_llc_disconnect = 0x40003c54; +r_llc_disconnect_end = 0x40003c60; +r_llc_disconnect_proc_continue = 0x40003c6c; +r_llc_disconnect_proc_err_cb = 0x40003c78; +r_llc_dl_chg_check = 0x40003c84; +r_llc_dle_proc_err_cb = 0x40003c90; +r_llc_feats_exch_proc_err_cb = 0x40003c9c; +r_llc_hci_cmd_handler_tab_p_get = 0x40003ca8; +r_llc_hci_con_param_req_evt_send = 0x40003cc0; +r_llc_hci_con_upd_info_send = 0x40003ccc; +r_llc_hci_disconnected_dis = 0x40003cd8; +r_llc_hci_dl_upd_info_send = 0x40003ce4; +r_llc_hci_enc_evt_send = 0x40003cf0; +r_llc_hci_feats_info_send = 0x40003cfc; +r_llc_hci_le_phy_upd_cmp_evt_send = 0x40003d08; +r_llc_hci_ltk_request_evt_send = 0x40003d14; +r_llc_hci_nb_cmp_pkts_evt_send = 0x40003d20; +r_llc_hci_version_info_send = 0x40003d2c; +r_llc_init_term_proc = 0x40003d38; +r_llc_iv_skd_rand_gen = 0x40003d44; +r_llc_le_ping_proc_continue = 0x40003d50; +r_llc_le_ping_proc_err_cb = 0x40003d5c; +/* r_llc_le_ping_restart = 0x40003d68; */ +r_llc_le_ping_set = 0x40003d74; +r_llc_ll_pause_enc_rsp_ack_handler = 0x40003d80; +r_llc_ll_reject_ind_ack_handler = 0x40003d8c; +r_llc_ll_reject_ind_pdu_send = 0x40003d98; +r_llc_ll_start_enc_rsp_ack_handler = 0x40003da4; +r_llc_ll_terminate_ind_ack = 0x40003db0; +r_llc_ll_unknown_ind_handler = 0x40003dbc; +r_llc_llcp_send = 0x40003dc8; +r_llc_llcp_state_set = 0x40003dd4; +r_llc_llcp_trans_timer_set = 0x40003de0; +r_llc_llcp_tx_check = 0x40003dec; +/* r_llc_loc_ch_map_proc_continue = 0x40003df8; */ +r_llc_loc_con_upd_proc_err_cb = 0x40003e10; +r_llc_loc_dl_upd_proc_continue = 0x40003e1c; +r_llc_loc_encrypt_proc_continue = 0x40003e28; +r_llc_loc_encrypt_proc_err_cb = 0x40003e34; +r_llc_loc_feats_exch_proc_continue = 0x40003e40; +r_llc_loc_phy_upd_proc_err_cb = 0x40003e58; +r_llc_msg_handler_tab_p_get = 0x40003e64; +r_llc_pref_param_compute = 0x40003e70; +r_llc_proc_collision_check = 0x40003e7c; +r_llc_proc_err_ind = 0x40003e88; +r_llc_proc_get = 0x40003e94; +r_llc_proc_id_get = 0x40003ea0; +r_llc_proc_reg = 0x40003eac; +r_llc_proc_state_get = 0x40003eb8; +r_llc_proc_state_set = 0x40003ec4; +r_llc_proc_timer_pause_set = 0x40003ed0; +r_llc_proc_timer_set = 0x40003edc; +r_llc_proc_unreg = 0x40003ee8; +r_llc_rem_ch_map_proc_continue = 0x40003ef4; +r_llc_rem_con_upd_proc_err_cb = 0x40003f0c; +r_llc_rem_dl_upd_proc = 0x40003f18; +r_llc_rem_encrypt_proc_continue = 0x40003f24; +r_llc_rem_encrypt_proc_err_cb = 0x40003f30; +r_llc_rem_phy_upd_proc_continue = 0x40003f3c; +r_llc_rem_phy_upd_proc_err_cb = 0x40003f48; +r_llc_role_get = 0x40003f54; +r_llc_sk_gen = 0x40003f60; +r_llc_start = 0x40003f6c; +r_llc_stop = 0x40003f78; +r_llc_ver_exch_loc_proc_continue = 0x40003f84; +r_llc_ver_proc_err_cb = 0x40003f90; +r_llcp_pdu_handler_tab_p_get = 0x40003f9c; +r_lld_aa_gen = 0x40003fa8; +r_lld_adv_adv_data_set = 0x40003fb4; +r_lld_adv_adv_data_update = 0x40003fc0; +r_lld_adv_aux_ch_idx_set = 0x40003fcc; +r_lld_adv_aux_evt_canceled_cbk = 0x40003fd8; +r_lld_adv_aux_evt_start_cbk = 0x40003fe4; +r_lld_adv_coex_check_ext_adv_synced = 0x40003ff0; +r_lld_adv_coex_env_reset = 0x40003ffc; +r_lld_adv_duration_update = 0x40004008; +r_lld_adv_dynamic_pti_process = 0x40004014; +r_lld_adv_end = 0x40004020; +r_lld_adv_evt_canceled_cbk = 0x4000402c; +r_lld_adv_evt_start_cbk = 0x40004038; +r_lld_adv_ext_chain_construct = 0x40004044; +r_lld_adv_ext_pkt_prepare = 0x40004050; +r_lld_adv_frm_cbk = 0x4000405c; +r_lld_adv_frm_isr = 0x40004068; +r_lld_adv_frm_skip_isr = 0x40004074; +r_lld_adv_init = 0x40004080; +r_lld_adv_pkt_rx = 0x4000408c; +r_lld_adv_pkt_rx_connect_ind = 0x40004098; +r_lld_adv_pkt_rx_send_scan_req_evt = 0x400040a4; +r_lld_adv_rand_addr_update = 0x400040b0; +r_lld_adv_restart = 0x400040bc; +r_lld_adv_scan_rsp_data_set = 0x400040c8; +r_lld_adv_scan_rsp_data_update = 0x400040d4; +r_lld_adv_set_tx_power = 0x400040e0; +r_lld_adv_start = 0x400040ec; +r_lld_adv_stop = 0x400040f8; +r_lld_adv_sync_info_set = 0x40004104; +r_lld_adv_sync_info_update = 0x40004110; +r_lld_calc_aux_rx = 0x4000411c; +r_lld_cca_alloc = 0x40004128; +r_lld_cca_data_reset = 0x40004134; +r_lld_cca_free = 0x40004140; +r_lld_ch_assess_data_get = 0x4000414c; +r_lld_ch_idx_get = 0x40004158; +r_lld_ch_map_set = 0x40004164; +r_lld_channel_assess = 0x40004170; +r_lld_con_activity_act_offset_compute = 0x4000417c; +r_lld_con_activity_offset_compute = 0x40004188; +r_lld_con_ch_map_update = 0x40004194; +r_lld_con_cleanup = 0x400041a0; +r_lld_con_current_tx_power_get = 0x400041ac; +r_lld_con_data_flow_set = 0x400041b8; +r_lld_con_data_len_update = 0x400041c4; +r_lld_con_data_tx = 0x400041d0; +r_lld_con_enc_key_load = 0x400041dc; +r_lld_con_event_counter_get = 0x400041e8; +r_lld_con_evt_canceled_cbk = 0x400041f4; +r_lld_con_evt_duration_min_get = 0x40004200; +r_lld_con_evt_max_eff_time_cal = 0x4000420c; +r_lld_con_evt_sd_evt_time_get = 0x40004218; +r_lld_con_evt_start_cbk = 0x40004224; +r_lld_con_evt_time_update = 0x40004230; +r_lld_con_free_all_tx_buf = 0x4000423c; +r_lld_con_frm_cbk = 0x40004248; +r_lld_con_frm_isr = 0x40004254; +r_lld_con_frm_skip_isr = 0x40004260; +r_lld_con_init = 0x4000426c; +r_lld_con_llcp_tx = 0x40004278; +r_lld_con_max_lat_calc = 0x40004284; +r_lld_con_offset_get = 0x40004290; +r_lld_con_param_update = 0x4000429c; +r_lld_con_phys_update = 0x400042a8; +r_lld_con_pref_slave_evt_dur_set = 0x400042b4; +r_lld_con_pref_slave_latency_set = 0x400042c0; +r_lld_con_rssi_get = 0x400042cc; +r_lld_con_rx = 0x400042d8; +/* r_lld_con_rx_channel_assess = 0x400042e4; */ +r_lld_con_rx_enc = 0x400042f0; +r_lld_con_rx_isr = 0x400042fc; +r_lld_con_rx_link_info_check = 0x40004308; +r_lld_con_rx_llcp_check = 0x40004314; +r_lld_con_rx_sync_time_update = 0x40004320; +r_lld_con_set_tx_power = 0x40004338; +r_lld_con_start = 0x40004344; +r_lld_con_tx = 0x4000435c; +r_lld_con_tx_enc = 0x40004368; +r_lld_con_tx_isr = 0x40004374; +r_lld_con_tx_len_update = 0x40004380; +r_lld_con_tx_len_update_for_intv = 0x4000438c; +r_lld_con_tx_len_update_for_rate = 0x40004398; +r_lld_con_tx_prog = 0x400043a4; +r_lld_conn_dynamic_pti_process = 0x400043b0; +r_lld_continue_scan_rx_isr_end_process = 0x400043bc; +r_lld_ext_scan_dynamic_pti_process = 0x400043c8; +r_lld_hw_cca_end_isr = 0x400043d4; +r_lld_hw_cca_evt_handler = 0x400043e0; +r_lld_hw_cca_isr = 0x400043ec; +r_lld_init_cal_anchor_point = 0x400043f8; +r_lld_init_compute_winoffset = 0x40004404; +r_lld_init_connect_req_pack = 0x40004410; +r_lld_init_end = 0x4000441c; +r_lld_init_evt_canceled_cbk = 0x40004428; +r_lld_init_evt_start_cbk = 0x40004434; +r_lld_init_frm_cbk = 0x40004440; +r_lld_init_frm_eof_isr = 0x4000444c; +r_lld_init_frm_skip_isr = 0x40004458; +r_lld_init_init = 0x40004464; +r_lld_init_process_pkt_rx = 0x40004470; +r_lld_init_process_pkt_rx_adv_ext_ind = 0x4000447c; +r_lld_init_process_pkt_rx_adv_ind_or_direct_ind = 0x40004488; +r_lld_init_process_pkt_rx_aux_connect_rsp = 0x40004494; +r_lld_init_process_pkt_tx = 0x400044a0; +r_lld_init_process_pkt_tx_cal_con_timestamp = 0x400044ac; +r_lld_init_sched = 0x400044b8; +r_lld_init_set_tx_power = 0x400044c4; +r_lld_init_start = 0x400044d0; +r_lld_init_stop = 0x400044dc; +r_lld_instant_proc_end = 0x400044e8; +r_lld_per_adv_ch_map_update = 0x40004500; +r_lld_per_adv_chain_construct = 0x4000450c; +r_lld_per_adv_cleanup = 0x40004518; +r_lld_per_adv_coex_env_reset = 0x40004524; +r_lld_per_adv_data_set = 0x40004530; +r_lld_per_adv_data_update = 0x4000453c; +r_lld_per_adv_dynamic_pti_process = 0x40004548; +r_lld_per_adv_evt_canceled_cbk = 0x40004554; +r_lld_per_adv_evt_start_cbk = 0x40004560; +r_lld_per_adv_ext_pkt_prepare = 0x4000456c; +r_lld_per_adv_frm_cbk = 0x40004578; +r_lld_per_adv_frm_isr = 0x40004584; +r_lld_per_adv_frm_skip_isr = 0x40004590; +r_lld_per_adv_init = 0x4000459c; +r_lld_per_adv_init_info_get = 0x400045a8; +r_lld_per_adv_list_add = 0x400045b4; +r_lld_per_adv_list_rem = 0x400045c0; +r_lld_per_adv_set_tx_power = 0x400045d8; +r_lld_per_adv_start = 0x400045e4; +r_lld_per_adv_stop = 0x400045f0; +r_lld_per_adv_sync_info_get = 0x400045fc; +r_lld_process_cca_data = 0x40004608; +r_lld_ral_search = 0x40004614; +r_lld_read_clock = 0x40004620; +r_lld_res_list_add = 0x4000462c; +r_lld_res_list_is_empty = 0x40004644; +r_lld_res_list_local_rpa_get = 0x40004650; +r_lld_res_list_peer_rpa_get = 0x4000465c; +r_lld_res_list_peer_update = 0x40004668; +/* r_lld_res_list_priv_mode_update = 0x40004674; */ +r_lld_reset_reg = 0x4000468c; +r_lld_rpa_renew = 0x40004698; +r_lld_rpa_renew_evt_canceled_cbk = 0x400046a4; +r_lld_rpa_renew_evt_start_cbk = 0x400046b0; +r_lld_rpa_renew_instant_cbk = 0x400046bc; +r_lld_rxdesc_check = 0x400046c8; +r_lld_rxdesc_free = 0x400046d4; +r_lld_scan_create_sync = 0x400046e0; +r_lld_scan_create_sync_cancel = 0x400046ec; +r_lld_scan_end = 0x400046f8; +r_lld_scan_evt_canceled_cbk = 0x40004704; +r_lld_scan_evt_start_cbk = 0x40004710; +r_lld_scan_frm_cbk = 0x4000471c; +r_lld_scan_frm_eof_isr = 0x40004728; +r_lld_scan_frm_rx_isr = 0x40004734; +r_lld_scan_frm_skip_isr = 0x40004740; +r_lld_scan_init = 0x4000474c; +r_lld_scan_params_update = 0x40004758; +r_lld_scan_process_pkt_rx_aux_adv_ind = 0x4000477c; +r_lld_scan_process_pkt_rx_aux_chain_ind = 0x40004788; +r_lld_scan_process_pkt_rx_aux_scan_rsp = 0x40004794; +r_lld_scan_process_pkt_rx_ext_adv = 0x400047a0; +r_lld_scan_process_pkt_rx_ext_adv_ind = 0x400047ac; +r_lld_scan_process_pkt_rx_legacy_adv = 0x400047b8; +r_lld_scan_restart = 0x400047c4; +r_lld_scan_sched = 0x400047d0; +r_lld_scan_set_tx_power = 0x400047dc; +r_lld_scan_start = 0x400047e8; +r_lld_scan_stop = 0x400047f4; +r_lld_scan_sync_accept = 0x40004800; +r_lld_scan_sync_info_unpack = 0x4000480c; +r_lld_scan_trunc_ind = 0x40004818; +r_lld_sw_cca_evt_handler = 0x40004824; +r_lld_sw_cca_isr = 0x40004830; +r_lld_sync_ch_map_update = 0x4000483c; +r_lld_sync_cleanup = 0x40004848; +r_lld_sync_evt_canceled_cbk = 0x40004854; +r_lld_sync_evt_start_cbk = 0x40004860; +r_lld_sync_frm_cbk = 0x4000486c; +r_lld_sync_frm_eof_isr = 0x40004878; +r_lld_sync_frm_rx_isr = 0x40004884; +r_lld_sync_frm_skip_isr = 0x40004890; +r_lld_sync_init = 0x4000489c; +r_lld_sync_process_pkt_rx = 0x400048a8; +r_lld_sync_process_pkt_rx_aux_sync_ind = 0x400048b4; +r_lld_sync_process_pkt_rx_pkt_check = 0x400048c0; +r_lld_sync_scan_dynamic_pti_process = 0x400048cc; +r_lld_sync_sched = 0x400048d8; +r_lld_sync_start = 0x400048e4; +r_lld_sync_stop = 0x400048f0; +r_lld_sync_trunc_ind = 0x400048fc; +r_lld_test_cleanup = 0x40004908; +r_lld_test_evt_canceled_cbk = 0x40004914; +r_lld_test_evt_start_cbk = 0x40004920; +r_lld_test_freq2chnl = 0x4000492c; +r_lld_test_frm_cbk = 0x40004938; +r_lld_test_frm_isr = 0x40004944; +r_lld_test_init = 0x40004950; +r_lld_test_rx_isr = 0x4000495c; +r_lld_test_set_tx_power = 0x40004968; +r_lld_test_start = 0x40004974; +/* r_lld_test_stop = 0x40004980;*/ +r_lld_update_rxbuf = 0x4000498c; +r_lld_update_rxbuf_isr = 0x40004998; +r_lld_white_list_add = 0x400049a4; +r_lld_white_list_rem = 0x400049b0; +r_llm_activity_free_get = 0x400049bc; +r_llm_activity_free_set = 0x400049c8; +r_llm_activity_syncing_get = 0x400049d4; +r_llm_adv_con_len_check = 0x400049e0; +r_llm_adv_hdl_to_id = 0x400049ec; +r_llm_adv_rep_flow_control_check = 0x400049f8; +r_llm_adv_rep_flow_control_update = 0x40004a04; +r_llm_adv_reports_list_check = 0x40004a10; +r_llm_adv_set_all_release = 0x40004a1c; +r_llm_adv_set_dft_params = 0x40004a28; +r_llm_adv_set_release = 0x40004a34; +r_llm_aes_res_cb = 0x40004a40; +r_llm_ble_update_adv_flow_control = 0x40004a4c; +r_llm_ch_map_update = 0x40004a58; +r_llm_cmd_cmp_send = 0x40004a64; +r_llm_cmd_stat_send = 0x40004a70; +r_llm_dev_list_empty_entry = 0x40004a7c; +r_llm_dev_list_search = 0x40004a88; +r_llm_env_adv_dup_filt_deinit = 0x40004a94; +r_llm_env_adv_dup_filt_init = 0x40004aa0; +r_llm_init_ble_adv_report_flow_contol = 0x40004aac; +r_llm_is_dev_connected = 0x40004ab8; +r_llm_is_dev_synced = 0x40004ac4; +r_llm_is_non_con_act_ongoing_check = 0x40004ad0; +r_llm_is_wl_accessible = 0x40004adc; +r_llm_le_evt_mask_check = 0x40004ae8; +r_llm_link_disc = 0x40004b00; +r_llm_master_ch_map_get = 0x40004b0c; +r_llm_msg_handler_tab_p_get = 0x40004b18; +r_llm_no_activity = 0x40004b24; +r_llm_per_adv_slot_dur = 0x40004b30; +r_llm_plan_elt_get = 0x40004b3c; +r_llm_rx_path_comp_get = 0x40004b48; +r_llm_scan_start = 0x40004b54; +r_llm_scan_sync_acad_attach = 0x40004b60; +r_llm_scan_sync_acad_detach = 0x40004b6c; +r_llm_send_adv_lost_event_to_host = 0x40004b78; +r_llm_tx_path_comp_get = 0x40004b84; +r_misc_deinit = 0x40004b90; +r_misc_free_em_buf_in_isr = 0x40004b9c; +r_misc_init = 0x40004ba8; +r_misc_msg_handler_tab_p_get = 0x40004bb4; +r_notEqual256 = 0x40004bc0; +r_phy_upd_proc_start = 0x40004bcc; +r_platform_reset = 0x40004bd8; +r_rf_em_init = 0x40004bf0; +r_rf_force_agc_enable = 0x40004bfc; +r_rf_reg_rd = 0x40004c08; +r_rf_reg_wr = 0x40004c14; +r_rf_reset = 0x40004c20; +r_rf_rssi_convert = 0x40004c2c; +r_rf_rw_v9_le_disable = 0x40004c38; +r_rf_rw_v9_le_enable = 0x40004c44; +r_rf_sleep = 0x40004c50; +r_rf_util_cs_fmt_convert = 0x40004c74; +r_rw_crypto_aes_ccm = 0x40004c80; +r_rw_crypto_aes_encrypt = 0x40004c8c; +r_rw_crypto_aes_init = 0x40004c98; +r_rw_crypto_aes_k1 = 0x40004ca4; +r_rw_crypto_aes_k2 = 0x40004cb0; +r_rw_crypto_aes_k3 = 0x40004cbc; +r_rw_crypto_aes_k4 = 0x40004cc8; +r_rw_crypto_aes_rand = 0x40004cd4; +r_rw_crypto_aes_result_handler = 0x40004ce0; +r_rw_crypto_aes_s1 = 0x40004cec; +r_rw_cryto_aes_cmac = 0x40004cf8; +r_rw_v9_init_em_radio_table = 0x40004d04; +r_rwble_sleep_enter = 0x40004d1c; +r_rwble_sleep_wakeup_end = 0x40004d28; +/* r_rwbtdm_isr_wrapper = 0x40004d34; */ +r_rwip_active_check = 0x40004d40; +r_rwip_aes_encrypt = 0x40004d4c; +/* r_rwip_assert = 0x40004d58; */ +r_rwip_crypt_evt_handler = 0x40004d64; +r_rwip_crypt_isr_handler = 0x40004d70; +r_rwip_eif_get = 0x40004d7c; +r_rwip_half_slot_2_lpcycles = 0x40004d88; +r_rwip_hus_2_lpcycles = 0x40004d94; +r_rwip_isr = 0x40004da0; +r_rwip_lpcycles_2_hus = 0x40004dac; +r_rwip_prevent_sleep_clear = 0x40004db8; +r_rwip_prevent_sleep_set = 0x40004dc4; +r_rwip_schedule = 0x40004dd0; +r_rwip_sleep = 0x40004ddc; +r_rwip_sw_int_handler = 0x40004de8; +r_rwip_sw_int_req = 0x40004df4; +r_rwip_time_get = 0x40004e00; +r_rwip_timer_10ms_handler = 0x40004e0c; +r_rwip_timer_10ms_set = 0x40004e18; +r_rwip_timer_hs_handler = 0x40004e24; +r_rwip_timer_hs_set = 0x40004e30; +r_rwip_timer_hus_handler = 0x40004e3c; +r_rwip_timer_hus_set = 0x40004e48; +r_rwip_wakeup = 0x40004e54; +/* r_rwip_wakeup_end = 0x40004e60; */ +r_rwip_wlcoex_set = 0x40004e6c; +r_sch_alarm_clear = 0x40004e78; +r_sch_alarm_init = 0x40004e84; +r_sch_alarm_prog = 0x40004e90; +r_sch_alarm_set = 0x40004e9c; +r_sch_alarm_timer_isr = 0x40004ea8; +r_sch_arb_conflict_check = 0x40004eb4; +r_sch_arb_elt_cancel = 0x40004ec0; +r_sch_arb_init = 0x40004ed8; +r_sch_arb_insert = 0x40004ee4; +r_sch_arb_prog_timer = 0x40004ef0; +r_sch_arb_remove = 0x40004efc; +r_sch_arb_sw_isr = 0x40004f08; +r_sch_plan_chk = 0x40004f14; +r_sch_plan_clock_wrap_offset_update = 0x40004f20; +r_sch_plan_init = 0x40004f2c; +r_sch_plan_interval_req = 0x40004f38; +r_sch_plan_offset_max_calc = 0x40004f44; +r_sch_plan_offset_req = 0x40004f50; +r_sch_plan_position_range_compute = 0x40004f5c; +r_sch_plan_rem = 0x40004f68; +r_sch_plan_req = 0x40004f74; +r_sch_prog_init = 0x40004f98; +r_sch_prog_push = 0x40004fa4; +r_sch_prog_rx_isr = 0x40004fb0; +r_sch_prog_skip_isr = 0x40004fbc; +r_sch_prog_tx_isr = 0x40004fc8; +r_sch_slice_bg_add = 0x40004fd4; +r_sch_slice_bg_remove = 0x40004fe0; +r_sch_slice_compute = 0x40004fec; +r_sch_slice_fg_add = 0x40004ff8; +r_sch_slice_fg_remove = 0x40005004; +r_sch_slice_init = 0x40005010; +r_sch_slice_per_add = 0x4000501c; +r_sch_slice_per_remove = 0x40005028; +r_sdk_config_get_bt_sleep_enable = 0x40005034; +r_sdk_config_get_hl_derived_opts = 0x40005040; +r_sdk_config_get_opts = 0x4000504c; +r_sdk_config_get_priv_opts = 0x40005058; +r_sdk_config_set_bt_sleep_enable = 0x40005064; +r_sdk_config_set_hl_derived_opts = 0x40005070; +r_sdk_config_set_opts = 0x4000507c; +r_specialModP256 = 0x40005088; +r_unloaded_area_init = 0x40005094; +r_vhci_flow_off = 0x400050a0; +r_vhci_flow_on = 0x400050ac; +r_vhci_notify_host_send_available = 0x400050b8; +r_vhci_send_to_host = 0x400050c4; +r_vnd_hci_command_handler = 0x400050d0; +r_vshci_init = 0x400050dc; +vnd_hci_command_handler_wrapper = 0x400050e8; +r_lld_legacy_adv_dynamic_pti_get = 0x400050f4; +r_lld_legacy_adv_dynamic_pti_process = 0x40005100; +r_lld_ext_adv_dynamic_pti_get = 0x4000510c; +r_lld_ext_adv_dynamic_aux_pti_process = 0x40005118; +r_lld_ext_adv_dynamic_pti_process = 0x40005124; +/* +r_lld_adv_ext_pkt_prepare_set = 0x40005130; +*/ +r_lld_adv_ext_chain_connectable_construct = 0x40005148; +r_lld_adv_pkt_rx_connect_post = 0x40005160; +r_lld_adv_start_init_evt_param = 0x4000516c; +r_lld_adv_start_set_cs = 0x40005178; +/* r_lld_adv_start_update_filter_policy = 0x40005184; */ +r_lld_adv_start_schedule_asap = 0x40005190; +r_lld_con_tx_prog_new_packet_coex = 0x4000519c; +r_lld_per_adv_dynamic_pti_get = 0x400051b4; +r_lld_per_adv_evt_start_chm_upd = 0x400051c0; +r_lld_ext_scan_dynamic_pti_get = 0x400051cc; +r_lld_sync_insert = 0x400051e4; +/* +r_sch_prog_ble_push = 0x400051f0; +*/ +r_sch_prog_bt_push = 0x400051fc; +r_lld_init_evt_end_type_set = 0x40005208; +r_lld_init_evt_end_type_get = 0x40005214; +r_lld_adv_direct_adv_use_rpa_addr_state_set = 0x40005220; +r_lld_adv_direct_adv_use_rpa_addr_state_get = 0x4000522c; +r_lld_init_evt_end_type_check_state_set = 0x40005238; +r_lld_init_evt_end_type_check_state_get = 0x40005244; + +/* bluetooth hook funcs */ +r_llc_loc_encrypt_proc_continue_hook = 0x40001c60; +r_llc_loc_phy_upd_proc_continue_hook = 0x40001c64; +r_llc_rem_phy_upd_proc_continue_hook = 0x40001c68; +r_lld_scan_frm_eof_isr_hook = 0x40001c6c; +r_lld_scan_evt_start_cbk_hook = 0x40001c70; +r_lld_scan_process_pkt_rx_ext_adv_hook = 0x40001c78; +r_lld_scan_sched_hook = 0x40001c7c; +r_lld_adv_evt_start_cbk_hook = 0x40001c84; +r_lld_adv_aux_evt_start_cbk_hook = 0x40001c88; +r_lld_adv_frm_isr_hook = 0x40001c8c; +r_lld_adv_start_init_evt_param_hook = 0x40001c90; +r_lld_con_evt_canceled_cbk_hook = 0x40001c94; +r_lld_con_frm_isr_hook = 0x40001c98; +r_lld_con_tx_hook = 0x40001c9c; +r_lld_con_rx_hook = 0x40001ca0; +r_lld_con_evt_start_cbk_hook = 0x40001ca4; +r_lld_con_tx_prog_new_packet_hook = 0x40001cac; +r_lld_init_frm_eof_isr_hook = 0x40001cb0; +r_lld_init_evt_start_cbk_hook = 0x40001cb4; +r_lld_init_sched_hook = 0x40001cbc; +r_lld_init_process_pkt_tx_hook = 0x40001cc0; +r_lld_per_adv_evt_start_cbk_hook = 0x40001cc4; +r_lld_per_adv_frm_isr_hook = 0x40001cc8; +r_lld_per_adv_start_hook = 0x40001ccc; +r_lld_sync_frm_eof_isr_hook = 0x40001cd0; +r_lld_sync_evt_start_cbk_hook = 0x40001cd4; +r_lld_sync_start_hook = 0x40001cd8; +r_lld_sync_process_pkt_rx_pkt_check_hook = 0x40001cdc; +r_sch_arb_insert_hook = 0x40001ce0; +r_sch_plan_offset_req_hook = 0x40001ce4; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld index 5c3caaee26e5..da107450e39e 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -799,825 +799,6 @@ rom_usb_osglue = 0x3fceffac; Group bluetooth ***************************************/ -/* Functions */ -bt_rf_coex_get_dft_cfg = 0x40002a78; -bt_rf_coex_hooks_p_set = 0x40002a84; -btdm_con_maxevtime_cal_impl = 0x40002a90; -btdm_controller_get_compile_version_impl = 0x40002a9c; -btdm_controller_rom_data_init = 0x40002aa8; -btdm_dis_privacy_err_report_impl = 0x40002ab4; -btdm_disable_adv_delay_impl = 0x40002ac0; -btdm_enable_scan_continue_impl = 0x40002acc; -btdm_enable_scan_forever_impl = 0x40002ad8; -btdm_get_power_state_impl = 0x40002ae4; -btdm_get_prevent_sleep_flag_impl = 0x40002af0; -btdm_power_state_active_impl = 0x40002afc; -btdm_switch_phy_coded_impl = 0x40002b08; -hci_acl_data_handler = 0x40002b14; -hci_disconnect_cmd_handler = 0x40002b20; -hci_le_con_upd_cmd_handler = 0x40002b2c; -hci_le_ltk_req_neg_reply_cmd_handler = 0x40002b38; -hci_le_ltk_req_reply_cmd_handler = 0x40002b44; -hci_le_rd_chnl_map_cmd_handler = 0x40002b50; -hci_le_rd_phy_cmd_handler = 0x40002b5c; -hci_le_rd_rem_feats_cmd_handler = 0x40002b68; -hci_le_rem_con_param_req_neg_reply_cmd_handler = 0x40002b74; -hci_le_rem_con_param_req_reply_cmd_handler = 0x40002b80; -hci_le_set_data_len_cmd_handler = 0x40002b8c; -hci_le_set_phy_cmd_handler = 0x40002b98; -hci_le_start_enc_cmd_handler = 0x40002ba4; -hci_rd_auth_payl_to_cmd_handler = 0x40002bb0; -hci_rd_rem_ver_info_cmd_handler = 0x40002bbc; -hci_rd_rssi_cmd_handler = 0x40002bc8; -hci_rd_tx_pwr_lvl_cmd_handler = 0x40002bd4; -hci_vs_set_pref_slave_evt_dur_cmd_handler = 0x40002be0; -hci_vs_set_pref_slave_latency_cmd_handler = 0x40002bec; -hci_wr_auth_payl_to_cmd_handler = 0x40002bf8; -ll_channel_map_ind_handler = 0x40002c04; -ll_connection_param_req_handler = 0x40002c10; -ll_connection_param_rsp_handler = 0x40002c1c; -ll_connection_update_ind_handler = 0x40002c28; -ll_enc_req_handler = 0x40002c34; -ll_enc_rsp_handler = 0x40002c40; -ll_feature_req_handler = 0x40002c4c; -ll_feature_rsp_handler = 0x40002c58; -ll_length_req_handler = 0x40002c64; -ll_length_rsp_handler = 0x40002c70; -ll_min_used_channels_ind_handler = 0x40002c7c; -ll_pause_enc_req_handler = 0x40002c88; -ll_pause_enc_rsp_handler = 0x40002c94; -ll_phy_req_handler = 0x40002ca0; -ll_phy_rsp_handler = 0x40002cac; -ll_phy_update_ind_handler = 0x40002cb8; -ll_ping_req_handler = 0x40002cc4; -ll_ping_rsp_handler = 0x40002cd0; -ll_slave_feature_req_handler = 0x40002cdc; -ll_start_enc_req_handler = 0x40002ce8; -ll_start_enc_rsp_handler = 0x40002cf4; -ll_terminate_ind_handler = 0x40002d00; -ll_version_ind_handler = 0x40002d0c; -llc_auth_payl_nearly_to_handler = 0x40002d18; -llc_auth_payl_real_to_handler = 0x40002d24; -llc_encrypt_ind_handler = 0x40002d30; -llc_hci_command_handler_wrapper = 0x40002d3c; -llc_ll_connection_param_req_pdu_send = 0x40002d48; -llc_ll_connection_param_rsp_pdu_send = 0x40002d54; -llc_ll_connection_update_ind_pdu_send = 0x40002d60; -llc_ll_enc_req_pdu_send = 0x40002d6c; -llc_ll_enc_rsp_pdu_send = 0x40002d78; -llc_ll_feature_req_pdu_send = 0x40002d84; -llc_ll_feature_rsp_pdu_send = 0x40002d90; -llc_ll_length_req_pdu_send = 0x40002d9c; -llc_ll_length_rsp_pdu_send = 0x40002da8; -llc_ll_pause_enc_req_pdu_send = 0x40002db4; -llc_ll_pause_enc_rsp_pdu_send = 0x40002dc0; -llc_ll_phy_req_pdu_send = 0x40002dcc; -llc_ll_phy_rsp_pdu_send = 0x40002dd8; -llc_ll_ping_req_pdu_send = 0x40002de4; -llc_ll_ping_rsp_pdu_send = 0x40002df0; -llc_ll_start_enc_req_pdu_send = 0x40002dfc; -llc_ll_start_enc_rsp_pdu_send = 0x40002e08; -llc_ll_terminate_ind_pdu_send = 0x40002e14; -llc_ll_unknown_rsp_pdu_send = 0x40002e20; -llc_llcp_ch_map_update_ind_pdu_send = 0x40002e2c; -llc_llcp_phy_upd_ind_pdu_send = 0x40002e38; -llc_llcp_version_ind_pdu_send = 0x40002e44; -llc_op_ch_map_upd_ind_handler = 0x40002e50; -llc_op_con_upd_ind_handler = 0x40002e5c; -llc_op_disconnect_ind_handler = 0x40002e68; -llc_op_dl_upd_ind_handler = 0x40002e74; -llc_op_encrypt_ind_handler = 0x40002e80; -llc_op_feats_exch_ind_handler = 0x40002e8c; -llc_op_le_ping_ind_handler = 0x40002e98; -llc_op_phy_upd_ind_handler = 0x40002ea4; -llc_op_ver_exch_ind_handler = 0x40002eb0; -llc_stopped_ind_handler = 0x40002ebc; -lld_acl_rx_ind_handler = 0x40002ec8; -lld_acl_tx_cfm_handler = 0x40002ed4; -lld_adv_end_ind_handler = 0x40002ee0; -lld_adv_rep_ind_handler = 0x40002eec; -lld_ch_map_upd_cfm_handler = 0x40002ef8; -lld_con_estab_ind_handler = 0x40002f04; -lld_con_evt_sd_evt_time_set = 0x40002f10; -lld_con_offset_upd_ind_handler = 0x40002f1c; -lld_con_param_upd_cfm_handler = 0x40002f28; -lld_disc_ind_handler = 0x40002f34; -lld_init_end_ind_handler = 0x40002f40; -lld_llcp_rx_ind_handler_wrapper = 0x40002f4c; -lld_llcp_tx_cfm_handler = 0x40002f58; -lld_per_adv_end_ind_handler = 0x40002f64; -lld_per_adv_rep_ind_handler = 0x40002f70; -lld_per_adv_rx_end_ind_handler = 0x40002f7c; -lld_phy_coded_500k_get = 0x40002f88; -lld_phy_upd_cfm_handler = 0x40002f94; -lld_scan_end_ind_handler = 0x40002fa0; -lld_scan_req_ind_handler = 0x40002fac; -lld_sync_start_req_handler = 0x40002fb8; -lld_test_end_ind_handler = 0x40002fc4; -lld_update_rxbuf_handler = 0x40002fd0; -llm_ch_map_update_ind_handler = 0x40002fdc; -llm_hci_command_handler_wrapper = 0x40002fe8; -llm_scan_period_to_handler = 0x40002ff4; -r_Add2SelfBigHex256 = 0x40003000; -r_AddBigHex256 = 0x4000300c; -r_AddBigHexModP256 = 0x40003018; -r_AddP256 = 0x40003024; -r_AddPdiv2_256 = 0x40003030; -r_GF_Jacobian_Point_Addition256 = 0x4000303c; -r_GF_Jacobian_Point_Double256 = 0x40003048; -r_GF_Point_Jacobian_To_Affine256 = 0x40003054; -r_MultiplyBigHexByUint32_256 = 0x40003060; -r_MultiplyBigHexModP256 = 0x4000306c; -r_MultiplyByU16ModP256 = 0x40003078; -r_SubtractBigHex256 = 0x40003084; -r_SubtractBigHexMod256 = 0x40003090; -r_SubtractBigHexUint32_256 = 0x4000309c; -r_SubtractFromSelfBigHex256 = 0x400030a8; -r_SubtractFromSelfBigHexSign256 = 0x400030b4; -r_aes_alloc = 0x400030c0; -r_aes_ccm_continue = 0x400030cc; -r_aes_ccm_process_e = 0x400030d8; -r_aes_ccm_xor_128_lsb = 0x400030e4; -r_aes_ccm_xor_128_msb = 0x400030f0; -r_aes_cmac_continue = 0x400030fc; -r_aes_cmac_start = 0x40003108; -r_aes_k1_continue = 0x40003114; -r_aes_k2_continue = 0x40003120; -r_aes_k3_continue = 0x4000312c; -r_aes_k4_continue = 0x40003138; -r_aes_shift_left_128 = 0x40003144; -r_aes_start = 0x40003150; -r_aes_xor_128 = 0x4000315c; -r_assert_err = 0x40003168; -r_assert_param = 0x40003174; -r_assert_warn = 0x40003180; -r_bigHexInversion256 = 0x4000318c; -r_ble_sw_cca_check_isr = 0x40003198; -r_ble_util_buf_acl_tx_alloc = 0x400031a4; -r_ble_util_buf_acl_tx_elt_get = 0x400031b0; -r_ble_util_buf_acl_tx_free = 0x400031bc; -r_ble_util_buf_acl_tx_free_in_isr = 0x400031c8; -r_ble_util_buf_adv_tx_alloc = 0x400031d4; -r_ble_util_buf_adv_tx_free = 0x400031e0; -r_ble_util_buf_adv_tx_free_in_isr = 0x400031ec; -r_ble_util_buf_env_deinit = 0x400031f8; -r_ble_util_buf_env_init = 0x40003204; -r_ble_util_buf_get_rx_buf_nb = 0x40003210; -r_ble_util_buf_get_rx_buf_size = 0x4000321c; -r_ble_util_buf_llcp_tx_alloc = 0x40003228; -r_ble_util_buf_llcp_tx_free = 0x40003234; -r_ble_util_buf_rx_alloc = 0x40003240; -r_ble_util_buf_rx_alloc_in_isr = 0x4000324c; -r_ble_util_buf_rx_free = 0x40003258; -r_ble_util_buf_rx_free_in_isr = 0x40003264; -r_ble_util_buf_set_rx_buf_nb = 0x40003270; -r_ble_util_buf_set_rx_buf_size = 0x4000327c; -r_ble_util_data_rx_buf_reset = 0x40003288; -r_bt_bb_get_intr_mask = 0x40003294; -r_bt_bb_intr_clear = 0x400032a0; -r_bt_bb_intr_mask_set = 0x400032ac; -r_bt_rf_coex_cfg_set = 0x400032c4; -r_bt_rf_coex_conn_dynamic_pti_en_get = 0x400032d0; -r_bt_rf_coex_ext_adv_dynamic_pti_en_get = 0x400032e8; -r_bt_rf_coex_ext_scan_dynamic_pti_en_get = 0x400032f4; -r_bt_rf_coex_legacy_adv_dynamic_pti_en_get = 0x40003300; -r_bt_rf_coex_per_adv_dynamic_pti_en_get = 0x4000330c; -r_bt_rf_coex_pti_table_get = 0x40003318; -r_bt_rf_coex_st_param_get = 0x40003324; -r_bt_rf_coex_st_param_set = 0x40003330; -r_bt_rf_coex_sync_scan_dynamic_pti_en_get = 0x4000333c; -r_bt_rma_apply_rule_cs_fmt = 0x40003348; -r_bt_rma_apply_rule_cs_idx = 0x40003354; -r_bt_rma_configure = 0x40003360; -r_bt_rma_deregister_rule_cs_fmt = 0x4000336c; -r_bt_rma_deregister_rule_cs_idx = 0x40003378; -r_bt_rma_get_ant_by_act = 0x40003384; -r_bt_rma_init = 0x40003390; -r_bt_rma_register_rule_cs_fmt = 0x4000339c; -r_bt_rma_register_rule_cs_idx = 0x400033a8; -r_bt_rtp_apply_rule_cs_fmt = 0x400033b4; -r_bt_rtp_apply_rule_cs_idx = 0x400033c0; -r_bt_rtp_deregister_rule_cs_fmt = 0x400033cc; -r_bt_rtp_deregister_rule_cs_idx = 0x400033d8; -r_bt_rtp_init = 0x400033f0; -r_bt_rtp_register_rule_cs_fmt = 0x400033fc; -r_bt_rtp_register_rule_cs_idx = 0x40003408; -r_btdm_isr = 0x40003414; -r_cali_phase_match_p = 0x40003444; -r_cmp_abs_time = 0x40003450; -r_cmp_dest_id = 0x4000345c; -r_cmp_timer_id = 0x40003468; -r_co_bdaddr_compare = 0x40003474; -r_co_ble_pkt_dur_in_us = 0x40003480; -r_co_list_extract = 0x4000348c; -r_co_list_extract_after = 0x40003498; -r_co_list_extract_sublist = 0x400034a4; -r_co_list_find = 0x400034b0; -r_co_list_init = 0x400034bc; -r_co_list_insert_after = 0x400034c8; -r_co_list_insert_before = 0x400034d4; -r_co_list_merge = 0x400034e0; -r_co_list_pool_init = 0x400034ec; -r_co_list_pop_front = 0x400034f8; -r_co_list_push_back = 0x40003504; -r_co_list_push_back_sublist = 0x40003510; -r_co_list_push_front = 0x4000351c; -r_co_list_size = 0x40003528; -r_co_nb_good_le_channels = 0x40003534; -r_co_util_pack = 0x40003540; -r_co_util_read_array_size = 0x4000354c; -r_co_util_unpack = 0x40003558; -r_dbg_env_deinit = 0x40003564; -r_dbg_env_init = 0x40003570; -r_dbg_platform_reset_complete = 0x4000357c; -r_dl_upd_proc_start = 0x40003588; -r_dump_data = 0x40003594; -r_ecc_abort_key256_generation = 0x400035a0; -r_ecc_gen_new_public_key = 0x400035ac; -r_ecc_gen_new_secret_key = 0x400035b8; -r_ecc_generate_key256 = 0x400035c4; -r_ecc_get_debug_Keys = 0x400035d0; -r_ecc_init = 0x400035dc; -r_ecc_is_valid_point = 0x400035e8; -r_ecc_multiplication_event_handler = 0x400035f4; -r_ecc_point_multiplication_win_256 = 0x40003600; -r_emi_alloc_em_mapping_by_offset = 0x4000360c; -r_emi_base_reg_lut_show = 0x40003618; -r_emi_em_base_reg_show = 0x40003624; -r_emi_free_em_mapping_by_offset = 0x40003630; -r_emi_get_em_mapping_idx_by_offset = 0x4000363c; -r_emi_get_mem_addr_by_offset = 0x40003648; -r_emi_overwrite_em_mapping_by_offset = 0x40003654; -r_esp_vendor_hci_command_handler = 0x40003660; -r_get_stack_usage = 0x4000366c; -r_h4tl_acl_hdr_rx_evt_handler = 0x40003678; -r_h4tl_cmd_hdr_rx_evt_handler = 0x40003684; -r_h4tl_cmd_pld_rx_evt_handler = 0x40003690; -r_h4tl_eif_io_event_post = 0x4000369c; -r_h4tl_eif_register = 0x400036a8; -r_h4tl_init = 0x400036b4; -r_h4tl_out_of_sync = 0x400036c0; -r_h4tl_out_of_sync_check = 0x400036cc; -r_h4tl_read_hdr = 0x400036d8; -r_h4tl_read_next_out_of_sync = 0x400036e4; -r_h4tl_read_payl = 0x400036f0; -r_h4tl_read_start = 0x400036fc; -r_h4tl_rx_acl_hdr_extract = 0x40003708; -r_h4tl_rx_cmd_hdr_extract = 0x40003714; -r_h4tl_rx_done = 0x40003720; -r_h4tl_start = 0x4000372c; -r_h4tl_stop = 0x40003738; -r_h4tl_tx_done = 0x40003744; -r_h4tl_tx_evt_handler = 0x40003750; -r_h4tl_write = 0x4000375c; -r_hci_acl_tx_data_alloc = 0x40003768; -r_hci_acl_tx_data_received = 0x40003774; -r_hci_basic_cmd_send_2_controller = 0x40003780; -r_hci_ble_adv_report_filter_check = 0x4000378c; -r_hci_ble_adv_report_tx_check = 0x40003798; -r_hci_ble_conhdl_register = 0x400037a4; -r_hci_ble_conhdl_unregister = 0x400037b0; -r_hci_build_acl_data = 0x400037bc; -r_hci_build_cc_evt = 0x400037c8; -r_hci_build_cs_evt = 0x400037d4; -r_hci_build_evt = 0x400037e0; -r_hci_build_le_evt = 0x400037ec; -r_hci_cmd_get_max_param_size = 0x400037f8; -r_hci_cmd_received = 0x40003804; -r_hci_cmd_reject = 0x40003810; -r_hci_evt_mask_check = 0x4000381c; -r_hci_evt_mask_set = 0x40003828; -r_hci_fc_acl_buf_size_set = 0x40003834; -r_hci_fc_acl_en = 0x40003840; -r_hci_fc_acl_packet_sent = 0x4000384c; -r_hci_fc_check_host_available_nb_acl_packets = 0x40003858; -r_hci_fc_host_nb_acl_pkts_complete = 0x40003864; -r_hci_fc_init = 0x40003870; -r_hci_look_for_cmd_desc = 0x4000387c; -r_hci_look_for_evt_desc = 0x40003888; -r_hci_look_for_le_evt_desc = 0x40003894; -r_hci_look_for_le_evt_desc_esp = 0x400038a0; -r_hci_pack_bytes = 0x400038ac; -r_hci_send_2_controller = 0x400038c4; -r_hci_send_2_host = 0x400038d0; -r_hci_tl_c2h_data_flow_on = 0x400038dc; -r_hci_tl_cmd_hdr_rx_evt_handler = 0x400038e8; -r_hci_tl_cmd_pld_rx_evt_handler = 0x400038f4; -r_hci_tl_get_pkt = 0x40003900; -r_hci_tl_hci_pkt_handler = 0x4000390c; -r_hci_tl_hci_tx_done_evt_handler = 0x40003918; -r_hci_tl_inc_nb_h2c_cmd_pkts = 0x40003924; -r_hci_tl_save_pkt = 0x40003930; -r_hci_tl_send = 0x4000393c; -r_hci_tx_done = 0x40003948; -r_hci_tx_start = 0x40003954; -r_hci_tx_trigger = 0x40003960; -r_isValidSecretKey_256 = 0x4000396c; -r_ke_check_malloc = 0x40003978; -r_ke_event_callback_set = 0x40003984; -r_ke_event_clear = 0x40003990; -r_ke_event_flush = 0x4000399c; -r_ke_event_get = 0x400039a8; -r_ke_event_get_all = 0x400039b4; -r_ke_event_init = 0x400039c0; -r_ke_event_schedule = 0x400039cc; -r_ke_event_set = 0x400039d8; -r_ke_flush = 0x400039e4; -r_ke_free = 0x400039f0; -r_ke_handler_search = 0x400039fc; -r_ke_init = 0x40003a08; -r_ke_is_free = 0x40003a14; -r_ke_malloc = 0x40003a20; -r_ke_mem_init = 0x40003a2c; -r_ke_mem_is_empty = 0x40003a38; -r_ke_mem_is_in_heap = 0x40003a44; -r_ke_msg_alloc = 0x40003a50; -r_ke_msg_dest_id_get = 0x40003a5c; -r_ke_msg_discard = 0x40003a68; -r_ke_msg_forward = 0x40003a74; -r_ke_msg_forward_new_id = 0x40003a80; -r_ke_msg_free = 0x40003a8c; -r_ke_msg_in_queue = 0x40003a98; -r_ke_msg_save = 0x40003aa4; -r_ke_msg_send = 0x40003ab0; -r_ke_msg_send_basic = 0x40003abc; -r_ke_msg_src_id_get = 0x40003ac8; -r_ke_queue_extract = 0x40003ad4; -r_ke_queue_insert = 0x40003ae0; -r_ke_sleep_check = 0x40003aec; -r_ke_state_get = 0x40003af8; -r_ke_state_set = 0x40003b04; -r_ke_task_check = 0x40003b10; -r_ke_task_create = 0x40003b1c; -r_ke_task_delete = 0x40003b28; -r_ke_task_handler_get = 0x40003b34; -r_ke_task_init = 0x40003b40; -r_ke_task_msg_flush = 0x40003b4c; -r_ke_task_saved_update = 0x40003b58; -r_ke_time = 0x40003b70; -r_ke_time_cmp = 0x40003b7c; -r_ke_time_past = 0x40003b88; -r_ke_timer_active = 0x40003b94; -r_ke_timer_adjust_all = 0x40003ba0; -r_ke_timer_clear = 0x40003bac; -r_ke_timer_init = 0x40003bb8; -r_ke_timer_schedule = 0x40003bc4; -r_ke_timer_set = 0x40003bd0; -r_led_init = 0x40003bdc; -r_led_set_all = 0x40003be8; -r_llc_aes_res_cb = 0x40003bf4; -r_llc_ch_map_up_proc_err_cb = 0x40003c00; -r_llc_cleanup = 0x40003c0c; -r_llc_cmd_cmp_send = 0x40003c18; -r_llc_cmd_stat_send = 0x40003c24; -r_llc_con_move_cbk = 0x40003c30; -r_llc_con_plan_set_update = 0x40003c3c; -r_llc_con_upd_param_in_range = 0x40003c48; -r_llc_disconnect = 0x40003c54; -r_llc_disconnect_end = 0x40003c60; -r_llc_disconnect_proc_continue = 0x40003c6c; -r_llc_disconnect_proc_err_cb = 0x40003c78; -r_llc_dl_chg_check = 0x40003c84; -r_llc_dle_proc_err_cb = 0x40003c90; -r_llc_feats_exch_proc_err_cb = 0x40003c9c; -r_llc_hci_cmd_handler_tab_p_get = 0x40003ca8; -r_llc_hci_con_param_req_evt_send = 0x40003cc0; -r_llc_hci_con_upd_info_send = 0x40003ccc; -r_llc_hci_disconnected_dis = 0x40003cd8; -r_llc_hci_dl_upd_info_send = 0x40003ce4; -r_llc_hci_enc_evt_send = 0x40003cf0; -r_llc_hci_feats_info_send = 0x40003cfc; -r_llc_hci_le_phy_upd_cmp_evt_send = 0x40003d08; -r_llc_hci_ltk_request_evt_send = 0x40003d14; -r_llc_hci_nb_cmp_pkts_evt_send = 0x40003d20; -r_llc_hci_version_info_send = 0x40003d2c; -r_llc_init_term_proc = 0x40003d38; -r_llc_iv_skd_rand_gen = 0x40003d44; -r_llc_le_ping_proc_continue = 0x40003d50; -r_llc_le_ping_proc_err_cb = 0x40003d5c; -/* r_llc_le_ping_restart = 0x40003d68; */ -r_llc_le_ping_set = 0x40003d74; -r_llc_ll_pause_enc_rsp_ack_handler = 0x40003d80; -r_llc_ll_reject_ind_ack_handler = 0x40003d8c; -r_llc_ll_reject_ind_pdu_send = 0x40003d98; -r_llc_ll_start_enc_rsp_ack_handler = 0x40003da4; -r_llc_ll_terminate_ind_ack = 0x40003db0; -r_llc_ll_unknown_ind_handler = 0x40003dbc; -r_llc_llcp_send = 0x40003dc8; -r_llc_llcp_state_set = 0x40003dd4; -r_llc_llcp_trans_timer_set = 0x40003de0; -r_llc_llcp_tx_check = 0x40003dec; -/* r_llc_loc_ch_map_proc_continue = 0x40003df8; */ -r_llc_loc_con_upd_proc_err_cb = 0x40003e10; -r_llc_loc_dl_upd_proc_continue = 0x40003e1c; -r_llc_loc_encrypt_proc_continue = 0x40003e28; -r_llc_loc_encrypt_proc_err_cb = 0x40003e34; -r_llc_loc_feats_exch_proc_continue = 0x40003e40; -r_llc_loc_phy_upd_proc_err_cb = 0x40003e58; -r_llc_msg_handler_tab_p_get = 0x40003e64; -r_llc_pref_param_compute = 0x40003e70; -r_llc_proc_collision_check = 0x40003e7c; -r_llc_proc_err_ind = 0x40003e88; -r_llc_proc_get = 0x40003e94; -r_llc_proc_id_get = 0x40003ea0; -r_llc_proc_reg = 0x40003eac; -r_llc_proc_state_get = 0x40003eb8; -r_llc_proc_state_set = 0x40003ec4; -r_llc_proc_timer_pause_set = 0x40003ed0; -r_llc_proc_timer_set = 0x40003edc; -r_llc_proc_unreg = 0x40003ee8; -r_llc_rem_ch_map_proc_continue = 0x40003ef4; -r_llc_rem_con_upd_proc_err_cb = 0x40003f0c; -r_llc_rem_dl_upd_proc = 0x40003f18; -r_llc_rem_encrypt_proc_continue = 0x40003f24; -r_llc_rem_encrypt_proc_err_cb = 0x40003f30; -r_llc_rem_phy_upd_proc_continue = 0x40003f3c; -r_llc_rem_phy_upd_proc_err_cb = 0x40003f48; -r_llc_role_get = 0x40003f54; -r_llc_sk_gen = 0x40003f60; -r_llc_start = 0x40003f6c; -r_llc_stop = 0x40003f78; -r_llc_ver_exch_loc_proc_continue = 0x40003f84; -r_llc_ver_proc_err_cb = 0x40003f90; -r_llcp_pdu_handler_tab_p_get = 0x40003f9c; -r_lld_aa_gen = 0x40003fa8; -r_lld_adv_adv_data_set = 0x40003fb4; -r_lld_adv_adv_data_update = 0x40003fc0; -r_lld_adv_aux_ch_idx_set = 0x40003fcc; -r_lld_adv_aux_evt_canceled_cbk = 0x40003fd8; -r_lld_adv_aux_evt_start_cbk = 0x40003fe4; -r_lld_adv_coex_check_ext_adv_synced = 0x40003ff0; -r_lld_adv_coex_env_reset = 0x40003ffc; -r_lld_adv_duration_update = 0x40004008; -r_lld_adv_dynamic_pti_process = 0x40004014; -r_lld_adv_end = 0x40004020; -r_lld_adv_evt_canceled_cbk = 0x4000402c; -r_lld_adv_evt_start_cbk = 0x40004038; -r_lld_adv_ext_chain_construct = 0x40004044; -r_lld_adv_ext_pkt_prepare = 0x40004050; -r_lld_adv_frm_cbk = 0x4000405c; -r_lld_adv_frm_isr = 0x40004068; -r_lld_adv_frm_skip_isr = 0x40004074; -r_lld_adv_init = 0x40004080; -r_lld_adv_pkt_rx = 0x4000408c; -r_lld_adv_pkt_rx_connect_ind = 0x40004098; -r_lld_adv_pkt_rx_send_scan_req_evt = 0x400040a4; -r_lld_adv_rand_addr_update = 0x400040b0; -r_lld_adv_restart = 0x400040bc; -r_lld_adv_scan_rsp_data_set = 0x400040c8; -r_lld_adv_scan_rsp_data_update = 0x400040d4; -r_lld_adv_set_tx_power = 0x400040e0; -r_lld_adv_start = 0x400040ec; -r_lld_adv_stop = 0x400040f8; -r_lld_adv_sync_info_set = 0x40004104; -r_lld_adv_sync_info_update = 0x40004110; -r_lld_calc_aux_rx = 0x4000411c; -r_lld_cca_alloc = 0x40004128; -r_lld_cca_data_reset = 0x40004134; -r_lld_cca_free = 0x40004140; -r_lld_ch_assess_data_get = 0x4000414c; -r_lld_ch_idx_get = 0x40004158; -r_lld_ch_map_set = 0x40004164; -r_lld_channel_assess = 0x40004170; -r_lld_con_activity_act_offset_compute = 0x4000417c; -r_lld_con_activity_offset_compute = 0x40004188; -r_lld_con_ch_map_update = 0x40004194; -r_lld_con_cleanup = 0x400041a0; -r_lld_con_current_tx_power_get = 0x400041ac; -r_lld_con_data_flow_set = 0x400041b8; -r_lld_con_data_len_update = 0x400041c4; -r_lld_con_data_tx = 0x400041d0; -r_lld_con_enc_key_load = 0x400041dc; -r_lld_con_event_counter_get = 0x400041e8; -r_lld_con_evt_canceled_cbk = 0x400041f4; -r_lld_con_evt_duration_min_get = 0x40004200; -r_lld_con_evt_max_eff_time_cal = 0x4000420c; -r_lld_con_evt_sd_evt_time_get = 0x40004218; -r_lld_con_evt_start_cbk = 0x40004224; -r_lld_con_evt_time_update = 0x40004230; -r_lld_con_free_all_tx_buf = 0x4000423c; -r_lld_con_frm_cbk = 0x40004248; -r_lld_con_frm_isr = 0x40004254; -r_lld_con_frm_skip_isr = 0x40004260; -r_lld_con_init = 0x4000426c; -r_lld_con_llcp_tx = 0x40004278; -r_lld_con_max_lat_calc = 0x40004284; -r_lld_con_offset_get = 0x40004290; -r_lld_con_param_update = 0x4000429c; -r_lld_con_phys_update = 0x400042a8; -r_lld_con_pref_slave_evt_dur_set = 0x400042b4; -r_lld_con_pref_slave_latency_set = 0x400042c0; -r_lld_con_rssi_get = 0x400042cc; -r_lld_con_rx = 0x400042d8; -/* r_lld_con_rx_channel_assess = 0x400042e4; */ -r_lld_con_rx_enc = 0x400042f0; -r_lld_con_rx_isr = 0x400042fc; -r_lld_con_rx_link_info_check = 0x40004308; -r_lld_con_rx_llcp_check = 0x40004314; -r_lld_con_rx_sync_time_update = 0x40004320; -r_lld_con_set_tx_power = 0x40004338; -r_lld_con_start = 0x40004344; -r_lld_con_tx = 0x4000435c; -r_lld_con_tx_enc = 0x40004368; -r_lld_con_tx_isr = 0x40004374; -r_lld_con_tx_len_update = 0x40004380; -r_lld_con_tx_len_update_for_intv = 0x4000438c; -r_lld_con_tx_len_update_for_rate = 0x40004398; -r_lld_con_tx_prog = 0x400043a4; -r_lld_conn_dynamic_pti_process = 0x400043b0; -r_lld_continue_scan_rx_isr_end_process = 0x400043bc; -r_lld_ext_scan_dynamic_pti_process = 0x400043c8; -r_lld_hw_cca_end_isr = 0x400043d4; -r_lld_hw_cca_evt_handler = 0x400043e0; -r_lld_hw_cca_isr = 0x400043ec; -r_lld_init_cal_anchor_point = 0x400043f8; -r_lld_init_compute_winoffset = 0x40004404; -r_lld_init_connect_req_pack = 0x40004410; -r_lld_init_end = 0x4000441c; -r_lld_init_evt_canceled_cbk = 0x40004428; -r_lld_init_evt_start_cbk = 0x40004434; -r_lld_init_frm_cbk = 0x40004440; -r_lld_init_frm_eof_isr = 0x4000444c; -r_lld_init_frm_skip_isr = 0x40004458; -r_lld_init_init = 0x40004464; -r_lld_init_process_pkt_rx = 0x40004470; -r_lld_init_process_pkt_rx_adv_ext_ind = 0x4000447c; -r_lld_init_process_pkt_rx_adv_ind_or_direct_ind = 0x40004488; -r_lld_init_process_pkt_rx_aux_connect_rsp = 0x40004494; -r_lld_init_process_pkt_tx = 0x400044a0; -r_lld_init_process_pkt_tx_cal_con_timestamp = 0x400044ac; -r_lld_init_sched = 0x400044b8; -r_lld_init_set_tx_power = 0x400044c4; -r_lld_init_start = 0x400044d0; -r_lld_init_stop = 0x400044dc; -r_lld_instant_proc_end = 0x400044e8; -r_lld_per_adv_ch_map_update = 0x40004500; -r_lld_per_adv_chain_construct = 0x4000450c; -r_lld_per_adv_cleanup = 0x40004518; -r_lld_per_adv_coex_env_reset = 0x40004524; -r_lld_per_adv_data_set = 0x40004530; -r_lld_per_adv_data_update = 0x4000453c; -r_lld_per_adv_dynamic_pti_process = 0x40004548; -r_lld_per_adv_evt_canceled_cbk = 0x40004554; -r_lld_per_adv_evt_start_cbk = 0x40004560; -r_lld_per_adv_ext_pkt_prepare = 0x4000456c; -r_lld_per_adv_frm_cbk = 0x40004578; -r_lld_per_adv_frm_isr = 0x40004584; -r_lld_per_adv_frm_skip_isr = 0x40004590; -r_lld_per_adv_init = 0x4000459c; -r_lld_per_adv_init_info_get = 0x400045a8; -r_lld_per_adv_list_add = 0x400045b4; -r_lld_per_adv_list_rem = 0x400045c0; -r_lld_per_adv_set_tx_power = 0x400045d8; -r_lld_per_adv_start = 0x400045e4; -r_lld_per_adv_stop = 0x400045f0; -r_lld_per_adv_sync_info_get = 0x400045fc; -r_lld_process_cca_data = 0x40004608; -r_lld_ral_search = 0x40004614; -r_lld_read_clock = 0x40004620; -r_lld_res_list_add = 0x4000462c; -r_lld_res_list_is_empty = 0x40004644; -r_lld_res_list_local_rpa_get = 0x40004650; -r_lld_res_list_peer_rpa_get = 0x4000465c; -r_lld_res_list_peer_update = 0x40004668; -/* r_lld_res_list_priv_mode_update = 0x40004674; */ -r_lld_reset_reg = 0x4000468c; -r_lld_rpa_renew = 0x40004698; -r_lld_rpa_renew_evt_canceled_cbk = 0x400046a4; -r_lld_rpa_renew_evt_start_cbk = 0x400046b0; -r_lld_rpa_renew_instant_cbk = 0x400046bc; -r_lld_rxdesc_check = 0x400046c8; -r_lld_rxdesc_free = 0x400046d4; -r_lld_scan_create_sync = 0x400046e0; -r_lld_scan_create_sync_cancel = 0x400046ec; -r_lld_scan_end = 0x400046f8; -r_lld_scan_evt_canceled_cbk = 0x40004704; -r_lld_scan_evt_start_cbk = 0x40004710; -r_lld_scan_frm_cbk = 0x4000471c; -r_lld_scan_frm_eof_isr = 0x40004728; -r_lld_scan_frm_rx_isr = 0x40004734; -r_lld_scan_frm_skip_isr = 0x40004740; -r_lld_scan_init = 0x4000474c; -r_lld_scan_params_update = 0x40004758; -r_lld_scan_process_pkt_rx_aux_adv_ind = 0x4000477c; -r_lld_scan_process_pkt_rx_aux_chain_ind = 0x40004788; -r_lld_scan_process_pkt_rx_aux_scan_rsp = 0x40004794; -r_lld_scan_process_pkt_rx_ext_adv = 0x400047a0; -r_lld_scan_process_pkt_rx_ext_adv_ind = 0x400047ac; -r_lld_scan_process_pkt_rx_legacy_adv = 0x400047b8; -r_lld_scan_restart = 0x400047c4; -r_lld_scan_sched = 0x400047d0; -r_lld_scan_set_tx_power = 0x400047dc; -r_lld_scan_start = 0x400047e8; -r_lld_scan_stop = 0x400047f4; -r_lld_scan_sync_accept = 0x40004800; -r_lld_scan_sync_info_unpack = 0x4000480c; -r_lld_scan_trunc_ind = 0x40004818; -r_lld_sw_cca_evt_handler = 0x40004824; -r_lld_sw_cca_isr = 0x40004830; -r_lld_sync_ch_map_update = 0x4000483c; -r_lld_sync_cleanup = 0x40004848; -r_lld_sync_evt_canceled_cbk = 0x40004854; -r_lld_sync_evt_start_cbk = 0x40004860; -r_lld_sync_frm_cbk = 0x4000486c; -r_lld_sync_frm_eof_isr = 0x40004878; -r_lld_sync_frm_rx_isr = 0x40004884; -r_lld_sync_frm_skip_isr = 0x40004890; -r_lld_sync_init = 0x4000489c; -r_lld_sync_process_pkt_rx = 0x400048a8; -r_lld_sync_process_pkt_rx_aux_sync_ind = 0x400048b4; -r_lld_sync_process_pkt_rx_pkt_check = 0x400048c0; -r_lld_sync_scan_dynamic_pti_process = 0x400048cc; -r_lld_sync_sched = 0x400048d8; -r_lld_sync_start = 0x400048e4; -r_lld_sync_stop = 0x400048f0; -r_lld_sync_trunc_ind = 0x400048fc; -r_lld_test_cleanup = 0x40004908; -r_lld_test_evt_canceled_cbk = 0x40004914; -r_lld_test_evt_start_cbk = 0x40004920; -r_lld_test_freq2chnl = 0x4000492c; -r_lld_test_frm_cbk = 0x40004938; -r_lld_test_frm_isr = 0x40004944; -r_lld_test_init = 0x40004950; -r_lld_test_rx_isr = 0x4000495c; -r_lld_test_set_tx_power = 0x40004968; -r_lld_test_start = 0x40004974; -/* r_lld_test_stop = 0x40004980;*/ -r_lld_update_rxbuf = 0x4000498c; -r_lld_update_rxbuf_isr = 0x40004998; -r_lld_white_list_add = 0x400049a4; -r_lld_white_list_rem = 0x400049b0; -r_llm_activity_free_get = 0x400049bc; -r_llm_activity_free_set = 0x400049c8; -r_llm_activity_syncing_get = 0x400049d4; -r_llm_adv_con_len_check = 0x400049e0; -r_llm_adv_hdl_to_id = 0x400049ec; -r_llm_adv_rep_flow_control_check = 0x400049f8; -r_llm_adv_rep_flow_control_update = 0x40004a04; -r_llm_adv_reports_list_check = 0x40004a10; -r_llm_adv_set_all_release = 0x40004a1c; -r_llm_adv_set_dft_params = 0x40004a28; -r_llm_adv_set_release = 0x40004a34; -r_llm_aes_res_cb = 0x40004a40; -r_llm_ble_update_adv_flow_control = 0x40004a4c; -r_llm_ch_map_update = 0x40004a58; -r_llm_cmd_cmp_send = 0x40004a64; -r_llm_cmd_stat_send = 0x40004a70; -r_llm_dev_list_empty_entry = 0x40004a7c; -r_llm_dev_list_search = 0x40004a88; -r_llm_env_adv_dup_filt_deinit = 0x40004a94; -r_llm_env_adv_dup_filt_init = 0x40004aa0; -r_llm_init_ble_adv_report_flow_contol = 0x40004aac; -r_llm_is_dev_connected = 0x40004ab8; -r_llm_is_dev_synced = 0x40004ac4; -r_llm_is_non_con_act_ongoing_check = 0x40004ad0; -r_llm_is_wl_accessible = 0x40004adc; -r_llm_le_evt_mask_check = 0x40004ae8; -r_llm_link_disc = 0x40004b00; -r_llm_master_ch_map_get = 0x40004b0c; -r_llm_msg_handler_tab_p_get = 0x40004b18; -r_llm_no_activity = 0x40004b24; -r_llm_per_adv_slot_dur = 0x40004b30; -r_llm_plan_elt_get = 0x40004b3c; -r_llm_rx_path_comp_get = 0x40004b48; -r_llm_scan_start = 0x40004b54; -r_llm_scan_sync_acad_attach = 0x40004b60; -r_llm_scan_sync_acad_detach = 0x40004b6c; -r_llm_send_adv_lost_event_to_host = 0x40004b78; -r_llm_tx_path_comp_get = 0x40004b84; -r_misc_deinit = 0x40004b90; -r_misc_free_em_buf_in_isr = 0x40004b9c; -r_misc_init = 0x40004ba8; -r_misc_msg_handler_tab_p_get = 0x40004bb4; -r_notEqual256 = 0x40004bc0; -r_phy_upd_proc_start = 0x40004bcc; -r_platform_reset = 0x40004bd8; -r_rf_em_init = 0x40004bf0; -r_rf_force_agc_enable = 0x40004bfc; -r_rf_reg_rd = 0x40004c08; -r_rf_reg_wr = 0x40004c14; -r_rf_reset = 0x40004c20; -r_rf_rssi_convert = 0x40004c2c; -r_rf_rw_v9_le_disable = 0x40004c38; -r_rf_rw_v9_le_enable = 0x40004c44; -r_rf_sleep = 0x40004c50; -r_rf_util_cs_fmt_convert = 0x40004c74; -r_rw_crypto_aes_ccm = 0x40004c80; -r_rw_crypto_aes_encrypt = 0x40004c8c; -r_rw_crypto_aes_init = 0x40004c98; -r_rw_crypto_aes_k1 = 0x40004ca4; -r_rw_crypto_aes_k2 = 0x40004cb0; -r_rw_crypto_aes_k3 = 0x40004cbc; -r_rw_crypto_aes_k4 = 0x40004cc8; -r_rw_crypto_aes_rand = 0x40004cd4; -r_rw_crypto_aes_result_handler = 0x40004ce0; -r_rw_crypto_aes_s1 = 0x40004cec; -r_rw_cryto_aes_cmac = 0x40004cf8; -r_rw_v9_init_em_radio_table = 0x40004d04; -r_rwble_sleep_enter = 0x40004d1c; -r_rwble_sleep_wakeup_end = 0x40004d28; -/* r_rwbtdm_isr_wrapper = 0x40004d34; */ -r_rwip_active_check = 0x40004d40; -r_rwip_aes_encrypt = 0x40004d4c; -/* r_rwip_assert = 0x40004d58; */ -r_rwip_crypt_evt_handler = 0x40004d64; -r_rwip_crypt_isr_handler = 0x40004d70; -r_rwip_eif_get = 0x40004d7c; -r_rwip_half_slot_2_lpcycles = 0x40004d88; -r_rwip_hus_2_lpcycles = 0x40004d94; -r_rwip_isr = 0x40004da0; -r_rwip_lpcycles_2_hus = 0x40004dac; -r_rwip_prevent_sleep_clear = 0x40004db8; -r_rwip_prevent_sleep_set = 0x40004dc4; -r_rwip_schedule = 0x40004dd0; -r_rwip_sleep = 0x40004ddc; -r_rwip_sw_int_handler = 0x40004de8; -r_rwip_sw_int_req = 0x40004df4; -r_rwip_time_get = 0x40004e00; -r_rwip_timer_10ms_handler = 0x40004e0c; -r_rwip_timer_10ms_set = 0x40004e18; -r_rwip_timer_hs_handler = 0x40004e24; -r_rwip_timer_hs_set = 0x40004e30; -r_rwip_timer_hus_handler = 0x40004e3c; -r_rwip_timer_hus_set = 0x40004e48; -r_rwip_wakeup = 0x40004e54; -/* r_rwip_wakeup_end = 0x40004e60; */ -r_rwip_wlcoex_set = 0x40004e6c; -r_sch_alarm_clear = 0x40004e78; -r_sch_alarm_init = 0x40004e84; -r_sch_alarm_prog = 0x40004e90; -r_sch_alarm_set = 0x40004e9c; -r_sch_alarm_timer_isr = 0x40004ea8; -r_sch_arb_conflict_check = 0x40004eb4; -r_sch_arb_elt_cancel = 0x40004ec0; -r_sch_arb_init = 0x40004ed8; -r_sch_arb_insert = 0x40004ee4; -r_sch_arb_prog_timer = 0x40004ef0; -r_sch_arb_remove = 0x40004efc; -r_sch_arb_sw_isr = 0x40004f08; -r_sch_plan_chk = 0x40004f14; -r_sch_plan_clock_wrap_offset_update = 0x40004f20; -r_sch_plan_init = 0x40004f2c; -r_sch_plan_interval_req = 0x40004f38; -r_sch_plan_offset_max_calc = 0x40004f44; -r_sch_plan_offset_req = 0x40004f50; -r_sch_plan_position_range_compute = 0x40004f5c; -r_sch_plan_rem = 0x40004f68; -r_sch_plan_req = 0x40004f74; -r_sch_prog_init = 0x40004f98; -r_sch_prog_push = 0x40004fa4; -r_sch_prog_rx_isr = 0x40004fb0; -r_sch_prog_skip_isr = 0x40004fbc; -r_sch_prog_tx_isr = 0x40004fc8; -r_sch_slice_bg_add = 0x40004fd4; -r_sch_slice_bg_remove = 0x40004fe0; -r_sch_slice_compute = 0x40004fec; -r_sch_slice_fg_add = 0x40004ff8; -r_sch_slice_fg_remove = 0x40005004; -r_sch_slice_init = 0x40005010; -r_sch_slice_per_add = 0x4000501c; -r_sch_slice_per_remove = 0x40005028; -r_sdk_config_get_bt_sleep_enable = 0x40005034; -r_sdk_config_get_hl_derived_opts = 0x40005040; -r_sdk_config_get_opts = 0x4000504c; -r_sdk_config_get_priv_opts = 0x40005058; -r_sdk_config_set_bt_sleep_enable = 0x40005064; -r_sdk_config_set_hl_derived_opts = 0x40005070; -r_sdk_config_set_opts = 0x4000507c; -r_specialModP256 = 0x40005088; -r_unloaded_area_init = 0x40005094; -r_vhci_flow_off = 0x400050a0; -r_vhci_flow_on = 0x400050ac; -r_vhci_notify_host_send_available = 0x400050b8; -r_vhci_send_to_host = 0x400050c4; -r_vnd_hci_command_handler = 0x400050d0; -r_vshci_init = 0x400050dc; -vnd_hci_command_handler_wrapper = 0x400050e8; -r_lld_legacy_adv_dynamic_pti_get = 0x400050f4; -r_lld_legacy_adv_dynamic_pti_process = 0x40005100; -r_lld_ext_adv_dynamic_pti_get = 0x4000510c; -r_lld_ext_adv_dynamic_aux_pti_process = 0x40005118; -r_lld_ext_adv_dynamic_pti_process = 0x40005124; -/* r_lld_adv_ext_pkt_prepare_set = 0x40005130; */ -r_lld_adv_ext_chain_connectable_construct = 0x40005148; -r_lld_adv_pkt_rx_connect_post = 0x40005160; -r_lld_adv_start_init_evt_param = 0x4000516c; -r_lld_adv_start_set_cs = 0x40005178; -/* r_lld_adv_start_update_filter_policy = 0x40005184; */ -r_lld_adv_start_schedule_asap = 0x40005190; -r_lld_con_tx_prog_new_packet_coex = 0x4000519c; -r_lld_per_adv_dynamic_pti_get = 0x400051b4; -r_lld_per_adv_evt_start_chm_upd = 0x400051c0; -r_lld_ext_scan_dynamic_pti_get = 0x400051cc; -r_lld_sync_insert = 0x400051e4; -r_sch_prog_ble_push = 0x400051f0; -r_sch_prog_bt_push = 0x400051fc; -r_lld_init_evt_end_type_set = 0x40005208; -r_lld_init_evt_end_type_get = 0x40005214; -r_lld_adv_direct_adv_use_rpa_addr_state_set = 0x40005220; -r_lld_adv_direct_adv_use_rpa_addr_state_get = 0x4000522c; -r_lld_init_evt_end_type_check_state_set = 0x40005238; -r_lld_init_evt_end_type_check_state_get = 0x40005244; /* Data (.data, .bss, .rodata) */ bt_rf_coex_cfg_p = 0x3fceffa8; bt_rf_coex_hooks_p = 0x3fceffa4; @@ -1761,38 +942,6 @@ rwip_coex_cfg = 0x3ff1eebe; rwip_priority = 0x3ff1eea8; veryBigHexP256 = 0x3ff1ee5c; -/* bluetooth hook funcs */ -r_llc_loc_encrypt_proc_continue_hook = 0x40001c60; -r_llc_loc_phy_upd_proc_continue_hook = 0x40001c64; -r_llc_rem_phy_upd_proc_continue_hook = 0x40001c68; -r_lld_scan_frm_eof_isr_hook = 0x40001c6c; -r_lld_scan_evt_start_cbk_hook = 0x40001c70; -r_lld_scan_process_pkt_rx_ext_adv_hook = 0x40001c78; -r_lld_scan_sched_hook = 0x40001c7c; -r_lld_adv_evt_start_cbk_hook = 0x40001c84; -r_lld_adv_aux_evt_start_cbk_hook = 0x40001c88; -r_lld_adv_frm_isr_hook = 0x40001c8c; -r_lld_adv_start_init_evt_param_hook = 0x40001c90; -r_lld_con_evt_canceled_cbk_hook = 0x40001c94; -r_lld_con_frm_isr_hook = 0x40001c98; -r_lld_con_tx_hook = 0x40001c9c; -r_lld_con_rx_hook = 0x40001ca0; -r_lld_con_evt_start_cbk_hook = 0x40001ca4; -r_lld_con_tx_prog_new_packet_hook = 0x40001cac; -r_lld_init_frm_eof_isr_hook = 0x40001cb0; -r_lld_init_evt_start_cbk_hook = 0x40001cb4; -r_lld_init_sched_hook = 0x40001cbc; -r_lld_init_process_pkt_tx_hook = 0x40001cc0; -r_lld_per_adv_evt_start_cbk_hook = 0x40001cc4; -r_lld_per_adv_frm_isr_hook = 0x40001cc8; -r_lld_per_adv_start_hook = 0x40001ccc; -r_lld_sync_frm_eof_isr_hook = 0x40001cd0; -r_lld_sync_evt_start_cbk_hook = 0x40001cd4; -r_lld_sync_start_hook = 0x40001cd8; -r_lld_sync_process_pkt_rx_pkt_check_hook = 0x40001cdc; -r_sch_arb_insert_hook = 0x40001ce0; -r_sch_plan_offset_req_hook = 0x40001ce4; - /*************************************** Group rom_pp ***************************************/ From cf055247c1166f48f259cf4ea2a825f60e417bd6 Mon Sep 17 00:00:00 2001 From: hongshuqing Date: Thu, 6 Jun 2024 21:42:23 +0800 Subject: [PATCH 14/56] fix: fix pll low temp bug --- components/esp_hw_support/port/esp32h2/pmu_sleep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/esp_hw_support/port/esp32h2/pmu_sleep.c b/components/esp_hw_support/port/esp32h2/pmu_sleep.c index a59e81f1ecc4..33f84d20ce30 100644 --- a/components/esp_hw_support/port/esp32h2/pmu_sleep.c +++ b/components/esp_hw_support/port/esp32h2/pmu_sleep.c @@ -20,6 +20,8 @@ #include "hal/efuse_ll.h" #include "hal/efuse_hal.h" #include "esp_hw_log.h" +#include "soc/regi2c_bias.h" +#include "regi2c_ctrl.h" static __attribute__((unused)) const char *TAG = "pmu_sleep"; @@ -263,6 +265,8 @@ uint32_t pmu_sleep_start(uint32_t wakeup_opt, uint32_t reject_opt, uint32_t lslp bool pmu_sleep_finish(void) { + // Restore registers lost during sleep + REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_0P8, 8); // fix low temp issue, need to increase this internal voltage return pmu_ll_hp_is_sleep_reject(PMU_instance()->hal->dev); } From 5ac289c463712433c05ecdb038097b37fcaec5e3 Mon Sep 17 00:00:00 2001 From: liqigan Date: Mon, 4 Nov 2024 16:06:08 +0800 Subject: [PATCH 15/56] fix(bt/bluedroid): Fixed AVRCP compatibility issue on absolute volume synchronization --- .../bluedroid/btc/profile/std/avrc/btc_avrc.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/components/bt/host/bluedroid/btc/profile/std/avrc/btc_avrc.c b/components/bt/host/bluedroid/btc/profile/std/avrc/btc_avrc.c index dde3728dbca0..738fbfd3c930 100644 --- a/components/bt/host/bluedroid/btc/profile/std/avrc/btc_avrc.c +++ b/components/bt/host/bluedroid/btc/profile/std/avrc/btc_avrc.c @@ -170,8 +170,7 @@ bool btc_avrc_ct_init_p(void) bool btc_avrc_tg_connected_p(void) { return (s_rc_tg_init == BTC_RC_TG_INIT_MAGIC) && - (btc_rc_cb.rc_connected == TRUE) && - (btc_rc_cb.rc_features & BTA_AV_FEAT_RCCT); + (btc_rc_cb.rc_connected == TRUE); } bool btc_avrc_ct_connected_p(void) @@ -456,7 +455,7 @@ static void handle_rc_connect (tBTA_AV_RC_OPEN *p_rc_open) btc_avrc_ct_cb_to_app(ESP_AVRC_CT_CONNECTION_STATE_EVT, ¶m); } - if (p_rc_open->peer_features & BTA_AV_FEAT_RCCT) { + if (btc_avrc_tg_init_p()) { esp_avrc_tg_cb_param_t param; memset(¶m, 0, sizeof(esp_avrc_tg_cb_param_t)); param.conn_stat.connected = true; @@ -515,7 +514,7 @@ static void handle_rc_disconnect (tBTA_AV_RC_CLOSE *p_rc_close) btc_avrc_ct_cb_to_app(ESP_AVRC_CT_CONNECTION_STATE_EVT, ¶m); } - if (rc_features & BTA_AV_FEAT_RCCT) { + if (btc_avrc_tg_init_p()) { esp_avrc_tg_cb_param_t param; memset(¶m, 0, sizeof(esp_avrc_ct_cb_param_t)); param.conn_stat.connected = false; @@ -941,14 +940,10 @@ void btc_rc_handler(tBTA_AV_EVT event, tBTA_AV *p_data) memcpy(param.conn_stat.remote_bda, btc_rc_cb.rc_addr, sizeof(esp_bd_addr_t)); btc_avrc_ct_cb_to_app(ESP_AVRC_CT_CONNECTION_STATE_EVT, ¶m); } - if ((p_data->rc_feat.peer_features & BTA_AV_FEAT_RCCT) && - !(old_feats & BTA_AV_FEAT_RCCT)) { - esp_avrc_tg_cb_param_t param; - memset(¶m, 0, sizeof(esp_avrc_ct_cb_param_t)); - param.conn_stat.connected = true; - memcpy(param.conn_stat.remote_bda, btc_rc_cb.rc_addr, sizeof(esp_bd_addr_t)); - btc_avrc_tg_cb_to_app(ESP_AVRC_TG_CONNECTION_STATE_EVT, ¶m); - } + /** + * @note ESP_AVRC_TG_CONNECTION_STATE_EVT has been reported on rc connect/disconnect event, + * it doesn't rely on the SDP results. + */ } while (0); btc_rc_cb.rc_features = p_data->rc_feat.peer_features; btc_rc_cb.rc_ct_features = p_data->rc_feat.peer_ct_features; From 9ff8a54cfe91c175bda573b7e2958f5882c6e01f Mon Sep 17 00:00:00 2001 From: xiongweichao Date: Tue, 29 Oct 2024 17:40:04 +0800 Subject: [PATCH 16/56] fix(bt/bluedroid): Replace free/malloc with osi_free/malloc --- .../host/bluedroid/btc/profile/std/l2cap/btc_l2cap.c | 10 +++++----- .../bt/host/bluedroid/btc/profile/std/spp/btc_spp.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/bt/host/bluedroid/btc/profile/std/l2cap/btc_l2cap.c b/components/bt/host/bluedroid/btc/profile/std/l2cap/btc_l2cap.c index 7c5157736a95..12e55c621841 100644 --- a/components/bt/host/bluedroid/btc/profile/std/l2cap/btc_l2cap.c +++ b/components/bt/host/bluedroid/btc/profile/std/l2cap/btc_l2cap.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -281,7 +281,7 @@ static void close_timeout_handler(void *arg) status = btc_transfer_context(&msg, slot->alarm_arg, sizeof(tBTA_JV), NULL, NULL); if (slot->alarm_arg) { - free(slot->alarm_arg); + osi_free(slot->alarm_arg); slot->alarm_arg = NULL; } @@ -832,7 +832,7 @@ void btc_l2cap_cb_handler(btc_msg_t *msg) // if rx still has data, delay free slot if (slot->close_alarm == NULL && slot->rx.queue && fixed_queue_length(slot->rx.queue) > 0) { tBTA_JV *p_arg = NULL; - if ((p_arg = malloc(sizeof(tBTA_JV))) == NULL) { + if ((p_arg = osi_malloc(sizeof(tBTA_JV))) == NULL) { param.close.status = ESP_BT_L2CAP_NO_RESOURCE; osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex); BTC_TRACE_ERROR("%s unable to malloc slot close_alarm arg!", __func__); @@ -842,7 +842,7 @@ void btc_l2cap_cb_handler(btc_msg_t *msg) slot->alarm_arg = (void *)p_arg; if ((slot->close_alarm = osi_alarm_new("slot", close_timeout_handler, (void *)slot, VFS_CLOSE_TIMEOUT)) == NULL) { - free(p_arg); + osi_free(p_arg); slot->alarm_arg = NULL; param.close.status = ESP_BT_L2CAP_NO_RESOURCE; osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex); @@ -850,7 +850,7 @@ void btc_l2cap_cb_handler(btc_msg_t *msg) break; } if (osi_alarm_set(slot->close_alarm, VFS_CLOSE_TIMEOUT) != OSI_ALARM_ERR_PASS) { - free(p_arg); + osi_free(p_arg); slot->alarm_arg = NULL; osi_alarm_free(slot->close_alarm); param.close.status = ESP_BT_L2CAP_BUSY; diff --git a/components/bt/host/bluedroid/btc/profile/std/spp/btc_spp.c b/components/bt/host/bluedroid/btc/profile/std/spp/btc_spp.c index cf334494487d..181f2014164c 100644 --- a/components/bt/host/bluedroid/btc/profile/std/spp/btc_spp.c +++ b/components/bt/host/bluedroid/btc/profile/std/spp/btc_spp.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -1199,7 +1199,7 @@ void btc_spp_cb_handler(btc_msg_t *msg) slot->alarm_arg = (void *)p_arg; if ((slot->close_alarm = osi_alarm_new("slot", close_timeout_handler, (void *)slot, VFS_CLOSE_TIMEOUT)) == NULL) { - free(p_arg); + osi_free(p_arg); slot->alarm_arg = NULL; param.close.status = ESP_SPP_NO_RESOURCE; osi_mutex_unlock(&spp_local_param.spp_slot_mutex); @@ -1207,7 +1207,7 @@ void btc_spp_cb_handler(btc_msg_t *msg) break; } if (osi_alarm_set(slot->close_alarm, VFS_CLOSE_TIMEOUT) != OSI_ALARM_ERR_PASS) { - free(p_arg); + osi_free(p_arg); slot->alarm_arg = NULL; osi_alarm_free(slot->close_alarm); param.close.status = ESP_SPP_BUSY; @@ -1488,7 +1488,7 @@ static ssize_t spp_vfs_write(int fd, const void * data, size_t size) BTC_TRACE_DEBUG("%s items_waiting:%d, fd:%d\n", __func__, items_waiting, fd); osi_mutex_unlock(&spp_local_param.spp_slot_mutex); - // block untill under water level, be closed or time out + // block until under water level, be closed or time out tx_event_group_val = xEventGroupWaitBits(spp_local_param.tx_event_group, SLOT_WRITE_BIT(serial) | SLOT_CLOSE_BIT(serial), pdTRUE, pdFALSE, VFS_WRITE_TIMEOUT / portTICK_PERIOD_MS); From 4f85a2726e04b737c8646d865b44ddd837b703db Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Mon, 21 Oct 2024 16:40:00 +0800 Subject: [PATCH 17/56] fix(wifi): Support AES IV with random value in esptouch v2 --- components/esp_wifi/lib | 2 +- .../api-reference/network/esp_smartconfig.rst | 11 ++++++- .../api-reference/network/esp_smartconfig.rst | 29 ++++++++++++++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 3c0c961eaa92..225cc5d2dc05 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 3c0c961eaa925626666400b451028f6512e2bad9 +Subproject commit 225cc5d2dc0509c4d348343736427cb1679a60d4 diff --git a/docs/en/api-reference/network/esp_smartconfig.rst b/docs/en/api-reference/network/esp_smartconfig.rst index 9d95a68fc0fe..3f62b3da0ca4 100644 --- a/docs/en/api-reference/network/esp_smartconfig.rst +++ b/docs/en/api-reference/network/esp_smartconfig.rst @@ -1,10 +1,19 @@ SmartConfig =========== -The SmartConfig\ :sup:`TM` is a provisioning technology developed by TI to connect a new Wi-Fi device to a Wi-Fi network. It uses a mobile app to broadcast the network credentials from a smartphone, or a tablet, to an un-provisioned Wi-Fi device. +:link_to_translation:`zh_CN:[中文]` + +Introduction +------------ + +The SmartConfig\ :sup:`TM` is a provisioning technology developed by TI to connect a new Wi-Fi device to a Wi-Fi network. It uses a mobile application to broadcast the network credentials from a smartphone, or a tablet, to an un-provisioned Wi-Fi device. The advantage of this technology is that the device does not need to directly know SSID or password of an Access Point (AP). This information is provided using the smartphone. This is particularly important to headless device and systems, due to their lack of a user interface. +Currently, {IDF_TARGET_NAME} support three types of SmartConfig: Airkiss, ESPTouch, and ESPTouch v2. ESPTouch v2 has been supported since SmartConfig v3.0 (the version of SmartConfig can be get from :cpp:func:`esp_smartconfig_get_version()`), and it employs a completely different algorithm compared to ESPTouch, resulting in faster setup times. Additionally, ESPTouch v2 introduces AES encryption and custom data fields. + +Starting from SmartConfig v3.0.2, ESPTouch v2 introduces support for random IV in AES encryption. On the application side, when the option for random IV is disabled, the default IV is set to 0, maintaining consistency with previous versions. When the random IV option is enabled, the IV will be a random value. It is important to note that when AES encryption is enabled with a random IV, the provision time will be extended due to the need of transmitting the IV to the provisioning device. On the provisioning device side, the device will identify whether the random IV for AES is enabled based on the flag in the provisioning packet. + If you are looking for other options to provision your {IDF_TARGET_NAME} devices, check :doc:`../provisioning/index`. diff --git a/docs/zh_CN/api-reference/network/esp_smartconfig.rst b/docs/zh_CN/api-reference/network/esp_smartconfig.rst index 00a8e6f6603d..4acfe91f2eb3 100644 --- a/docs/zh_CN/api-reference/network/esp_smartconfig.rst +++ b/docs/zh_CN/api-reference/network/esp_smartconfig.rst @@ -1 +1,28 @@ -.. include:: ../../../en/api-reference/network/esp_smartconfig.rst +SmartConfig + +:link_to_translation:`en:[English]` + +概述 +----- + +SmartConfig\ :sup:`TM` 是由 TI 开发的配网技术,用于将新的 Wi-Fi 设备连接到 Wi-Fi 网络。它使用移动应用程序将无线网凭据从智能手机或平板电脑端广播给未配网的 Wi-Fi 设备。 + +这项技术的优势在于,设备无需直接获知 AP 的 SSID 或密码,而是通过智能手机获取。这对于没有用户界面的无头设备和系统而言十分重要。 + +目前, {IDF_TARGET_NAME} 支持三种类型的 SmartConfig 配网: Airkiss、ESPTouch 和 ESPTouch v2。ESPTouch v2 自 SmartConfig v3.0 (SmartConfig 的版本可以从 :cpp:func:`esp_smartconfig_get_version()` 获取)起开始支持,ESPTouch v2 和 vESPTouch 采用完全不同的配网算法,因此配网速度更快。此外,ESPTouch v2 还增加了 AES 加密功能和自定义数据字段。 + +从 SmartConfig v3.0.2 开始,ESPTouch v2 的 AES 加密支持随机 IV。在应用程序端,当随机 IV 的选项关闭的时候,默认的 IV 为 0,与旧版本保持一致,当随机 IV 的选项打开的时候,IV 为随机值。需要注意的是,当启用 AES 加密且 IV 为随机值时,配网时间会延长,因为需要将 IV 传输到配网设备。在配网设备端,设备会根据配网包中的 flag 来识别 AES 的随机 IV 是否开启。 + +如需通过其他方式为 {IDF_TARGET_NAME} 设备配网,请参阅 :doc:`../provisioning/index`。 + + +应用示例 +------------ + +前往 :example:`wifi/smart_config`,查看使用 SmartConfig 将 {IDF_TARGET_NAME} 连接到目标 AP 的应用示例。 + + +API 参考 +---------- + +.. include-build-file:: inc/esp_smartconfig.inc From 4fff9f7cf7af309418b9238ad998d5773094417a Mon Sep 17 00:00:00 2001 From: Shen Weilong Date: Fri, 8 Nov 2024 16:43:19 +0800 Subject: [PATCH 18/56] feat(ble): Support for putting code in flash on ESP32-C2 --- components/bt/CMakeLists.txt | 9 +- components/bt/controller/esp32c2/Kconfig.in | 178 ++- components/bt/controller/esp32c2/bt.c | 17 + components/bt/controller/esp32c2/dummy.c | 320 +++++ components/bt/controller/esp32c2/esp_bt_cfg.h | 51 + .../bt/controller/lib_esp32c2/esp32c2-bt-lib | 2 +- components/bt/host/nimble/Kconfig.in | 245 ++-- components/bt/linker_esp32c2.lf | 40 +- components/esp_rom/CMakeLists.txt | 8 + .../esp32c2/ld/esp32c2.rom.ble-eco4.ld | 1229 +++++++++++++++++ .../esp_rom/esp32c2/ld/esp32c2.rom.ble.ld | 914 ++++++++++++ .../esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld | 1213 ---------------- components/esp_rom/esp32c2/ld/esp32c2.rom.ld | 899 ------------ 13 files changed, 2825 insertions(+), 2300 deletions(-) create mode 100644 components/bt/controller/esp32c2/dummy.c create mode 100644 components/esp_rom/esp32c2/ld/esp32c2.rom.ble-eco4.ld create mode 100644 components/esp_rom/esp32c2/ld/esp32c2.rom.ble.ld diff --git a/components/bt/CMakeLists.txt b/components/bt/CMakeLists.txt index ccad344834c4..56e80b9c8e78 100644 --- a/components/bt/CMakeLists.txt +++ b/components/bt/CMakeLists.txt @@ -24,6 +24,9 @@ if(CONFIG_BT_ENABLED) elseif(CONFIG_IDF_TARGET_ESP32C2) list(APPEND srcs "controller/esp32c2/bt.c") list(APPEND include_dirs include/esp32c2/include) + if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + list(APPEND srcs "controller/esp32c2/dummy.c") + endif() set(ldscripts "linker_esp32c2.lf") elseif(CONFIG_IDF_TARGET_ESP32C6) @@ -790,7 +793,11 @@ if(CONFIG_BT_ENABLED) if(CONFIG_IDF_TARGET_ESP32C6) add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/esp32c6/libble_app.a") else() - add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app.a") + if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app_flash.a") + else() + add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app.a") + endif() endif() target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app) endif() diff --git a/components/bt/controller/esp32c2/Kconfig.in b/components/bt/controller/esp32c2/Kconfig.in index d05401c18620..adc5e2517b58 100644 --- a/components/bt/controller/esp32c2/Kconfig.in +++ b/components/bt/controller/esp32c2/Kconfig.in @@ -109,85 +109,99 @@ menuconfig BT_LE_50_FEATURE_SUPPORT help Enable BLE 5 feature -config BT_LE_LL_CFG_FEAT_LE_2M_PHY - bool "Enable 2M Phy" - depends on BT_LE_50_FEATURE_SUPPORT - default y - help - Enable 2M-PHY - -config BT_LE_LL_CFG_FEAT_LE_CODED_PHY - bool "Enable coded Phy" - depends on BT_LE_50_FEATURE_SUPPORT - default y - help - Enable coded-PHY - -config BT_LE_EXT_ADV - bool "Enable extended advertising" - depends on BT_LE_50_FEATURE_SUPPORT - default y - help - Enable this option to do extended advertising. Extended advertising - will be supported from BLE 5.0 onwards. - -if BT_LE_EXT_ADV - config BT_LE_MAX_EXT_ADV_INSTANCES - int "Maximum number of extended advertising instances." - range 0 4 - default 1 - depends on BT_LE_EXT_ADV - help - Change this option to set maximum number of extended advertising - instances. Minimum there is always one instance of - advertising. Enter how many more advertising instances you - want. - Each extended advertising instance will take about 0.5k DRAM. - - config BT_LE_EXT_ADV_MAX_SIZE - int "Maximum length of the advertising data." - range 0 1650 - default 1650 - depends on BT_LE_EXT_ADV +if BT_LE_50_FEATURE_SUPPORT + config BT_LE_LL_CFG_FEAT_LE_2M_PHY + bool "Enable 2M Phy" + depends on BT_LE_50_FEATURE_SUPPORT + default y help - Defines the length of the extended adv data. The value should not - exceed 1650. + Enable 2M-PHY - config BT_LE_ENABLE_PERIODIC_ADV - bool "Enable periodic advertisement." + config BT_LE_LL_CFG_FEAT_LE_CODED_PHY + bool "Enable coded Phy" + depends on BT_LE_50_FEATURE_SUPPORT default y - depends on BT_LE_EXT_ADV help - Enable this option to start periodic advertisement. + Enable coded-PHY - config BT_LE_PERIODIC_ADV_SYNC_TRANSFER - bool "Enable Transfer Sync Events" - depends on BT_LE_ENABLE_PERIODIC_ADV + config BT_LE_EXT_ADV + bool "Enable extended advertising" + depends on BT_LE_50_FEATURE_SUPPORT default y help - This enables controller transfer periodic sync events to host + Enable this option to do extended advertising. Extended advertising + will be supported from BLE 5.0 onwards. + + if BT_LE_EXT_ADV + config BT_LE_MAX_EXT_ADV_INSTANCES + int "Maximum number of extended advertising instances." + range 0 4 + default 1 + depends on BT_LE_EXT_ADV + help + Change this option to set maximum number of extended advertising + instances. Minimum there is always one instance of + advertising. Enter how many more advertising instances you + want. + Each extended advertising instance will take about 0.5k DRAM. + + config BT_LE_EXT_ADV_MAX_SIZE + int "Maximum length of the advertising data." + range 0 1650 + default 1650 + depends on BT_LE_EXT_ADV + help + Defines the length of the extended adv data. The value should not + exceed 1650. -endif + config BT_LE_ENABLE_PERIODIC_ADV + bool "Enable periodic advertisement." + default y + depends on BT_LE_EXT_ADV + help + Enable this option to start periodic advertisement. -config BT_LE_MAX_PERIODIC_SYNCS - int "Maximum number of periodic advertising syncs" - depends on BT_LE_50_FEATURE_SUPPORT && !BT_NIMBLE_ENABLED + config BT_LE_PERIODIC_ADV_SYNC_TRANSFER + bool "Enable Transfer Sync Events" + depends on BT_LE_ENABLE_PERIODIC_ADV + default y + help + This enables controller transfer periodic sync events to host + endif - range 0 3 - default 1 if BT_LE_ENABLE_PERIODIC_ADV - default 0 - help - Set this option to set the upper limit for number of periodic sync - connections. This should be less than maximum connections allowed by - controller. + config BT_LE_EXT_SCAN + bool "Enable extended scanning" + depends on BT_LE_50_FEATURE_SUPPORT && BT_LE_ROLE_OBSERVER_ENABLE + default y + help + Enable this option to do extended scanning. -config BT_LE_MAX_PERIODIC_ADVERTISER_LIST - int "Maximum number of periodic advertiser list" - depends on BT_LE_50_FEATURE_SUPPORT && !BT_NIMBLE_ENABLED - range 1 5 - default 5 - help - Set this option to set the upper limit for number of periodic advertiser list. + config BT_LE_ENABLE_PERIODIC_SYNC + bool "Enable periodic sync" + default y + depends on BT_LE_EXT_SCAN + help + Enable this option to receive periodic advertisement. + + if BT_LE_ENABLE_PERIODIC_SYNC + config BT_LE_MAX_PERIODIC_SYNCS + int "Maximum number of periodic advertising syncs" + range 0 3 + default 1 if BT_LE_ENABLE_PERIODIC_ADV + default 0 + help + Set this option to set the upper limit for number of periodic sync + connections. This should be less than maximum connections allowed by + controller. + + config BT_LE_MAX_PERIODIC_ADVERTISER_LIST + int "Maximum number of periodic advertiser list" + range 1 5 + default 5 + help + Set this option to set the upper limit for number of periodic advertiser list. + endif +endif menu "Memory Settings" depends on !BT_NIMBLE_ENABLED @@ -522,6 +536,10 @@ config BT_LE_TX_CCA_ENABLED help Enable CCA feature to cancel sending the packet if the signal power is stronger than CCA threshold. +config BT_LE_DTM_ENABLED + bool "Enable Direct Test Mode (DTM) feature" + default n + config BT_LE_CCA_RSSI_THRESH int "CCA RSSI threshold value" depends on BT_LE_TX_CCA_ENABLED @@ -530,6 +548,10 @@ config BT_LE_CCA_RSSI_THRESH help Power threshold of CCA in unit of -1 dBm. +config BT_LE_FEAT_LL_ENCRYPTION + bool "Enable controller ACL encryption" + default y + config BT_LE_ROLE_CENTROL_ENABLE bool "Enable BLE Centrol role function" depends on !BT_NIMBLE_ENABLED @@ -616,3 +638,23 @@ config BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF default 18 if BT_LE_DFT_TX_POWER_LEVEL_P18 default 20 if BT_LE_DFT_TX_POWER_LEVEL_P20 default 0 + +config BT_CTRL_RUN_IN_FLASH_ONLY + bool "Reduce BLE IRAM usage (READ DOCS FIRST) (EXPERIMENTAL)" + default n + help + Move most IRAM into flash. This will increase the usage of flash and reduce ble performance. + Because the code is moved to the flash, the execution speed of the code is reduced. + To have a small impact on performance, you need to enable flash suspend (SPI_FLASH_AUTO_SUSPEND). + + - Only one Tx-Rx can be performed in each connection interval. Therefore, reduce the connection interval + as much as possible to improve the throughput. If you want higher connection performance, you can + enable BT_LE_PLACE_CONN_RELATED_INTO_IRAM to put the connection-related code into iram. + - For HCI_LE_Extended_Create_Connection command, only 1M phy's connection parameters will be applied. + Other phys' will be ignored. + - For extended scanning, we may be unable to receive the extended adv with 300us MAFS. + +config BT_LE_PLACE_CONN_RELATED_INTO_IRAM + bool "Place the connection-related code into IRAM" + depends on BT_CTRL_RUN_IN_FLASH_ONLY + default n diff --git a/components/bt/controller/esp32c2/bt.c b/components/bt/controller/esp32c2/bt.c index d421df3bdac9..4b2eab8be0ad 100644 --- a/components/bt/controller/esp32c2/bt.c +++ b/components/bt/controller/esp32c2/bt.c @@ -154,6 +154,10 @@ extern int ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_cou extern void bt_track_pll_cap(void); extern char *ble_controller_get_compile_version(void); extern const char *r_ble_controller_get_rom_compile_version(void); +#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY +extern void ble_ll_supported_features_init(void); +#endif //CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY + #if CONFIG_BT_RELEASE_IRAM extern uint32_t _iram_bt_text_start; extern uint32_t _bss_bt_end; @@ -532,7 +536,12 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler, void *arg, void **ret_handle_in) { +#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY + int rc = esp_intr_alloc(source, flags, handler, arg, (intr_handle_t *)ret_handle_in); +#else int rc = esp_intr_alloc(source, flags | ESP_INTR_FLAG_IRAM, handler, arg, (intr_handle_t *)ret_handle_in); +#endif + return rc; } @@ -741,6 +750,8 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) return ret; } + /* If we place the ble code into flash, don't need to initialize ROM. */ +#if !CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY #if DEFAULT_BT_LE_50_FEATURE_SUPPORT || DEFAULT_BT_LE_ROLE_CENTROL || DEFAULT_BT_LE_ROLE_OBSERVER extern int esp_ble_rom_func_ptr_init_all(void); esp_ble_rom_func_ptr_init_all(); @@ -749,6 +760,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) extern int esp_ble_rom_func_ptr_init_legacy_adv_and_slave(void); esp_ble_rom_func_ptr_init_legacy_adv_and_slave(); #endif +#endif //!CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY /* Initialize the function pointers for OS porting */ npl_freertos_funcs_init(); @@ -798,6 +810,11 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) #if CONFIG_SW_COEXIST_ENABLE coex_init(); #endif + +#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY + ble_ll_supported_features_init(); +#endif //CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY + ret = ble_controller_init(cfg); if (ret != ESP_OK) { ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret); diff --git a/components/bt/controller/esp32c2/dummy.c b/components/bt/controller/esp32c2/dummy.c new file mode 100644 index 000000000000..0621f547c2aa --- /dev/null +++ b/components/bt/controller/esp32c2/dummy.c @@ -0,0 +1,320 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include "esp_bt_cfg.h" + +#define BLE_ERR_UNKNOWN_HCI_CMD (0x01) +/* LL Features */ +#define BLE_LL_FEAT_LE_ENCRYPTION (0x0000000001) +#define BLE_LL_FEAT_CONN_PARM_REQ (0x0000000002) +#define BLE_LL_FEAT_EXTENDED_REJ (0x0000000004) +#define BLE_LL_FEAT_PERIPH_INIT (0x0000000008) +#define BLE_LL_FEAT_LE_PING (0x0000000010) +#define BLE_LL_FEAT_DATA_LEN_EXT (0x0000000020) +#define BLE_LL_FEAT_LL_PRIVACY (0x0000000040) +#define BLE_LL_FEAT_EXT_SCAN_FILT (0x0000000080) +#define BLE_LL_FEAT_LE_2M_PHY (0x0000000100) +#define BLE_LL_FEAT_STABLE_MOD_ID_TX (0x0000000200) +#define BLE_LL_FEAT_STABLE_MOD_ID_RX (0x0000000400) +#define BLE_LL_FEAT_LE_CODED_PHY (0x0000000800) +#define BLE_LL_FEAT_EXT_ADV (0x0000001000) +#define BLE_LL_FEAT_PERIODIC_ADV (0x0000002000) +#define BLE_LL_FEAT_CSA2 (0x0000004000) +#define BLE_LL_FEAT_LE_POWER_CLASS_1 (0x0000008000) +#define BLE_LL_FEAT_MIN_USED_CHAN (0x0000010000) +#define BLE_LL_FEAT_CTE_REQ (0x0000020000) +#define BLE_LL_FEAT_CTE_RSP (0x0000040000) +#define BLE_LL_FEAT_CTE_TX (0x0000080000) +#define BLE_LL_FEAT_CTE_RX (0x0000100000) +#define BLE_LL_FEAT_CTE_AOD (0x0000200000) +#define BLE_LL_FEAT_CTE_AOA (0x0000400000) +#define BLE_LL_FEAT_CTE_RECV (0x0000800000) +#define BLE_LL_FEAT_SYNC_TRANS_SEND (0x0001000000) +#define BLE_LL_FEAT_SYNC_TRANS_RECV (0x0002000000) +#define BLE_LL_FEAT_SCA_UPDATE (0x0004000000) +#define BLE_LL_FEAT_REM_PKEY (0x0008000000) +#define BLE_LL_FEAT_CIS_CENTRAL (0x0010000000) +#define BLE_LL_FEAT_CIS_PERIPH (0x0020000000) +#define BLE_LL_FEAT_ISO_BROADCASTER (0x0040000000) +#define BLE_LL_FEAT_SYNC_RECV (0x0080000000) +#define BLE_LL_FEAT_CIS_HOST (0x0100000000) +#define BLE_LL_FEAT_POWER_CTRL_REQ (0x0200000000) +#define BLE_LL_FEAT_POWER_CHANGE_IND (0x0400000000) +#define BLE_LL_FEAT_PATH_LOSS_MON (0x0800000000) +#define BLE_LL_FEAT_PERIODIC_ADV_ADI (0x1000000000) +#define BLE_LL_FEAT_CONN_SUBRATING (0x2000000000) +#define BLE_LL_FEAT_CONN_SUBRATING_HOST (0x4000000000) +#define BLE_LL_FEAT_CHANNEL_CLASS (0x8000000000) + +uint64_t ble_ll_supported_features; + +void +ble_ll_supported_features_init(void) +{ + ble_ll_supported_features = BLE_LL_FEAT_EXTENDED_REJ; + ble_ll_supported_features |= BLE_LL_FEAT_DATA_LEN_EXT; + +#if DEFAULT_BT_LE_ROLE_CENTROL || DEFAULT_BT_LE_ROLE_PERIPHERAL + ble_ll_supported_features |= BLE_LL_FEAT_PERIPH_INIT; + ble_ll_supported_features |= BLE_LL_FEAT_CONN_PARM_REQ; +#endif + +#if CONFIG_BT_LE_FEAT_LL_ENCRYPTION + ble_ll_supported_features |= BLE_LL_FEAT_LE_ENCRYPTION; +#endif + + ble_ll_supported_features |= (BLE_LL_FEAT_LL_PRIVACY | BLE_LL_FEAT_EXT_SCAN_FILT); + ble_ll_supported_features |= BLE_LL_FEAT_LE_PING; + +#if DEFAULT_BT_LE_EXT_ADV + ble_ll_supported_features |= BLE_LL_FEAT_EXT_ADV; +#endif + +#if DEFAULT_BT_LE_PERIODIC_ADV + ble_ll_supported_features |= BLE_LL_FEAT_PERIODIC_ADV; + ble_ll_supported_features |= BLE_LL_FEAT_PERIODIC_ADV_ADI; +#endif + +#if DEFAULT_BT_LE_PAST + ble_ll_supported_features |= BLE_LL_FEAT_SYNC_TRANS_RECV; + ble_ll_supported_features |= BLE_LL_FEAT_SYNC_TRANS_SEND; +#endif + +#if DEGAULT_BT_LE_2M_PHY + ble_ll_supported_features |= BLE_LL_FEAT_LE_2M_PHY; +#endif + +#if DEGAULT_BT_LE_CODED_PHY + ble_ll_supported_features |= BLE_LL_FEAT_LE_CODED_PHY; +#endif + +#if DEFAULT_BT_LE_50_FEATURE_SUPPORT + ble_ll_supported_features |= BLE_LL_FEAT_CSA2; + ble_ll_supported_features |= BLE_LL_FEAT_SCA_UPDATE; + ble_ll_supported_features |= BLE_LL_FEAT_REM_PKEY; + ble_ll_supported_features |= BLE_LL_FEAT_CHANNEL_CLASS; +#endif +} + +#if !DEFAULT_BT_LE_ROLE_BROADCASTER +void r_ble_ll_adv_rpa_timeout(void) { } +void r_ble_lll_adv_halt(void) { } +void r_ble_lll_adv_event_rmvd_from_sched(void) { } +void r_ble_lll_adv_ext_event_rmvd_from_sched(void) { } +int r_ble_ll_adv_enabled(void) { return 0; } +int r_ble_ll_adv_can_chg_whitelist(void) { return 1; } +int r_ble_ll_adv_set_random_addr(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +void r_ble_ll_adv_reset(void) { } +void r_ble_ll_adv_init(void) { } +void r_ble_ll_adv_deinit(void) { } +int r_ble_ll_adv_env_init(void) { return 0; } +void r_ble_ll_adv_env_deinit(void) { } +int r_ble_lll_adv_rx_pkt_isr(void) { return -1; } +void r_ble_ll_adv_rx_pkt_in(void) { } +int r_ble_ll_adv_set_adv_params(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_read_txpwr(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_hci_set_adv_data(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_hci_set_scan_rsp_data(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_hci_adv_set_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_vendor_hci_legacy_adv_clear(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_set_data_related_addr_change(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif // !DEFAULT_BT_LE_ROLE_BROADCASTER + +#if !DEFAULT_BT_LE_EXT_ADV +bool r_ble_ll_adv_ext_check_data_itvl(void) { return true; } +void r_ble_lll_adv_coex_dpc_update_on_aux_scheduled(void) { } +void r_ble_lll_adv_coex_dpc_calc_pti_update_itvl(void) { } +void r_ble_lll_adv_sec_done(void) { } +int r_ble_lll_adv_sec_schedule_next_aux(void) { return 0; } +void r_ble_lll_adv_sec_event_done(void) { } +int r_ble_lll_adv_secondary_tx_start_cb(void) { return 0; } +void r_ble_lll_adv_aux_schedule(void) { } +void r_ble_lll_adv_update_rsp_offset(void) { } +int r_ble_ll_adv_hci_set_random_addr(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_ext_set_param(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_ext_set_adv_data(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_ext_set_scan_rsp(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_ext_set_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_rd_max_adv_data_len(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_rd_sup_adv_sets(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_remove(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_clear_all(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_EXT_ADV + +#if !DEFAULT_BT_LE_PERIODIC_ADV +void r_ble_ll_adv_sm_stop_periodic(void) { } +void r_ble_lll_adv_periodic_event_done(void) { } +int r_ble_lll_adv_sync_tx_start_cb(void) { return 0; } +void r_ble_lll_adv_sync_tx_end(void) { } +int r_ble_lll_adv_periodic_start(void) { return 0; } +void r_ble_lll_adv_periodic_rmvd_from_sched(void) { } +int r_ble_ll_adv_periodic_set_param(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_periodic_set_data(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_adv_periodic_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_PERIODIC_ADV + +#if !DEFAULT_BT_LE_ROLE_OBSERVER +void r_ble_lll_scan_halt(void) { } +void r_ble_ll_scan_end_adv_evt(void) { } +void r_ble_ll_scan_rx_pkt_in(void) { } +int r_ble_lll_scan_rx_pkt_isr(void) { return -1; } +int r_ble_ll_scan_env_init(void) { return 0; } +void r_ble_ll_scan_env_deinit(void) { } +void r_ble_ll_scan_init(void) { } +void r_ble_ll_scan_deinit(void) { } +void r_ble_ll_scan_reset(void) { } +int r_ble_ll_scan_can_chg_whitelist(void) { return 1; } +int r_ble_ll_scan_enabled(void) { return false; } +int r_ble_lll_scan_chk_resume(void) { return -1; } +int r_ble_ll_scan_set_scan_params(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_hci_scan_set_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_scan_hci_update_adv_report_flow_ctrl(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_scan_hci_set_adv_report_flow_ctrl(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_ROLE_OBSERVER + +#if !DEFAULT_BT_LE_EXT_SCAN +void r_ble_lll_scan_duration_period_timers_restart(void) { } +void r_ble_lll_scan_duration_period_timers_stop(void) { } +int r_ble_ll_hci_send_legacy_ext_adv_report(void) { return -1; } +void r_ble_lll_sched_rmv_elem_type(void) { } +void r_ble_ll_scan_send_truncated(void) { } +void r_ble_ll_scan_aux_data_unref(void) { } +void r_ble_lll_scan_sched_remove(void) { } +void r_ble_lll_scan_aux_data_free(void) { } +void r_ble_lll_aux_scan_drop(void) { } +int r_ble_lll_sched_aux_scan(void) { return -1; } +int r_ble_lll_scan_rx_isr_on_aux(void) { return -1; } +void r_ble_lll_scan_period_timer_cb(void) { } +void r_ble_lll_scan_duration_timer_cb(void) { } +void r_ble_ll_scan_rx_pkt_in_on_aux(void) { } +int r_ble_ll_set_ext_scan_params(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_hci_ext_scan_set_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_EXT_SCAN + +#if !DEFAULT_BT_LE_ROLE_CENTROL +void r_ble_ll_init_rx_pkt_in(void) { } +int r_ble_lll_init_rx_pkt_isr(void) { return -1; } +int r_ble_ll_conn_create(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_conn_create_cancel(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_ROLE_CENTROL + +#if !DEFAULT_BT_LE_ROLE_CENTROL || !DEFAULT_BT_LE_EXT_SCAN +int r_ble_ll_ext_conn_create(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_ROLE_CENTROL || !DEFAULT_BT_LE_EXT_SCAN + +#if !DEFAULT_BT_LE_ROLE_PERIPHERAL +int r_ble_ll_conn_slave_start(void) { return 0; } +#endif //!DEFAULT_BT_LE_ROLE_PERIPHERAL + +#if !DEFAULT_BT_LE_ROLE_CENTROL && !DEFAULT_BT_LE_ROLE_PERIPHERAL +void r_ble_ll_conn_rx_data_pdu(void) { } +int r_ble_lll_conn_rx_pkt_isr(void) { return -1; } +int r_ble_ll_hci_disconnect(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_conn_hci_rd_rem_ver_cmd(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_conn_hci_update(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_conn_hci_rd_chan_map(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_conn_hci_read_rem_features(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_conn_hci_param_rr(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_conn_hci_param_nrr(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_ROLE_CENTROL && !DEFAULT_BT_LE_ROLE_PERIPHERAL + +#if !CONFIG_BT_LE_FEAT_LL_ENCRYPTION +int r_ble_ll_conn_chk_phy_upd_start(void) { return -1; } +void r_ble_ll_hci_ev_encrypt_chg(void) { } +int r_ble_ll_ctrl_enc_allowed_pdu_rx(void) { return 1; } +int r_ble_ll_ctrl_enc_allowed_pdu_tx(void) { return 1; } +uint8_t r_ble_ll_ctrl_rx_start_enc_rsp(void) { return 0x07; } +uint8_t r_ble_ll_ctrl_rx_pause_enc_rsp(void) { return 0x07; } +int r_ble_ll_hci_le_encrypt(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!CONFIG_BT_LE_FEAT_LL_ENCRYPTION + +#if !DEFAULT_BT_LE_ROLE_PERIPHERAL || !CONFIG_BT_LE_FEAT_LL_ENCRYPTION +uint8_t r_ble_ll_ctrl_rx_pause_enc_req(void) { return 0x07; } +uint8_t r_ble_ll_ctrl_rx_enc_req(void) { return 0x07; } +int r_ble_ll_conn_hci_le_ltk_reply(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_conn_hci_le_ltk_neg_reply(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_ROLE_PERIPHERAL || !CONFIG_BT_LE_FEAT_LL_ENCRYPTION + +#if !DEFAULT_BT_LE_ROLE_CENTROL || !CONFIG_BT_LE_FEAT_LL_ENCRYPTION +uint8_t r_ble_ll_ctrl_rx_start_enc_req(void) { return 0x07; } +void r_ble_ll_ctrl_rx_enc_rsp(void) { } +void r_ble_ll_ctrl_enc_req_make(void) { } +int r_ble_ll_conn_hci_le_start_encrypt(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_ROLE_CENTROL || !CONFIG_BT_LE_FEAT_LL_ENCRYPTION + +#if !DEGAULT_BT_LE_2M_PHY && !DEGAULT_BT_LE_CODED_PHY +void r_ble_ll_ctrl_phy_update_proc_complete(void) { } +void r_ble_ll_ctrl_phy_update_cancel(void) { } +uint8_t r_ble_ll_ctrl_rx_phy_update_ind(void) { return 0x07; } +uint8_t r_ble_ll_ctrl_rx_phy_rsp(void) { return 0x07; } +uint8_t r_ble_ll_ctrl_rx_phy_req(void) { return 0x07; } +void r_ble_ll_ctrl_phy_req_rsp_make(void) { } +#endif //DEGAULT_BT_LE_2M_PHY && DEGAULT_BT_LE_CODED_PHY + +#if !DEFAULT_BT_LE_PERIODIC_SYNC +void r_ble_lll_sync_halt(void) { } +void r_ble_lll_sync_rmvd_from_sched(void) { } +int r_ble_ll_sync_list_search(void) { return -1; } +uint8_t r_ble_ll_ctrl_rx_periodic_sync_ind(void) { return 0x07; } +void r_ble_ll_sync_rx_pkt_in(void) { } +int r_ble_lll_sync_rx_pkt_isr(void) { return -1; } +int r_ble_ll_sync_env_init(void) { return 0; } +void r_ble_ll_sync_env_deinit(void) { } +void r_ble_ll_sync_init(void) { } +void r_ble_ll_sync_deinit(void) { } +void r_ble_ll_sync_reset(void) { } +bool r_ble_ll_sync_enabled(void) { return false; } +int r_ble_ll_sync_create(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_sync_cancel(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_sync_terminate(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_sync_list_add(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_sync_list_remove(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_sync_list_clear(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_sync_list_size(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_sync_receive_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_PERIODIC_SYNC + +#if !DEFAULT_BT_LE_PAST || !DEFAULT_BT_LE_PERIODIC_ADV +int r_ble_ll_adv_periodic_set_info_transfer(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_PAST || !DEFAULT_BT_LE_PERIODIC_ADV + +#if !DEFAULT_BT_LE_PAST || !DEFAULT_BT_LE_PERIODIC_SYNC +int r_ble_ll_sync_transfer(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_set_sync_transfer_params(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_set_default_sync_transfer_params(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_PAST || !DEFAULT_BT_LE_PERIODIC_SYNC + +#if !DEFAULT_BT_LE_50_FEATURE_SUPPORT +uint8_t r_ble_ll_ctrl_rx_channel_reporting_ind(void) { return 0x07; } +uint8_t r_ble_ll_ctrl_rx_channel_status_ind(void) { return 0x07; } +uint8_t r_ble_ll_ctrl_rx_sca_req(void) { return 0x07; } +uint8_t r_ble_ll_ctrl_rx_sca_rsp(void) { return 0x07; } +void r_ble_ll_ctrl_channel_class_reporting_make(void) { } +void r_ble_ll_ctrl_channel_class_enable_make(void) { } +void r_ble_ll_ctrl_sca_req_rsp_make(void) { } +int r_ble_ll_modify_sca(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_conn_req_peer_sca(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_50_FEATURE_SUPPORT + +#if !DEFAULT_BT_LE_50_FEATURE_SUPPORT +int r_ble_ll_conn_hci_le_rd_phy(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_hci_le_set_def_phy(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_ll_conn_hci_le_set_phy(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!DEFAULT_BT_LE_50_FEATURE_SUPPORT + +#if !CONFIG_BT_LE_DTM_ENABLED +void r_ble_lll_dtm_rx_pkt_in(void) { } +int r_ble_lll_dtm_rx_isr_end(void) { return -1; } +void r_ble_lll_dtm_reset(void) { } +void r_ble_lll_dtm_init(void) { } +void r_ble_lll_dtm_deinit(void) { } +int r_ble_lll_dtm_env_init(void) { return 0; } +void r_ble_lll_dtm_env_deinit(void) { } +int r_ble_lll_hci_dtm_tx_test(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_lll_hci_dtm_rx_test(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_lll_dtm_end_test(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_lll_hci_dtm_rx_test_v2(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +int r_ble_lll_hci_dtm_tx_test_v2(void) { return BLE_ERR_UNKNOWN_HCI_CMD; } +#endif //!CONFIG_BT_LE_DTM_ENABLED diff --git a/components/bt/controller/esp32c2/esp_bt_cfg.h b/components/bt/controller/esp32c2/esp_bt_cfg.h index 456ddcf9a859..1dbd57985733 100644 --- a/components/bt/controller/esp32c2/esp_bt_cfg.h +++ b/components/bt/controller/esp32c2/esp_bt_cfg.h @@ -45,6 +45,14 @@ extern "C" { #define DEFAULT_BT_LE_50_FEATURE_SUPPORT (0) #endif + #define DEGAULT_BT_LE_2M_PHY (CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY) + #define DEGAULT_BT_LE_CODED_PHY (CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY) + #define DEFAULT_BT_LE_EXT_ADV (CONFIG_BT_NIMBLE_EXT_ADV) + #define DEFAULT_BT_LE_PERIODIC_ADV (CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV) + #define DEFAULT_BT_LE_EXT_SCAN (CONFIG_BT_NIMBLE_EXT_SCAN) + #define DEFAULT_BT_LE_PERIODIC_SYNC (CONFIG_BT_NIMBLE_ENABLE_PERIODIC_SYNC) + #define DEFAULT_BT_LE_PAST (CONFIG_BT_NIMBLE_PERIODIC_ADV_SYNC_TRANSFER) + #define DEFAULT_BT_LE_ROLE_OBSERVER MYNEWT_VAL(BLE_ROLE_OBSERVER) #define DEFAULT_BT_LE_ROLE_CENTROL MYNEWT_VAL(BLE_ROLE_CENTRAL) #define DEFAULT_BT_LE_ROLE_PERIPHERAL MYNEWT_VAL(BLE_ROLE_PERIPHERAL) @@ -122,12 +130,55 @@ extern "C" { #else #define DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT (8) #endif + #if defined(CONFIG_BT_LE_50_FEATURE_SUPPORT) #define DEFAULT_BT_LE_50_FEATURE_SUPPORT (1) #else #define DEFAULT_BT_LE_50_FEATURE_SUPPORT (0) #endif + #if defined(CONFIG_BT_LE_LL_CFG_FEAT_LE_2M_PHY) + #define DEGAULT_BT_LE_2M_PHY (CONFIG_BT_LE_LL_CFG_FEAT_LE_2M_PHY) + #else + #define DEGAULT_BT_LE_2M_PHY (0) + #endif + + #if defined(CONFIG_BT_LE_LL_CFG_FEAT_LE_CODED_PHY) + #define DEGAULT_BT_LE_CODED_PHY (CONFIG_BT_LE_LL_CFG_FEAT_LE_CODED_PHY) + #else + #define DEGAULT_BT_LE_CODED_PHY (0) + #endif + + #if defined(CONFIG_BT_LE_EXT_ADV) + #define DEFAULT_BT_LE_EXT_ADV (CONFIG_BT_LE_EXT_ADV) + #else + #define DEFAULT_BT_LE_EXT_ADV (0) + #endif + + #if defined(CONFIG_BT_LE_ENABLE_PERIODIC_ADV) + #define DEFAULT_BT_LE_PERIODIC_ADV (CONFIG_BT_LE_ENABLE_PERIODIC_ADV) + #else + #define DEFAULT_BT_LE_PERIODIC_ADV (0) + #endif + + #if defined(CONFIG_BT_LE_EXT_SCAN) + #define DEFAULT_BT_LE_EXT_SCAN (CONFIG_BT_LE_EXT_SCAN) + #else + #define DEFAULT_BT_LE_EXT_SCAN (0) + #endif + + #if defined(CONFIG_BT_LE_ENABLE_PERIODIC_SYNC) + #define DEFAULT_BT_LE_PERIODIC_SYNC (CONFIG_BT_LE_ENABLE_PERIODIC_SYNC) + #else + #define DEFAULT_BT_LE_PERIODIC_SYNC (0) + #endif + + #if defined(BT_LE_PERIODIC_ADV_SYNC_TRANSFER) + #define DEFAULT_BT_LE_PAST (BT_LE_PERIODIC_ADV_SYNC_TRANSFER) + #else + #define DEFAULT_BT_LE_PAST (0) + #endif + #if defined(CONFIG_BT_LE_ROLE_CENTROL_ENABLE) #define DEFAULT_BT_LE_ROLE_CENTROL (1) #else diff --git a/components/bt/controller/lib_esp32c2/esp32c2-bt-lib b/components/bt/controller/lib_esp32c2/esp32c2-bt-lib index e5c7ef0bf701..99ea7d1483a9 160000 --- a/components/bt/controller/lib_esp32c2/esp32c2-bt-lib +++ b/components/bt/controller/lib_esp32c2/esp32c2-bt-lib @@ -1 +1 @@ -Subproject commit e5c7ef0bf701d02c2203e26081fdd348d45935e5 +Subproject commit 99ea7d1483a9e5329d0801293d8c051d0fddefd7 diff --git a/components/bt/host/nimble/Kconfig.in b/components/bt/host/nimble/Kconfig.in index d352fe1342ee..74ff37001049 100644 --- a/components/bt/host/nimble/Kconfig.in +++ b/components/bt/host/nimble/Kconfig.in @@ -543,131 +543,148 @@ menuconfig BT_NIMBLE_50_FEATURE_SUPPORT help Enable BLE 5 feature -config BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY - bool "Enable 2M Phy" - depends on BT_NIMBLE_50_FEATURE_SUPPORT - default y - help - Enable 2M-PHY - -config BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY - bool "Enable coded Phy" - depends on BT_NIMBLE_50_FEATURE_SUPPORT - default y - help - Enable coded-PHY +if BT_NIMBLE_50_FEATURE_SUPPORT + config BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY + bool "Enable 2M Phy" + depends on BT_NIMBLE_50_FEATURE_SUPPORT + default y + help + Enable 2M-PHY -config BT_NIMBLE_EXT_ADV - bool "Enable extended advertising" - depends on BT_NIMBLE_50_FEATURE_SUPPORT - default n - help - Enable this option to do extended advertising. Extended advertising - will be supported from BLE 5.0 onwards. - -if BT_NIMBLE_EXT_ADV - config BT_NIMBLE_MAX_EXT_ADV_INSTANCES - int "Maximum number of extended advertising instances." - range 0 4 - default 1 if BT_NIMBLE_EXT_ADV - default 0 - depends on BT_NIMBLE_EXT_ADV + config BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY + bool "Enable coded Phy" + depends on BT_NIMBLE_50_FEATURE_SUPPORT + default y help - Change this option to set maximum number of extended advertising - instances. Minimum there is always one instance of - advertising. Enter how many more advertising instances you - want. - For ESP32C2, ESP32C6 and ESP32H2, each extended advertising instance - will take about 0.5k DRAM. - - config BT_NIMBLE_EXT_ADV_MAX_SIZE - int "Maximum length of the advertising data." - range 0 1650 - default 1650 if BT_NIMBLE_EXT_ADV - default 0 - depends on BT_NIMBLE_EXT_ADV + Enable coded-PHY + + config BT_NIMBLE_EXT_ADV + bool "Enable extended advertising" + depends on BT_NIMBLE_50_FEATURE_SUPPORT + default n help - Defines the length of the extended adv data. The value should not - exceed 1650. + Enable this option to do extended advertising. Extended advertising + will be supported from BLE 5.0 onwards. + + if BT_NIMBLE_EXT_ADV + config BT_NIMBLE_MAX_EXT_ADV_INSTANCES + int "Maximum number of extended advertising instances." + range 0 4 + default 1 if BT_NIMBLE_EXT_ADV + default 0 + depends on BT_NIMBLE_EXT_ADV + help + Change this option to set maximum number of extended advertising + instances. Minimum there is always one instance of + advertising. Enter how many more advertising instances you + want. + For ESP32C2, ESP32C6 and ESP32H2, each extended advertising instance + will take about 0.5k DRAM. + + config BT_NIMBLE_EXT_ADV_MAX_SIZE + int "Maximum length of the advertising data." + range 0 1650 + default 1650 if BT_NIMBLE_EXT_ADV + default 0 + depends on BT_NIMBLE_EXT_ADV + help + Defines the length of the extended adv data. The value should not + exceed 1650. + + config BT_NIMBLE_ENABLE_PERIODIC_ADV + bool "Enable periodic advertisement." + default y + depends on BT_NIMBLE_EXT_ADV + help + Enable this option to start periodic advertisement. - config BT_NIMBLE_ENABLE_PERIODIC_ADV - bool "Enable periodic advertisement." + config BT_NIMBLE_PERIODIC_ADV_ENH + bool "Periodic adv enhancements(adi support)" + depends on BT_NIMBLE_ENABLE_PERIODIC_ADV && SOC_BLE_PERIODIC_ADV_ENH_SUPPORTED + help + Enable the periodic advertising enhancements + + config BT_NIMBLE_PERIODIC_ADV_SYNC_TRANSFER + bool "Enable Transfer Sync Events" + depends on BT_NIMBLE_ENABLE_PERIODIC_ADV + default y + help + This enables controller transfer periodic sync events to host + endif + + config BT_NIMBLE_EXT_SCAN + bool "Enable extended scanning" + depends on BT_NIMBLE_50_FEATURE_SUPPORT && BT_NIMBLE_ROLE_OBSERVER default y - depends on BT_NIMBLE_EXT_ADV help - Enable this option to start periodic advertisement. + Enable this option to do extended scanning. - config BT_NIMBLE_PERIODIC_ADV_SYNC_TRANSFER - bool "Enable Transfer Sync Events" - depends on BT_NIMBLE_ENABLE_PERIODIC_ADV + config BT_NIMBLE_ENABLE_PERIODIC_SYNC + bool "Enable periodic sync" default y + depends on BT_NIMBLE_EXT_SCAN help - This enables controller transfer periodic sync events to host -endif - -config BT_NIMBLE_MAX_PERIODIC_SYNCS - int "Maximum number of periodic advertising syncs" - depends on BT_NIMBLE_50_FEATURE_SUPPORT - range 0 3 if IDF_TARGET_ESP32C2 - range 0 8 - default 1 if BT_NIMBLE_ENABLE_PERIODIC_ADV - default 0 - help - Set this option to set the upper limit for number of periodic sync - connections. This should be less than maximum connections allowed by - controller. - -config BT_NIMBLE_MAX_PERIODIC_ADVERTISER_LIST - int "Maximum number of periodic advertiser list" - depends on BT_NIMBLE_50_FEATURE_SUPPORT && SOC_ESP_NIMBLE_CONTROLLER - range 1 5 - default 5 if BT_NIMBLE_50_FEATURE_SUPPORT - help - Set this option to set the upper limit for number of periodic advertiser list. - -config BT_NIMBLE_BLE_POWER_CONTROL - bool "Enable support for BLE Power Control" - depends on BT_NIMBLE_50_FEATURE_SUPPORT && SOC_BLE_POWER_CONTROL_SUPPORTED - default n - help - Set this option to enable the Power Control feature + Enable this option to receive periodic advertisement. + + if BT_NIMBLE_ENABLE_PERIODIC_SYNC + config BT_NIMBLE_MAX_PERIODIC_SYNCS + int "Maximum number of periodic advertising syncs" + range 0 3 if IDF_TARGET_ESP32C2 + range 0 8 + default 1 if BT_NIMBLE_ENABLE_PERIODIC_ADV + default 0 + help + Set this option to set the upper limit for number of periodic sync + connections. This should be less than maximum connections allowed by + controller. + + config BT_NIMBLE_MAX_PERIODIC_ADVERTISER_LIST + int "Maximum number of periodic advertiser list" + depends on SOC_ESP_NIMBLE_CONTROLLER + range 1 5 + default 5 if BT_NIMBLE_50_FEATURE_SUPPORT + help + Set this option to set the upper limit for number of periodic advertiser list. + endif -config BT_NIMBLE_PERIODIC_ADV_ENH - bool "Periodic adv enhancements(adi support)" - depends on BT_NIMBLE_ENABLE_PERIODIC_ADV && BT_NIMBLE_50_FEATURE_SUPPORT && SOC_BLE_PERIODIC_ADV_ENH_SUPPORTED - help - Enable the periodic advertising enhancements + config BT_NIMBLE_BLE_POWER_CONTROL + bool "Enable support for BLE Power Control" + depends on BT_NIMBLE_50_FEATURE_SUPPORT && SOC_BLE_POWER_CONTROL_SUPPORTED + default n + help + Set this option to enable the Power Control feature -menuconfig BT_NIMBLE_GATT_CACHING - bool "Enable GATT caching" - depends on BT_NIMBLE_ENABLED && BT_NIMBLE_50_FEATURE_SUPPORT - select BT_NIMBLE_DYNAMIC_SERVICE - help - Enable GATT caching -config BT_NIMBLE_GATT_CACHING_MAX_CONNS - int "Maximum connections to be cached" - depends on BT_NIMBLE_GATT_CACHING - default 1 - help - Set this option to set the upper limit on number of connections to be cached. -config BT_NIMBLE_GATT_CACHING_MAX_SVCS - int "Maximum number of services per connection" - depends on BT_NIMBLE_GATT_CACHING - default 64 - help - Set this option to set the upper limit on number of services per connection to be cached. -config BT_NIMBLE_GATT_CACHING_MAX_CHRS - int "Maximum number of characteristics per connection" - depends on BT_NIMBLE_GATT_CACHING - default 64 - help - Set this option to set the upper limit on number of characteristics per connection to be cached. -config BT_NIMBLE_GATT_CACHING_MAX_DSCS - int "Maximum number of descriptors per connection" - depends on BT_NIMBLE_GATT_CACHING - default 64 - help - Set this option to set the upper limit on number of descriptors per connection to be cached. + menuconfig BT_NIMBLE_GATT_CACHING + bool "Enable GATT caching" + depends on BT_NIMBLE_ENABLED && BT_NIMBLE_50_FEATURE_SUPPORT + select BT_NIMBLE_DYNAMIC_SERVICE + help + Enable GATT caching + config BT_NIMBLE_GATT_CACHING_MAX_CONNS + int "Maximum connections to be cached" + depends on BT_NIMBLE_GATT_CACHING + default 1 + help + Set this option to set the upper limit on number of connections to be cached. + config BT_NIMBLE_GATT_CACHING_MAX_SVCS + int "Maximum number of services per connection" + depends on BT_NIMBLE_GATT_CACHING + default 64 + help + Set this option to set the upper limit on number of services per connection to be cached. + config BT_NIMBLE_GATT_CACHING_MAX_CHRS + int "Maximum number of characteristics per connection" + depends on BT_NIMBLE_GATT_CACHING + default 64 + help + Set this option to set the upper limit on number of characteristics per connection to be cached. + config BT_NIMBLE_GATT_CACHING_MAX_DSCS + int "Maximum number of descriptors per connection" + depends on BT_NIMBLE_GATT_CACHING + default 64 + help + Set this option to set the upper limit on number of descriptors per connection to be cached. +endif config BT_NIMBLE_WHITELIST_SIZE int "BLE white list size" diff --git a/components/bt/linker_esp32c2.lf b/components/bt/linker_esp32c2.lf index 7178420a00a0..75f0d5968096 100644 --- a/components/bt/linker_esp32c2.lf +++ b/components/bt/linker_esp32c2.lf @@ -2,6 +2,14 @@ entries: .iram1+ +[sections:bt_isr_iram_text] +entries: + .isr_iram1+ + +[sections:bt_conn_iram_text] +entries: + .conn_iram1+ + [sections:bt_bss] entries: .bss+ @@ -19,10 +27,26 @@ entries: [scheme:bt_default] entries: - bt_iram_text -> iram0_bt_text - bt_bss -> dram0_bt_bss - bt_common -> dram0_bt_bss - bt_data -> dram0_bt_data + if BT_CTRL_RUN_IN_FLASH_ONLY = y: + bt_iram_text -> flash_text + bt_bss -> dram0_bt_bss + bt_common -> dram0_bt_bss + bt_data -> dram0_bt_data + + if BT_LE_PLACE_CONN_RELATED_INTO_IRAM = y: + bt_conn_iram_text -> iram0_bt_text + bt_isr_iram_text -> iram0_bt_text + else: + bt_conn_iram_text -> flash_text + bt_isr_iram_text -> flash_text + else: + bt_iram_text -> iram0_bt_text + bt_bss -> dram0_bt_bss + bt_common -> dram0_bt_bss + bt_data -> dram0_bt_data + + bt_conn_iram_text -> iram0_bt_text + bt_isr_iram_text -> iram0_bt_text # For the following fragments, order matters for # 'ALIGN(4) ALIGN(4, post) SURROUND(sym)', which generates: @@ -48,3 +72,11 @@ entries: bt_bss -> dram0_bt_bss ALIGN(4) ALIGN(4, post) SURROUND(bt_controller_bss), bt_common -> dram0_bt_bss ALIGN(4) ALIGN(4, post) SURROUND(bt_controller_common), bt_data -> dram0_bt_data ALIGN(4) ALIGN(4, post) SURROUND(bt_controller_data) + +[mapping:ble_app_flash] +archive: libble_app_flash.a +entries: + * (bt_default); + bt_bss -> dram0_bt_bss ALIGN(4) ALIGN(4, post) SURROUND(bt_controller_bss), + bt_common -> dram0_bt_bss ALIGN(4) ALIGN(4, post) SURROUND(bt_controller_common), + bt_data -> dram0_bt_data ALIGN(4) ALIGN(4, post) SURROUND(bt_controller_data) diff --git a/components/esp_rom/CMakeLists.txt b/components/esp_rom/CMakeLists.txt index e48d8c3371d6..3fe59139ed45 100644 --- a/components/esp_rom/CMakeLists.txt +++ b/components/esp_rom/CMakeLists.txt @@ -240,6 +240,14 @@ else() # Regular app build rom_linker_script("eco4") endif() + if(NOT CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY) + if(CONFIG_ESP32C2_REV_MIN_FULL GREATER_EQUAL 200) + rom_linker_script("ble-eco4") + else() + rom_linker_script("ble") + endif() + endif() + elseif(target STREQUAL "esp32c6") rom_linker_script("newlib") rom_linker_script("version") diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ble-eco4.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ble-eco4.ld new file mode 100644 index 000000000000..822fae15c8dd --- /dev/null +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ble-eco4.ld @@ -0,0 +1,1229 @@ +/* + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* ROM function interface esp32c2.rom.ld for esp32c2 + * + * + * Generated from ./interface-esp32c2.yml md5sum c679b6ed5e9f0a9c3e7b93e5e0f2a1a3 + * + * Compatible with ROM where ECO version equal or greater to 1. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + + +/*************************************** + Group bluetooth + ***************************************/ + +/* Functions */ +ble_controller_rom_data_init = 0x40000aa8; +ble_osi_coex_funcs_register = 0x40000aac; +bt_rf_coex_cfg_get_default = 0x40000ab0; +bt_rf_coex_dft_pti_get_default = 0x40000ab4; +bt_rf_coex_hooks_p_set = 0x40000ab8; +r__os_mbuf_copypkthdr = 0x40000abc; +r__os_msys_find_pool = 0x40000ac0; +r_ble_controller_get_rom_compile_version = 0x40000ac4; +//r_ble_hci_ram_hs_acl_tx = 0x40000ac8; +//r_ble_hci_ram_hs_cmd_tx = 0x40000acc; +//r_ble_hci_ram_ll_acl_tx = 0x40000ad0; +//r_ble_hci_ram_ll_evt_tx = 0x40000ad4; +r_ble_hci_ram_reset = 0x40000ad8; +r_ble_hci_ram_set_acl_free_cb = 0x40000adc; +r_ble_hci_trans_acl_buf_alloc = 0x40000ae0; +r_ble_hci_trans_buf_alloc = 0x40000ae4; +r_ble_hci_trans_buf_free = 0x40000ae8; +r_ble_hci_trans_cfg_hs = 0x40000aec; +r_ble_hci_trans_cfg_ll = 0x40000af0; +r_ble_hci_trans_deinit = 0x40000af4; +//r_ble_hci_trans_env_init = 0x40000af8; +r_ble_hci_trans_init = 0x40000afc; +r_ble_hci_uart_acl_tx = 0x40000b00; +r_ble_hci_uart_cmdevt_tx = 0x40000b04; +r_ble_hci_uart_config = 0x40000b08; +r_ble_hci_uart_free_pkt = 0x40000b0c; +r_ble_hci_uart_hs_acl_tx = 0x40000b10; +r_ble_hci_uart_hs_cmd_tx = 0x40000b14; +r_ble_hci_uart_ll_acl_tx = 0x40000b18; +r_ble_hci_uart_ll_evt_tx = 0x40000b1c; +r_ble_hci_uart_rx_acl = 0x40000b20; +r_ble_hci_uart_rx_char = 0x40000b24; +r_ble_hci_uart_rx_cmd = 0x40000b28; +r_ble_hci_uart_rx_evt = 0x40000b2c; +r_ble_hci_uart_rx_evt_cb = 0x40000b30; +r_ble_hci_uart_rx_le_evt = 0x40000b34; +r_ble_hci_uart_rx_pkt_type = 0x40000b38; +r_ble_hci_uart_rx_skip_acl = 0x40000b3c; +r_ble_hci_uart_rx_skip_cmd = 0x40000b40; +r_ble_hci_uart_rx_skip_evt = 0x40000b44; +r_ble_hci_uart_rx_sync_loss = 0x40000b48; +r_ble_hci_uart_set_acl_free_cb = 0x40000b4c; +r_ble_hci_uart_sync_lost = 0x40000b50; +r_ble_hci_uart_trans_reset = 0x40000b54; +r_ble_hci_uart_tx_char = 0x40000b58; +r_ble_hci_uart_tx_pkt_type = 0x40000b5c; +r_ble_hw_driver_deinit = 0x40000b60; +r_ble_hw_driver_env_init = 0x40000b64; +r_ble_hw_encrypt_block = 0x40000b68; +r_ble_hw_get_public_addr = 0x40000b6c; +r_ble_hw_get_static_addr = 0x40000b70; +r_ble_hw_periodiclist_add = 0x40000b74; +r_ble_hw_periodiclist_clear = 0x40000b78; +r_ble_hw_periodiclist_rmv = 0x40000b7c; +r_ble_hw_resolv_list_cur_entry = 0x40000b80; +r_ble_hw_resolv_list_get_cur_entry = 0x40000b84; +r_ble_hw_resolv_list_set = 0x40000b88; +r_ble_hw_rng_init = 0x40000b8c; +r_ble_hw_rng_start = 0x40000b90; +r_ble_hw_rng_stop = 0x40000b94; +r_ble_hw_rx_local_is_resolved = 0x40000b98; +r_ble_hw_rx_local_is_rpa = 0x40000b9c; +r_ble_hw_whitelist_add = 0x40000ba0; +r_ble_hw_whitelist_clear = 0x40000ba4; +r_ble_hw_whitelist_dev_num = 0x40000ba8; +r_ble_hw_whitelist_get_base = 0x40000bac; +r_ble_hw_whitelist_rmv = 0x40000bb0; +r_ble_hw_whitelist_search = 0x40000bb4; +r_ble_hw_whitelist_sort = 0x40000bb8; +r_ble_ll_acl_data_in = 0x40000bbc; +r_ble_ll_addr_is_id = 0x40000bc0; +r_ble_ll_addr_subtype = 0x40000bc4; +r_ble_ll_adv_active_chanset_clear = 0x40000bc8; +r_ble_ll_adv_active_chanset_is_pri = 0x40000bcc; +r_ble_ll_adv_active_chanset_is_sec = 0x40000bd0; +r_ble_ll_adv_active_chanset_set_pri = 0x40000bd4; +r_ble_ll_adv_active_chanset_set_sec = 0x40000bd8; +r_ble_ll_adv_aux_calculate = 0x40000bdc; +r_ble_ll_adv_aux_conn_rsp_pdu_make = 0x40000be0; +r_ble_ll_adv_aux_pdu_make = 0x40000be4; +r_ble_ll_adv_aux_scannable_pdu_make = 0x40000be8; +r_ble_ll_adv_aux_txed = 0x40000bec; +r_ble_ll_adv_can_chg_whitelist = 0x40000bf0; +r_ble_ll_adv_chk_rpa_timeout = 0x40000bf4; +r_ble_ll_adv_clear_all = 0x40000bf8; +r_ble_ll_adv_conn_req_rxd = 0x40000bfc; +r_ble_ll_adv_deinit = 0x40000c00; +r_ble_ll_adv_enabled = 0x40000c04; +r_ble_ll_adv_env_init = 0x40000c08; +r_ble_ll_adv_ext_set_adv_data = 0x40000c0c; +r_ble_ll_adv_ext_set_enable = 0x40000c10; +//r_ble_ll_adv_ext_set_param = 0x40000c14; +r_ble_ll_adv_ext_set_scan_rsp = 0x40000c18; +r_ble_ll_adv_final_chan = 0x40000c1c; +r_ble_ll_adv_first_chan = 0x40000c20; +r_ble_ll_adv_flags_clear = 0x40000c24; +r_ble_ll_adv_flags_set = 0x40000c28; +r_ble_ll_adv_get_chan_num = 0x40000c2c; +r_ble_ll_adv_get_local_rpa = 0x40000c30; +r_ble_ll_adv_get_peer_rpa = 0x40000c34; +r_ble_ll_adv_hci_set_random_addr = 0x40000c38; +r_ble_ll_adv_init = 0x40000c3c; +r_ble_ll_adv_legacy_pdu_make = 0x40000c40; +r_ble_ll_adv_next_chan = 0x40000c44; +r_ble_ll_adv_pdu_make = 0x40000c48; +r_ble_ll_adv_periodic_check_data_itvl = 0x40000c4c; +r_ble_ll_adv_periodic_enable = 0x40000c50; +r_ble_ll_adv_periodic_estimate_data_itvl = 0x40000c54; +r_ble_ll_adv_periodic_send_sync_ind = 0x40000c58; +r_ble_ll_adv_periodic_set_data = 0x40000c5c; +r_ble_ll_adv_periodic_set_info_transfer = 0x40000c60; +r_ble_ll_adv_periodic_set_param = 0x40000c64; +r_ble_ll_adv_pre_process = 0x40000c68; +r_ble_ll_adv_put_acad_chM_update_ind = 0x40000c6c; +r_ble_ll_adv_put_aux_ptr = 0x40000c70; +r_ble_ll_adv_put_syncinfo = 0x40000c74; +r_ble_ll_adv_rd_max_adv_data_len = 0x40000c78; +r_ble_ll_adv_rd_sup_adv_sets = 0x40000c7c; +r_ble_ll_adv_read_txpwr = 0x40000c80; +r_ble_ll_adv_remove = 0x40000c84; +r_ble_ll_adv_reset = 0x40000c88; +r_ble_ll_adv_rpa_timeout = 0x40000c8c; +r_ble_ll_adv_rpa_update = 0x40000c90; +r_ble_ll_adv_rx_pkt_in = 0x40000c94; +r_ble_ll_adv_scan_req_rxd = 0x40000c98; +r_ble_ll_adv_scan_rsp_legacy_pdu_make = 0x40000c9c; +r_ble_ll_adv_scan_rsp_pdu_make = 0x40000ca0; +r_ble_ll_adv_scheduled = 0x40000ca4; +r_ble_ll_adv_send_conn_comp_ev = 0x40000ca8; +//r_ble_ll_adv_set_adv_data = 0x40000cac; +//r_ble_ll_adv_set_adv_params = 0x40000cb0; +//r_ble_ll_adv_set_enable = 0x40000cb4; +r_ble_ll_adv_set_random_addr = 0x40000cb8; +//r_ble_ll_adv_set_scan_rsp_data = 0x40000cbc; +r_ble_ll_adv_set_sched = 0x40000cc0; +r_ble_ll_adv_sm_deinit = 0x40000cc4; +r_ble_ll_adv_sm_event_init = 0x40000cc8; +r_ble_ll_adv_sm_find_configured = 0x40000ccc; +r_ble_ll_adv_sm_get = 0x40000cd0; +r_ble_ll_adv_sm_init = 0x40000cd4; +r_ble_ll_adv_sm_reset = 0x40000cd8; +r_ble_ll_adv_sm_start = 0x40000cdc; +r_ble_ll_adv_sm_start_periodic = 0x40000ce0; +r_ble_ll_adv_sm_stop = 0x40000ce4; +r_ble_ll_adv_sm_stop_limit_reached = 0x40000ce8; +r_ble_ll_adv_sm_stop_periodic = 0x40000cec; +r_ble_ll_adv_sm_stop_timeout = 0x40000cf0; +r_ble_ll_adv_sync_calculate = 0x40000cf4; +r_ble_ll_adv_sync_get_pdu_len = 0x40000cf8; +r_ble_ll_adv_sync_pdu_make = 0x40000cfc; +r_ble_ll_adv_update_adv_scan_rsp_data = 0x40000d00; +r_ble_ll_adv_update_data_mbuf = 0x40000d04; +r_ble_ll_adv_update_did = 0x40000d08; +r_ble_ll_adv_update_periodic_data = 0x40000d0c; +r_ble_ll_arr_pool_init = 0x40000d10; +r_ble_ll_auth_pyld_tmo_event_send = 0x40000d14; +r_ble_ll_calc_offset_ticks_us_for_rampup = 0x40000d18; +r_ble_ll_calc_session_key = 0x40000d1c; +r_ble_ll_calc_ticks_per_slot = 0x40000d20; +//r_ble_ll_check_scan_params = 0x40000d24; +r_ble_ll_chk_txrx_octets = 0x40000d28; +r_ble_ll_chk_txrx_time = 0x40000d2c; +r_ble_ll_conn_adjust_pyld_len = 0x40000d30; +r_ble_ll_conn_auth_pyld_timer_cb = 0x40000d34; +r_ble_ll_conn_auth_pyld_timer_start = 0x40000d38; +r_ble_ll_conn_calc_dci = 0x40000d3c; +r_ble_ll_conn_calc_dci_csa1 = 0x40000d40; +r_ble_ll_conn_calc_itvl_ticks = 0x40000d44; +r_ble_ll_conn_chk_csm_flags = 0x40000d48; +r_ble_ll_conn_chk_phy_upd_start = 0x40000d4c; +r_ble_ll_conn_comp_event_send = 0x40000d50; +r_ble_ll_conn_connect_ind_pdu_make = 0x40000d54; +r_ble_ll_conn_create = 0x40000d58; +r_ble_ll_conn_create_cancel = 0x40000d5c; +r_ble_ll_conn_created = 0x40000d60; +r_ble_ll_conn_cth_flow_enable = 0x40000d64; +r_ble_ll_conn_cth_flow_error_fn = 0x40000d68; +r_ble_ll_conn_cth_flow_have_credit = 0x40000d6c; +r_ble_ll_conn_cth_flow_is_enabled = 0x40000d70; +r_ble_ll_conn_cth_flow_process_cmd = 0x40000d74; +r_ble_ll_conn_cth_flow_set_buffers = 0x40000d78; +r_ble_ll_conn_enqueue_pkt = 0x40000d7c; +r_ble_ll_conn_env_init = 0x40000d80; +r_ble_ll_conn_ext_master_init = 0x40000d84; +r_ble_ll_conn_find_active_conn = 0x40000d88; +r_ble_ll_conn_get_active_conn = 0x40000d8c; +r_ble_ll_conn_get_anchor = 0x40000d90; +r_ble_ll_conn_hcc_params_set_fallback = 0x40000d94; +r_ble_ll_conn_hci_cancel_conn_complete_event = 0x40000d98; +r_ble_ll_conn_hci_chk_conn_params = 0x40000d9c; +r_ble_ll_conn_hci_chk_scan_params = 0x40000da0; +r_ble_ll_conn_hci_disconnect_cmd = 0x40000da4; +r_ble_ll_conn_hci_le_ltk_neg_reply = 0x40000da8; +r_ble_ll_conn_hci_le_ltk_reply = 0x40000dac; +r_ble_ll_conn_hci_le_rd_phy = 0x40000db0; +r_ble_ll_conn_hci_le_set_phy = 0x40000db4; +r_ble_ll_conn_hci_le_start_encrypt = 0x40000db8; +r_ble_ll_conn_hci_param_nrr = 0x40000dbc; +r_ble_ll_conn_hci_param_rr = 0x40000dc0; +r_ble_ll_conn_hci_rd_auth_pyld_tmo = 0x40000dc4; +r_ble_ll_conn_hci_rd_chan_map = 0x40000dc8; +r_ble_ll_conn_hci_rd_rem_ver_cmd = 0x40000dcc; +r_ble_ll_conn_hci_rd_rssi = 0x40000dd0; +r_ble_ll_conn_hci_read_rem_features = 0x40000dd4; +r_ble_ll_conn_hci_set_chan_class = 0x40000dd8; +r_ble_ll_conn_hci_set_data_len = 0x40000ddc; +r_ble_ll_conn_hci_update = 0x40000de0; +r_ble_ll_conn_hci_wr_auth_pyld_tmo = 0x40000de4; +r_ble_ll_conn_init_phy = 0x40000de8; +r_ble_ll_conn_is_dev_connected = 0x40000dec; +r_ble_ll_conn_is_empty_pdu = 0x40000df0; +r_ble_ll_conn_is_lru = 0x40000df4; +r_ble_ll_conn_master_init = 0x40000df8; +r_ble_ll_conn_module_deinit = 0x40000dfc; +r_ble_ll_conn_module_init = 0x40000e00; +r_ble_ll_conn_module_reset = 0x40000e04; +r_ble_ll_conn_next_event = 0x40000e08; +r_ble_ll_conn_num_comp_pkts_event_send = 0x40000e0c; +r_ble_ll_conn_prepare_tx_pdu = 0x40000e10; +r_ble_ll_conn_process_conn_params = 0x40000e14; +r_ble_ll_conn_req_peer_sca = 0x40000e18; +//r_ble_ll_conn_rx_data_pdu = 0x40000e1c; +r_ble_ll_conn_set_csa = 0x40000e20; +r_ble_ll_conn_set_ext_con_params = 0x40000e24; +r_ble_ll_conn_set_global_chanmap = 0x40000e28; +r_ble_ll_conn_set_phy = 0x40000e2c; +r_ble_ll_conn_set_txpwr_by_handle = 0x40000e30; +r_ble_ll_conn_set_unknown_rx_octets = 0x40000e34; +r_ble_ll_conn_slave_start = 0x40000e38; +r_ble_ll_conn_sm_get = 0x40000e3c; +r_ble_ll_conn_sm_new = 0x40000e40; +r_ble_ll_conn_sm_npl_deinit = 0x40000e44; +r_ble_ll_conn_sm_npl_init = 0x40000e48; +r_ble_ll_conn_tx_pkt_in = 0x40000e4c; +r_ble_ll_conn_update_eff_data_len = 0x40000e50; +r_ble_ll_ctrl_chanmap_req_make = 0x40000e54; +r_ble_ll_ctrl_chk_proc_start = 0x40000e58; +r_ble_ll_ctrl_conn_param_pdu_make = 0x40000e5c; +r_ble_ll_ctrl_conn_param_pdu_proc = 0x40000e60; +r_ble_ll_ctrl_conn_param_reply = 0x40000e64; +r_ble_ll_ctrl_conn_upd_make = 0x40000e68; +r_ble_ll_ctrl_datalen_upd_make = 0x40000e6c; +r_ble_ll_ctrl_enc_allowed_pdu = 0x40000e70; +r_ble_ll_ctrl_enc_allowed_pdu_rx = 0x40000e74; +r_ble_ll_ctrl_enc_allowed_pdu_tx = 0x40000e78; +r_ble_ll_ctrl_enc_req_make = 0x40000e7c; +r_ble_ll_ctrl_find_new_phy = 0x40000e80; +r_ble_ll_ctrl_initiate_dle = 0x40000e84; +r_ble_ll_ctrl_len_proc = 0x40000e88; +r_ble_ll_ctrl_min_used_chan_rsp = 0x40000e8c; +r_ble_ll_ctrl_phy_from_phy_mask = 0x40000e90; +r_ble_ll_ctrl_phy_req_rsp_make = 0x40000e94; +r_ble_ll_ctrl_phy_tx_transition_get = 0x40000e98; +r_ble_ll_ctrl_phy_update_cancel = 0x40000e9c; +r_ble_ll_ctrl_phy_update_ind_make = 0x40000ea0; +r_ble_ll_ctrl_phy_update_proc_complete = 0x40000ea4; +r_ble_ll_ctrl_proc_init = 0x40000ea8; +r_ble_ll_ctrl_proc_rsp_timer_cb = 0x40000eac; +r_ble_ll_ctrl_proc_start = 0x40000eb0; +r_ble_ll_ctrl_proc_stop = 0x40000eb4; +r_ble_ll_ctrl_proc_unk_rsp = 0x40000eb8; +r_ble_ll_ctrl_proc_with_instant_initiated = 0x40000ebc; +r_ble_ll_ctrl_rej_ext_ind_make = 0x40000ec0; +r_ble_ll_ctrl_reject_ind_send = 0x40000ec4; +r_ble_ll_ctrl_rx_chanmap_req = 0x40000ec8; +r_ble_ll_ctrl_rx_conn_param_req = 0x40000ecc; +//r_ble_ll_ctrl_rx_conn_param_rsp = 0x40000ed0; +//r_ble_ll_ctrl_rx_conn_update = 0x40000ed4; +r_ble_ll_ctrl_rx_enc_req = 0x40000ed8; +r_ble_ll_ctrl_rx_enc_rsp = 0x40000edc; +r_ble_ll_ctrl_rx_feature_req = 0x40000ee0; +r_ble_ll_ctrl_rx_feature_rsp = 0x40000ee4; +r_ble_ll_ctrl_rx_pause_enc_req = 0x40000ee8; +r_ble_ll_ctrl_rx_pause_enc_rsp = 0x40000eec; +r_ble_ll_ctrl_rx_pdu = 0x40000ef0; +r_ble_ll_ctrl_rx_periodic_sync_ind = 0x40000ef4; +r_ble_ll_ctrl_rx_phy_req = 0x40000ef8; +r_ble_ll_ctrl_rx_phy_rsp = 0x40000efc; +r_ble_ll_ctrl_rx_phy_update_ind = 0x40000f00; +r_ble_ll_ctrl_rx_ping_rsp = 0x40000f04; +r_ble_ll_ctrl_rx_reject_ind = 0x40000f08; +r_ble_ll_ctrl_rx_sca_req = 0x40000f0c; +r_ble_ll_ctrl_rx_sca_rsp = 0x40000f10; +r_ble_ll_ctrl_rx_start_enc_req = 0x40000f14; +r_ble_ll_ctrl_rx_start_enc_rsp = 0x40000f18; +r_ble_ll_ctrl_rx_version_ind = 0x40000f1c; +r_ble_ll_ctrl_sca_req_rsp_make = 0x40000f20; +r_ble_ll_ctrl_start_enc_send = 0x40000f24; +r_ble_ll_ctrl_start_rsp_timer = 0x40000f28; +r_ble_ll_ctrl_terminate_start = 0x40000f2c; +r_ble_ll_ctrl_tx_done = 0x40000f30; +r_ble_ll_ctrl_update_features = 0x40000f34; +r_ble_ll_ctrl_version_ind_make = 0x40000f38; +r_ble_ll_data_buffer_overflow = 0x40000f3c; +r_ble_ll_deinit = 0x40000f40; +r_ble_ll_disconn_comp_event_send = 0x40000f44; +r_ble_ll_env_init = 0x40000f48; +r_ble_ll_event_comp_pkts = 0x40000f4c; +r_ble_ll_event_dbuf_overflow = 0x40000f50; +r_ble_ll_event_send = 0x40000f54; +r_ble_ll_event_tx_pkt = 0x40000f58; +r_ble_ll_ext_adv_phy_mode_to_local_phy = 0x40000f5c; +r_ble_ll_ext_conn_create = 0x40000f60; +r_ble_ll_ext_scan_parse_adv_info = 0x40000f64; +r_ble_ll_ext_scan_parse_aux_ptr = 0x40000f68; +r_ble_ll_flush_pkt_queue = 0x40000f6c; +r_ble_ll_generate_dh_key_v1 = 0x40000f70; +r_ble_ll_generate_dh_key_v2 = 0x40000f74; +r_ble_ll_generic_data_init = 0x40000f78; +r_ble_ll_get_addr_type = 0x40000f7c; +r_ble_ll_get_chan_to_scan = 0x40000f80; +r_ble_ll_get_our_devaddr = 0x40000f84; +r_ble_ll_get_tx_pwr_compensation = 0x40000f88; +r_ble_ll_hci_acl_rx = 0x40000f8c; +r_ble_ll_hci_adv_mode_ext = 0x40000f90; +r_ble_ll_hci_adv_set_enable = 0x40000f94; +r_ble_ll_hci_cb_host_buf_size = 0x40000f98; +r_ble_ll_hci_cb_set_ctrlr_to_host_fc = 0x40000f9c; +r_ble_ll_hci_cb_set_event_mask = 0x40000fa0; +r_ble_ll_hci_cb_set_event_mask2 = 0x40000fa4; +r_ble_ll_hci_chk_phy_masks = 0x40000fa8; +r_ble_ll_hci_cmd_proc = 0x40000fac; +r_ble_ll_hci_cmd_rx = 0x40000fb0; +r_ble_ll_hci_ctlr_bb_cmd_proc = 0x40000fb4; +r_ble_ll_hci_deinit = 0x40000fb8; +r_ble_ll_hci_disconnect = 0x40000fbc; +r_ble_ll_hci_env_init = 0x40000fc0; +r_ble_ll_hci_ev_conn_update = 0x40000fc4; +r_ble_ll_hci_ev_databuf_overflow = 0x40000fc8; +r_ble_ll_hci_ev_datalen_chg = 0x40000fcc; +r_ble_ll_hci_ev_encrypt_chg = 0x40000fd0; +r_ble_ll_hci_ev_hw_err = 0x40000fd4; +r_ble_ll_hci_ev_le_csa = 0x40000fd8; +r_ble_ll_hci_ev_ltk_req = 0x40000fdc; +r_ble_ll_hci_ev_phy_update = 0x40000fe0; +r_ble_ll_hci_ev_rd_rem_used_feat = 0x40000fe4; +r_ble_ll_hci_ev_rd_rem_ver = 0x40000fe8; +r_ble_ll_hci_ev_rem_conn_parm_req = 0x40000fec; +r_ble_ll_hci_ev_sca_update = 0x40000ff0; +r_ble_ll_hci_ev_send_adv_set_terminated = 0x40000ff4; +r_ble_ll_hci_ev_send_scan_req_recv = 0x40000ff8; +r_ble_ll_hci_ev_send_scan_timeout = 0x40000ffc; +r_ble_ll_hci_ev_send_vendor_err = 0x40001000; +//r_ble_ll_hci_event_send = 0x40001004; +r_ble_ll_hci_ext_scan_set_enable = 0x40001008; +r_ble_ll_hci_get_num_cmd_pkts = 0x4000100c; +r_ble_ll_hci_info_params_cmd_proc = 0x40001010; +r_ble_ll_hci_init = 0x40001014; +r_ble_ll_hci_init_support_cmd_base_on_lmp_ver = 0x40001018; +r_ble_ll_hci_is_event_enabled = 0x4000101c; +r_ble_ll_hci_is_le_event_enabled = 0x40001020; +r_ble_ll_hci_le_cmd_proc = 0x40001024; +r_ble_ll_hci_le_cmd_send_cmd_status = 0x40001028; +r_ble_ll_hci_le_encrypt = 0x4000102c; +r_ble_ll_hci_le_rand = 0x40001030; +r_ble_ll_hci_le_rd_max_data_len = 0x40001034; +r_ble_ll_hci_le_rd_sugg_data_len = 0x40001038; +r_ble_ll_hci_le_read_bufsize = 0x4000103c; +r_ble_ll_hci_le_read_local_features = 0x40001040; +r_ble_ll_hci_le_read_supp_states = 0x40001044; +r_ble_ll_hci_le_set_def_phy = 0x40001048; +r_ble_ll_hci_le_wr_sugg_data_len = 0x4000104c; +r_ble_ll_hci_link_ctrl_cmd_proc = 0x40001050; +r_ble_ll_hci_npl_init = 0x40001054; +r_ble_ll_hci_post_gen_dhkey_cmp_evt = 0x40001058; +r_ble_ll_hci_post_rd_p256_pubkey_cmp_evt = 0x4000105c; +r_ble_ll_hci_rd_bd_addr = 0x40001060; +r_ble_ll_hci_rd_local_supp_cmd = 0x40001064; +r_ble_ll_hci_rd_local_supp_feat = 0x40001068; +r_ble_ll_hci_rd_local_version = 0x4000106c; +r_ble_ll_hci_scan_set_enable = 0x40001070; +r_ble_ll_hci_send_adv_report = 0x40001074; +r_ble_ll_hci_send_dir_adv_report = 0x40001078; +//r_ble_ll_hci_send_ext_adv_report = 0x4000107c; +//r_ble_ll_hci_send_legacy_ext_adv_report = 0x40001080; +r_ble_ll_hci_send_noop = 0x40001084; +r_ble_ll_hci_set_adv_data = 0x40001088; +r_ble_ll_hci_set_le_event_mask = 0x4000108c; +r_ble_ll_hci_set_scan_rsp_data = 0x40001090; +r_ble_ll_hci_status_params_cmd_proc = 0x40001094; +r_ble_ll_hci_vs_cmd_proc = 0x40001098; +r_ble_ll_hci_vs_rd_static_addr = 0x4000109c; +r_ble_ll_hw_err_timer_cb = 0x400010a0; +r_ble_ll_hw_error = 0x400010a4; +r_ble_ll_init = 0x400010a8; +r_ble_ll_init_alloc_conn_comp_ev = 0x400010ac; +r_ble_ll_init_get_conn_comp_ev = 0x400010b0; +r_ble_ll_init_rx_pkt_in = 0x400010b4; +r_ble_ll_is_addr_empty = 0x400010b8; +r_ble_ll_is_controller_busy = 0x400010bc; +r_ble_ll_is_on_resolv_list = 0x400010c0; +r_ble_ll_is_our_devaddr = 0x400010c4; +r_ble_ll_is_rpa = 0x400010c8; +r_ble_ll_is_valid_adv_mode = 0x400010cc; +r_ble_ll_is_valid_own_addr_type = 0x400010d0; +r_ble_ll_is_valid_public_addr = 0x400010d4; +r_ble_ll_is_valid_random_addr = 0x400010d8; +r_ble_ll_mbuf_init = 0x400010dc; +r_ble_ll_misc_options_set = 0x400010e0; +r_ble_ll_modify_sca = 0x400010e4; +r_ble_ll_modify_sca_action = 0x400010e8; +r_ble_ll_pdu_max_tx_octets_get = 0x400010ec; +r_ble_ll_pdu_tx_time_get = 0x400010f0; +r_ble_ll_phy_to_phy_mode = 0x400010f4; +r_ble_ll_qa_enable = 0x400010f8; +r_ble_ll_rand = 0x400010fc; +r_ble_ll_rand_data_get = 0x40001100; +r_ble_ll_rand_deinit = 0x40001104; +r_ble_ll_rand_env_init = 0x40001108; +r_ble_ll_rand_init = 0x4000110c; +r_ble_ll_rand_prand_get = 0x40001110; +r_ble_ll_rand_sample = 0x40001114; +r_ble_ll_rand_start = 0x40001118; +r_ble_ll_read_local_p256_pub_key = 0x4000111c; +r_ble_ll_read_rf_path_compensation = 0x40001120; +r_ble_ll_read_supp_features = 0x40001124; +r_ble_ll_read_supp_states = 0x40001128; +r_ble_ll_read_tx_power = 0x4000112c; +r_ble_ll_reset = 0x40001130; +r_ble_ll_resolv_clear_all_pl_bit = 0x40001134; +r_ble_ll_resolv_clear_all_wl_bit = 0x40001138; +r_ble_ll_resolv_deinit = 0x4000113c; +r_ble_ll_resolv_enable_cmd = 0x40001140; +r_ble_ll_resolv_enabled = 0x40001144; +r_ble_ll_resolv_env_init = 0x40001148; +r_ble_ll_resolv_gen_priv_addr = 0x4000114c; +r_ble_ll_resolv_gen_rpa = 0x40001150; +r_ble_ll_resolv_get_addr_pointer = 0x40001154; +r_ble_ll_resolv_get_index = 0x40001158; +r_ble_ll_resolv_get_irk_pointer = 0x4000115c; +r_ble_ll_resolv_get_list = 0x40001160; +r_ble_ll_resolv_get_priv_addr = 0x40001164; +r_ble_ll_resolv_get_rpa_tmo = 0x40001168; +r_ble_ll_resolv_init = 0x4000116c; +r_ble_ll_resolv_irk_nonzero = 0x40001170; +r_ble_ll_resolv_list_add = 0x40001174; +r_ble_ll_resolv_list_chg_allowed = 0x40001178; +r_ble_ll_resolv_list_clr = 0x4000117c; +r_ble_ll_resolv_list_find = 0x40001180; +r_ble_ll_resolv_list_read_size = 0x40001184; +r_ble_ll_resolv_list_reset = 0x40001188; +r_ble_ll_resolv_list_rmv = 0x4000118c; +r_ble_ll_resolv_local_addr_rd = 0x40001190; +r_ble_ll_resolv_peer_addr_rd = 0x40001194; +r_ble_ll_resolv_peer_rpa_any = 0x40001198; +r_ble_ll_resolv_reset = 0x4000119c; +r_ble_ll_resolv_rpa = 0x400011a0; +r_ble_ll_resolv_rpa_timer_cb = 0x400011a4; +r_ble_ll_resolv_set_local_rpa = 0x400011a8; +r_ble_ll_resolv_set_peer_rpa = 0x400011ac; +r_ble_ll_resolv_set_rpa_tmo = 0x400011b0; +r_ble_ll_resolve_set_priv_mode = 0x400011b4; +r_ble_ll_rxpdu_alloc = 0x400011b8; +r_ble_ll_scan_add_scan_rsp_adv = 0x400011bc; +r_ble_ll_scan_adv_decode_addr = 0x400011c0; +r_ble_ll_scan_aux_data_ref = 0x400011c4; +r_ble_ll_scan_aux_data_unref = 0x400011c8; +r_ble_ll_scan_can_chg_whitelist = 0x400011cc; +r_ble_ll_scan_check_periodic_sync = 0x400011d0; +r_ble_ll_scan_classify_filter_aux_init = 0x400011d4; +r_ble_ll_scan_classify_filter_init = 0x400011d8; +r_ble_ll_scan_common_init = 0x400011dc; +r_ble_ll_scan_continue_en = 0x400011e0; +r_ble_ll_scan_deinit = 0x400011e4; +r_ble_ll_scan_dup_check_ext = 0x400011e8; +r_ble_ll_scan_dup_check_legacy = 0x400011ec; +r_ble_ll_scan_dup_move_to_head = 0x400011f0; +r_ble_ll_scan_dup_new = 0x400011f4; +r_ble_ll_scan_dup_update_ext = 0x400011f8; +r_ble_ll_scan_dup_update_legacy = 0x400011fc; +r_ble_ll_scan_enabled = 0x40001200; +r_ble_ll_scan_end_adv_evt = 0x40001204; +r_ble_ll_scan_env_init = 0x40001208; +r_ble_ll_scan_ext_initiator_start = 0x4000120c; +r_ble_ll_scan_get_addr_data_from_legacy = 0x40001210; +r_ble_ll_scan_get_addr_from_ext_adv = 0x40001214; +r_ble_ll_scan_get_cur_sm = 0x40001218; +r_ble_ll_scan_get_ext_adv_report = 0x4000121c; +r_ble_ll_scan_get_local_rpa = 0x40001220; +r_ble_ll_scan_get_next_adv_prim_chan = 0x40001224; +r_ble_ll_scan_get_peer_rpa = 0x40001228; +r_ble_ll_scan_have_rxd_scan_rsp = 0x4000122c; +r_ble_ll_scan_init = 0x40001230; +r_ble_ll_scan_initiator_start = 0x40001234; +r_ble_ll_scan_is_inside_window = 0x40001238; +r_ble_ll_scan_move_window_to = 0x4000123c; +r_ble_ll_scan_npl_reset = 0x40001240; +r_ble_ll_scan_parse_auxptr = 0x40001244; +r_ble_ll_scan_parse_ext_hdr = 0x40001248; +r_ble_ll_scan_pre_process = 0x4000124c; +r_ble_ll_scan_record_new_adv = 0x40001250; +r_ble_ll_scan_refresh_nrpa = 0x40001254; +r_ble_ll_scan_reset = 0x40001258; +r_ble_ll_scan_rx_pkt_in = 0x4000125c; +r_ble_ll_scan_rx_pkt_in_on_aux = 0x40001260; +r_ble_ll_scan_rx_pkt_in_on_legacy = 0x40001264; +r_ble_ll_scan_rx_pkt_in_restore_addr_data = 0x40001268; +r_ble_ll_scan_rxed = 0x4000126c; +//r_ble_ll_scan_send_adv_report = 0x40001270; +r_ble_ll_scan_send_truncated = 0x40001274; +r_ble_ll_scan_set_enable = 0x40001278; +r_ble_ll_scan_set_peer_rpa = 0x4000127c; +r_ble_ll_scan_set_perfer_addr = 0x40001280; +r_ble_ll_scan_set_scan_params = 0x40001284; +r_ble_ll_scan_sm_start = 0x40001288; +r_ble_ll_scan_sm_stop = 0x4000128c; +r_ble_ll_scan_time_hci_to_ticks = 0x40001290; +r_ble_ll_scan_update_aux_data = 0x40001294; +r_ble_ll_scan_whitelist_enabled = 0x40001298; +r_ble_ll_set_default_privacy_mode = 0x4000129c; +r_ble_ll_set_default_sync_transfer_params = 0x400012a0; +r_ble_ll_set_ext_scan_params = 0x400012a4; +r_ble_ll_set_host_feat = 0x400012a8; +r_ble_ll_set_public_addr = 0x400012ac; +r_ble_ll_set_random_addr = 0x400012b0; +r_ble_ll_set_sync_transfer_params = 0x400012b4; +r_ble_ll_state_get = 0x400012b8; +r_ble_ll_state_set = 0x400012bc; +r_ble_ll_sync_adjust_ext_hdr = 0x400012c0; +r_ble_ll_sync_cancel = 0x400012c4; +r_ble_ll_sync_cancel_complete_event = 0x400012c8; +r_ble_ll_sync_check_acad = 0x400012cc; +r_ble_ll_sync_check_failed = 0x400012d0; +r_ble_ll_sync_create = 0x400012d4; +r_ble_ll_sync_deinit = 0x400012d8; +r_ble_ll_sync_enabled = 0x400012dc; +r_ble_ll_sync_env_init = 0x400012e0; +r_ble_ll_sync_est_event_failed = 0x400012e4; +r_ble_ll_sync_est_event_success = 0x400012e8; +r_ble_ll_sync_established = 0x400012ec; +r_ble_ll_sync_filter_enabled = 0x400012f0; +r_ble_ll_sync_find = 0x400012f4; +r_ble_ll_sync_get_cur_sm = 0x400012f8; +r_ble_ll_sync_get_handle = 0x400012fc; +r_ble_ll_sync_get_sm = 0x40001300; +r_ble_ll_sync_info_event = 0x40001304; +r_ble_ll_sync_init = 0x40001308; +r_ble_ll_sync_list_add = 0x4000130c; +r_ble_ll_sync_list_clear = 0x40001310; +r_ble_ll_sync_list_empty = 0x40001314; +r_ble_ll_sync_list_get_free = 0x40001318; +r_ble_ll_sync_list_remove = 0x4000131c; +r_ble_ll_sync_list_search = 0x40001320; +r_ble_ll_sync_list_size = 0x40001324; +r_ble_ll_sync_lost_event = 0x40001328; +r_ble_ll_sync_next_event = 0x4000132c; +r_ble_ll_sync_on_list = 0x40001330; +r_ble_ll_sync_parse_ext_hdr = 0x40001334; +r_ble_ll_sync_periodic_ind = 0x40001338; +r_ble_ll_sync_phy_mode_to_aux_phy = 0x4000133c; +r_ble_ll_sync_phy_mode_to_hci = 0x40001340; +r_ble_ll_sync_put_syncinfo = 0x40001344; +r_ble_ll_sync_receive_enable = 0x40001348; +r_ble_ll_sync_reserve = 0x4000134c; +r_ble_ll_sync_reset = 0x40001350; +r_ble_ll_sync_reset_sm = 0x40001354; +r_ble_ll_sync_rx_pkt_in = 0x40001358; +r_ble_ll_sync_send_per_adv_rpt = 0x4000135c; +r_ble_ll_sync_send_sync_ind = 0x40001360; +r_ble_ll_sync_send_truncated_per_adv_rpt = 0x40001364; +r_ble_ll_sync_sm_clear = 0x40001368; +r_ble_ll_sync_terminate = 0x4000136c; +r_ble_ll_sync_transfer = 0x40001370; +r_ble_ll_sync_transfer_get = 0x40001374; +r_ble_ll_sync_transfer_received = 0x40001378; +r_ble_ll_task = 0x4000137c; +r_ble_ll_trace_set_func = 0x40001380; +r_ble_ll_trace_u32 = 0x40001384; +r_ble_ll_trace_u32x2 = 0x40001388; +r_ble_ll_trace_u32x3 = 0x4000138c; +r_ble_ll_tx_flat_mbuf_pducb = 0x40001390; +r_ble_ll_tx_mbuf_pducb = 0x40001394; +r_ble_ll_tx_pkt_in = 0x40001398; +r_ble_ll_update_max_tx_octets_phy_mode = 0x4000139c; +r_ble_ll_usecs_to_ticks_round_up = 0x400013a0; +r_ble_ll_utils_calc_access_addr = 0x400013a4; +r_ble_ll_utils_calc_dci_csa2 = 0x400013a8; +r_ble_ll_utils_calc_num_used_chans = 0x400013ac; +r_ble_ll_utils_calc_window_widening = 0x400013b0; +r_ble_ll_utils_csa2_perm = 0x400013b4; +r_ble_ll_utils_csa2_prng = 0x400013b8; +r_ble_ll_utils_remapped_channel = 0x400013bc; +r_ble_ll_whitelist_add = 0x400013c0; +r_ble_ll_whitelist_chg_allowed = 0x400013c4; +r_ble_ll_whitelist_clear = 0x400013c8; +r_ble_ll_whitelist_read_size = 0x400013cc; +r_ble_ll_whitelist_rmv = 0x400013d0; +r_ble_ll_whitelist_search = 0x400013d4; +r_ble_ll_write_rf_path_compensation = 0x400013d8; +r_ble_lll_adv_aux_scannable_pdu_payload_len = 0x400013dc; +r_ble_lll_adv_aux_schedule = 0x400013e0; +r_ble_lll_adv_aux_schedule_first = 0x400013e4; +r_ble_lll_adv_aux_schedule_next = 0x400013e8; +r_ble_lll_adv_aux_scheduled = 0x400013ec; +r_ble_lll_adv_aux_set_start_time = 0x400013f0; +r_ble_lll_adv_coex_dpc_calc_pti_update_itvl = 0x400013f4; +r_ble_lll_adv_coex_dpc_process_pri = 0x400013f8; +r_ble_lll_adv_coex_dpc_process_sec = 0x400013fc; +r_ble_lll_adv_coex_dpc_pti_get = 0x40001400; +r_ble_lll_adv_coex_dpc_update = 0x40001404; +r_ble_lll_adv_coex_dpc_update_on_adv_start = 0x40001408; +r_ble_lll_adv_coex_dpc_update_on_aux_scheduled = 0x4000140c; +r_ble_lll_adv_coex_dpc_update_on_data_updated = 0x40001410; +r_ble_lll_adv_coex_dpc_update_on_event_end = 0x40001414; +r_ble_lll_adv_coex_dpc_update_on_event_scheduled = 0x40001418; +r_ble_lll_adv_done = 0x4000141c; +r_ble_lll_adv_drop_event = 0x40001420; +r_ble_lll_adv_event_done = 0x40001424; +r_ble_lll_adv_event_rmvd_from_sched = 0x40001428; +r_ble_lll_adv_ext_estimate_data_itvl = 0x4000142c; +r_ble_lll_adv_get_sec_pdu_len = 0x40001430; +r_ble_lll_adv_halt = 0x40001434; +r_ble_lll_adv_make_done = 0x40001438; +r_ble_lll_adv_periodic_done = 0x4000143c; +r_ble_lll_adv_periodic_event_done = 0x40001440; +r_ble_lll_adv_periodic_rmvd_from_sched = 0x40001444; +r_ble_lll_adv_periodic_schedule_first = 0x40001448; +r_ble_lll_adv_periodic_schedule_next = 0x4000144c; +r_ble_lll_adv_periodic_start = 0x40001450; +r_ble_lll_adv_periodic_stop = 0x40001454; +r_ble_lll_adv_pri_schedule_tx_pdu = 0x40001458; +r_ble_lll_adv_reschedule_event = 0x4000145c; +r_ble_lll_adv_reschedule_periodic_event = 0x40001460; +r_ble_lll_adv_rx_pkt_isr = 0x40001464; +r_ble_lll_adv_sec_done = 0x40001468; +r_ble_lll_adv_sec_event_done = 0x4000146c; +r_ble_lll_adv_sec_schedule_next_aux = 0x40001470; +r_ble_lll_adv_secondary_tx_start_cb = 0x40001474; +r_ble_lll_adv_sm_deinit = 0x40001478; +r_ble_lll_adv_sm_event_init = 0x4000147c; +r_ble_lll_adv_sm_event_restore = 0x40001480; +r_ble_lll_adv_sm_event_store = 0x40001484; +r_ble_lll_adv_sm_init = 0x40001488; +r_ble_lll_adv_sm_reset = 0x4000148c; +r_ble_lll_adv_start = 0x40001490; +r_ble_lll_adv_stop = 0x40001494; +r_ble_lll_adv_sync_next_scheduled = 0x40001498; +r_ble_lll_adv_sync_schedule = 0x4000149c; +r_ble_lll_adv_sync_tx_done = 0x400014a0; +r_ble_lll_adv_sync_tx_end = 0x400014a4; +r_ble_lll_adv_sync_tx_start_cb = 0x400014a8; +r_ble_lll_adv_tx_done = 0x400014ac; +r_ble_lll_adv_tx_start_cb = 0x400014b0; +r_ble_lll_adv_update_rsp_offset = 0x400014b4; +r_ble_lll_aux_scan_cb = 0x400014b8; +r_ble_lll_aux_scan_drop = 0x400014bc; +r_ble_lll_aux_scan_drop_event_cb = 0x400014c0; +r_ble_lll_calc_us_convert_tick_unit = 0x400014c4; +r_ble_lll_conn_append_tx_buffer = 0x400014c8; +r_ble_lll_conn_can_send_next_pdu = 0x400014cc; +r_ble_lll_conn_check_opcode_matched = 0x400014d0; +r_ble_lll_conn_coex_dpc_process = 0x400014d4; +r_ble_lll_conn_coex_dpc_pti_get = 0x400014d8; +r_ble_lll_conn_coex_dpc_update = 0x400014dc; +r_ble_lll_conn_coex_dpc_update_on_event_end = 0x400014e0; +r_ble_lll_conn_coex_dpc_update_on_event_scheduled = 0x400014e4; +r_ble_lll_conn_coex_dpc_update_on_event_started = 0x400014e8; +r_ble_lll_conn_cth_flow_alloc_credit = 0x400014ec; +r_ble_lll_conn_cth_flow_free_credit = 0x400014f0; +r_ble_lll_conn_current_sm_over = 0x400014f4; +r_ble_lll_conn_end = 0x400014f8; +r_ble_lll_conn_env_deinit = 0x400014fc; +r_ble_lll_conn_env_init = 0x40001500; +r_ble_lll_conn_event_end = 0x40001504; +r_ble_lll_conn_event_end_timer_cb = 0x40001508; +r_ble_lll_conn_event_halt = 0x4000150c; +r_ble_lll_conn_event_is_over = 0x40001510; +r_ble_lll_conn_event_start_cb = 0x40001514; +r_ble_lll_conn_free_rx_mbuf = 0x40001518; +r_ble_lll_conn_get_addr_info_from_rx_buf = 0x4000151c; +r_ble_lll_conn_get_ce_end_time = 0x40001520; +r_ble_lll_conn_get_next_sched_time = 0x40001524; +r_ble_lll_conn_get_rx_mbuf = 0x40001528; +r_ble_lll_conn_halt = 0x4000152c; +r_ble_lll_conn_master_common_init = 0x40001530; +r_ble_lll_conn_master_new = 0x40001534; +r_ble_lll_conn_module_deinit = 0x40001538; +r_ble_lll_conn_module_init = 0x4000153c; +r_ble_lll_conn_module_reset = 0x40001540; +r_ble_lll_conn_no_mem_evt_pre_cb = 0x40001544; +r_ble_lll_conn_pre_process = 0x40001548; +r_ble_lll_conn_process_acked_pdu = 0x4000154c; +r_ble_lll_conn_process_in_isr = 0x40001550; +r_ble_lll_conn_recv_ack = 0x40001554; +r_ble_lll_conn_recv_valid_packet = 0x40001558; +r_ble_lll_conn_reset_pending_sched = 0x4000155c; +r_ble_lll_conn_rx_pkt_isr = 0x40001560; +r_ble_lll_conn_sched_next_anchor = 0x40001564; +r_ble_lll_conn_sched_next_event = 0x40001568; +r_ble_lll_conn_set_slave_flow_control = 0x4000156c; +r_ble_lll_conn_slave_new = 0x40001570; +r_ble_lll_conn_sm_new = 0x40001574; +r_ble_lll_conn_sm_npl_deinit = 0x40001578; +r_ble_lll_conn_sm_npl_init = 0x4000157c; +r_ble_lll_conn_superversion_timer_cb = 0x40001580; +r_ble_lll_conn_timeout = 0x40001584; +r_ble_lll_conn_update_anchor = 0x40001588; +r_ble_lll_conn_update_conn_ind_params = 0x4000158c; +r_ble_lll_conn_update_encryption = 0x40001590; +r_ble_lll_conn_update_tx_buffer = 0x40001594; +r_ble_lll_deinit = 0x40001598; +r_ble_lll_dtm_calculate_itvl = 0x4000159c; +r_ble_lll_dtm_ctx_free = 0x400015a0; +r_ble_lll_dtm_deinit = 0x400015a4; +r_ble_lll_dtm_end_test = 0x400015a8; +r_ble_lll_dtm_ev_rx_restart_cb = 0x400015ac; +r_ble_lll_dtm_ev_tx_resched_cb = 0x400015b0; +r_ble_lll_dtm_init = 0x400015b4; +r_ble_lll_dtm_reset = 0x400015b8; +r_ble_lll_dtm_rx_create_ctx = 0x400015bc; +r_ble_lll_dtm_rx_isr_end = 0x400015c0; +r_ble_lll_dtm_rx_isr_start = 0x400015c4; +r_ble_lll_dtm_rx_pkt_in = 0x400015c8; +r_ble_lll_dtm_rx_sched_cb = 0x400015cc; +r_ble_lll_dtm_rx_start = 0x400015d0; +r_ble_lll_dtm_rx_test = 0x400015d4; +r_ble_lll_dtm_set_next = 0x400015d8; +r_ble_lll_dtm_tx_create_ctx = 0x400015dc; +r_ble_lll_dtm_tx_done = 0x400015e0; +r_ble_lll_dtm_tx_sched_cb = 0x400015e4; +r_ble_lll_dtm_tx_test = 0x400015e8; +r_ble_lll_dtm_wfr_timer_exp = 0x400015ec; +r_ble_lll_event_rx_pkt = 0x400015f0; +r_ble_lll_ext_scan_coex_dpc_process = 0x400015f4; +r_ble_lll_ext_scan_coex_dpc_pti_get = 0x400015f8; +r_ble_lll_ext_scan_coex_dpc_update = 0x400015fc; +r_ble_lll_ext_scan_coex_dpc_update_on_start = 0x40001600; +r_ble_lll_hci_dtm_rx_test = 0x40001604; +r_ble_lll_hci_dtm_rx_test_v2 = 0x40001608; +r_ble_lll_hci_dtm_tx_test = 0x4000160c; +r_ble_lll_hci_dtm_tx_test_ext = 0x40001610; +r_ble_lll_hci_dtm_tx_test_v2 = 0x40001614; +r_ble_lll_hci_dtm_tx_test_v2_ext = 0x40001618; +r_ble_lll_init = 0x4000161c; +r_ble_lll_init_pre_process = 0x40001620; +r_ble_lll_init_rx_pkt_isr = 0x40001624; +r_ble_lll_per_adv_coex_dpc_calc_pti_update_itvl = 0x40001628; +r_ble_lll_per_adv_coex_dpc_process = 0x4000162c; +r_ble_lll_per_adv_coex_dpc_pti_get = 0x40001630; +r_ble_lll_per_adv_coex_dpc_update = 0x40001634; +r_ble_lll_per_adv_coex_dpc_update_on_data_updated = 0x40001638; +r_ble_lll_per_adv_coex_dpc_update_on_scheduled = 0x4000163c; +r_ble_lll_per_adv_coex_dpc_update_on_start = 0x40001640; +r_ble_lll_reset = 0x40001644; +r_ble_lll_rfmgmt_controller_sleep_en = 0x40001648; +r_ble_lll_rfmgmt_deinit = 0x4000164c; +r_ble_lll_rfmgmt_disable = 0x40001650; +r_ble_lll_rfmgmt_enable = 0x40001654; +r_ble_lll_rfmgmt_enable_now = 0x40001658; +r_ble_lll_rfmgmt_init = 0x4000165c; +r_ble_lll_rfmgmt_is_enabled = 0x40001660; +r_ble_lll_rfmgmt_release = 0x40001664; +r_ble_lll_rfmgmt_release_ev = 0x40001668; +r_ble_lll_rfmgmt_reset = 0x4000166c; +r_ble_lll_rfmgmt_scan_changed = 0x40001670; +r_ble_lll_rfmgmt_sched_changed = 0x40001674; +r_ble_lll_rfmgmt_set_sleep_cb = 0x40001678; +r_ble_lll_rfmgmt_ticks_to_enabled = 0x4000167c; +r_ble_lll_rfmgmt_timer_exp = 0x40001680; +r_ble_lll_rfmgmt_timer_reschedule = 0x40001684; +r_ble_lll_rx_pdu_in = 0x40001688; +r_ble_lll_rx_pkt_in = 0x4000168c; +r_ble_lll_rx_pkt_isr = 0x40001690; +r_ble_lll_scan_abort_aux_sched = 0x40001694; +r_ble_lll_scan_aux_data_free = 0x40001698; +r_ble_lll_scan_chk_resume = 0x4000169c; +r_ble_lll_scan_clean_cur_aux_data = 0x400016a0; +r_ble_lll_scan_coex_event_cb = 0x400016a4; +r_ble_lll_scan_common_init = 0x400016a8; +r_ble_lll_scan_deinit = 0x400016ac; +r_ble_lll_scan_duration_period_timers_restart = 0x400016b0; +r_ble_lll_scan_duration_period_timers_stop = 0x400016b4; +r_ble_lll_scan_duration_timer_cb = 0x400016b8; +r_ble_lll_scan_event_proc = 0x400016bc; +r_ble_lll_scan_ext_adv_init = 0x400016c0; +r_ble_lll_scan_halt = 0x400016c4; +r_ble_lll_scan_has_sent_scan_req = 0x400016c8; +r_ble_lll_scan_init = 0x400016cc; +r_ble_lll_scan_npl_init = 0x400016d0; +r_ble_lll_scan_npl_reset = 0x400016d4; +r_ble_lll_scan_npl_restore = 0x400016d8; +r_ble_lll_scan_npl_store = 0x400016dc; +r_ble_lll_scan_period_timer_cb = 0x400016e0; +r_ble_lll_scan_process_adv_in_isr = 0x400016e4; +r_ble_lll_scan_process_rsp_in_isr = 0x400016e8; +r_ble_lll_scan_req_backoff = 0x400016ec; +r_ble_lll_scan_restart = 0x400016f0; +r_ble_lll_scan_rx_isr_on_aux = 0x400016f4; +r_ble_lll_scan_rx_isr_on_legacy = 0x400016f8; +r_ble_lll_scan_rx_pkt_isr = 0x400016fc; +r_ble_lll_scan_sched_next_aux = 0x40001700; +r_ble_lll_scan_sched_remove = 0x40001704; +r_ble_lll_scan_start = 0x40001708; +r_ble_lll_scan_start_rx = 0x4000170c; +r_ble_lll_scan_stop = 0x40001710; +r_ble_lll_scan_targeta_is_matched = 0x40001714; +r_ble_lll_scan_timer_cb = 0x40001718; +r_ble_lll_sched_adv_new = 0x4000171c; +r_ble_lll_sched_adv_resched_pdu = 0x40001720; +r_ble_lll_sched_adv_reschedule = 0x40001724; +r_ble_lll_sched_aux_scan = 0x40001728; +r_ble_lll_sched_conn_overlap = 0x4000172c; +r_ble_lll_sched_conn_reschedule = 0x40001730; +r_ble_lll_sched_deinit = 0x40001734; +r_ble_lll_sched_dtm = 0x40001738; +r_ble_lll_sched_env_init = 0x4000173c; +r_ble_lll_sched_execute_check = 0x40001740; +r_ble_lll_sched_execute_item = 0x40001744; +r_ble_lll_sched_init = 0x40001748; +r_ble_lll_sched_insert_if_empty = 0x4000174c; +r_ble_lll_sched_is_overlap = 0x40001750; +r_ble_lll_sched_master_new = 0x40001754; +r_ble_lll_sched_next_time = 0x40001758; +r_ble_lll_sched_overlaps_current = 0x4000175c; +r_ble_lll_sched_periodic_adv = 0x40001760; +r_ble_lll_sched_rmv_elem = 0x40001764; +r_ble_lll_sched_rmv_elem_type = 0x40001768; +r_ble_lll_sched_run = 0x4000176c; +r_ble_lll_sched_scan_req_over_aux_ptr = 0x40001770; +r_ble_lll_sched_slave_new = 0x40001774; +r_ble_lll_sched_stop = 0x40001778; +r_ble_lll_sched_sync = 0x4000177c; +r_ble_lll_sched_sync_overlaps_current = 0x40001780; +r_ble_lll_sched_sync_reschedule = 0x40001784; +r_ble_lll_sync_chain_start_cb = 0x40001788; +r_ble_lll_sync_coex_dpc_process = 0x4000178c; +r_ble_lll_sync_coex_dpc_pti_get = 0x40001790; +r_ble_lll_sync_coex_dpc_update = 0x40001794; +r_ble_lll_sync_current_sm_over = 0x40001798; +r_ble_lll_sync_deinit = 0x4000179c; +r_ble_lll_sync_event_end = 0x400017a0; +r_ble_lll_sync_event_end_cb = 0x400017a4; +r_ble_lll_sync_event_start_cb = 0x400017a8; +r_ble_lll_sync_get_event_end_time = 0x400017ac; +r_ble_lll_sync_halt = 0x400017b0; +r_ble_lll_sync_init = 0x400017b4; +r_ble_lll_sync_new = 0x400017b8; +r_ble_lll_sync_reset = 0x400017bc; +r_ble_lll_sync_reset_sm = 0x400017c0; +r_ble_lll_sync_rmvd_from_sched = 0x400017c4; +r_ble_lll_sync_rx_pkt_isr = 0x400017c8; +r_ble_lll_sync_schedule_chain = 0x400017cc; +r_ble_lll_sync_stop = 0x400017d0; +r_ble_lll_sync_trnasfer_sched = 0x400017d4; +r_ble_phy_access_addr_get = 0x400017d8; +r_ble_phy_calculate_rxtx_ifs = 0x400017dc; +r_ble_phy_calculate_rxwindow = 0x400017e0; +r_ble_phy_calculate_txrx_ifs = 0x400017e4; +r_ble_phy_check_bb_status = 0x400017e8; +r_ble_phy_complete_rx_info = 0x400017ec; +r_ble_phy_config_access_addr = 0x400017f0; +r_ble_phy_data_make = 0x400017f4; +r_ble_phy_disable = 0x400017f8; +r_ble_phy_disable_irq = 0x400017fc; +r_ble_phy_disable_whitening = 0x40001800; +r_ble_phy_enable_whitening = 0x40001804; +r_ble_phy_encrypt_disable = 0x40001808; +r_ble_phy_env_init = 0x4000180c; +r_ble_phy_get_current_phy = 0x40001810; +r_ble_phy_get_packet_counter = 0x40001814; +r_ble_phy_get_packet_status = 0x40001818; +r_ble_phy_get_pyld_time_offset = 0x4000181c; +r_ble_phy_get_rx_phy_mode = 0x40001820; +r_ble_phy_get_seq_end_st = 0x40001824; +r_ble_phy_init = 0x40001828; +//r_ble_phy_isr = 0x4000182c; +r_ble_phy_max_data_pdu_pyld = 0x40001830; +r_ble_phy_mode_config = 0x40001834; +r_ble_phy_mode_convert = 0x40001838; +r_ble_phy_mode_write = 0x4000183c; +r_ble_phy_module_deinit = 0x40001840; +r_ble_phy_module_init = 0x40001844; +r_ble_phy_monitor_bb_sync = 0x40001848; +r_ble_phy_reset_bb_monitor = 0x4000184c; +r_ble_phy_resolv_list_disable = 0x40001850; +r_ble_phy_resolv_list_enable = 0x40001854; +r_ble_phy_restart_sequence = 0x40001858; +r_ble_phy_rx_set_start_time_forcibly = 0x4000185c; +r_ble_phy_rxpdu_copy = 0x40001860; +r_ble_phy_seq_encrypt_enable = 0x40001864; +r_ble_phy_seq_encrypt_set_pkt_cntr = 0x40001868; +r_ble_phy_sequence_end_isr = 0x4000186c; +r_ble_phy_sequence_get_mode = 0x40001870; +r_ble_phy_sequence_is_running = 0x40001874; +r_ble_phy_sequence_is_waiting_rsp = 0x40001878; +r_ble_phy_sequence_single_end = 0x4000187c; +r_ble_phy_sequence_tx_end_invoke = 0x40001880; +r_ble_phy_sequence_update_conn_ind_params = 0x40001884; +r_ble_phy_set_adv_mode = 0x40001888; +r_ble_phy_set_coex_pti = 0x4000188c; +r_ble_phy_set_conn_ind_pdu = 0x40001890; +r_ble_phy_set_conn_mode = 0x40001894; +r_ble_phy_set_dev_address = 0x40001898; +r_ble_phy_set_rx_pwr_compensation = 0x4000189c; +r_ble_phy_set_rxhdr = 0x400018a0; +r_ble_phy_set_scan_mode = 0x400018a4; +r_ble_phy_set_sequence_mode = 0x400018a8; +r_ble_phy_set_single_packet_rx_sequence = 0x400018ac; +r_ble_phy_set_single_packet_tx_sequence = 0x400018b0; +r_ble_phy_set_tx_rx_transition = 0x400018b4; +r_ble_phy_set_txend_cb = 0x400018b8; +r_ble_phy_setchan = 0x400018bc; +r_ble_phy_start_rx_immediately = 0x400018c0; +r_ble_phy_state_get = 0x400018c4; +r_ble_phy_timer_config_start_time = 0x400018c8; +r_ble_phy_timer_start_now = 0x400018cc; +r_ble_phy_timer_stop = 0x400018d0; +r_ble_phy_tx_set_start_time = 0x400018d4; +r_ble_phy_txpower_round = 0x400018d8; +r_ble_phy_txpwr_set = 0x400018dc; +r_ble_phy_update_conn_sequence = 0x400018e0; +r_ble_phy_update_encryption = 0x400018e4; +r_ble_phy_update_ifs = 0x400018e8; +r_ble_phy_xcvr_state_get = 0x400018ec; +r_ble_plf_set_log_level = 0x400018f0; +r_ble_rtc_wake_up_cpu_init = 0x400018f4; +r_ble_rtc_wake_up_state_clr = 0x400018f8; +r_ble_vendor_hci_register = 0x400018fc; +r_bt_rf_coex_cfg_set = 0x40001900; +r_bt_rf_coex_coded_txrx_time_upper_lim = 0x40001904; +r_bt_rf_coex_dft_pti_set = 0x40001908; +r_bt_rf_coex_hook_deinit = 0x4000190c; +r_bt_rf_coex_hook_init = 0x40001910; +r_bt_rf_coex_hook_st_set = 0x40001914; +r_bt_rf_coex_hooks_p_set_default = 0x40001918; +r_btdm_disable_adv_delay = 0x4000191c; +r_btdm_switch_phy_coded = 0x40001920; +r_esp_wait_disabled = 0x40001924; +r_get_be16 = 0x40001928; +r_get_be24 = 0x4000192c; +r_get_be32 = 0x40001930; +r_get_be64 = 0x40001934; +r_get_le16 = 0x40001938; +r_get_le24 = 0x4000193c; +r_get_le32 = 0x40001940; +r_get_le64 = 0x40001944; +r_get_local_irk_offset = 0x40001948; +r_get_local_rpa_offset = 0x4000194c; +r_get_max_skip = 0x40001950; +r_get_peer_id_offset = 0x40001954; +r_get_peer_irk_offset = 0x40001958; +r_get_peer_rpa_offset = 0x4000195c; +r_hal_rtc_intr_init = 0x40001960; +//r_hal_rtc_irq_handler = 0x40001964; +r_hal_timer_deinit = 0x40001968; +r_hal_timer_disable_irq = 0x4000196c; +r_hal_timer_env_init = 0x40001970; +r_hal_timer_init = 0x40001974; +r_hal_timer_process = 0x40001978; +r_hal_timer_read = 0x4000197c; +r_hal_timer_read_tick = 0x40001980; +r_hal_timer_set_cb = 0x40001984; +r_hal_timer_set_exp_tick = 0x40001988; +r_hal_timer_start = 0x4000198c; +r_hal_timer_start_at = 0x40001990; +r_hal_timer_stop = 0x40001994; +r_hal_timer_task_start = 0x40001998; +r_ll_assert = 0x4000199c; +r_mem_init_mbuf_pool = 0x400019a0; +r_mem_malloc_mbuf_pool = 0x400019a4; +r_mem_malloc_mbufpkt_pool = 0x400019a8; +r_mem_malloc_mempool = 0x400019ac; +r_mem_malloc_mempool_ext = 0x400019b0; +r_mem_malloc_mempool_gen = 0x400019b4; +r_mem_pullup_obj = 0x400019b8; +r_mem_split_frag = 0x400019bc; +r_os_cputime_get32 = 0x400019c0; +r_os_cputime_ticks_to_usecs = 0x400019c4; +r_os_cputime_timer_init = 0x400019c8; +r_os_cputime_timer_relative = 0x400019cc; +r_os_cputime_timer_start = 0x400019d0; +r_os_cputime_timer_stop = 0x400019d4; +r_os_cputime_usecs_to_ticks = 0x400019d8; +r_os_mbuf_adj = 0x400019dc; +r_os_mbuf_append = 0x400019e0; +r_os_mbuf_appendfrom = 0x400019e4; +r_os_mbuf_cmpf = 0x400019e8; +r_os_mbuf_cmpm = 0x400019ec; +r_os_mbuf_concat = 0x400019f0; +r_os_mbuf_copydata = 0x400019f4; +r_os_mbuf_copyinto = 0x400019f8; +r_os_mbuf_dup = 0x400019fc; +r_os_mbuf_extend = 0x40001a00; +r_os_mbuf_free = 0x40001a04; +r_os_mbuf_free_chain = 0x40001a08; +r_os_mbuf_get = 0x40001a0c; +r_os_mbuf_get_pkthdr = 0x40001a10; +r_os_mbuf_leadingspace = 0x40001a14; +r_os_mbuf_len = 0x40001a18; +r_os_mbuf_off = 0x40001a1c; +r_os_mbuf_pack_chains = 0x40001a20; +r_os_mbuf_pool_init = 0x40001a24; +r_os_mbuf_prepend = 0x40001a28; +r_os_mbuf_prepend_pullup = 0x40001a2c; +r_os_mbuf_pullup = 0x40001a30; +r_os_mbuf_trailingspace = 0x40001a34; +r_os_mbuf_trim_front = 0x40001a38; +r_os_mbuf_widen = 0x40001a3c; +r_os_memblock_from = 0x40001a40; +r_os_memblock_get = 0x40001a44; +r_os_memblock_put = 0x40001a48; +r_os_memblock_put_from_cb = 0x40001a4c; +r_os_mempool_clear = 0x40001a50; +r_os_mempool_ext_clear = 0x40001a54; +r_os_mempool_ext_init = 0x40001a58; +r_os_mempool_init = 0x40001a60; +r_os_mempool_init_internal = 0x40001a64; +r_os_mempool_is_sane = 0x40001a68; +r_os_mempool_module_init = 0x40001a6c; +r_os_mqueue_get = 0x40001a74; +r_os_mqueue_init = 0x40001a78; +r_os_mqueue_put = 0x40001a7c; +r_os_msys_count = 0x40001a80; +r_os_msys_get = 0x40001a84; +r_os_msys_get_pkthdr = 0x40001a88; +r_os_msys_num_free = 0x40001a8c; +r_os_msys_register = 0x40001a90; +r_os_msys_reset = 0x40001a94; +r_pri_phy_valid = 0x40001a98; +r_put_be16 = 0x40001a9c; +r_put_be24 = 0x40001aa0; +r_put_be32 = 0x40001aa4; +r_put_be64 = 0x40001aa8; +r_put_le16 = 0x40001aac; +r_put_le24 = 0x40001ab0; +r_put_le32 = 0x40001ab4; +r_put_le64 = 0x40001ab8; +r_rtc0_timer_handler = 0x40001abc; +r_sdkconfig_get_opts = 0x40001ac0; +r_sdkconfig_set_opts = 0x40001ac4; +r_sec_phy_valid = 0x40001ac8; +r_swap_buf = 0x40001acc; +r_swap_in_place = 0x40001ad0; +/* Data (.data, .bss, .rodata) */ +ble_lll_dtm_module_env_p = 0x3fcdffc4; +g_ble_lll_dtm_prbs15_data = 0x3ff4fee4; +g_ble_lll_dtm_prbs9_data = 0x3ff4fde4; +g_channel_rf_to_index = 0x3ff4fdbc; +g_ble_lll_rfmgmt_data = 0x3fcdff7c; +g_ble_sleep_enter_cb = 0x3fcdff78; +g_ble_sleep_exit_cb = 0x3fcdff74; +ble_lll_sched_env_p = 0x3fcdff70; +ble_ll_env_p = 0x3fcdff6c; +g_ble_ll_pdu_header_tx_time_ro = 0x3ff4fdb4; +ble_ll_adv_env_p = 0x3fcdff68; +ble_ll_conn_env_p = 0x3fcdff64; +ble_ll_conn_required_phy_mask = 0x3ff4fdb0; +ble_ll_valid_conn_phy_mask = 0x3ff4fdaf; +g_ble_ll_ctrl_pkt_lengths_ro = 0x3ff4fd8c; +ble_ll_hci_env_p = 0x3fcdff60; +g_debug_le_private_key = 0x3ff4fd6c; +g_ecc_key = 0x3fcdfefc; +ble_ll_rand_env_p = 0x3fcdfef8; +ble_ll_resolv_env_p = 0x3fcdfef4; +g_ble_ll_resolve_hdr = 0x3fcdfeec; +g_device_mode_default = 0x3fcdfe68; +ble_ll_scan_classify_filter_aux_check_cb = 0x3fcdfee8; +ble_ll_scan_classify_filter_check_cb = 0x3fcdfee4; +ble_ll_scan_env_p = 0x3fcdfee0; +g_ble_ll_supp_cmds_ro = 0x3ff4fd3c; +ble_ll_sync_env_p = 0x3fcdfedc; +g_ble_sca_ppm_tbl_ro = 0x3ff4fd2c; +priv_config_opts = 0x3fcdfe48; +ble_hci_uart_reset_cmd = 0x3ff4fd28; +ble_hci_trans_env_p = 0x3fcdfed8; +ble_hci_trans_mode = 0x3fcdfe44; +ble_hci_trans_funcs_ptr = 0x3fcdfed4; +r_ble_lll_stub_funcs_ptr = 0x3fcdfed0; +r_ble_stub_funcs_ptr = 0x3fcdfecc; +r_ext_funcs_p = 0x3fcdfec8; +r_npl_funcs = 0x3fcdfec4; +ble_hw_env_p = 0x3fcdfec0; +ble_phy_module_env_p = 0x3fcdfebc; +g_ble_phy_chan_freq_ro = 0x3ff4fd00; +g_ble_phy_mode_pkt_start_off_ro = 0x3ff4fcf8; +g_ble_phy_rxtx_ifs_compensation_ro = 0x3ff4fce8; +g_ble_phy_t_rxaddrdelay_ro = 0x3ff4fce4; +g_ble_phy_t_rxenddelay_ro = 0x3ff4fce0; +g_ble_phy_t_txdelay_ro = 0x3ff4fcdc; +g_ble_phy_t_txenddelay_ro = 0x3ff4fcd8; +g_ble_phy_txrx_ifs_compensation_ro = 0x3ff4fcc8; +hal_timer_env_p = 0x3fcdfeb8; +r_osi_coex_funcs_p = 0x3fcdfeb4; +bt_rf_coex_hooks = 0x3fcdfeac; +bt_rf_coex_hooks_p = 0x3fcdfea8; +coex_hook_st_group_tab = 0x3ff4fcbc; +coex_hook_st_group_to_coex_schm_st_tab = 0x3ff4fcb8; +s_ble_act_count_by_group = 0x3fcdfea4; +s_ble_coex_st_map = 0x3fcdfe90; +bt_rf_coex_cfg_cb = 0x3fcdfe74; +bt_rf_coex_cfg_p = 0x3fcdfe70; +bt_rf_coex_cfg_rom = 0x3ff4fc9c; +bt_rf_coex_pti_dft_p = 0x3fcdfe6c; +bt_rf_coex_pti_dft_rom = 0x3fcdfe04; +conn_dynamic_pti_param_rom = 0x3ff4fc84; +conn_phy_coded_max_data_time_param_rom = 0x3ff4fc80; +ext_adv_dynamic_pti_param_rom = 0x3ff4fc4c; +ext_scan_dynamic_param_rom = 0x3ff4fc14; +legacy_adv_dynamic_pti_param_rom = 0x3ff4fbf4; +per_adv_dynamic_pti_param_rom = 0x3ff4fbd8; +sync_dynamic_param_rom = 0x3ff4fbc0; +g_ble_plf_log_level = 0x3fcdfe00; +g_msys_pool_list = 0x3fcdfdf8; +g_os_mempool_list = 0x3fcdfdf0; + + +/*************************************** + Group eco4_bluetooth + ***************************************/ + +/* Functions */ +r_ble_ll_adv_ext_pdu_tx_len = 0x40002eb0; +//r_ble_ll_adv_ext_estimate_data_itvl = 0x40002eb4; +//r_ble_ll_adv_ext_check_data_itvl = 0x40002eb8; +r_ble_ll_ctrl_channel_status_report_timer_cb = 0x40002ebc; +r_ble_ll_ctrl_channel_class_enable_make = 0x40002ec0; +r_ble_ll_ctrl_channel_class_reporting_make = 0x40002ec4; +r_ble_ll_ctrl_rx_channel_reporting_ind = 0x40002ec8; +r_ble_ll_ctrl_rx_channel_status_ind = 0x40002ecc; +r_ble_ll_ctrl_channel_class_info_update = 0x40002ed0; +r_ble_ll_adv_set_data_related_addr_change = 0x40002ed4; +r_ble_ll_misc_additional_options_set = 0x40002ed8; +r_ble_phy_get_txdbm_by_level = 0x40002edc; +r_hal_timer_disable_intr = 0x40002ee0; +r_hal_timer_enable_intr = 0x40002ee4; +r_hal_timer_task_stop = 0x40002ee8; +r_ble_lll_rfmgmt_env_init = 0x40002eec; +r_ble_ll_scan_set_aux_ll_flag = 0x40002ef0; +r_ble_ll_rf_temp_calibration = 0x40002ef4; +r_ble_ll_adv_env_deinit = 0x40002ef8; +r_ble_ll_conn_env_deinit = 0x40002efc; +r_ble_ll_hci_env_deinit = 0x40002f00; +r_ble_ll_rand_env_deinit = 0x40002f04; +r_ble_ll_resolv_env_deinit = 0x40002f08; +r_ble_ll_scan_env_deinit = 0x40002f0c; +r_ble_ll_sync_env_deinit = 0x40002f10; +r_ble_lll_rfmgmt_env_deinit = 0x40002f14; +r_hal_timer_env_deinit = 0x40002f18; +r_ble_ll_env_deinit = 0x40002f1c; +r_ble_ll_generic_data_deinit = 0x40002f20; +//r_ble_hci_trans_env_deinit = 0x40002f24; +r_ble_ll_conn_callout_env_init = 0x40002f28; +r_ble_ll_conn_callout_env_deinit = 0x40002f2c; +r_ble_ll_scan_callout_env_init = 0x40002f30; +r_ble_ll_scan_callout_env_deinit = 0x40002f34; +r_ble_ll_callout_env_init = 0x40002f38; +r_ble_ll_callout_env_deinit = 0x40002f3c; +r_ble_ll_resolv_callout_env_init = 0x40002f40; +r_ble_ll_resolv_callout_env_deinit = 0x40002f44; +r_ble_ll_get_npl_element_info = 0x40002f48; +r_ble_rtc_wake_up_cpu_clr = 0x40002f4c; +r_ble_ll_scan_hci_set_adv_report_flow_ctrl = 0x40002f50; +r_ble_ll_scan_hci_update_adv_report_flow_ctrl = 0x40002f54; +r_ble_ll_scan_send_adv_lost_report = 0x40002f58; +r_ble_ll_scan_adv_report_cth_flow_is_enabled = 0x40002f5c; +r_ble_ll_scan_adv_report_cth_flow_alloc_credit = 0x40002f60; +r_ble_ll_scan_adv_report_cth_flow_free_credit = 0x40002f64; +r_ble_ll_scan_adv_report_cth_flow_have_credit = 0x40002f68; +r_ble_ll_scan_adv_report_lost_cnt_threshold_arrived = 0x40002f6c; +r_ble_ll_scan_adv_report_lost_cnt_clear = 0x40002f70; +r_ble_ll_scan_adv_report_lost_cnt_add = 0x40002f74; +r_ble_ll_trace_hex = 0x40002f78; +r_ble_ll_conn_calc_closest_event_cntr = 0x40002f7c; +r_ble_ll_trace_buffer_select = 0x40002f80; +r_ble_ll_adv_vendor_hci_legacy_adv_clear = 0x40002f84; +r_ble_ll_conn_is_lru_compare_with_sync = 0x40002f88; +r_ble_ll_conn_rollback_last_unmapped_chan = 0x40002f8c; +r_ble_ll_hci_vs_csa_set = 0x40002f90; +r_ble_ll_hci_reset = 0x40002f94; +r_ble_ll_adv_status_check = 0x40002f98; +r_ble_ll_conn_status_check = 0x40002f9c; +r_ble_ll_scan_status_check = 0x40002fa0; +r_ble_ll_sync_status_check = 0x40002fa4; +r_ble_ll_resolv_status_check = 0x40002fa8; +r_ble_ll_whitelist_status_check = 0x40002fac; +r_ble_ll_adv_delay_get = 0x40002fb0; +r_ble_ll_scan_continue_status_get = 0x40002fb4; +r_ble_ll_default_privacy_mode_get = 0x40002fb8; +r_ble_ll_adv_periodic_status_check = 0x40002fbc; +r_ble_ll_sync_list_status_check = 0x40002fc0; +r_ble_lll_rfmgmt_wake_up_ev = 0x40002fc4; +r_ble_lll_sched_env_deinit = 0x40002fc8; +r_ble_phy_env_deinit = 0x40002fcc; +r_ble_hw_driver_env_deinit = 0x40002fd0; +r_ble_lll_dtm_env_init = 0x40002fd4; +r_ble_lll_dtm_env_deinit = 0x40002fd8; +r_ble_lll_scan_callout_env_init = 0x40002fdc; +r_ble_lll_scan_callout_env_deinit = 0x40002fe0; +r_ble_lll_scan_env_init = 0x40002fe4; +r_ble_lll_scan_env_deinit = 0x40002fe8; +r_ble_lll_get_npl_element_info = 0x40002fec; +r_ble_lll_conn_rxpdu_alloc = 0x40002ff0; +r_ble_lll_scan_filter_out_useless_adv = 0x40002ff4; +r_ble_hw_whitelist_check_in_wl = 0x40002ff8; +r_ble_phy_stats_reset = 0x40002ffc; +r_ble_phy_ramup_time_set = 0x40003000; +r_ble_lll_rfmgmt_should_skip_light_sleep_check = 0x40003004; +r_ble_phy_rx_err_record = 0x40003008; +r_ble_lll_rfmgmt_wake_up_overhead_set = 0x4000300c; +r_ble_lll_conn_event_delete_and_reschedule = 0x40003010; +r_ble_lll_conn_should_reschedule = 0x40003014; +r_ble_lll_adv_ext_event_rmvd_from_sched = 0x40003018; +r_ble_lll_conn_process_rx_data_after_halt = 0x4000301c; +r_ble_phy_global_rxbuf_get = 0x40003020; +/* Data (.data, .bss, .rodata) */ +priv_config_additional_opts_ptr = 0x3fcdfa70; +g_ble_ll_ctrl_pkt_lengths_eco4_ro = 0x3ff4fbac; diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ble.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ble.ld new file mode 100644 index 000000000000..afd6b9cdeee7 --- /dev/null +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ble.ld @@ -0,0 +1,914 @@ +/* + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* ROM function interface esp32c2.rom.ld for esp32c2 + * + * + * Generated from ./interface-esp32c2.yml md5sum c679b6ed5e9f0a9c3e7b93e5e0f2a1a3 + * + * Compatible with ROM where ECO version equal or greater to 1. + * + * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. + */ + + +/*************************************** + Group bluetooth + ***************************************/ + +/* Functions */ +ble_controller_rom_data_init = 0x40000aa8; +ble_osi_coex_funcs_register = 0x40000aac; +bt_rf_coex_cfg_get_default = 0x40000ab0; +bt_rf_coex_dft_pti_get_default = 0x40000ab4; +bt_rf_coex_hooks_p_set = 0x40000ab8; +r__os_mbuf_copypkthdr = 0x40000abc; +r_ble_controller_get_rom_compile_version = 0x40000ac4; +r_ble_hci_ram_reset = 0x40000ad8; +r_ble_hci_ram_set_acl_free_cb = 0x40000adc; +r_ble_hci_trans_acl_buf_alloc = 0x40000ae0; +r_ble_hci_trans_buf_alloc = 0x40000ae4; +r_ble_hci_trans_buf_free = 0x40000ae8; +r_ble_hci_trans_cfg_hs = 0x40000aec; +r_ble_hci_trans_cfg_ll = 0x40000af0; +r_ble_hci_trans_init = 0x40000afc; +r_ble_hci_uart_acl_tx = 0x40000b00; +r_ble_hci_uart_cmdevt_tx = 0x40000b04; +r_ble_hci_uart_config = 0x40000b08; +r_ble_hci_uart_free_pkt = 0x40000b0c; +r_ble_hci_uart_rx_acl = 0x40000b20; +r_ble_hci_uart_rx_char = 0x40000b24; +r_ble_hci_uart_rx_cmd = 0x40000b28; +r_ble_hci_uart_rx_evt = 0x40000b2c; +r_ble_hci_uart_rx_evt_cb = 0x40000b30; +r_ble_hci_uart_rx_le_evt = 0x40000b34; +r_ble_hci_uart_rx_pkt_type = 0x40000b38; +r_ble_hci_uart_rx_skip_acl = 0x40000b3c; +r_ble_hci_uart_rx_skip_cmd = 0x40000b40; +r_ble_hci_uart_rx_skip_evt = 0x40000b44; +r_ble_hci_uart_rx_sync_loss = 0x40000b48; +r_ble_hci_uart_set_acl_free_cb = 0x40000b4c; +r_ble_hci_uart_sync_lost = 0x40000b50; +r_ble_hci_uart_trans_reset = 0x40000b54; +r_ble_hci_uart_tx_char = 0x40000b58; +r_ble_hci_uart_tx_pkt_type = 0x40000b5c; +r_ble_hw_encrypt_block = 0x40000b68; +r_ble_hw_get_public_addr = 0x40000b6c; +r_ble_hw_get_static_addr = 0x40000b70; +r_ble_hw_periodiclist_add = 0x40000b74; +r_ble_hw_periodiclist_clear = 0x40000b78; +r_ble_hw_periodiclist_rmv = 0x40000b7c; +r_ble_hw_resolv_list_cur_entry = 0x40000b80; +r_ble_hw_resolv_list_set = 0x40000b88; +r_ble_hw_rng_init = 0x40000b8c; +r_ble_hw_rng_start = 0x40000b90; +r_ble_hw_rng_stop = 0x40000b94; +r_ble_hw_rx_local_is_resolved = 0x40000b98; +r_ble_hw_rx_local_is_rpa = 0x40000b9c; +r_ble_hw_whitelist_add = 0x40000ba0; +r_ble_hw_whitelist_dev_num = 0x40000ba8; +r_ble_hw_whitelist_get_base = 0x40000bac; +r_ble_hw_whitelist_search = 0x40000bb4; +r_ble_hw_whitelist_sort = 0x40000bb8; +r_ble_ll_acl_data_in = 0x40000bbc; +r_ble_ll_addr_is_id = 0x40000bc0; +r_ble_ll_addr_subtype = 0x40000bc4; +r_ble_ll_adv_active_chanset_clear = 0x40000bc8; +r_ble_ll_adv_active_chanset_is_pri = 0x40000bcc; +r_ble_ll_adv_active_chanset_is_sec = 0x40000bd0; +r_ble_ll_adv_active_chanset_set_pri = 0x40000bd4; +r_ble_ll_adv_active_chanset_set_sec = 0x40000bd8; +r_ble_ll_adv_aux_calculate = 0x40000bdc; +r_ble_ll_adv_aux_conn_rsp_pdu_make = 0x40000be0; +r_ble_ll_adv_aux_pdu_make = 0x40000be4; +r_ble_ll_adv_aux_scannable_pdu_make = 0x40000be8; +r_ble_ll_adv_aux_txed = 0x40000bec; +r_ble_ll_adv_can_chg_whitelist = 0x40000bf0; +r_ble_ll_adv_chk_rpa_timeout = 0x40000bf4; +r_ble_ll_adv_clear_all = 0x40000bf8; +r_ble_ll_adv_conn_req_rxd = 0x40000bfc; +r_ble_ll_adv_enabled = 0x40000c04; +r_ble_ll_adv_ext_set_adv_data = 0x40000c0c; +r_ble_ll_adv_ext_set_scan_rsp = 0x40000c18; +r_ble_ll_adv_final_chan = 0x40000c1c; +r_ble_ll_adv_first_chan = 0x40000c20; +r_ble_ll_adv_flags_clear = 0x40000c24; +r_ble_ll_adv_flags_set = 0x40000c28; +r_ble_ll_adv_get_chan_num = 0x40000c2c; +r_ble_ll_adv_get_local_rpa = 0x40000c30; +r_ble_ll_adv_get_peer_rpa = 0x40000c34; +r_ble_ll_adv_hci_set_random_addr = 0x40000c38; +r_ble_ll_adv_init = 0x40000c3c; +r_ble_ll_adv_next_chan = 0x40000c44; +r_ble_ll_adv_pdu_make = 0x40000c48; +r_ble_ll_adv_periodic_check_data_itvl = 0x40000c4c; +r_ble_ll_adv_periodic_estimate_data_itvl = 0x40000c54; +r_ble_ll_adv_periodic_send_sync_ind = 0x40000c58; +r_ble_ll_adv_periodic_set_info_transfer = 0x40000c60; +r_ble_ll_adv_periodic_set_param = 0x40000c64; +r_ble_ll_adv_pre_process = 0x40000c68; +r_ble_ll_adv_put_acad_chM_update_ind = 0x40000c6c; +r_ble_ll_adv_put_aux_ptr = 0x40000c70; +r_ble_ll_adv_put_syncinfo = 0x40000c74; +r_ble_ll_adv_rd_max_adv_data_len = 0x40000c78; +r_ble_ll_adv_rd_sup_adv_sets = 0x40000c7c; +r_ble_ll_adv_read_txpwr = 0x40000c80; +r_ble_ll_adv_rpa_timeout = 0x40000c8c; +r_ble_ll_adv_rpa_update = 0x40000c90; +r_ble_ll_adv_scan_req_rxd = 0x40000c98; +r_ble_ll_adv_scan_rsp_legacy_pdu_make = 0x40000c9c; +r_ble_ll_adv_scan_rsp_pdu_make = 0x40000ca0; +r_ble_ll_adv_scheduled = 0x40000ca4; +r_ble_ll_adv_set_random_addr = 0x40000cb8; +r_ble_ll_adv_sm_deinit = 0x40000cc4; +r_ble_ll_adv_sm_event_init = 0x40000cc8; +r_ble_ll_adv_sm_find_configured = 0x40000ccc; +r_ble_ll_adv_sm_get = 0x40000cd0; +r_ble_ll_adv_sm_reset = 0x40000cd8; +r_ble_ll_adv_sm_start = 0x40000cdc; +r_ble_ll_adv_sm_start_periodic = 0x40000ce0; +r_ble_ll_adv_sm_stop = 0x40000ce4; +r_ble_ll_adv_sm_stop_limit_reached = 0x40000ce8; +r_ble_ll_adv_sm_stop_periodic = 0x40000cec; +r_ble_ll_adv_sm_stop_timeout = 0x40000cf0; +r_ble_ll_adv_sync_get_pdu_len = 0x40000cf8; +r_ble_ll_adv_update_adv_scan_rsp_data = 0x40000d00; +r_ble_ll_adv_update_data_mbuf = 0x40000d04; +r_ble_ll_adv_update_did = 0x40000d08; +r_ble_ll_adv_update_periodic_data = 0x40000d0c; +r_ble_ll_auth_pyld_tmo_event_send = 0x40000d14; +r_ble_ll_calc_offset_ticks_us_for_rampup = 0x40000d18; +r_ble_ll_calc_session_key = 0x40000d1c; +r_ble_ll_calc_ticks_per_slot = 0x40000d20; +r_ble_ll_chk_txrx_octets = 0x40000d28; +r_ble_ll_chk_txrx_time = 0x40000d2c; +r_ble_ll_conn_adjust_pyld_len = 0x40000d30; +r_ble_ll_conn_auth_pyld_timer_cb = 0x40000d34; +r_ble_ll_conn_auth_pyld_timer_start = 0x40000d38; +r_ble_ll_conn_calc_dci = 0x40000d3c; +r_ble_ll_conn_calc_dci_csa1 = 0x40000d40; +r_ble_ll_conn_calc_itvl_ticks = 0x40000d44; +r_ble_ll_conn_chk_csm_flags = 0x40000d48; +r_ble_ll_conn_chk_phy_upd_start = 0x40000d4c; +r_ble_ll_conn_comp_event_send = 0x40000d50; +r_ble_ll_conn_create_cancel = 0x40000d5c; +r_ble_ll_conn_cth_flow_enable = 0x40000d64; +r_ble_ll_conn_cth_flow_error_fn = 0x40000d68; +r_ble_ll_conn_cth_flow_have_credit = 0x40000d6c; +r_ble_ll_conn_cth_flow_is_enabled = 0x40000d70; +r_ble_ll_conn_cth_flow_process_cmd = 0x40000d74; +r_ble_ll_conn_cth_flow_set_buffers = 0x40000d78; +r_ble_ll_conn_ext_master_init = 0x40000d84; +r_ble_ll_conn_find_active_conn = 0x40000d88; +r_ble_ll_conn_get_active_conn = 0x40000d8c; +r_ble_ll_conn_get_anchor = 0x40000d90; +r_ble_ll_conn_hcc_params_set_fallback = 0x40000d94; +r_ble_ll_conn_hci_cancel_conn_complete_event = 0x40000d98; +r_ble_ll_conn_hci_chk_conn_params = 0x40000d9c; +r_ble_ll_conn_hci_chk_scan_params = 0x40000da0; +r_ble_ll_conn_hci_disconnect_cmd = 0x40000da4; +r_ble_ll_conn_hci_le_ltk_neg_reply = 0x40000da8; +r_ble_ll_conn_hci_le_ltk_reply = 0x40000dac; +r_ble_ll_conn_hci_le_rd_phy = 0x40000db0; +r_ble_ll_conn_hci_le_start_encrypt = 0x40000db8; +r_ble_ll_conn_hci_param_nrr = 0x40000dbc; +r_ble_ll_conn_hci_param_rr = 0x40000dc0; +r_ble_ll_conn_hci_rd_auth_pyld_tmo = 0x40000dc4; +r_ble_ll_conn_hci_rd_chan_map = 0x40000dc8; +r_ble_ll_conn_hci_rd_rem_ver_cmd = 0x40000dcc; +r_ble_ll_conn_hci_rd_rssi = 0x40000dd0; +r_ble_ll_conn_hci_read_rem_features = 0x40000dd4; +r_ble_ll_conn_hci_set_data_len = 0x40000ddc; +r_ble_ll_conn_hci_update = 0x40000de0; +r_ble_ll_conn_hci_wr_auth_pyld_tmo = 0x40000de4; +r_ble_ll_conn_init_phy = 0x40000de8; +r_ble_ll_conn_is_empty_pdu = 0x40000df0; +r_ble_ll_conn_is_lru = 0x40000df4; +r_ble_ll_conn_master_init = 0x40000df8; +r_ble_ll_conn_module_reset = 0x40000e04; +r_ble_ll_conn_num_comp_pkts_event_send = 0x40000e0c; +r_ble_ll_conn_process_conn_params = 0x40000e14; +r_ble_ll_conn_req_peer_sca = 0x40000e18; +r_ble_ll_conn_set_csa = 0x40000e20; +r_ble_ll_conn_set_ext_con_params = 0x40000e24; +r_ble_ll_conn_set_global_chanmap = 0x40000e28; +r_ble_ll_conn_set_phy = 0x40000e2c; +r_ble_ll_conn_set_txpwr_by_handle = 0x40000e30; +r_ble_ll_conn_set_unknown_rx_octets = 0x40000e34; +r_ble_ll_conn_sm_get = 0x40000e3c; +r_ble_ll_conn_tx_pkt_in = 0x40000e4c; +r_ble_ll_conn_update_eff_data_len = 0x40000e50; +r_ble_ll_ctrl_chanmap_req_make = 0x40000e54; +r_ble_ll_ctrl_conn_param_pdu_make = 0x40000e5c; +r_ble_ll_ctrl_conn_param_pdu_proc = 0x40000e60; +r_ble_ll_ctrl_conn_param_reply = 0x40000e64; +r_ble_ll_ctrl_datalen_upd_make = 0x40000e6c; +r_ble_ll_ctrl_enc_allowed_pdu = 0x40000e70; +r_ble_ll_ctrl_enc_allowed_pdu_rx = 0x40000e74; +r_ble_ll_ctrl_enc_req_make = 0x40000e7c; +r_ble_ll_ctrl_find_new_phy = 0x40000e80; +r_ble_ll_ctrl_initiate_dle = 0x40000e84; +r_ble_ll_ctrl_len_proc = 0x40000e88; +r_ble_ll_ctrl_min_used_chan_rsp = 0x40000e8c; +r_ble_ll_ctrl_phy_from_phy_mask = 0x40000e90; +r_ble_ll_ctrl_phy_req_rsp_make = 0x40000e94; +r_ble_ll_ctrl_phy_tx_transition_get = 0x40000e98; +r_ble_ll_ctrl_phy_update_cancel = 0x40000e9c; +r_ble_ll_ctrl_phy_update_ind_make = 0x40000ea0; +r_ble_ll_ctrl_phy_update_proc_complete = 0x40000ea4; +r_ble_ll_ctrl_proc_rsp_timer_cb = 0x40000eac; +r_ble_ll_ctrl_proc_stop = 0x40000eb4; +r_ble_ll_ctrl_proc_with_instant_initiated = 0x40000ebc; +r_ble_ll_ctrl_rej_ext_ind_make = 0x40000ec0; +r_ble_ll_ctrl_reject_ind_send = 0x40000ec4; +r_ble_ll_ctrl_rx_chanmap_req = 0x40000ec8; +r_ble_ll_ctrl_rx_conn_param_req = 0x40000ecc; +r_ble_ll_ctrl_rx_enc_req = 0x40000ed8; +r_ble_ll_ctrl_rx_enc_rsp = 0x40000edc; +r_ble_ll_ctrl_rx_feature_req = 0x40000ee0; +r_ble_ll_ctrl_rx_pause_enc_req = 0x40000ee8; +r_ble_ll_ctrl_rx_pause_enc_rsp = 0x40000eec; +r_ble_ll_ctrl_rx_periodic_sync_ind = 0x40000ef4; +r_ble_ll_ctrl_rx_phy_req = 0x40000ef8; +r_ble_ll_ctrl_rx_phy_rsp = 0x40000efc; +r_ble_ll_ctrl_rx_phy_update_ind = 0x40000f00; +r_ble_ll_ctrl_rx_ping_rsp = 0x40000f04; +r_ble_ll_ctrl_rx_reject_ind = 0x40000f08; +r_ble_ll_ctrl_rx_sca_req = 0x40000f0c; +r_ble_ll_ctrl_rx_sca_rsp = 0x40000f10; +r_ble_ll_ctrl_rx_start_enc_req = 0x40000f14; +r_ble_ll_ctrl_rx_start_enc_rsp = 0x40000f18; +r_ble_ll_ctrl_rx_version_ind = 0x40000f1c; +r_ble_ll_ctrl_sca_req_rsp_make = 0x40000f20; +r_ble_ll_ctrl_start_enc_send = 0x40000f24; +r_ble_ll_ctrl_start_rsp_timer = 0x40000f28; +r_ble_ll_ctrl_terminate_start = 0x40000f2c; +r_ble_ll_ctrl_update_features = 0x40000f34; +r_ble_ll_ctrl_version_ind_make = 0x40000f38; +r_ble_ll_data_buffer_overflow = 0x40000f3c; +r_ble_ll_disconn_comp_event_send = 0x40000f44; +r_ble_ll_event_comp_pkts = 0x40000f4c; +r_ble_ll_event_dbuf_overflow = 0x40000f50; +r_ble_ll_event_send = 0x40000f54; +r_ble_ll_event_tx_pkt = 0x40000f58; +r_ble_ll_ext_adv_phy_mode_to_local_phy = 0x40000f5c; +r_ble_ll_ext_scan_parse_adv_info = 0x40000f64; +r_ble_ll_ext_scan_parse_aux_ptr = 0x40000f68; +r_ble_ll_flush_pkt_queue = 0x40000f6c; +r_ble_ll_generate_dh_key_v1 = 0x40000f70; +r_ble_ll_generate_dh_key_v2 = 0x40000f74; +r_ble_ll_get_addr_type = 0x40000f7c; +r_ble_ll_get_our_devaddr = 0x40000f84; +r_ble_ll_get_tx_pwr_compensation = 0x40000f88; +r_ble_ll_hci_acl_rx = 0x40000f8c; +r_ble_ll_hci_adv_mode_ext = 0x40000f90; +r_ble_ll_hci_adv_set_enable = 0x40000f94; +r_ble_ll_hci_cb_set_ctrlr_to_host_fc = 0x40000f9c; +r_ble_ll_hci_cb_set_event_mask = 0x40000fa0; +r_ble_ll_hci_cb_set_event_mask2 = 0x40000fa4; +r_ble_ll_hci_chk_phy_masks = 0x40000fa8; +r_ble_ll_hci_cmd_rx = 0x40000fb0; +r_ble_ll_hci_disconnect = 0x40000fbc; +r_ble_ll_hci_ev_conn_update = 0x40000fc4; +r_ble_ll_hci_ev_databuf_overflow = 0x40000fc8; +r_ble_ll_hci_ev_datalen_chg = 0x40000fcc; +r_ble_ll_hci_ev_encrypt_chg = 0x40000fd0; +r_ble_ll_hci_ev_hw_err = 0x40000fd4; +r_ble_ll_hci_ev_le_csa = 0x40000fd8; +r_ble_ll_hci_ev_ltk_req = 0x40000fdc; +r_ble_ll_hci_ev_phy_update = 0x40000fe0; +r_ble_ll_hci_ev_rd_rem_used_feat = 0x40000fe4; +r_ble_ll_hci_ev_rd_rem_ver = 0x40000fe8; +r_ble_ll_hci_ev_rem_conn_parm_req = 0x40000fec; +r_ble_ll_hci_ev_sca_update = 0x40000ff0; +r_ble_ll_hci_ev_send_adv_set_terminated = 0x40000ff4; +r_ble_ll_hci_ev_send_scan_req_recv = 0x40000ff8; +r_ble_ll_hci_ev_send_scan_timeout = 0x40000ffc; +r_ble_ll_hci_ev_send_vendor_err = 0x40001000; +r_ble_ll_hci_ext_scan_set_enable = 0x40001008; +r_ble_ll_hci_get_num_cmd_pkts = 0x4000100c; +r_ble_ll_hci_info_params_cmd_proc = 0x40001010; +r_ble_ll_hci_init = 0x40001014; +r_ble_ll_hci_init_support_cmd_base_on_lmp_ver = 0x40001018; +r_ble_ll_hci_is_event_enabled = 0x4000101c; +r_ble_ll_hci_is_le_event_enabled = 0x40001020; +r_ble_ll_hci_le_cmd_send_cmd_status = 0x40001028; +r_ble_ll_hci_le_encrypt = 0x4000102c; +r_ble_ll_hci_le_rand = 0x40001030; +r_ble_ll_hci_le_rd_max_data_len = 0x40001034; +r_ble_ll_hci_le_rd_sugg_data_len = 0x40001038; +r_ble_ll_hci_le_read_bufsize = 0x4000103c; +r_ble_ll_hci_le_read_supp_states = 0x40001044; +r_ble_ll_hci_le_set_def_phy = 0x40001048; +r_ble_ll_hci_le_wr_sugg_data_len = 0x4000104c; +r_ble_ll_hci_link_ctrl_cmd_proc = 0x40001050; +r_ble_ll_hci_npl_init = 0x40001054; +r_ble_ll_hci_post_gen_dhkey_cmp_evt = 0x40001058; +r_ble_ll_hci_post_rd_p256_pubkey_cmp_evt = 0x4000105c; +r_ble_ll_hci_rd_bd_addr = 0x40001060; +r_ble_ll_hci_rd_local_supp_cmd = 0x40001064; +r_ble_ll_hci_rd_local_supp_feat = 0x40001068; +r_ble_ll_hci_rd_local_version = 0x4000106c; +r_ble_ll_hci_scan_set_enable = 0x40001070; +r_ble_ll_hci_send_adv_report = 0x40001074; +r_ble_ll_hci_send_dir_adv_report = 0x40001078; +r_ble_ll_hci_send_noop = 0x40001084; +r_ble_ll_hci_set_adv_data = 0x40001088; +r_ble_ll_hci_set_le_event_mask = 0x4000108c; +r_ble_ll_hci_set_scan_rsp_data = 0x40001090; +r_ble_ll_hci_status_params_cmd_proc = 0x40001094; +r_ble_ll_hci_vs_cmd_proc = 0x40001098; +r_ble_ll_hci_vs_rd_static_addr = 0x4000109c; +r_ble_ll_hw_err_timer_cb = 0x400010a0; +r_ble_ll_hw_error = 0x400010a4; +r_ble_ll_init_alloc_conn_comp_ev = 0x400010ac; +r_ble_ll_init_get_conn_comp_ev = 0x400010b0; +r_ble_ll_is_addr_empty = 0x400010b8; +r_ble_ll_is_controller_busy = 0x400010bc; +r_ble_ll_is_on_resolv_list = 0x400010c0; +r_ble_ll_is_our_devaddr = 0x400010c4; +r_ble_ll_is_rpa = 0x400010c8; +r_ble_ll_is_valid_adv_mode = 0x400010cc; +r_ble_ll_is_valid_own_addr_type = 0x400010d0; +r_ble_ll_is_valid_public_addr = 0x400010d4; +r_ble_ll_is_valid_random_addr = 0x400010d8; +r_ble_ll_misc_options_set = 0x400010e0; +r_ble_ll_modify_sca = 0x400010e4; +r_ble_ll_pdu_max_tx_octets_get = 0x400010ec; +r_ble_ll_pdu_tx_time_get = 0x400010f0; +r_ble_ll_phy_to_phy_mode = 0x400010f4; +r_ble_ll_qa_enable = 0x400010f8; +r_ble_ll_rand_data_get = 0x40001100; +r_ble_ll_rand_init = 0x4000110c; +r_ble_ll_rand_prand_get = 0x40001110; +r_ble_ll_rand_sample = 0x40001114; +r_ble_ll_rand_start = 0x40001118; +r_ble_ll_read_local_p256_pub_key = 0x4000111c; +r_ble_ll_read_rf_path_compensation = 0x40001120; +r_ble_ll_read_supp_features = 0x40001124; +r_ble_ll_read_supp_states = 0x40001128; +r_ble_ll_resolv_clear_all_pl_bit = 0x40001134; +r_ble_ll_resolv_clear_all_wl_bit = 0x40001138; +r_ble_ll_resolv_enable_cmd = 0x40001140; +r_ble_ll_resolv_enabled = 0x40001144; +r_ble_ll_resolv_gen_rpa = 0x40001150; +r_ble_ll_resolv_get_addr_pointer = 0x40001154; +r_ble_ll_resolv_get_index = 0x40001158; +r_ble_ll_resolv_get_irk_pointer = 0x4000115c; +r_ble_ll_resolv_get_list = 0x40001160; +r_ble_ll_resolv_get_priv_addr = 0x40001164; +r_ble_ll_resolv_get_rpa_tmo = 0x40001168; +r_ble_ll_resolv_irk_nonzero = 0x40001170; +r_ble_ll_resolv_list_add = 0x40001174; +r_ble_ll_resolv_list_chg_allowed = 0x40001178; +r_ble_ll_resolv_list_clr = 0x4000117c; +r_ble_ll_resolv_list_find = 0x40001180; +r_ble_ll_resolv_list_read_size = 0x40001184; +r_ble_ll_resolv_list_reset = 0x40001188; +r_ble_ll_resolv_local_addr_rd = 0x40001190; +r_ble_ll_resolv_peer_addr_rd = 0x40001194; +r_ble_ll_resolv_peer_rpa_any = 0x40001198; +r_ble_ll_resolv_reset = 0x4000119c; +r_ble_ll_resolv_rpa = 0x400011a0; +r_ble_ll_resolv_rpa_timer_cb = 0x400011a4; +r_ble_ll_resolv_set_local_rpa = 0x400011a8; +r_ble_ll_resolv_set_peer_rpa = 0x400011ac; +r_ble_ll_resolv_set_rpa_tmo = 0x400011b0; +r_ble_ll_resolve_set_priv_mode = 0x400011b4; +r_ble_ll_rxpdu_alloc = 0x400011b8; +r_ble_ll_scan_add_scan_rsp_adv = 0x400011bc; +r_ble_ll_scan_adv_decode_addr = 0x400011c0; +r_ble_ll_scan_aux_data_ref = 0x400011c4; +r_ble_ll_scan_aux_data_unref = 0x400011c8; +r_ble_ll_scan_can_chg_whitelist = 0x400011cc; +r_ble_ll_scan_check_periodic_sync = 0x400011d0; +r_ble_ll_scan_classify_filter_aux_init = 0x400011d4; +r_ble_ll_scan_classify_filter_init = 0x400011d8; +r_ble_ll_scan_common_init = 0x400011dc; +r_ble_ll_scan_continue_en = 0x400011e0; +r_ble_ll_scan_dup_check_ext = 0x400011e8; +r_ble_ll_scan_dup_check_legacy = 0x400011ec; +r_ble_ll_scan_dup_move_to_head = 0x400011f0; +r_ble_ll_scan_dup_new = 0x400011f4; +r_ble_ll_scan_dup_update_ext = 0x400011f8; +r_ble_ll_scan_dup_update_legacy = 0x400011fc; +r_ble_ll_scan_enabled = 0x40001200; +r_ble_ll_scan_end_adv_evt = 0x40001204; +r_ble_ll_scan_ext_initiator_start = 0x4000120c; +r_ble_ll_scan_get_addr_data_from_legacy = 0x40001210; +r_ble_ll_scan_get_addr_from_ext_adv = 0x40001214; +r_ble_ll_scan_get_cur_sm = 0x40001218; +r_ble_ll_scan_get_ext_adv_report = 0x4000121c; +r_ble_ll_scan_get_local_rpa = 0x40001220; +r_ble_ll_scan_get_next_adv_prim_chan = 0x40001224; +r_ble_ll_scan_get_peer_rpa = 0x40001228; +r_ble_ll_scan_have_rxd_scan_rsp = 0x4000122c; +r_ble_ll_scan_initiator_start = 0x40001234; +r_ble_ll_scan_is_inside_window = 0x40001238; +r_ble_ll_scan_move_window_to = 0x4000123c; +r_ble_ll_scan_npl_reset = 0x40001240; +r_ble_ll_scan_parse_auxptr = 0x40001244; +r_ble_ll_scan_parse_ext_hdr = 0x40001248; +r_ble_ll_scan_record_new_adv = 0x40001250; +r_ble_ll_scan_refresh_nrpa = 0x40001254; +r_ble_ll_scan_reset = 0x40001258; +r_ble_ll_scan_rx_pkt_in = 0x4000125c; +r_ble_ll_scan_rx_pkt_in_restore_addr_data = 0x40001268; +r_ble_ll_scan_rxed = 0x4000126c; +r_ble_ll_scan_send_truncated = 0x40001274; +r_ble_ll_scan_set_peer_rpa = 0x4000127c; +r_ble_ll_scan_set_perfer_addr = 0x40001280; +r_ble_ll_scan_sm_start = 0x40001288; +r_ble_ll_scan_sm_stop = 0x4000128c; +r_ble_ll_scan_time_hci_to_ticks = 0x40001290; +r_ble_ll_scan_update_aux_data = 0x40001294; +r_ble_ll_scan_whitelist_enabled = 0x40001298; +r_ble_ll_set_default_privacy_mode = 0x4000129c; +r_ble_ll_set_default_sync_transfer_params = 0x400012a0; +r_ble_ll_set_public_addr = 0x400012ac; +r_ble_ll_set_random_addr = 0x400012b0; +r_ble_ll_set_sync_transfer_params = 0x400012b4; +r_ble_ll_state_get = 0x400012b8; +r_ble_ll_state_set = 0x400012bc; +r_ble_ll_sync_adjust_ext_hdr = 0x400012c0; +r_ble_ll_sync_cancel = 0x400012c4; +r_ble_ll_sync_cancel_complete_event = 0x400012c8; +r_ble_ll_sync_check_acad = 0x400012cc; +r_ble_ll_sync_check_failed = 0x400012d0; +r_ble_ll_sync_enabled = 0x400012dc; +r_ble_ll_sync_established = 0x400012ec; +r_ble_ll_sync_filter_enabled = 0x400012f0; +r_ble_ll_sync_find = 0x400012f4; +r_ble_ll_sync_get_cur_sm = 0x400012f8; +r_ble_ll_sync_get_handle = 0x400012fc; +r_ble_ll_sync_get_sm = 0x40001300; +r_ble_ll_sync_info_event = 0x40001304; +r_ble_ll_sync_init = 0x40001308; +r_ble_ll_sync_list_add = 0x4000130c; +r_ble_ll_sync_list_clear = 0x40001310; +r_ble_ll_sync_list_empty = 0x40001314; +r_ble_ll_sync_list_get_free = 0x40001318; +r_ble_ll_sync_list_remove = 0x4000131c; +r_ble_ll_sync_list_search = 0x40001320; +r_ble_ll_sync_list_size = 0x40001324; +r_ble_ll_sync_lost_event = 0x40001328; +r_ble_ll_sync_next_event = 0x4000132c; +r_ble_ll_sync_on_list = 0x40001330; +r_ble_ll_sync_periodic_ind = 0x40001338; +r_ble_ll_sync_phy_mode_to_aux_phy = 0x4000133c; +r_ble_ll_sync_phy_mode_to_hci = 0x40001340; +r_ble_ll_sync_reserve = 0x4000134c; +r_ble_ll_sync_reset = 0x40001350; +r_ble_ll_sync_reset_sm = 0x40001354; +r_ble_ll_sync_send_per_adv_rpt = 0x4000135c; +r_ble_ll_sync_send_sync_ind = 0x40001360; +r_ble_ll_sync_send_truncated_per_adv_rpt = 0x40001364; +r_ble_ll_sync_sm_clear = 0x40001368; +r_ble_ll_sync_terminate = 0x4000136c; +r_ble_ll_sync_transfer = 0x40001370; +r_ble_ll_sync_transfer_get = 0x40001374; +r_ble_ll_sync_transfer_received = 0x40001378; +r_ble_ll_trace_u32 = 0x40001384; +r_ble_ll_trace_u32x2 = 0x40001388; +r_ble_ll_trace_u32x3 = 0x4000138c; +r_ble_ll_tx_flat_mbuf_pducb = 0x40001390; +r_ble_ll_update_max_tx_octets_phy_mode = 0x4000139c; +r_ble_ll_usecs_to_ticks_round_up = 0x400013a0; +r_ble_ll_utils_calc_access_addr = 0x400013a4; +r_ble_ll_utils_calc_dci_csa2 = 0x400013a8; +r_ble_ll_utils_calc_num_used_chans = 0x400013ac; +r_ble_ll_utils_calc_window_widening = 0x400013b0; +r_ble_ll_utils_csa2_perm = 0x400013b4; +r_ble_ll_utils_csa2_prng = 0x400013b8; +r_ble_ll_utils_remapped_channel = 0x400013bc; +r_ble_ll_whitelist_add = 0x400013c0; +r_ble_ll_whitelist_chg_allowed = 0x400013c4; +r_ble_ll_whitelist_read_size = 0x400013cc; +r_ble_ll_write_rf_path_compensation = 0x400013d8; +r_ble_lll_adv_aux_schedule = 0x400013e0; +r_ble_lll_adv_aux_schedule_first = 0x400013e4; +r_ble_lll_adv_aux_schedule_next = 0x400013e8; +r_ble_lll_adv_aux_scheduled = 0x400013ec; +r_ble_lll_adv_aux_set_start_time = 0x400013f0; +r_ble_lll_adv_coex_dpc_calc_pti_update_itvl = 0x400013f4; +r_ble_lll_adv_coex_dpc_process_pri = 0x400013f8; +r_ble_lll_adv_coex_dpc_process_sec = 0x400013fc; +r_ble_lll_adv_coex_dpc_pti_get = 0x40001400; +r_ble_lll_adv_coex_dpc_update = 0x40001404; +r_ble_lll_adv_coex_dpc_update_on_adv_start = 0x40001408; +r_ble_lll_adv_coex_dpc_update_on_aux_scheduled = 0x4000140c; +r_ble_lll_adv_coex_dpc_update_on_data_updated = 0x40001410; +r_ble_lll_adv_coex_dpc_update_on_event_end = 0x40001414; +r_ble_lll_adv_coex_dpc_update_on_event_scheduled = 0x40001418; +r_ble_lll_adv_done = 0x4000141c; +r_ble_lll_adv_event_done = 0x40001424; +r_ble_lll_adv_event_rmvd_from_sched = 0x40001428; +r_ble_lll_adv_get_sec_pdu_len = 0x40001430; +r_ble_lll_adv_make_done = 0x40001438; +r_ble_lll_adv_periodic_done = 0x4000143c; +r_ble_lll_adv_periodic_event_done = 0x40001440; +r_ble_lll_adv_periodic_rmvd_from_sched = 0x40001444; +r_ble_lll_adv_periodic_schedule_first = 0x40001448; +r_ble_lll_adv_pri_schedule_tx_pdu = 0x40001458; +r_ble_lll_adv_reschedule_event = 0x4000145c; +r_ble_lll_adv_reschedule_periodic_event = 0x40001460; +r_ble_lll_adv_sec_event_done = 0x4000146c; +r_ble_lll_adv_sec_schedule_next_aux = 0x40001470; +r_ble_lll_adv_secondary_tx_start_cb = 0x40001474; +r_ble_lll_adv_sm_deinit = 0x40001478; +r_ble_lll_adv_sm_event_init = 0x4000147c; +r_ble_lll_adv_sm_event_restore = 0x40001480; +r_ble_lll_adv_sm_event_store = 0x40001484; +r_ble_lll_adv_sm_init = 0x40001488; +r_ble_lll_adv_sm_reset = 0x4000148c; +r_ble_lll_adv_start = 0x40001490; +r_ble_lll_adv_stop = 0x40001494; +r_ble_lll_adv_sync_next_scheduled = 0x40001498; +r_ble_lll_adv_sync_schedule = 0x4000149c; +r_ble_lll_adv_sync_tx_done = 0x400014a0; +r_ble_lll_adv_sync_tx_end = 0x400014a4; +r_ble_lll_adv_sync_tx_start_cb = 0x400014a8; +r_ble_lll_adv_tx_done = 0x400014ac; +r_ble_lll_adv_tx_start_cb = 0x400014b0; +r_ble_lll_adv_update_rsp_offset = 0x400014b4; +r_ble_lll_aux_scan_cb = 0x400014b8; +r_ble_lll_aux_scan_drop = 0x400014bc; +r_ble_lll_aux_scan_drop_event_cb = 0x400014c0; +r_ble_lll_calc_us_convert_tick_unit = 0x400014c4; +r_ble_lll_conn_can_send_next_pdu = 0x400014cc; +r_ble_lll_conn_check_opcode_matched = 0x400014d0; +r_ble_lll_conn_coex_dpc_process = 0x400014d4; +r_ble_lll_conn_coex_dpc_pti_get = 0x400014d8; +r_ble_lll_conn_coex_dpc_update = 0x400014dc; +r_ble_lll_conn_coex_dpc_update_on_event_end = 0x400014e0; +r_ble_lll_conn_coex_dpc_update_on_event_scheduled = 0x400014e4; +r_ble_lll_conn_coex_dpc_update_on_event_started = 0x400014e8; +r_ble_lll_conn_cth_flow_alloc_credit = 0x400014ec; +r_ble_lll_conn_current_sm_over = 0x400014f4; +r_ble_lll_conn_event_is_over = 0x40001510; +r_ble_lll_conn_event_start_cb = 0x40001514; +r_ble_lll_conn_free_rx_mbuf = 0x40001518; +r_ble_lll_conn_get_addr_info_from_rx_buf = 0x4000151c; +r_ble_lll_conn_get_ce_end_time = 0x40001520; +r_ble_lll_conn_get_next_sched_time = 0x40001524; +r_ble_lll_conn_master_common_init = 0x40001530; +r_ble_lll_conn_master_new = 0x40001534; +r_ble_lll_conn_module_reset = 0x40001540; +r_ble_lll_conn_pre_process = 0x40001548; +r_ble_lll_conn_recv_ack = 0x40001554; +r_ble_lll_conn_recv_valid_packet = 0x40001558; +r_ble_lll_conn_reset_pending_sched = 0x4000155c; +r_ble_lll_conn_sched_next_anchor = 0x40001564; +r_ble_lll_conn_sched_next_event = 0x40001568; +r_ble_lll_conn_sm_new = 0x40001574; +r_ble_lll_conn_sm_npl_deinit = 0x40001578; +r_ble_lll_conn_sm_npl_init = 0x4000157c; +r_ble_lll_conn_superversion_timer_cb = 0x40001580; +r_ble_lll_conn_timeout = 0x40001584; +r_ble_lll_conn_update_anchor = 0x40001588; +r_ble_lll_conn_update_conn_ind_params = 0x4000158c; +r_ble_lll_conn_update_tx_buffer = 0x40001594; +r_ble_lll_deinit = 0x40001598; +r_ble_lll_dtm_calculate_itvl = 0x4000159c; +r_ble_lll_dtm_ctx_free = 0x400015a0; +r_ble_lll_dtm_end_test = 0x400015a8; +r_ble_lll_dtm_ev_rx_restart_cb = 0x400015ac; +r_ble_lll_dtm_ev_tx_resched_cb = 0x400015b0; +r_ble_lll_dtm_reset = 0x400015b8; +r_ble_lll_dtm_rx_create_ctx = 0x400015bc; +r_ble_lll_dtm_rx_isr_end = 0x400015c0; +r_ble_lll_dtm_rx_isr_start = 0x400015c4; +r_ble_lll_dtm_rx_pkt_in = 0x400015c8; +r_ble_lll_dtm_rx_sched_cb = 0x400015cc; +r_ble_lll_dtm_rx_start = 0x400015d0; +r_ble_lll_dtm_rx_test = 0x400015d4; +r_ble_lll_dtm_set_next = 0x400015d8; +r_ble_lll_dtm_tx_done = 0x400015e0; +r_ble_lll_dtm_tx_sched_cb = 0x400015e4; +r_ble_lll_dtm_tx_test = 0x400015e8; +r_ble_lll_dtm_wfr_timer_exp = 0x400015ec; +r_ble_lll_event_rx_pkt = 0x400015f0; +r_ble_lll_ext_scan_coex_dpc_process = 0x400015f4; +r_ble_lll_ext_scan_coex_dpc_pti_get = 0x400015f8; +r_ble_lll_ext_scan_coex_dpc_update = 0x400015fc; +r_ble_lll_ext_scan_coex_dpc_update_on_start = 0x40001600; +r_ble_lll_hci_dtm_rx_test = 0x40001604; +r_ble_lll_hci_dtm_rx_test_v2 = 0x40001608; +r_ble_lll_hci_dtm_tx_test = 0x4000160c; +r_ble_lll_hci_dtm_tx_test_ext = 0x40001610; +r_ble_lll_hci_dtm_tx_test_v2 = 0x40001614; +r_ble_lll_hci_dtm_tx_test_v2_ext = 0x40001618; +r_ble_lll_init = 0x4000161c; +r_ble_lll_init_pre_process = 0x40001620; +r_ble_lll_per_adv_coex_dpc_calc_pti_update_itvl = 0x40001628; +r_ble_lll_per_adv_coex_dpc_process = 0x4000162c; +r_ble_lll_per_adv_coex_dpc_pti_get = 0x40001630; +r_ble_lll_per_adv_coex_dpc_update = 0x40001634; +r_ble_lll_per_adv_coex_dpc_update_on_data_updated = 0x40001638; +r_ble_lll_per_adv_coex_dpc_update_on_scheduled = 0x4000163c; +r_ble_lll_per_adv_coex_dpc_update_on_start = 0x40001640; +r_ble_lll_rfmgmt_is_enabled = 0x40001660; +r_ble_lll_rfmgmt_release = 0x40001664; +r_ble_lll_rfmgmt_scan_changed = 0x40001670; +r_ble_lll_rfmgmt_sched_changed = 0x40001674; +r_ble_lll_rfmgmt_set_sleep_cb = 0x40001678; +r_ble_lll_rfmgmt_ticks_to_enabled = 0x4000167c; +r_ble_lll_rx_pdu_in = 0x40001688; +r_ble_lll_rx_pkt_in = 0x4000168c; +r_ble_lll_rx_pkt_isr = 0x40001690; +r_ble_lll_scan_abort_aux_sched = 0x40001694; +r_ble_lll_scan_chk_resume = 0x4000169c; +r_ble_lll_scan_clean_cur_aux_data = 0x400016a0; +r_ble_lll_scan_coex_event_cb = 0x400016a4; +r_ble_lll_scan_common_init = 0x400016a8; +r_ble_lll_scan_deinit = 0x400016ac; +r_ble_lll_scan_duration_period_timers_restart = 0x400016b0; +r_ble_lll_scan_duration_period_timers_stop = 0x400016b4; +r_ble_lll_scan_duration_timer_cb = 0x400016b8; +r_ble_lll_scan_event_proc = 0x400016bc; +r_ble_lll_scan_ext_adv_init = 0x400016c0; +r_ble_lll_scan_has_sent_scan_req = 0x400016c8; +r_ble_lll_scan_npl_reset = 0x400016d4; +r_ble_lll_scan_npl_restore = 0x400016d8; +r_ble_lll_scan_npl_store = 0x400016dc; +r_ble_lll_scan_period_timer_cb = 0x400016e0; +r_ble_lll_scan_process_adv_in_isr = 0x400016e4; +r_ble_lll_scan_req_backoff = 0x400016ec; +r_ble_lll_scan_sched_next_aux = 0x40001700; +r_ble_lll_scan_sched_remove = 0x40001704; +r_ble_lll_scan_start = 0x40001708; +r_ble_lll_scan_start_rx = 0x4000170c; +r_ble_lll_scan_timer_cb = 0x40001718; +r_ble_lll_sched_adv_new = 0x4000171c; +r_ble_lll_sched_adv_resched_pdu = 0x40001720; +r_ble_lll_sched_adv_reschedule = 0x40001724; +r_ble_lll_sched_aux_scan = 0x40001728; +r_ble_lll_sched_conn_overlap = 0x4000172c; +r_ble_lll_sched_dtm = 0x40001738; +r_ble_lll_sched_execute_item = 0x40001744; +r_ble_lll_sched_insert_if_empty = 0x4000174c; +r_ble_lll_sched_is_overlap = 0x40001750; +r_ble_lll_sched_master_new = 0x40001754; +r_ble_lll_sched_next_time = 0x40001758; +r_ble_lll_sched_overlaps_current = 0x4000175c; +r_ble_lll_sched_periodic_adv = 0x40001760; +r_ble_lll_sched_rmv_elem = 0x40001764; +r_ble_lll_sched_rmv_elem_type = 0x40001768; +r_ble_lll_sched_run = 0x4000176c; +r_ble_lll_sched_scan_req_over_aux_ptr = 0x40001770; +r_ble_lll_sched_slave_new = 0x40001774; +r_ble_lll_sched_stop = 0x40001778; +r_ble_lll_sched_sync = 0x4000177c; +r_ble_lll_sched_sync_overlaps_current = 0x40001780; +r_ble_lll_sync_chain_start_cb = 0x40001788; +r_ble_lll_sync_coex_dpc_process = 0x4000178c; +r_ble_lll_sync_coex_dpc_pti_get = 0x40001790; +r_ble_lll_sync_coex_dpc_update = 0x40001794; +r_ble_lll_sync_current_sm_over = 0x40001798; +r_ble_lll_sync_deinit = 0x4000179c; +r_ble_lll_sync_event_end_cb = 0x400017a4; +r_ble_lll_sync_get_event_end_time = 0x400017ac; +r_ble_lll_sync_init = 0x400017b4; +r_ble_lll_sync_new = 0x400017b8; +r_ble_lll_sync_reset = 0x400017bc; +r_ble_lll_sync_reset_sm = 0x400017c0; +r_ble_lll_sync_rmvd_from_sched = 0x400017c4; +r_ble_lll_sync_schedule_chain = 0x400017cc; +r_ble_lll_sync_stop = 0x400017d0; +r_ble_lll_sync_trnasfer_sched = 0x400017d4; +r_ble_phy_access_addr_get = 0x400017d8; +r_ble_phy_calculate_rxtx_ifs = 0x400017dc; +r_ble_phy_calculate_rxwindow = 0x400017e0; +r_ble_phy_calculate_txrx_ifs = 0x400017e4; +r_ble_phy_check_bb_status = 0x400017e8; +r_ble_phy_complete_rx_info = 0x400017ec; +r_ble_phy_data_make = 0x400017f4; +r_ble_phy_disable = 0x400017f8; +r_ble_phy_disable_irq = 0x400017fc; +r_ble_phy_disable_whitening = 0x40001800; +r_ble_phy_enable_whitening = 0x40001804; +r_ble_phy_encrypt_disable = 0x40001808; +r_ble_phy_get_current_phy = 0x40001810; +r_ble_phy_get_packet_counter = 0x40001814; +r_ble_phy_get_packet_status = 0x40001818; +r_ble_phy_get_pyld_time_offset = 0x4000181c; +r_ble_phy_get_rx_phy_mode = 0x40001820; +r_ble_phy_get_seq_end_st = 0x40001824; +r_ble_phy_max_data_pdu_pyld = 0x40001830; +r_ble_phy_mode_config = 0x40001834; +r_ble_phy_mode_convert = 0x40001838; +r_ble_phy_mode_write = 0x4000183c; +r_ble_phy_module_init = 0x40001844; +r_ble_phy_reset_bb_monitor = 0x4000184c; +r_ble_phy_resolv_list_disable = 0x40001850; +r_ble_phy_resolv_list_enable = 0x40001854; +r_ble_phy_restart_sequence = 0x40001858; +r_ble_phy_rx_set_start_time_forcibly = 0x4000185c; +r_ble_phy_rxpdu_copy = 0x40001860; +r_ble_phy_seq_encrypt_enable = 0x40001864; +r_ble_phy_seq_encrypt_set_pkt_cntr = 0x40001868; +r_ble_phy_sequence_end_isr = 0x4000186c; +r_ble_phy_sequence_get_mode = 0x40001870; +r_ble_phy_sequence_is_running = 0x40001874; +r_ble_phy_sequence_is_waiting_rsp = 0x40001878; +r_ble_phy_sequence_single_end = 0x4000187c; +r_ble_phy_sequence_tx_end_invoke = 0x40001880; +r_ble_phy_sequence_update_conn_ind_params = 0x40001884; +r_ble_phy_set_coex_pti = 0x4000188c; +r_ble_phy_set_conn_ind_pdu = 0x40001890; +r_ble_phy_set_conn_mode = 0x40001894; +r_ble_phy_set_dev_address = 0x40001898; +r_ble_phy_set_rx_pwr_compensation = 0x4000189c; +r_ble_phy_set_single_packet_rx_sequence = 0x400018ac; +r_ble_phy_set_single_packet_tx_sequence = 0x400018b0; +r_ble_phy_set_tx_rx_transition = 0x400018b4; +r_ble_phy_set_txend_cb = 0x400018b8; +r_ble_phy_setchan = 0x400018bc; +r_ble_phy_start_rx_immediately = 0x400018c0; +r_ble_phy_state_get = 0x400018c4; +r_ble_phy_timer_config_start_time = 0x400018c8; +r_ble_phy_timer_start_now = 0x400018cc; +r_ble_phy_timer_stop = 0x400018d0; +r_ble_phy_tx_set_start_time = 0x400018d4; +r_ble_phy_txpwr_set = 0x400018dc; +r_ble_phy_update_ifs = 0x400018e8; +r_ble_phy_xcvr_state_get = 0x400018ec; +r_ble_plf_set_log_level = 0x400018f0; +r_ble_rtc_wake_up_cpu_init = 0x400018f4; +r_ble_rtc_wake_up_state_clr = 0x400018f8; +r_ble_vendor_hci_register = 0x400018fc; +r_bt_rf_coex_cfg_set = 0x40001900; +r_bt_rf_coex_coded_txrx_time_upper_lim = 0x40001904; +r_bt_rf_coex_dft_pti_set = 0x40001908; +r_bt_rf_coex_hook_deinit = 0x4000190c; +r_bt_rf_coex_hook_init = 0x40001910; +r_bt_rf_coex_hook_st_set = 0x40001914; +r_bt_rf_coex_hooks_p_set_default = 0x40001918; +r_btdm_disable_adv_delay = 0x4000191c; +r_btdm_switch_phy_coded = 0x40001920; +r_esp_wait_disabled = 0x40001924; +r_get_be16 = 0x40001928; +r_get_be24 = 0x4000192c; +r_get_be32 = 0x40001930; +r_get_be64 = 0x40001934; +r_get_le16 = 0x40001938; +r_get_le24 = 0x4000193c; +r_get_le32 = 0x40001940; +r_get_le64 = 0x40001944; +r_get_local_irk_offset = 0x40001948; +r_get_local_rpa_offset = 0x4000194c; +r_get_max_skip = 0x40001950; +r_get_peer_id_offset = 0x40001954; +r_get_peer_irk_offset = 0x40001958; +r_get_peer_rpa_offset = 0x4000195c; +r_hal_timer_disable_irq = 0x4000196c; +r_hal_timer_process = 0x40001978; +r_hal_timer_read = 0x4000197c; +r_hal_timer_read_tick = 0x40001980; +r_hal_timer_set_cb = 0x40001984; +r_hal_timer_start = 0x4000198c; +r_hal_timer_task_start = 0x40001998; +r_ll_assert = 0x4000199c; +r_mem_init_mbuf_pool = 0x400019a0; +r_mem_malloc_mbuf_pool = 0x400019a4; +r_mem_malloc_mbufpkt_pool = 0x400019a8; +r_mem_malloc_mempool = 0x400019ac; +r_mem_malloc_mempool_ext = 0x400019b0; +r_mem_malloc_mempool_gen = 0x400019b4; +r_mem_pullup_obj = 0x400019b8; +r_os_cputime_get32 = 0x400019c0; +r_os_cputime_ticks_to_usecs = 0x400019c4; +r_os_cputime_timer_init = 0x400019c8; +r_os_cputime_timer_relative = 0x400019cc; +r_os_cputime_timer_start = 0x400019d0; +r_os_cputime_timer_stop = 0x400019d4; +r_os_cputime_usecs_to_ticks = 0x400019d8; +r_os_mbuf_adj = 0x400019dc; +r_os_mbuf_appendfrom = 0x400019e4; +r_os_mbuf_cmpf = 0x400019e8; +r_os_mbuf_cmpm = 0x400019ec; +r_os_mbuf_concat = 0x400019f0; +r_os_mbuf_copydata = 0x400019f4; +r_os_mbuf_copyinto = 0x400019f8; +r_os_mbuf_dup = 0x400019fc; +r_os_mbuf_extend = 0x40001a00; +r_os_mbuf_free = 0x40001a04; +r_os_mbuf_free_chain = 0x40001a08; +r_os_mbuf_get = 0x40001a0c; +r_os_mbuf_get_pkthdr = 0x40001a10; +r_os_mbuf_leadingspace = 0x40001a14; +r_os_mbuf_len = 0x40001a18; +r_os_mbuf_off = 0x40001a1c; +r_os_mbuf_pack_chains = 0x40001a20; +r_os_mbuf_pool_init = 0x40001a24; +r_os_mbuf_prepend = 0x40001a28; +r_os_mbuf_prepend_pullup = 0x40001a2c; +r_os_mbuf_pullup = 0x40001a30; +r_os_mbuf_trailingspace = 0x40001a34; +r_os_mbuf_trim_front = 0x40001a38; +r_os_mbuf_widen = 0x40001a3c; +r_os_memblock_from = 0x40001a40; +r_os_memblock_get = 0x40001a44; +r_os_memblock_put_from_cb = 0x40001a4c; +r_os_mempool_clear = 0x40001a50; +r_os_mempool_ext_clear = 0x40001a54; +r_os_mempool_ext_init = 0x40001a58; +r_os_mempool_init = 0x40001a60; +r_os_mempool_is_sane = 0x40001a68; +r_os_mqueue_get = 0x40001a74; +r_os_mqueue_init = 0x40001a78; +r_os_mqueue_put = 0x40001a7c; +r_os_msys_count = 0x40001a80; +r_os_msys_get = 0x40001a84; +r_os_msys_get_pkthdr = 0x40001a88; +r_os_msys_num_free = 0x40001a8c; +r_os_msys_register = 0x40001a90; +r_os_msys_reset = 0x40001a94; +r_pri_phy_valid = 0x40001a98; +r_put_be16 = 0x40001a9c; +r_put_be24 = 0x40001aa0; +r_put_be32 = 0x40001aa4; +r_put_be64 = 0x40001aa8; +r_put_le16 = 0x40001aac; +r_put_le24 = 0x40001ab0; +r_put_le32 = 0x40001ab4; +r_put_le64 = 0x40001ab8; +r_rtc0_timer_handler = 0x40001abc; +r_sdkconfig_get_opts = 0x40001ac0; +r_sdkconfig_set_opts = 0x40001ac4; +r_sec_phy_valid = 0x40001ac8; +r_swap_buf = 0x40001acc; +r_swap_in_place = 0x40001ad0; +/* Data (.data, .bss, .rodata) */ +ble_lll_dtm_module_env_p = 0x3fcdffc4; +g_ble_lll_dtm_prbs15_data = 0x3ff4fee4; +g_ble_lll_dtm_prbs9_data = 0x3ff4fde4; +g_channel_rf_to_index = 0x3ff4fdbc; +g_ble_lll_rfmgmt_data = 0x3fcdff7c; +g_ble_sleep_enter_cb = 0x3fcdff78; +g_ble_sleep_exit_cb = 0x3fcdff74; +ble_lll_sched_env_p = 0x3fcdff70; +ble_ll_env_p = 0x3fcdff6c; +g_ble_ll_pdu_header_tx_time_ro = 0x3ff4fdb4; +ble_ll_adv_env_p = 0x3fcdff68; +ble_ll_conn_env_p = 0x3fcdff64; +ble_ll_conn_required_phy_mask = 0x3ff4fdb0; +ble_ll_valid_conn_phy_mask = 0x3ff4fdaf; +ble_ll_hci_env_p = 0x3fcdff60; +g_debug_le_private_key = 0x3ff4fd6c; +g_ecc_key = 0x3fcdfefc; +ble_ll_rand_env_p = 0x3fcdfef8; +ble_ll_resolv_env_p = 0x3fcdfef4; +g_ble_ll_resolve_hdr = 0x3fcdfeec; +g_device_mode_default = 0x3fcdfe68; +ble_ll_scan_classify_filter_aux_check_cb = 0x3fcdfee8; +ble_ll_scan_classify_filter_check_cb = 0x3fcdfee4; +ble_ll_scan_env_p = 0x3fcdfee0; +g_ble_ll_supp_cmds_ro = 0x3ff4fd3c; +ble_ll_sync_env_p = 0x3fcdfedc; +g_ble_sca_ppm_tbl_ro = 0x3ff4fd2c; +priv_config_opts = 0x3fcdfe48; +ble_hci_uart_reset_cmd = 0x3ff4fd28; +ble_hci_trans_env_p = 0x3fcdfed8; +ble_hci_trans_mode = 0x3fcdfe44; +ble_hci_trans_funcs_ptr = 0x3fcdfed4; +r_ble_lll_stub_funcs_ptr = 0x3fcdfed0; +r_ble_stub_funcs_ptr = 0x3fcdfecc; +r_ext_funcs_p = 0x3fcdfec8; +r_npl_funcs = 0x3fcdfec4; +ble_hw_env_p = 0x3fcdfec0; +ble_phy_module_env_p = 0x3fcdfebc; +g_ble_phy_chan_freq_ro = 0x3ff4fd00; +g_ble_phy_mode_pkt_start_off_ro = 0x3ff4fcf8; +g_ble_phy_rxtx_ifs_compensation_ro = 0x3ff4fce8; +g_ble_phy_t_rxaddrdelay_ro = 0x3ff4fce4; +g_ble_phy_t_rxenddelay_ro = 0x3ff4fce0; +g_ble_phy_t_txdelay_ro = 0x3ff4fcdc; +g_ble_phy_t_txenddelay_ro = 0x3ff4fcd8; +g_ble_phy_txrx_ifs_compensation_ro = 0x3ff4fcc8; +hal_timer_env_p = 0x3fcdfeb8; +r_osi_coex_funcs_p = 0x3fcdfeb4; +bt_rf_coex_hooks = 0x3fcdfeac; +bt_rf_coex_hooks_p = 0x3fcdfea8; +coex_hook_st_group_tab = 0x3ff4fcbc; +coex_hook_st_group_to_coex_schm_st_tab = 0x3ff4fcb8; +s_ble_act_count_by_group = 0x3fcdfea4; +s_ble_coex_st_map = 0x3fcdfe90; +bt_rf_coex_cfg_cb = 0x3fcdfe74; +bt_rf_coex_cfg_p = 0x3fcdfe70; +bt_rf_coex_cfg_rom = 0x3ff4fc9c; +bt_rf_coex_pti_dft_p = 0x3fcdfe6c; +bt_rf_coex_pti_dft_rom = 0x3fcdfe04; +conn_dynamic_pti_param_rom = 0x3ff4fc84; +conn_phy_coded_max_data_time_param_rom = 0x3ff4fc80; +ext_adv_dynamic_pti_param_rom = 0x3ff4fc4c; +ext_scan_dynamic_param_rom = 0x3ff4fc14; +legacy_adv_dynamic_pti_param_rom = 0x3ff4fbf4; +per_adv_dynamic_pti_param_rom = 0x3ff4fbd8; +sync_dynamic_param_rom = 0x3ff4fbc0; +g_ble_plf_log_level = 0x3fcdfe00; +g_msys_pool_list = 0x3fcdfdf8; +g_os_mempool_list = 0x3fcdfdf0; diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld index 43d218f7f5be..a4771c74096f 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld @@ -4,1116 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/*************************************** - Group bluetooth - ***************************************/ - -/* Functions */ -ble_controller_rom_data_init = 0x40000aa8; -ble_osi_coex_funcs_register = 0x40000aac; -bt_rf_coex_cfg_get_default = 0x40000ab0; -bt_rf_coex_dft_pti_get_default = 0x40000ab4; -bt_rf_coex_hooks_p_set = 0x40000ab8; -r__os_mbuf_copypkthdr = 0x40000abc; -r__os_msys_find_pool = 0x40000ac0; -r_ble_controller_get_rom_compile_version = 0x40000ac4; -//r_ble_hci_ram_hs_acl_tx = 0x40000ac8; -//r_ble_hci_ram_hs_cmd_tx = 0x40000acc; -//r_ble_hci_ram_ll_acl_tx = 0x40000ad0; -//r_ble_hci_ram_ll_evt_tx = 0x40000ad4; -r_ble_hci_ram_reset = 0x40000ad8; -r_ble_hci_ram_set_acl_free_cb = 0x40000adc; -r_ble_hci_trans_acl_buf_alloc = 0x40000ae0; -r_ble_hci_trans_buf_alloc = 0x40000ae4; -r_ble_hci_trans_buf_free = 0x40000ae8; -r_ble_hci_trans_cfg_hs = 0x40000aec; -r_ble_hci_trans_cfg_ll = 0x40000af0; -r_ble_hci_trans_deinit = 0x40000af4; -//r_ble_hci_trans_env_init = 0x40000af8; -r_ble_hci_trans_init = 0x40000afc; -r_ble_hci_uart_acl_tx = 0x40000b00; -r_ble_hci_uart_cmdevt_tx = 0x40000b04; -r_ble_hci_uart_config = 0x40000b08; -r_ble_hci_uart_free_pkt = 0x40000b0c; -r_ble_hci_uart_hs_acl_tx = 0x40000b10; -r_ble_hci_uart_hs_cmd_tx = 0x40000b14; -r_ble_hci_uart_ll_acl_tx = 0x40000b18; -r_ble_hci_uart_ll_evt_tx = 0x40000b1c; -r_ble_hci_uart_rx_acl = 0x40000b20; -r_ble_hci_uart_rx_char = 0x40000b24; -r_ble_hci_uart_rx_cmd = 0x40000b28; -r_ble_hci_uart_rx_evt = 0x40000b2c; -r_ble_hci_uart_rx_evt_cb = 0x40000b30; -r_ble_hci_uart_rx_le_evt = 0x40000b34; -r_ble_hci_uart_rx_pkt_type = 0x40000b38; -r_ble_hci_uart_rx_skip_acl = 0x40000b3c; -r_ble_hci_uart_rx_skip_cmd = 0x40000b40; -r_ble_hci_uart_rx_skip_evt = 0x40000b44; -r_ble_hci_uart_rx_sync_loss = 0x40000b48; -r_ble_hci_uart_set_acl_free_cb = 0x40000b4c; -r_ble_hci_uart_sync_lost = 0x40000b50; -r_ble_hci_uart_trans_reset = 0x40000b54; -r_ble_hci_uart_tx_char = 0x40000b58; -r_ble_hci_uart_tx_pkt_type = 0x40000b5c; -r_ble_hw_driver_deinit = 0x40000b60; -r_ble_hw_driver_env_init = 0x40000b64; -r_ble_hw_encrypt_block = 0x40000b68; -r_ble_hw_get_public_addr = 0x40000b6c; -r_ble_hw_get_static_addr = 0x40000b70; -r_ble_hw_periodiclist_add = 0x40000b74; -r_ble_hw_periodiclist_clear = 0x40000b78; -r_ble_hw_periodiclist_rmv = 0x40000b7c; -r_ble_hw_resolv_list_cur_entry = 0x40000b80; -r_ble_hw_resolv_list_get_cur_entry = 0x40000b84; -r_ble_hw_resolv_list_set = 0x40000b88; -r_ble_hw_rng_init = 0x40000b8c; -r_ble_hw_rng_start = 0x40000b90; -r_ble_hw_rng_stop = 0x40000b94; -r_ble_hw_rx_local_is_resolved = 0x40000b98; -r_ble_hw_rx_local_is_rpa = 0x40000b9c; -r_ble_hw_whitelist_add = 0x40000ba0; -r_ble_hw_whitelist_clear = 0x40000ba4; -r_ble_hw_whitelist_dev_num = 0x40000ba8; -r_ble_hw_whitelist_get_base = 0x40000bac; -r_ble_hw_whitelist_rmv = 0x40000bb0; -r_ble_hw_whitelist_search = 0x40000bb4; -r_ble_hw_whitelist_sort = 0x40000bb8; -r_ble_ll_acl_data_in = 0x40000bbc; -r_ble_ll_addr_is_id = 0x40000bc0; -r_ble_ll_addr_subtype = 0x40000bc4; -r_ble_ll_adv_active_chanset_clear = 0x40000bc8; -r_ble_ll_adv_active_chanset_is_pri = 0x40000bcc; -r_ble_ll_adv_active_chanset_is_sec = 0x40000bd0; -r_ble_ll_adv_active_chanset_set_pri = 0x40000bd4; -r_ble_ll_adv_active_chanset_set_sec = 0x40000bd8; -r_ble_ll_adv_aux_calculate = 0x40000bdc; -r_ble_ll_adv_aux_conn_rsp_pdu_make = 0x40000be0; -r_ble_ll_adv_aux_pdu_make = 0x40000be4; -r_ble_ll_adv_aux_scannable_pdu_make = 0x40000be8; -r_ble_ll_adv_aux_txed = 0x40000bec; -r_ble_ll_adv_can_chg_whitelist = 0x40000bf0; -r_ble_ll_adv_chk_rpa_timeout = 0x40000bf4; -r_ble_ll_adv_clear_all = 0x40000bf8; -r_ble_ll_adv_conn_req_rxd = 0x40000bfc; -r_ble_ll_adv_deinit = 0x40000c00; -r_ble_ll_adv_enabled = 0x40000c04; -r_ble_ll_adv_env_init = 0x40000c08; -r_ble_ll_adv_ext_set_adv_data = 0x40000c0c; -r_ble_ll_adv_ext_set_enable = 0x40000c10; -//r_ble_ll_adv_ext_set_param = 0x40000c14; -r_ble_ll_adv_ext_set_scan_rsp = 0x40000c18; -r_ble_ll_adv_final_chan = 0x40000c1c; -r_ble_ll_adv_first_chan = 0x40000c20; -r_ble_ll_adv_flags_clear = 0x40000c24; -r_ble_ll_adv_flags_set = 0x40000c28; -r_ble_ll_adv_get_chan_num = 0x40000c2c; -r_ble_ll_adv_get_local_rpa = 0x40000c30; -r_ble_ll_adv_get_peer_rpa = 0x40000c34; -r_ble_ll_adv_hci_set_random_addr = 0x40000c38; -r_ble_ll_adv_init = 0x40000c3c; -r_ble_ll_adv_legacy_pdu_make = 0x40000c40; -r_ble_ll_adv_next_chan = 0x40000c44; -r_ble_ll_adv_pdu_make = 0x40000c48; -r_ble_ll_adv_periodic_check_data_itvl = 0x40000c4c; -r_ble_ll_adv_periodic_enable = 0x40000c50; -r_ble_ll_adv_periodic_estimate_data_itvl = 0x40000c54; -r_ble_ll_adv_periodic_send_sync_ind = 0x40000c58; -r_ble_ll_adv_periodic_set_data = 0x40000c5c; -r_ble_ll_adv_periodic_set_info_transfer = 0x40000c60; -r_ble_ll_adv_periodic_set_param = 0x40000c64; -r_ble_ll_adv_pre_process = 0x40000c68; -r_ble_ll_adv_put_acad_chM_update_ind = 0x40000c6c; -r_ble_ll_adv_put_aux_ptr = 0x40000c70; -r_ble_ll_adv_put_syncinfo = 0x40000c74; -r_ble_ll_adv_rd_max_adv_data_len = 0x40000c78; -r_ble_ll_adv_rd_sup_adv_sets = 0x40000c7c; -r_ble_ll_adv_read_txpwr = 0x40000c80; -r_ble_ll_adv_remove = 0x40000c84; -r_ble_ll_adv_reset = 0x40000c88; -r_ble_ll_adv_rpa_timeout = 0x40000c8c; -r_ble_ll_adv_rpa_update = 0x40000c90; -r_ble_ll_adv_rx_pkt_in = 0x40000c94; -r_ble_ll_adv_scan_req_rxd = 0x40000c98; -r_ble_ll_adv_scan_rsp_legacy_pdu_make = 0x40000c9c; -r_ble_ll_adv_scan_rsp_pdu_make = 0x40000ca0; -r_ble_ll_adv_scheduled = 0x40000ca4; -r_ble_ll_adv_send_conn_comp_ev = 0x40000ca8; -//r_ble_ll_adv_set_adv_data = 0x40000cac; -//r_ble_ll_adv_set_adv_params = 0x40000cb0; -//r_ble_ll_adv_set_enable = 0x40000cb4; -r_ble_ll_adv_set_random_addr = 0x40000cb8; -//r_ble_ll_adv_set_scan_rsp_data = 0x40000cbc; -r_ble_ll_adv_set_sched = 0x40000cc0; -r_ble_ll_adv_sm_deinit = 0x40000cc4; -r_ble_ll_adv_sm_event_init = 0x40000cc8; -r_ble_ll_adv_sm_find_configured = 0x40000ccc; -r_ble_ll_adv_sm_get = 0x40000cd0; -r_ble_ll_adv_sm_init = 0x40000cd4; -r_ble_ll_adv_sm_reset = 0x40000cd8; -r_ble_ll_adv_sm_start = 0x40000cdc; -r_ble_ll_adv_sm_start_periodic = 0x40000ce0; -r_ble_ll_adv_sm_stop = 0x40000ce4; -r_ble_ll_adv_sm_stop_limit_reached = 0x40000ce8; -r_ble_ll_adv_sm_stop_periodic = 0x40000cec; -r_ble_ll_adv_sm_stop_timeout = 0x40000cf0; -r_ble_ll_adv_sync_calculate = 0x40000cf4; -r_ble_ll_adv_sync_get_pdu_len = 0x40000cf8; -r_ble_ll_adv_sync_pdu_make = 0x40000cfc; -r_ble_ll_adv_update_adv_scan_rsp_data = 0x40000d00; -r_ble_ll_adv_update_data_mbuf = 0x40000d04; -r_ble_ll_adv_update_did = 0x40000d08; -r_ble_ll_adv_update_periodic_data = 0x40000d0c; -r_ble_ll_arr_pool_init = 0x40000d10; -r_ble_ll_auth_pyld_tmo_event_send = 0x40000d14; -r_ble_ll_calc_offset_ticks_us_for_rampup = 0x40000d18; -r_ble_ll_calc_session_key = 0x40000d1c; -r_ble_ll_calc_ticks_per_slot = 0x40000d20; -//r_ble_ll_check_scan_params = 0x40000d24; -r_ble_ll_chk_txrx_octets = 0x40000d28; -r_ble_ll_chk_txrx_time = 0x40000d2c; -r_ble_ll_conn_adjust_pyld_len = 0x40000d30; -r_ble_ll_conn_auth_pyld_timer_cb = 0x40000d34; -r_ble_ll_conn_auth_pyld_timer_start = 0x40000d38; -r_ble_ll_conn_calc_dci = 0x40000d3c; -r_ble_ll_conn_calc_dci_csa1 = 0x40000d40; -r_ble_ll_conn_calc_itvl_ticks = 0x40000d44; -r_ble_ll_conn_chk_csm_flags = 0x40000d48; -r_ble_ll_conn_chk_phy_upd_start = 0x40000d4c; -r_ble_ll_conn_comp_event_send = 0x40000d50; -r_ble_ll_conn_connect_ind_pdu_make = 0x40000d54; -r_ble_ll_conn_create = 0x40000d58; -r_ble_ll_conn_create_cancel = 0x40000d5c; -r_ble_ll_conn_created = 0x40000d60; -r_ble_ll_conn_cth_flow_enable = 0x40000d64; -r_ble_ll_conn_cth_flow_error_fn = 0x40000d68; -r_ble_ll_conn_cth_flow_have_credit = 0x40000d6c; -r_ble_ll_conn_cth_flow_is_enabled = 0x40000d70; -r_ble_ll_conn_cth_flow_process_cmd = 0x40000d74; -r_ble_ll_conn_cth_flow_set_buffers = 0x40000d78; -r_ble_ll_conn_enqueue_pkt = 0x40000d7c; -r_ble_ll_conn_env_init = 0x40000d80; -r_ble_ll_conn_ext_master_init = 0x40000d84; -r_ble_ll_conn_find_active_conn = 0x40000d88; -r_ble_ll_conn_get_active_conn = 0x40000d8c; -r_ble_ll_conn_get_anchor = 0x40000d90; -r_ble_ll_conn_hcc_params_set_fallback = 0x40000d94; -r_ble_ll_conn_hci_cancel_conn_complete_event = 0x40000d98; -r_ble_ll_conn_hci_chk_conn_params = 0x40000d9c; -r_ble_ll_conn_hci_chk_scan_params = 0x40000da0; -r_ble_ll_conn_hci_disconnect_cmd = 0x40000da4; -r_ble_ll_conn_hci_le_ltk_neg_reply = 0x40000da8; -r_ble_ll_conn_hci_le_ltk_reply = 0x40000dac; -r_ble_ll_conn_hci_le_rd_phy = 0x40000db0; -r_ble_ll_conn_hci_le_set_phy = 0x40000db4; -r_ble_ll_conn_hci_le_start_encrypt = 0x40000db8; -r_ble_ll_conn_hci_param_nrr = 0x40000dbc; -r_ble_ll_conn_hci_param_rr = 0x40000dc0; -r_ble_ll_conn_hci_rd_auth_pyld_tmo = 0x40000dc4; -r_ble_ll_conn_hci_rd_chan_map = 0x40000dc8; -r_ble_ll_conn_hci_rd_rem_ver_cmd = 0x40000dcc; -r_ble_ll_conn_hci_rd_rssi = 0x40000dd0; -r_ble_ll_conn_hci_read_rem_features = 0x40000dd4; -r_ble_ll_conn_hci_set_chan_class = 0x40000dd8; -r_ble_ll_conn_hci_set_data_len = 0x40000ddc; -r_ble_ll_conn_hci_update = 0x40000de0; -r_ble_ll_conn_hci_wr_auth_pyld_tmo = 0x40000de4; -r_ble_ll_conn_init_phy = 0x40000de8; -r_ble_ll_conn_is_dev_connected = 0x40000dec; -r_ble_ll_conn_is_empty_pdu = 0x40000df0; -r_ble_ll_conn_is_lru = 0x40000df4; -r_ble_ll_conn_master_init = 0x40000df8; -r_ble_ll_conn_module_deinit = 0x40000dfc; -r_ble_ll_conn_module_init = 0x40000e00; -r_ble_ll_conn_module_reset = 0x40000e04; -r_ble_ll_conn_next_event = 0x40000e08; -r_ble_ll_conn_num_comp_pkts_event_send = 0x40000e0c; -r_ble_ll_conn_prepare_tx_pdu = 0x40000e10; -r_ble_ll_conn_process_conn_params = 0x40000e14; -r_ble_ll_conn_req_peer_sca = 0x40000e18; -//r_ble_ll_conn_rx_data_pdu = 0x40000e1c; -r_ble_ll_conn_set_csa = 0x40000e20; -r_ble_ll_conn_set_ext_con_params = 0x40000e24; -r_ble_ll_conn_set_global_chanmap = 0x40000e28; -r_ble_ll_conn_set_phy = 0x40000e2c; -r_ble_ll_conn_set_txpwr_by_handle = 0x40000e30; -r_ble_ll_conn_set_unknown_rx_octets = 0x40000e34; -r_ble_ll_conn_slave_start = 0x40000e38; -r_ble_ll_conn_sm_get = 0x40000e3c; -r_ble_ll_conn_sm_new = 0x40000e40; -r_ble_ll_conn_sm_npl_deinit = 0x40000e44; -r_ble_ll_conn_sm_npl_init = 0x40000e48; -r_ble_ll_conn_tx_pkt_in = 0x40000e4c; -r_ble_ll_conn_update_eff_data_len = 0x40000e50; -r_ble_ll_ctrl_chanmap_req_make = 0x40000e54; -r_ble_ll_ctrl_chk_proc_start = 0x40000e58; -r_ble_ll_ctrl_conn_param_pdu_make = 0x40000e5c; -r_ble_ll_ctrl_conn_param_pdu_proc = 0x40000e60; -r_ble_ll_ctrl_conn_param_reply = 0x40000e64; -r_ble_ll_ctrl_conn_upd_make = 0x40000e68; -r_ble_ll_ctrl_datalen_upd_make = 0x40000e6c; -r_ble_ll_ctrl_enc_allowed_pdu = 0x40000e70; -r_ble_ll_ctrl_enc_allowed_pdu_rx = 0x40000e74; -r_ble_ll_ctrl_enc_allowed_pdu_tx = 0x40000e78; -r_ble_ll_ctrl_enc_req_make = 0x40000e7c; -r_ble_ll_ctrl_find_new_phy = 0x40000e80; -r_ble_ll_ctrl_initiate_dle = 0x40000e84; -r_ble_ll_ctrl_len_proc = 0x40000e88; -r_ble_ll_ctrl_min_used_chan_rsp = 0x40000e8c; -r_ble_ll_ctrl_phy_from_phy_mask = 0x40000e90; -r_ble_ll_ctrl_phy_req_rsp_make = 0x40000e94; -r_ble_ll_ctrl_phy_tx_transition_get = 0x40000e98; -r_ble_ll_ctrl_phy_update_cancel = 0x40000e9c; -r_ble_ll_ctrl_phy_update_ind_make = 0x40000ea0; -r_ble_ll_ctrl_phy_update_proc_complete = 0x40000ea4; -r_ble_ll_ctrl_proc_init = 0x40000ea8; -r_ble_ll_ctrl_proc_rsp_timer_cb = 0x40000eac; -r_ble_ll_ctrl_proc_start = 0x40000eb0; -r_ble_ll_ctrl_proc_stop = 0x40000eb4; -r_ble_ll_ctrl_proc_unk_rsp = 0x40000eb8; -r_ble_ll_ctrl_proc_with_instant_initiated = 0x40000ebc; -r_ble_ll_ctrl_rej_ext_ind_make = 0x40000ec0; -r_ble_ll_ctrl_reject_ind_send = 0x40000ec4; -r_ble_ll_ctrl_rx_chanmap_req = 0x40000ec8; -r_ble_ll_ctrl_rx_conn_param_req = 0x40000ecc; -//r_ble_ll_ctrl_rx_conn_param_rsp = 0x40000ed0; -//r_ble_ll_ctrl_rx_conn_update = 0x40000ed4; -r_ble_ll_ctrl_rx_enc_req = 0x40000ed8; -r_ble_ll_ctrl_rx_enc_rsp = 0x40000edc; -r_ble_ll_ctrl_rx_feature_req = 0x40000ee0; -r_ble_ll_ctrl_rx_feature_rsp = 0x40000ee4; -r_ble_ll_ctrl_rx_pause_enc_req = 0x40000ee8; -r_ble_ll_ctrl_rx_pause_enc_rsp = 0x40000eec; -r_ble_ll_ctrl_rx_pdu = 0x40000ef0; -r_ble_ll_ctrl_rx_periodic_sync_ind = 0x40000ef4; -r_ble_ll_ctrl_rx_phy_req = 0x40000ef8; -r_ble_ll_ctrl_rx_phy_rsp = 0x40000efc; -r_ble_ll_ctrl_rx_phy_update_ind = 0x40000f00; -r_ble_ll_ctrl_rx_ping_rsp = 0x40000f04; -r_ble_ll_ctrl_rx_reject_ind = 0x40000f08; -r_ble_ll_ctrl_rx_sca_req = 0x40000f0c; -r_ble_ll_ctrl_rx_sca_rsp = 0x40000f10; -r_ble_ll_ctrl_rx_start_enc_req = 0x40000f14; -r_ble_ll_ctrl_rx_start_enc_rsp = 0x40000f18; -r_ble_ll_ctrl_rx_version_ind = 0x40000f1c; -r_ble_ll_ctrl_sca_req_rsp_make = 0x40000f20; -r_ble_ll_ctrl_start_enc_send = 0x40000f24; -r_ble_ll_ctrl_start_rsp_timer = 0x40000f28; -r_ble_ll_ctrl_terminate_start = 0x40000f2c; -r_ble_ll_ctrl_tx_done = 0x40000f30; -r_ble_ll_ctrl_update_features = 0x40000f34; -r_ble_ll_ctrl_version_ind_make = 0x40000f38; -r_ble_ll_data_buffer_overflow = 0x40000f3c; -r_ble_ll_deinit = 0x40000f40; -r_ble_ll_disconn_comp_event_send = 0x40000f44; -r_ble_ll_env_init = 0x40000f48; -r_ble_ll_event_comp_pkts = 0x40000f4c; -r_ble_ll_event_dbuf_overflow = 0x40000f50; -r_ble_ll_event_send = 0x40000f54; -r_ble_ll_event_tx_pkt = 0x40000f58; -r_ble_ll_ext_adv_phy_mode_to_local_phy = 0x40000f5c; -r_ble_ll_ext_conn_create = 0x40000f60; -r_ble_ll_ext_scan_parse_adv_info = 0x40000f64; -r_ble_ll_ext_scan_parse_aux_ptr = 0x40000f68; -r_ble_ll_flush_pkt_queue = 0x40000f6c; -r_ble_ll_generate_dh_key_v1 = 0x40000f70; -r_ble_ll_generate_dh_key_v2 = 0x40000f74; -r_ble_ll_generic_data_init = 0x40000f78; -r_ble_ll_get_addr_type = 0x40000f7c; -r_ble_ll_get_chan_to_scan = 0x40000f80; -r_ble_ll_get_our_devaddr = 0x40000f84; -r_ble_ll_get_tx_pwr_compensation = 0x40000f88; -r_ble_ll_hci_acl_rx = 0x40000f8c; -r_ble_ll_hci_adv_mode_ext = 0x40000f90; -r_ble_ll_hci_adv_set_enable = 0x40000f94; -r_ble_ll_hci_cb_host_buf_size = 0x40000f98; -r_ble_ll_hci_cb_set_ctrlr_to_host_fc = 0x40000f9c; -r_ble_ll_hci_cb_set_event_mask = 0x40000fa0; -r_ble_ll_hci_cb_set_event_mask2 = 0x40000fa4; -r_ble_ll_hci_chk_phy_masks = 0x40000fa8; -r_ble_ll_hci_cmd_proc = 0x40000fac; -r_ble_ll_hci_cmd_rx = 0x40000fb0; -r_ble_ll_hci_ctlr_bb_cmd_proc = 0x40000fb4; -r_ble_ll_hci_deinit = 0x40000fb8; -r_ble_ll_hci_disconnect = 0x40000fbc; -r_ble_ll_hci_env_init = 0x40000fc0; -r_ble_ll_hci_ev_conn_update = 0x40000fc4; -r_ble_ll_hci_ev_databuf_overflow = 0x40000fc8; -r_ble_ll_hci_ev_datalen_chg = 0x40000fcc; -r_ble_ll_hci_ev_encrypt_chg = 0x40000fd0; -r_ble_ll_hci_ev_hw_err = 0x40000fd4; -r_ble_ll_hci_ev_le_csa = 0x40000fd8; -r_ble_ll_hci_ev_ltk_req = 0x40000fdc; -r_ble_ll_hci_ev_phy_update = 0x40000fe0; -r_ble_ll_hci_ev_rd_rem_used_feat = 0x40000fe4; -r_ble_ll_hci_ev_rd_rem_ver = 0x40000fe8; -r_ble_ll_hci_ev_rem_conn_parm_req = 0x40000fec; -r_ble_ll_hci_ev_sca_update = 0x40000ff0; -r_ble_ll_hci_ev_send_adv_set_terminated = 0x40000ff4; -r_ble_ll_hci_ev_send_scan_req_recv = 0x40000ff8; -r_ble_ll_hci_ev_send_scan_timeout = 0x40000ffc; -r_ble_ll_hci_ev_send_vendor_err = 0x40001000; -//r_ble_ll_hci_event_send = 0x40001004; -r_ble_ll_hci_ext_scan_set_enable = 0x40001008; -r_ble_ll_hci_get_num_cmd_pkts = 0x4000100c; -r_ble_ll_hci_info_params_cmd_proc = 0x40001010; -r_ble_ll_hci_init = 0x40001014; -r_ble_ll_hci_init_support_cmd_base_on_lmp_ver = 0x40001018; -r_ble_ll_hci_is_event_enabled = 0x4000101c; -r_ble_ll_hci_is_le_event_enabled = 0x40001020; -r_ble_ll_hci_le_cmd_proc = 0x40001024; -r_ble_ll_hci_le_cmd_send_cmd_status = 0x40001028; -r_ble_ll_hci_le_encrypt = 0x4000102c; -r_ble_ll_hci_le_rand = 0x40001030; -r_ble_ll_hci_le_rd_max_data_len = 0x40001034; -r_ble_ll_hci_le_rd_sugg_data_len = 0x40001038; -r_ble_ll_hci_le_read_bufsize = 0x4000103c; -r_ble_ll_hci_le_read_local_features = 0x40001040; -r_ble_ll_hci_le_read_supp_states = 0x40001044; -r_ble_ll_hci_le_set_def_phy = 0x40001048; -r_ble_ll_hci_le_wr_sugg_data_len = 0x4000104c; -r_ble_ll_hci_link_ctrl_cmd_proc = 0x40001050; -r_ble_ll_hci_npl_init = 0x40001054; -r_ble_ll_hci_post_gen_dhkey_cmp_evt = 0x40001058; -r_ble_ll_hci_post_rd_p256_pubkey_cmp_evt = 0x4000105c; -r_ble_ll_hci_rd_bd_addr = 0x40001060; -r_ble_ll_hci_rd_local_supp_cmd = 0x40001064; -r_ble_ll_hci_rd_local_supp_feat = 0x40001068; -r_ble_ll_hci_rd_local_version = 0x4000106c; -r_ble_ll_hci_scan_set_enable = 0x40001070; -r_ble_ll_hci_send_adv_report = 0x40001074; -r_ble_ll_hci_send_dir_adv_report = 0x40001078; -//r_ble_ll_hci_send_ext_adv_report = 0x4000107c; -//r_ble_ll_hci_send_legacy_ext_adv_report = 0x40001080; -r_ble_ll_hci_send_noop = 0x40001084; -r_ble_ll_hci_set_adv_data = 0x40001088; -r_ble_ll_hci_set_le_event_mask = 0x4000108c; -r_ble_ll_hci_set_scan_rsp_data = 0x40001090; -r_ble_ll_hci_status_params_cmd_proc = 0x40001094; -r_ble_ll_hci_vs_cmd_proc = 0x40001098; -r_ble_ll_hci_vs_rd_static_addr = 0x4000109c; -r_ble_ll_hw_err_timer_cb = 0x400010a0; -r_ble_ll_hw_error = 0x400010a4; -r_ble_ll_init = 0x400010a8; -r_ble_ll_init_alloc_conn_comp_ev = 0x400010ac; -r_ble_ll_init_get_conn_comp_ev = 0x400010b0; -r_ble_ll_init_rx_pkt_in = 0x400010b4; -r_ble_ll_is_addr_empty = 0x400010b8; -r_ble_ll_is_controller_busy = 0x400010bc; -r_ble_ll_is_on_resolv_list = 0x400010c0; -r_ble_ll_is_our_devaddr = 0x400010c4; -r_ble_ll_is_rpa = 0x400010c8; -r_ble_ll_is_valid_adv_mode = 0x400010cc; -r_ble_ll_is_valid_own_addr_type = 0x400010d0; -r_ble_ll_is_valid_public_addr = 0x400010d4; -r_ble_ll_is_valid_random_addr = 0x400010d8; -r_ble_ll_mbuf_init = 0x400010dc; -r_ble_ll_misc_options_set = 0x400010e0; -r_ble_ll_modify_sca = 0x400010e4; -r_ble_ll_modify_sca_action = 0x400010e8; -r_ble_ll_pdu_max_tx_octets_get = 0x400010ec; -r_ble_ll_pdu_tx_time_get = 0x400010f0; -r_ble_ll_phy_to_phy_mode = 0x400010f4; -r_ble_ll_qa_enable = 0x400010f8; -r_ble_ll_rand = 0x400010fc; -r_ble_ll_rand_data_get = 0x40001100; -r_ble_ll_rand_deinit = 0x40001104; -r_ble_ll_rand_env_init = 0x40001108; -r_ble_ll_rand_init = 0x4000110c; -r_ble_ll_rand_prand_get = 0x40001110; -r_ble_ll_rand_sample = 0x40001114; -r_ble_ll_rand_start = 0x40001118; -r_ble_ll_read_local_p256_pub_key = 0x4000111c; -r_ble_ll_read_rf_path_compensation = 0x40001120; -r_ble_ll_read_supp_features = 0x40001124; -r_ble_ll_read_supp_states = 0x40001128; -r_ble_ll_read_tx_power = 0x4000112c; -r_ble_ll_reset = 0x40001130; -r_ble_ll_resolv_clear_all_pl_bit = 0x40001134; -r_ble_ll_resolv_clear_all_wl_bit = 0x40001138; -r_ble_ll_resolv_deinit = 0x4000113c; -r_ble_ll_resolv_enable_cmd = 0x40001140; -r_ble_ll_resolv_enabled = 0x40001144; -r_ble_ll_resolv_env_init = 0x40001148; -r_ble_ll_resolv_gen_priv_addr = 0x4000114c; -r_ble_ll_resolv_gen_rpa = 0x40001150; -r_ble_ll_resolv_get_addr_pointer = 0x40001154; -r_ble_ll_resolv_get_index = 0x40001158; -r_ble_ll_resolv_get_irk_pointer = 0x4000115c; -r_ble_ll_resolv_get_list = 0x40001160; -r_ble_ll_resolv_get_priv_addr = 0x40001164; -r_ble_ll_resolv_get_rpa_tmo = 0x40001168; -r_ble_ll_resolv_init = 0x4000116c; -r_ble_ll_resolv_irk_nonzero = 0x40001170; -r_ble_ll_resolv_list_add = 0x40001174; -r_ble_ll_resolv_list_chg_allowed = 0x40001178; -r_ble_ll_resolv_list_clr = 0x4000117c; -r_ble_ll_resolv_list_find = 0x40001180; -r_ble_ll_resolv_list_read_size = 0x40001184; -r_ble_ll_resolv_list_reset = 0x40001188; -r_ble_ll_resolv_list_rmv = 0x4000118c; -r_ble_ll_resolv_local_addr_rd = 0x40001190; -r_ble_ll_resolv_peer_addr_rd = 0x40001194; -r_ble_ll_resolv_peer_rpa_any = 0x40001198; -r_ble_ll_resolv_reset = 0x4000119c; -r_ble_ll_resolv_rpa = 0x400011a0; -r_ble_ll_resolv_rpa_timer_cb = 0x400011a4; -r_ble_ll_resolv_set_local_rpa = 0x400011a8; -r_ble_ll_resolv_set_peer_rpa = 0x400011ac; -r_ble_ll_resolv_set_rpa_tmo = 0x400011b0; -r_ble_ll_resolve_set_priv_mode = 0x400011b4; -r_ble_ll_rxpdu_alloc = 0x400011b8; -r_ble_ll_scan_add_scan_rsp_adv = 0x400011bc; -r_ble_ll_scan_adv_decode_addr = 0x400011c0; -r_ble_ll_scan_aux_data_ref = 0x400011c4; -r_ble_ll_scan_aux_data_unref = 0x400011c8; -r_ble_ll_scan_can_chg_whitelist = 0x400011cc; -r_ble_ll_scan_check_periodic_sync = 0x400011d0; -r_ble_ll_scan_classify_filter_aux_init = 0x400011d4; -r_ble_ll_scan_classify_filter_init = 0x400011d8; -r_ble_ll_scan_common_init = 0x400011dc; -r_ble_ll_scan_continue_en = 0x400011e0; -r_ble_ll_scan_deinit = 0x400011e4; -r_ble_ll_scan_dup_check_ext = 0x400011e8; -r_ble_ll_scan_dup_check_legacy = 0x400011ec; -r_ble_ll_scan_dup_move_to_head = 0x400011f0; -r_ble_ll_scan_dup_new = 0x400011f4; -r_ble_ll_scan_dup_update_ext = 0x400011f8; -r_ble_ll_scan_dup_update_legacy = 0x400011fc; -r_ble_ll_scan_enabled = 0x40001200; -r_ble_ll_scan_end_adv_evt = 0x40001204; -r_ble_ll_scan_env_init = 0x40001208; -r_ble_ll_scan_ext_initiator_start = 0x4000120c; -r_ble_ll_scan_get_addr_data_from_legacy = 0x40001210; -r_ble_ll_scan_get_addr_from_ext_adv = 0x40001214; -r_ble_ll_scan_get_cur_sm = 0x40001218; -r_ble_ll_scan_get_ext_adv_report = 0x4000121c; -r_ble_ll_scan_get_local_rpa = 0x40001220; -r_ble_ll_scan_get_next_adv_prim_chan = 0x40001224; -r_ble_ll_scan_get_peer_rpa = 0x40001228; -r_ble_ll_scan_have_rxd_scan_rsp = 0x4000122c; -r_ble_ll_scan_init = 0x40001230; -r_ble_ll_scan_initiator_start = 0x40001234; -r_ble_ll_scan_is_inside_window = 0x40001238; -r_ble_ll_scan_move_window_to = 0x4000123c; -r_ble_ll_scan_npl_reset = 0x40001240; -r_ble_ll_scan_parse_auxptr = 0x40001244; -r_ble_ll_scan_parse_ext_hdr = 0x40001248; -r_ble_ll_scan_pre_process = 0x4000124c; -r_ble_ll_scan_record_new_adv = 0x40001250; -r_ble_ll_scan_refresh_nrpa = 0x40001254; -r_ble_ll_scan_reset = 0x40001258; -r_ble_ll_scan_rx_pkt_in = 0x4000125c; -r_ble_ll_scan_rx_pkt_in_on_aux = 0x40001260; -r_ble_ll_scan_rx_pkt_in_on_legacy = 0x40001264; -r_ble_ll_scan_rx_pkt_in_restore_addr_data = 0x40001268; -r_ble_ll_scan_rxed = 0x4000126c; -//r_ble_ll_scan_send_adv_report = 0x40001270; -r_ble_ll_scan_send_truncated = 0x40001274; -r_ble_ll_scan_set_enable = 0x40001278; -r_ble_ll_scan_set_peer_rpa = 0x4000127c; -r_ble_ll_scan_set_perfer_addr = 0x40001280; -r_ble_ll_scan_set_scan_params = 0x40001284; -r_ble_ll_scan_sm_start = 0x40001288; -r_ble_ll_scan_sm_stop = 0x4000128c; -r_ble_ll_scan_time_hci_to_ticks = 0x40001290; -r_ble_ll_scan_update_aux_data = 0x40001294; -r_ble_ll_scan_whitelist_enabled = 0x40001298; -r_ble_ll_set_default_privacy_mode = 0x4000129c; -r_ble_ll_set_default_sync_transfer_params = 0x400012a0; -r_ble_ll_set_ext_scan_params = 0x400012a4; -r_ble_ll_set_host_feat = 0x400012a8; -r_ble_ll_set_public_addr = 0x400012ac; -r_ble_ll_set_random_addr = 0x400012b0; -r_ble_ll_set_sync_transfer_params = 0x400012b4; -r_ble_ll_state_get = 0x400012b8; -r_ble_ll_state_set = 0x400012bc; -r_ble_ll_sync_adjust_ext_hdr = 0x400012c0; -r_ble_ll_sync_cancel = 0x400012c4; -r_ble_ll_sync_cancel_complete_event = 0x400012c8; -r_ble_ll_sync_check_acad = 0x400012cc; -r_ble_ll_sync_check_failed = 0x400012d0; -r_ble_ll_sync_create = 0x400012d4; -r_ble_ll_sync_deinit = 0x400012d8; -r_ble_ll_sync_enabled = 0x400012dc; -r_ble_ll_sync_env_init = 0x400012e0; -r_ble_ll_sync_est_event_failed = 0x400012e4; -r_ble_ll_sync_est_event_success = 0x400012e8; -r_ble_ll_sync_established = 0x400012ec; -r_ble_ll_sync_filter_enabled = 0x400012f0; -r_ble_ll_sync_find = 0x400012f4; -r_ble_ll_sync_get_cur_sm = 0x400012f8; -r_ble_ll_sync_get_handle = 0x400012fc; -r_ble_ll_sync_get_sm = 0x40001300; -r_ble_ll_sync_info_event = 0x40001304; -r_ble_ll_sync_init = 0x40001308; -r_ble_ll_sync_list_add = 0x4000130c; -r_ble_ll_sync_list_clear = 0x40001310; -r_ble_ll_sync_list_empty = 0x40001314; -r_ble_ll_sync_list_get_free = 0x40001318; -r_ble_ll_sync_list_remove = 0x4000131c; -r_ble_ll_sync_list_search = 0x40001320; -r_ble_ll_sync_list_size = 0x40001324; -r_ble_ll_sync_lost_event = 0x40001328; -r_ble_ll_sync_next_event = 0x4000132c; -r_ble_ll_sync_on_list = 0x40001330; -r_ble_ll_sync_parse_ext_hdr = 0x40001334; -r_ble_ll_sync_periodic_ind = 0x40001338; -r_ble_ll_sync_phy_mode_to_aux_phy = 0x4000133c; -r_ble_ll_sync_phy_mode_to_hci = 0x40001340; -r_ble_ll_sync_put_syncinfo = 0x40001344; -r_ble_ll_sync_receive_enable = 0x40001348; -r_ble_ll_sync_reserve = 0x4000134c; -r_ble_ll_sync_reset = 0x40001350; -r_ble_ll_sync_reset_sm = 0x40001354; -r_ble_ll_sync_rx_pkt_in = 0x40001358; -r_ble_ll_sync_send_per_adv_rpt = 0x4000135c; -r_ble_ll_sync_send_sync_ind = 0x40001360; -r_ble_ll_sync_send_truncated_per_adv_rpt = 0x40001364; -r_ble_ll_sync_sm_clear = 0x40001368; -r_ble_ll_sync_terminate = 0x4000136c; -r_ble_ll_sync_transfer = 0x40001370; -r_ble_ll_sync_transfer_get = 0x40001374; -r_ble_ll_sync_transfer_received = 0x40001378; -r_ble_ll_task = 0x4000137c; -r_ble_ll_trace_set_func = 0x40001380; -r_ble_ll_trace_u32 = 0x40001384; -r_ble_ll_trace_u32x2 = 0x40001388; -r_ble_ll_trace_u32x3 = 0x4000138c; -r_ble_ll_tx_flat_mbuf_pducb = 0x40001390; -r_ble_ll_tx_mbuf_pducb = 0x40001394; -r_ble_ll_tx_pkt_in = 0x40001398; -r_ble_ll_update_max_tx_octets_phy_mode = 0x4000139c; -r_ble_ll_usecs_to_ticks_round_up = 0x400013a0; -r_ble_ll_utils_calc_access_addr = 0x400013a4; -r_ble_ll_utils_calc_dci_csa2 = 0x400013a8; -r_ble_ll_utils_calc_num_used_chans = 0x400013ac; -r_ble_ll_utils_calc_window_widening = 0x400013b0; -r_ble_ll_utils_csa2_perm = 0x400013b4; -r_ble_ll_utils_csa2_prng = 0x400013b8; -r_ble_ll_utils_remapped_channel = 0x400013bc; -r_ble_ll_whitelist_add = 0x400013c0; -r_ble_ll_whitelist_chg_allowed = 0x400013c4; -r_ble_ll_whitelist_clear = 0x400013c8; -r_ble_ll_whitelist_read_size = 0x400013cc; -r_ble_ll_whitelist_rmv = 0x400013d0; -r_ble_ll_whitelist_search = 0x400013d4; -r_ble_ll_write_rf_path_compensation = 0x400013d8; -r_ble_lll_adv_aux_scannable_pdu_payload_len = 0x400013dc; -r_ble_lll_adv_aux_schedule = 0x400013e0; -r_ble_lll_adv_aux_schedule_first = 0x400013e4; -r_ble_lll_adv_aux_schedule_next = 0x400013e8; -r_ble_lll_adv_aux_scheduled = 0x400013ec; -r_ble_lll_adv_aux_set_start_time = 0x400013f0; -r_ble_lll_adv_coex_dpc_calc_pti_update_itvl = 0x400013f4; -r_ble_lll_adv_coex_dpc_process_pri = 0x400013f8; -r_ble_lll_adv_coex_dpc_process_sec = 0x400013fc; -r_ble_lll_adv_coex_dpc_pti_get = 0x40001400; -r_ble_lll_adv_coex_dpc_update = 0x40001404; -r_ble_lll_adv_coex_dpc_update_on_adv_start = 0x40001408; -r_ble_lll_adv_coex_dpc_update_on_aux_scheduled = 0x4000140c; -r_ble_lll_adv_coex_dpc_update_on_data_updated = 0x40001410; -r_ble_lll_adv_coex_dpc_update_on_event_end = 0x40001414; -r_ble_lll_adv_coex_dpc_update_on_event_scheduled = 0x40001418; -r_ble_lll_adv_done = 0x4000141c; -r_ble_lll_adv_drop_event = 0x40001420; -r_ble_lll_adv_event_done = 0x40001424; -r_ble_lll_adv_event_rmvd_from_sched = 0x40001428; -r_ble_lll_adv_ext_estimate_data_itvl = 0x4000142c; -r_ble_lll_adv_get_sec_pdu_len = 0x40001430; -r_ble_lll_adv_halt = 0x40001434; -r_ble_lll_adv_make_done = 0x40001438; -r_ble_lll_adv_periodic_done = 0x4000143c; -r_ble_lll_adv_periodic_event_done = 0x40001440; -r_ble_lll_adv_periodic_rmvd_from_sched = 0x40001444; -r_ble_lll_adv_periodic_schedule_first = 0x40001448; -r_ble_lll_adv_periodic_schedule_next = 0x4000144c; -r_ble_lll_adv_periodic_start = 0x40001450; -r_ble_lll_adv_periodic_stop = 0x40001454; -r_ble_lll_adv_pri_schedule_tx_pdu = 0x40001458; -r_ble_lll_adv_reschedule_event = 0x4000145c; -r_ble_lll_adv_reschedule_periodic_event = 0x40001460; -r_ble_lll_adv_rx_pkt_isr = 0x40001464; -r_ble_lll_adv_sec_done = 0x40001468; -r_ble_lll_adv_sec_event_done = 0x4000146c; -r_ble_lll_adv_sec_schedule_next_aux = 0x40001470; -r_ble_lll_adv_secondary_tx_start_cb = 0x40001474; -r_ble_lll_adv_sm_deinit = 0x40001478; -r_ble_lll_adv_sm_event_init = 0x4000147c; -r_ble_lll_adv_sm_event_restore = 0x40001480; -r_ble_lll_adv_sm_event_store = 0x40001484; -r_ble_lll_adv_sm_init = 0x40001488; -r_ble_lll_adv_sm_reset = 0x4000148c; -r_ble_lll_adv_start = 0x40001490; -r_ble_lll_adv_stop = 0x40001494; -r_ble_lll_adv_sync_next_scheduled = 0x40001498; -r_ble_lll_adv_sync_schedule = 0x4000149c; -r_ble_lll_adv_sync_tx_done = 0x400014a0; -r_ble_lll_adv_sync_tx_end = 0x400014a4; -r_ble_lll_adv_sync_tx_start_cb = 0x400014a8; -r_ble_lll_adv_tx_done = 0x400014ac; -r_ble_lll_adv_tx_start_cb = 0x400014b0; -r_ble_lll_adv_update_rsp_offset = 0x400014b4; -r_ble_lll_aux_scan_cb = 0x400014b8; -r_ble_lll_aux_scan_drop = 0x400014bc; -r_ble_lll_aux_scan_drop_event_cb = 0x400014c0; -r_ble_lll_calc_us_convert_tick_unit = 0x400014c4; -r_ble_lll_conn_append_tx_buffer = 0x400014c8; -r_ble_lll_conn_can_send_next_pdu = 0x400014cc; -r_ble_lll_conn_check_opcode_matched = 0x400014d0; -r_ble_lll_conn_coex_dpc_process = 0x400014d4; -r_ble_lll_conn_coex_dpc_pti_get = 0x400014d8; -r_ble_lll_conn_coex_dpc_update = 0x400014dc; -r_ble_lll_conn_coex_dpc_update_on_event_end = 0x400014e0; -r_ble_lll_conn_coex_dpc_update_on_event_scheduled = 0x400014e4; -r_ble_lll_conn_coex_dpc_update_on_event_started = 0x400014e8; -r_ble_lll_conn_cth_flow_alloc_credit = 0x400014ec; -r_ble_lll_conn_cth_flow_free_credit = 0x400014f0; -r_ble_lll_conn_current_sm_over = 0x400014f4; -r_ble_lll_conn_end = 0x400014f8; -r_ble_lll_conn_env_deinit = 0x400014fc; -r_ble_lll_conn_env_init = 0x40001500; -r_ble_lll_conn_event_end = 0x40001504; -r_ble_lll_conn_event_end_timer_cb = 0x40001508; -r_ble_lll_conn_event_halt = 0x4000150c; -r_ble_lll_conn_event_is_over = 0x40001510; -r_ble_lll_conn_event_start_cb = 0x40001514; -r_ble_lll_conn_free_rx_mbuf = 0x40001518; -r_ble_lll_conn_get_addr_info_from_rx_buf = 0x4000151c; -r_ble_lll_conn_get_ce_end_time = 0x40001520; -r_ble_lll_conn_get_next_sched_time = 0x40001524; -r_ble_lll_conn_get_rx_mbuf = 0x40001528; -r_ble_lll_conn_halt = 0x4000152c; -r_ble_lll_conn_master_common_init = 0x40001530; -r_ble_lll_conn_master_new = 0x40001534; -r_ble_lll_conn_module_deinit = 0x40001538; -r_ble_lll_conn_module_init = 0x4000153c; -r_ble_lll_conn_module_reset = 0x40001540; -r_ble_lll_conn_no_mem_evt_pre_cb = 0x40001544; -r_ble_lll_conn_pre_process = 0x40001548; -r_ble_lll_conn_process_acked_pdu = 0x4000154c; -r_ble_lll_conn_process_in_isr = 0x40001550; -r_ble_lll_conn_recv_ack = 0x40001554; -r_ble_lll_conn_recv_valid_packet = 0x40001558; -r_ble_lll_conn_reset_pending_sched = 0x4000155c; -r_ble_lll_conn_rx_pkt_isr = 0x40001560; -r_ble_lll_conn_sched_next_anchor = 0x40001564; -r_ble_lll_conn_sched_next_event = 0x40001568; -r_ble_lll_conn_set_slave_flow_control = 0x4000156c; -r_ble_lll_conn_slave_new = 0x40001570; -r_ble_lll_conn_sm_new = 0x40001574; -r_ble_lll_conn_sm_npl_deinit = 0x40001578; -r_ble_lll_conn_sm_npl_init = 0x4000157c; -r_ble_lll_conn_superversion_timer_cb = 0x40001580; -r_ble_lll_conn_timeout = 0x40001584; -r_ble_lll_conn_update_anchor = 0x40001588; -r_ble_lll_conn_update_conn_ind_params = 0x4000158c; -r_ble_lll_conn_update_encryption = 0x40001590; -r_ble_lll_conn_update_tx_buffer = 0x40001594; -r_ble_lll_deinit = 0x40001598; -r_ble_lll_dtm_calculate_itvl = 0x4000159c; -r_ble_lll_dtm_ctx_free = 0x400015a0; -r_ble_lll_dtm_deinit = 0x400015a4; -r_ble_lll_dtm_end_test = 0x400015a8; -r_ble_lll_dtm_ev_rx_restart_cb = 0x400015ac; -r_ble_lll_dtm_ev_tx_resched_cb = 0x400015b0; -r_ble_lll_dtm_init = 0x400015b4; -r_ble_lll_dtm_reset = 0x400015b8; -r_ble_lll_dtm_rx_create_ctx = 0x400015bc; -r_ble_lll_dtm_rx_isr_end = 0x400015c0; -r_ble_lll_dtm_rx_isr_start = 0x400015c4; -r_ble_lll_dtm_rx_pkt_in = 0x400015c8; -r_ble_lll_dtm_rx_sched_cb = 0x400015cc; -r_ble_lll_dtm_rx_start = 0x400015d0; -r_ble_lll_dtm_rx_test = 0x400015d4; -r_ble_lll_dtm_set_next = 0x400015d8; -r_ble_lll_dtm_tx_create_ctx = 0x400015dc; -r_ble_lll_dtm_tx_done = 0x400015e0; -r_ble_lll_dtm_tx_sched_cb = 0x400015e4; -r_ble_lll_dtm_tx_test = 0x400015e8; -r_ble_lll_dtm_wfr_timer_exp = 0x400015ec; -r_ble_lll_event_rx_pkt = 0x400015f0; -r_ble_lll_ext_scan_coex_dpc_process = 0x400015f4; -r_ble_lll_ext_scan_coex_dpc_pti_get = 0x400015f8; -r_ble_lll_ext_scan_coex_dpc_update = 0x400015fc; -r_ble_lll_ext_scan_coex_dpc_update_on_start = 0x40001600; -r_ble_lll_hci_dtm_rx_test = 0x40001604; -r_ble_lll_hci_dtm_rx_test_v2 = 0x40001608; -r_ble_lll_hci_dtm_tx_test = 0x4000160c; -r_ble_lll_hci_dtm_tx_test_ext = 0x40001610; -r_ble_lll_hci_dtm_tx_test_v2 = 0x40001614; -r_ble_lll_hci_dtm_tx_test_v2_ext = 0x40001618; -r_ble_lll_init = 0x4000161c; -r_ble_lll_init_pre_process = 0x40001620; -r_ble_lll_init_rx_pkt_isr = 0x40001624; -r_ble_lll_per_adv_coex_dpc_calc_pti_update_itvl = 0x40001628; -r_ble_lll_per_adv_coex_dpc_process = 0x4000162c; -r_ble_lll_per_adv_coex_dpc_pti_get = 0x40001630; -r_ble_lll_per_adv_coex_dpc_update = 0x40001634; -r_ble_lll_per_adv_coex_dpc_update_on_data_updated = 0x40001638; -r_ble_lll_per_adv_coex_dpc_update_on_scheduled = 0x4000163c; -r_ble_lll_per_adv_coex_dpc_update_on_start = 0x40001640; -r_ble_lll_reset = 0x40001644; -r_ble_lll_rfmgmt_controller_sleep_en = 0x40001648; -r_ble_lll_rfmgmt_deinit = 0x4000164c; -r_ble_lll_rfmgmt_disable = 0x40001650; -r_ble_lll_rfmgmt_enable = 0x40001654; -r_ble_lll_rfmgmt_enable_now = 0x40001658; -r_ble_lll_rfmgmt_init = 0x4000165c; -r_ble_lll_rfmgmt_is_enabled = 0x40001660; -r_ble_lll_rfmgmt_release = 0x40001664; -r_ble_lll_rfmgmt_release_ev = 0x40001668; -r_ble_lll_rfmgmt_reset = 0x4000166c; -r_ble_lll_rfmgmt_scan_changed = 0x40001670; -r_ble_lll_rfmgmt_sched_changed = 0x40001674; -r_ble_lll_rfmgmt_set_sleep_cb = 0x40001678; -r_ble_lll_rfmgmt_ticks_to_enabled = 0x4000167c; -r_ble_lll_rfmgmt_timer_exp = 0x40001680; -r_ble_lll_rfmgmt_timer_reschedule = 0x40001684; -r_ble_lll_rx_pdu_in = 0x40001688; -r_ble_lll_rx_pkt_in = 0x4000168c; -r_ble_lll_rx_pkt_isr = 0x40001690; -r_ble_lll_scan_abort_aux_sched = 0x40001694; -r_ble_lll_scan_aux_data_free = 0x40001698; -r_ble_lll_scan_chk_resume = 0x4000169c; -r_ble_lll_scan_clean_cur_aux_data = 0x400016a0; -r_ble_lll_scan_coex_event_cb = 0x400016a4; -r_ble_lll_scan_common_init = 0x400016a8; -r_ble_lll_scan_deinit = 0x400016ac; -r_ble_lll_scan_duration_period_timers_restart = 0x400016b0; -r_ble_lll_scan_duration_period_timers_stop = 0x400016b4; -r_ble_lll_scan_duration_timer_cb = 0x400016b8; -r_ble_lll_scan_event_proc = 0x400016bc; -r_ble_lll_scan_ext_adv_init = 0x400016c0; -r_ble_lll_scan_halt = 0x400016c4; -r_ble_lll_scan_has_sent_scan_req = 0x400016c8; -r_ble_lll_scan_init = 0x400016cc; -r_ble_lll_scan_npl_init = 0x400016d0; -r_ble_lll_scan_npl_reset = 0x400016d4; -r_ble_lll_scan_npl_restore = 0x400016d8; -r_ble_lll_scan_npl_store = 0x400016dc; -r_ble_lll_scan_period_timer_cb = 0x400016e0; -r_ble_lll_scan_process_adv_in_isr = 0x400016e4; -r_ble_lll_scan_process_rsp_in_isr = 0x400016e8; -r_ble_lll_scan_req_backoff = 0x400016ec; -r_ble_lll_scan_restart = 0x400016f0; -r_ble_lll_scan_rx_isr_on_aux = 0x400016f4; -r_ble_lll_scan_rx_isr_on_legacy = 0x400016f8; -r_ble_lll_scan_rx_pkt_isr = 0x400016fc; -r_ble_lll_scan_sched_next_aux = 0x40001700; -r_ble_lll_scan_sched_remove = 0x40001704; -r_ble_lll_scan_start = 0x40001708; -r_ble_lll_scan_start_rx = 0x4000170c; -r_ble_lll_scan_stop = 0x40001710; -r_ble_lll_scan_targeta_is_matched = 0x40001714; -r_ble_lll_scan_timer_cb = 0x40001718; -r_ble_lll_sched_adv_new = 0x4000171c; -r_ble_lll_sched_adv_resched_pdu = 0x40001720; -r_ble_lll_sched_adv_reschedule = 0x40001724; -r_ble_lll_sched_aux_scan = 0x40001728; -r_ble_lll_sched_conn_overlap = 0x4000172c; -r_ble_lll_sched_conn_reschedule = 0x40001730; -r_ble_lll_sched_deinit = 0x40001734; -r_ble_lll_sched_dtm = 0x40001738; -r_ble_lll_sched_env_init = 0x4000173c; -r_ble_lll_sched_execute_check = 0x40001740; -r_ble_lll_sched_execute_item = 0x40001744; -r_ble_lll_sched_init = 0x40001748; -r_ble_lll_sched_insert_if_empty = 0x4000174c; -r_ble_lll_sched_is_overlap = 0x40001750; -r_ble_lll_sched_master_new = 0x40001754; -r_ble_lll_sched_next_time = 0x40001758; -r_ble_lll_sched_overlaps_current = 0x4000175c; -r_ble_lll_sched_periodic_adv = 0x40001760; -r_ble_lll_sched_rmv_elem = 0x40001764; -r_ble_lll_sched_rmv_elem_type = 0x40001768; -r_ble_lll_sched_run = 0x4000176c; -r_ble_lll_sched_scan_req_over_aux_ptr = 0x40001770; -r_ble_lll_sched_slave_new = 0x40001774; -r_ble_lll_sched_stop = 0x40001778; -r_ble_lll_sched_sync = 0x4000177c; -r_ble_lll_sched_sync_overlaps_current = 0x40001780; -r_ble_lll_sched_sync_reschedule = 0x40001784; -r_ble_lll_sync_chain_start_cb = 0x40001788; -r_ble_lll_sync_coex_dpc_process = 0x4000178c; -r_ble_lll_sync_coex_dpc_pti_get = 0x40001790; -r_ble_lll_sync_coex_dpc_update = 0x40001794; -r_ble_lll_sync_current_sm_over = 0x40001798; -r_ble_lll_sync_deinit = 0x4000179c; -r_ble_lll_sync_event_end = 0x400017a0; -r_ble_lll_sync_event_end_cb = 0x400017a4; -r_ble_lll_sync_event_start_cb = 0x400017a8; -r_ble_lll_sync_get_event_end_time = 0x400017ac; -r_ble_lll_sync_halt = 0x400017b0; -r_ble_lll_sync_init = 0x400017b4; -r_ble_lll_sync_new = 0x400017b8; -r_ble_lll_sync_reset = 0x400017bc; -r_ble_lll_sync_reset_sm = 0x400017c0; -r_ble_lll_sync_rmvd_from_sched = 0x400017c4; -r_ble_lll_sync_rx_pkt_isr = 0x400017c8; -r_ble_lll_sync_schedule_chain = 0x400017cc; -r_ble_lll_sync_stop = 0x400017d0; -r_ble_lll_sync_trnasfer_sched = 0x400017d4; -r_ble_phy_access_addr_get = 0x400017d8; -r_ble_phy_calculate_rxtx_ifs = 0x400017dc; -r_ble_phy_calculate_rxwindow = 0x400017e0; -r_ble_phy_calculate_txrx_ifs = 0x400017e4; -r_ble_phy_check_bb_status = 0x400017e8; -r_ble_phy_complete_rx_info = 0x400017ec; -r_ble_phy_config_access_addr = 0x400017f0; -r_ble_phy_data_make = 0x400017f4; -r_ble_phy_disable = 0x400017f8; -r_ble_phy_disable_irq = 0x400017fc; -r_ble_phy_disable_whitening = 0x40001800; -r_ble_phy_enable_whitening = 0x40001804; -r_ble_phy_encrypt_disable = 0x40001808; -r_ble_phy_env_init = 0x4000180c; -r_ble_phy_get_current_phy = 0x40001810; -r_ble_phy_get_packet_counter = 0x40001814; -r_ble_phy_get_packet_status = 0x40001818; -r_ble_phy_get_pyld_time_offset = 0x4000181c; -r_ble_phy_get_rx_phy_mode = 0x40001820; -r_ble_phy_get_seq_end_st = 0x40001824; -r_ble_phy_init = 0x40001828; -//r_ble_phy_isr = 0x4000182c; -r_ble_phy_max_data_pdu_pyld = 0x40001830; -r_ble_phy_mode_config = 0x40001834; -r_ble_phy_mode_convert = 0x40001838; -r_ble_phy_mode_write = 0x4000183c; -r_ble_phy_module_deinit = 0x40001840; -r_ble_phy_module_init = 0x40001844; -r_ble_phy_monitor_bb_sync = 0x40001848; -r_ble_phy_reset_bb_monitor = 0x4000184c; -r_ble_phy_resolv_list_disable = 0x40001850; -r_ble_phy_resolv_list_enable = 0x40001854; -r_ble_phy_restart_sequence = 0x40001858; -r_ble_phy_rx_set_start_time_forcibly = 0x4000185c; -r_ble_phy_rxpdu_copy = 0x40001860; -r_ble_phy_seq_encrypt_enable = 0x40001864; -r_ble_phy_seq_encrypt_set_pkt_cntr = 0x40001868; -r_ble_phy_sequence_end_isr = 0x4000186c; -r_ble_phy_sequence_get_mode = 0x40001870; -r_ble_phy_sequence_is_running = 0x40001874; -r_ble_phy_sequence_is_waiting_rsp = 0x40001878; -r_ble_phy_sequence_single_end = 0x4000187c; -r_ble_phy_sequence_tx_end_invoke = 0x40001880; -r_ble_phy_sequence_update_conn_ind_params = 0x40001884; -r_ble_phy_set_adv_mode = 0x40001888; -r_ble_phy_set_coex_pti = 0x4000188c; -r_ble_phy_set_conn_ind_pdu = 0x40001890; -r_ble_phy_set_conn_mode = 0x40001894; -r_ble_phy_set_dev_address = 0x40001898; -r_ble_phy_set_rx_pwr_compensation = 0x4000189c; -r_ble_phy_set_rxhdr = 0x400018a0; -r_ble_phy_set_scan_mode = 0x400018a4; -r_ble_phy_set_sequence_mode = 0x400018a8; -r_ble_phy_set_single_packet_rx_sequence = 0x400018ac; -r_ble_phy_set_single_packet_tx_sequence = 0x400018b0; -r_ble_phy_set_tx_rx_transition = 0x400018b4; -r_ble_phy_set_txend_cb = 0x400018b8; -r_ble_phy_setchan = 0x400018bc; -r_ble_phy_start_rx_immediately = 0x400018c0; -r_ble_phy_state_get = 0x400018c4; -r_ble_phy_timer_config_start_time = 0x400018c8; -r_ble_phy_timer_start_now = 0x400018cc; -r_ble_phy_timer_stop = 0x400018d0; -r_ble_phy_tx_set_start_time = 0x400018d4; -r_ble_phy_txpower_round = 0x400018d8; -r_ble_phy_txpwr_set = 0x400018dc; -r_ble_phy_update_conn_sequence = 0x400018e0; -r_ble_phy_update_encryption = 0x400018e4; -r_ble_phy_update_ifs = 0x400018e8; -r_ble_phy_xcvr_state_get = 0x400018ec; -r_ble_plf_set_log_level = 0x400018f0; -r_ble_rtc_wake_up_cpu_init = 0x400018f4; -r_ble_rtc_wake_up_state_clr = 0x400018f8; -r_ble_vendor_hci_register = 0x400018fc; -r_bt_rf_coex_cfg_set = 0x40001900; -r_bt_rf_coex_coded_txrx_time_upper_lim = 0x40001904; -r_bt_rf_coex_dft_pti_set = 0x40001908; -r_bt_rf_coex_hook_deinit = 0x4000190c; -r_bt_rf_coex_hook_init = 0x40001910; -r_bt_rf_coex_hook_st_set = 0x40001914; -r_bt_rf_coex_hooks_p_set_default = 0x40001918; -r_btdm_disable_adv_delay = 0x4000191c; -r_btdm_switch_phy_coded = 0x40001920; -r_esp_wait_disabled = 0x40001924; -r_get_be16 = 0x40001928; -r_get_be24 = 0x4000192c; -r_get_be32 = 0x40001930; -r_get_be64 = 0x40001934; -r_get_le16 = 0x40001938; -r_get_le24 = 0x4000193c; -r_get_le32 = 0x40001940; -r_get_le64 = 0x40001944; -r_get_local_irk_offset = 0x40001948; -r_get_local_rpa_offset = 0x4000194c; -r_get_max_skip = 0x40001950; -r_get_peer_id_offset = 0x40001954; -r_get_peer_irk_offset = 0x40001958; -r_get_peer_rpa_offset = 0x4000195c; -r_hal_rtc_intr_init = 0x40001960; -//r_hal_rtc_irq_handler = 0x40001964; -r_hal_timer_deinit = 0x40001968; -r_hal_timer_disable_irq = 0x4000196c; -r_hal_timer_env_init = 0x40001970; -r_hal_timer_init = 0x40001974; -r_hal_timer_process = 0x40001978; -r_hal_timer_read = 0x4000197c; -r_hal_timer_read_tick = 0x40001980; -r_hal_timer_set_cb = 0x40001984; -r_hal_timer_set_exp_tick = 0x40001988; -r_hal_timer_start = 0x4000198c; -r_hal_timer_start_at = 0x40001990; -r_hal_timer_stop = 0x40001994; -r_hal_timer_task_start = 0x40001998; -r_ll_assert = 0x4000199c; -r_mem_init_mbuf_pool = 0x400019a0; -r_mem_malloc_mbuf_pool = 0x400019a4; -r_mem_malloc_mbufpkt_pool = 0x400019a8; -r_mem_malloc_mempool = 0x400019ac; -r_mem_malloc_mempool_ext = 0x400019b0; -r_mem_malloc_mempool_gen = 0x400019b4; -r_mem_pullup_obj = 0x400019b8; -r_mem_split_frag = 0x400019bc; -r_os_cputime_get32 = 0x400019c0; -r_os_cputime_ticks_to_usecs = 0x400019c4; -r_os_cputime_timer_init = 0x400019c8; -r_os_cputime_timer_relative = 0x400019cc; -r_os_cputime_timer_start = 0x400019d0; -r_os_cputime_timer_stop = 0x400019d4; -r_os_cputime_usecs_to_ticks = 0x400019d8; -r_os_mbuf_adj = 0x400019dc; -r_os_mbuf_append = 0x400019e0; -r_os_mbuf_appendfrom = 0x400019e4; -r_os_mbuf_cmpf = 0x400019e8; -r_os_mbuf_cmpm = 0x400019ec; -r_os_mbuf_concat = 0x400019f0; -r_os_mbuf_copydata = 0x400019f4; -r_os_mbuf_copyinto = 0x400019f8; -r_os_mbuf_dup = 0x400019fc; -r_os_mbuf_extend = 0x40001a00; -r_os_mbuf_free = 0x40001a04; -r_os_mbuf_free_chain = 0x40001a08; -r_os_mbuf_get = 0x40001a0c; -r_os_mbuf_get_pkthdr = 0x40001a10; -r_os_mbuf_leadingspace = 0x40001a14; -r_os_mbuf_len = 0x40001a18; -r_os_mbuf_off = 0x40001a1c; -r_os_mbuf_pack_chains = 0x40001a20; -r_os_mbuf_pool_init = 0x40001a24; -r_os_mbuf_prepend = 0x40001a28; -r_os_mbuf_prepend_pullup = 0x40001a2c; -r_os_mbuf_pullup = 0x40001a30; -r_os_mbuf_trailingspace = 0x40001a34; -r_os_mbuf_trim_front = 0x40001a38; -r_os_mbuf_widen = 0x40001a3c; -r_os_memblock_from = 0x40001a40; -r_os_memblock_get = 0x40001a44; -r_os_memblock_put = 0x40001a48; -r_os_memblock_put_from_cb = 0x40001a4c; -r_os_mempool_clear = 0x40001a50; -r_os_mempool_ext_clear = 0x40001a54; -r_os_mempool_ext_init = 0x40001a58; -r_os_mempool_init = 0x40001a60; -r_os_mempool_init_internal = 0x40001a64; -r_os_mempool_is_sane = 0x40001a68; -r_os_mempool_module_init = 0x40001a6c; -r_os_mqueue_get = 0x40001a74; -r_os_mqueue_init = 0x40001a78; -r_os_mqueue_put = 0x40001a7c; -r_os_msys_count = 0x40001a80; -r_os_msys_get = 0x40001a84; -r_os_msys_get_pkthdr = 0x40001a88; -r_os_msys_num_free = 0x40001a8c; -r_os_msys_register = 0x40001a90; -r_os_msys_reset = 0x40001a94; -r_pri_phy_valid = 0x40001a98; -r_put_be16 = 0x40001a9c; -r_put_be24 = 0x40001aa0; -r_put_be32 = 0x40001aa4; -r_put_be64 = 0x40001aa8; -r_put_le16 = 0x40001aac; -r_put_le24 = 0x40001ab0; -r_put_le32 = 0x40001ab4; -r_put_le64 = 0x40001ab8; -r_rtc0_timer_handler = 0x40001abc; -r_sdkconfig_get_opts = 0x40001ac0; -r_sdkconfig_set_opts = 0x40001ac4; -r_sec_phy_valid = 0x40001ac8; -r_swap_buf = 0x40001acc; -r_swap_in_place = 0x40001ad0; -/* Data (.data, .bss, .rodata) */ -ble_lll_dtm_module_env_p = 0x3fcdffc4; -g_ble_lll_dtm_prbs15_data = 0x3ff4fee4; -g_ble_lll_dtm_prbs9_data = 0x3ff4fde4; -g_channel_rf_to_index = 0x3ff4fdbc; -g_ble_lll_rfmgmt_data = 0x3fcdff7c; -g_ble_sleep_enter_cb = 0x3fcdff78; -g_ble_sleep_exit_cb = 0x3fcdff74; -ble_lll_sched_env_p = 0x3fcdff70; -ble_ll_env_p = 0x3fcdff6c; -g_ble_ll_pdu_header_tx_time_ro = 0x3ff4fdb4; -ble_ll_adv_env_p = 0x3fcdff68; -ble_ll_conn_env_p = 0x3fcdff64; -ble_ll_conn_required_phy_mask = 0x3ff4fdb0; -ble_ll_valid_conn_phy_mask = 0x3ff4fdaf; -g_ble_ll_ctrl_pkt_lengths_ro = 0x3ff4fd8c; -ble_ll_hci_env_p = 0x3fcdff60; -g_debug_le_private_key = 0x3ff4fd6c; -g_ecc_key = 0x3fcdfefc; -ble_ll_rand_env_p = 0x3fcdfef8; -ble_ll_resolv_env_p = 0x3fcdfef4; -g_ble_ll_resolve_hdr = 0x3fcdfeec; -g_device_mode_default = 0x3fcdfe68; -ble_ll_scan_classify_filter_aux_check_cb = 0x3fcdfee8; -ble_ll_scan_classify_filter_check_cb = 0x3fcdfee4; -ble_ll_scan_env_p = 0x3fcdfee0; -g_ble_ll_supp_cmds_ro = 0x3ff4fd3c; -ble_ll_sync_env_p = 0x3fcdfedc; -g_ble_sca_ppm_tbl_ro = 0x3ff4fd2c; -priv_config_opts = 0x3fcdfe48; -ble_hci_uart_reset_cmd = 0x3ff4fd28; -ble_hci_trans_env_p = 0x3fcdfed8; -ble_hci_trans_mode = 0x3fcdfe44; -ble_hci_trans_funcs_ptr = 0x3fcdfed4; -r_ble_lll_stub_funcs_ptr = 0x3fcdfed0; -r_ble_stub_funcs_ptr = 0x3fcdfecc; -r_ext_funcs_p = 0x3fcdfec8; -r_npl_funcs = 0x3fcdfec4; -ble_hw_env_p = 0x3fcdfec0; -ble_phy_module_env_p = 0x3fcdfebc; -g_ble_phy_chan_freq_ro = 0x3ff4fd00; -g_ble_phy_mode_pkt_start_off_ro = 0x3ff4fcf8; -g_ble_phy_rxtx_ifs_compensation_ro = 0x3ff4fce8; -g_ble_phy_t_rxaddrdelay_ro = 0x3ff4fce4; -g_ble_phy_t_rxenddelay_ro = 0x3ff4fce0; -g_ble_phy_t_txdelay_ro = 0x3ff4fcdc; -g_ble_phy_t_txenddelay_ro = 0x3ff4fcd8; -g_ble_phy_txrx_ifs_compensation_ro = 0x3ff4fcc8; -hal_timer_env_p = 0x3fcdfeb8; -r_osi_coex_funcs_p = 0x3fcdfeb4; -bt_rf_coex_hooks = 0x3fcdfeac; -bt_rf_coex_hooks_p = 0x3fcdfea8; -coex_hook_st_group_tab = 0x3ff4fcbc; -coex_hook_st_group_to_coex_schm_st_tab = 0x3ff4fcb8; -s_ble_act_count_by_group = 0x3fcdfea4; -s_ble_coex_st_map = 0x3fcdfe90; -bt_rf_coex_cfg_cb = 0x3fcdfe74; -bt_rf_coex_cfg_p = 0x3fcdfe70; -bt_rf_coex_cfg_rom = 0x3ff4fc9c; -bt_rf_coex_pti_dft_p = 0x3fcdfe6c; -bt_rf_coex_pti_dft_rom = 0x3fcdfe04; -conn_dynamic_pti_param_rom = 0x3ff4fc84; -conn_phy_coded_max_data_time_param_rom = 0x3ff4fc80; -ext_adv_dynamic_pti_param_rom = 0x3ff4fc4c; -ext_scan_dynamic_param_rom = 0x3ff4fc14; -legacy_adv_dynamic_pti_param_rom = 0x3ff4fbf4; -per_adv_dynamic_pti_param_rom = 0x3ff4fbd8; -sync_dynamic_param_rom = 0x3ff4fbc0; -g_ble_plf_log_level = 0x3fcdfe00; -g_msys_pool_list = 0x3fcdfdf8; -g_os_mempool_list = 0x3fcdfdf0; - /*************************************** Group rom_pp @@ -1269,109 +159,6 @@ systimer_hal_deinit = 0x40002ea8; systimer_hal_set_tick_rate_ops = 0x40002eac; -/*************************************** - Group eco4_bluetooth - ***************************************/ - -/* Functions */ -r_ble_ll_adv_ext_pdu_tx_len = 0x40002eb0; -//r_ble_ll_adv_ext_estimate_data_itvl = 0x40002eb4; -//r_ble_ll_adv_ext_check_data_itvl = 0x40002eb8; -r_ble_ll_ctrl_channel_status_report_timer_cb = 0x40002ebc; -r_ble_ll_ctrl_channel_class_enable_make = 0x40002ec0; -r_ble_ll_ctrl_channel_class_reporting_make = 0x40002ec4; -r_ble_ll_ctrl_rx_channel_reporting_ind = 0x40002ec8; -r_ble_ll_ctrl_rx_channel_status_ind = 0x40002ecc; -r_ble_ll_ctrl_channel_class_info_update = 0x40002ed0; -r_ble_ll_adv_set_data_related_addr_change = 0x40002ed4; -r_ble_ll_misc_additional_options_set = 0x40002ed8; -r_ble_phy_get_txdbm_by_level = 0x40002edc; -r_hal_timer_disable_intr = 0x40002ee0; -r_hal_timer_enable_intr = 0x40002ee4; -r_hal_timer_task_stop = 0x40002ee8; -r_ble_lll_rfmgmt_env_init = 0x40002eec; -r_ble_ll_scan_set_aux_ll_flag = 0x40002ef0; -r_ble_ll_rf_temp_calibration = 0x40002ef4; -r_ble_ll_adv_env_deinit = 0x40002ef8; -r_ble_ll_conn_env_deinit = 0x40002efc; -r_ble_ll_hci_env_deinit = 0x40002f00; -r_ble_ll_rand_env_deinit = 0x40002f04; -r_ble_ll_resolv_env_deinit = 0x40002f08; -r_ble_ll_scan_env_deinit = 0x40002f0c; -r_ble_ll_sync_env_deinit = 0x40002f10; -r_ble_lll_rfmgmt_env_deinit = 0x40002f14; -r_hal_timer_env_deinit = 0x40002f18; -r_ble_ll_env_deinit = 0x40002f1c; -r_ble_ll_generic_data_deinit = 0x40002f20; -//r_ble_hci_trans_env_deinit = 0x40002f24; -r_ble_ll_conn_callout_env_init = 0x40002f28; -r_ble_ll_conn_callout_env_deinit = 0x40002f2c; -r_ble_ll_scan_callout_env_init = 0x40002f30; -r_ble_ll_scan_callout_env_deinit = 0x40002f34; -r_ble_ll_callout_env_init = 0x40002f38; -r_ble_ll_callout_env_deinit = 0x40002f3c; -r_ble_ll_resolv_callout_env_init = 0x40002f40; -r_ble_ll_resolv_callout_env_deinit = 0x40002f44; -r_ble_ll_get_npl_element_info = 0x40002f48; -r_ble_rtc_wake_up_cpu_clr = 0x40002f4c; -r_ble_ll_scan_hci_set_adv_report_flow_ctrl = 0x40002f50; -r_ble_ll_scan_hci_update_adv_report_flow_ctrl = 0x40002f54; -r_ble_ll_scan_send_adv_lost_report = 0x40002f58; -r_ble_ll_scan_adv_report_cth_flow_is_enabled = 0x40002f5c; -r_ble_ll_scan_adv_report_cth_flow_alloc_credit = 0x40002f60; -r_ble_ll_scan_adv_report_cth_flow_free_credit = 0x40002f64; -r_ble_ll_scan_adv_report_cth_flow_have_credit = 0x40002f68; -r_ble_ll_scan_adv_report_lost_cnt_threshold_arrived = 0x40002f6c; -r_ble_ll_scan_adv_report_lost_cnt_clear = 0x40002f70; -r_ble_ll_scan_adv_report_lost_cnt_add = 0x40002f74; -r_ble_ll_trace_hex = 0x40002f78; -r_ble_ll_conn_calc_closest_event_cntr = 0x40002f7c; -r_ble_ll_trace_buffer_select = 0x40002f80; -r_ble_ll_adv_vendor_hci_legacy_adv_clear = 0x40002f84; -r_ble_ll_conn_is_lru_compare_with_sync = 0x40002f88; -r_ble_ll_conn_rollback_last_unmapped_chan = 0x40002f8c; -r_ble_ll_hci_vs_csa_set = 0x40002f90; -r_ble_ll_hci_reset = 0x40002f94; -r_ble_ll_adv_status_check = 0x40002f98; -r_ble_ll_conn_status_check = 0x40002f9c; -r_ble_ll_scan_status_check = 0x40002fa0; -r_ble_ll_sync_status_check = 0x40002fa4; -r_ble_ll_resolv_status_check = 0x40002fa8; -r_ble_ll_whitelist_status_check = 0x40002fac; -r_ble_ll_adv_delay_get = 0x40002fb0; -r_ble_ll_scan_continue_status_get = 0x40002fb4; -r_ble_ll_default_privacy_mode_get = 0x40002fb8; -r_ble_ll_adv_periodic_status_check = 0x40002fbc; -r_ble_ll_sync_list_status_check = 0x40002fc0; -r_ble_lll_rfmgmt_wake_up_ev = 0x40002fc4; -r_ble_lll_sched_env_deinit = 0x40002fc8; -r_ble_phy_env_deinit = 0x40002fcc; -r_ble_hw_driver_env_deinit = 0x40002fd0; -r_ble_lll_dtm_env_init = 0x40002fd4; -r_ble_lll_dtm_env_deinit = 0x40002fd8; -r_ble_lll_scan_callout_env_init = 0x40002fdc; -r_ble_lll_scan_callout_env_deinit = 0x40002fe0; -r_ble_lll_scan_env_init = 0x40002fe4; -r_ble_lll_scan_env_deinit = 0x40002fe8; -r_ble_lll_get_npl_element_info = 0x40002fec; -r_ble_lll_conn_rxpdu_alloc = 0x40002ff0; -r_ble_lll_scan_filter_out_useless_adv = 0x40002ff4; -r_ble_hw_whitelist_check_in_wl = 0x40002ff8; -r_ble_phy_stats_reset = 0x40002ffc; -r_ble_phy_ramup_time_set = 0x40003000; -r_ble_lll_rfmgmt_should_skip_light_sleep_check = 0x40003004; -r_ble_phy_rx_err_record = 0x40003008; -r_ble_lll_rfmgmt_wake_up_overhead_set = 0x4000300c; -r_ble_lll_conn_event_delete_and_reschedule = 0x40003010; -r_ble_lll_conn_should_reschedule = 0x40003014; -r_ble_lll_adv_ext_event_rmvd_from_sched = 0x40003018; -r_ble_lll_conn_process_rx_data_after_halt = 0x4000301c; -r_ble_phy_global_rxbuf_get = 0x40003020; -/* Data (.data, .bss, .rodata) */ -priv_config_additional_opts_ptr = 0x3fcdfa70; -g_ble_ll_ctrl_pkt_lengths_eco4_ro = 0x3ff4fbac; - - /*************************************** Group eco4_rom_net80211 ***************************************/ diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index e0786312a58d..9a89e2ec2b8d 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -551,905 +551,6 @@ g_uart_print = 0x3fcdffc9; g_usb_print = 0x3fcdffc8; -/*************************************** - Group bluetooth - ***************************************/ - -/* Functions */ -ble_controller_rom_data_init = 0x40000aa8; -ble_osi_coex_funcs_register = 0x40000aac; -bt_rf_coex_cfg_get_default = 0x40000ab0; -bt_rf_coex_dft_pti_get_default = 0x40000ab4; -bt_rf_coex_hooks_p_set = 0x40000ab8; -r__os_mbuf_copypkthdr = 0x40000abc; -r_ble_controller_get_rom_compile_version = 0x40000ac4; -r_ble_hci_ram_reset = 0x40000ad8; -r_ble_hci_ram_set_acl_free_cb = 0x40000adc; -r_ble_hci_trans_acl_buf_alloc = 0x40000ae0; -r_ble_hci_trans_buf_alloc = 0x40000ae4; -r_ble_hci_trans_buf_free = 0x40000ae8; -r_ble_hci_trans_cfg_hs = 0x40000aec; -r_ble_hci_trans_cfg_ll = 0x40000af0; -r_ble_hci_trans_init = 0x40000afc; -r_ble_hci_uart_acl_tx = 0x40000b00; -r_ble_hci_uart_cmdevt_tx = 0x40000b04; -r_ble_hci_uart_config = 0x40000b08; -r_ble_hci_uart_free_pkt = 0x40000b0c; -r_ble_hci_uart_rx_acl = 0x40000b20; -r_ble_hci_uart_rx_char = 0x40000b24; -r_ble_hci_uart_rx_cmd = 0x40000b28; -r_ble_hci_uart_rx_evt = 0x40000b2c; -r_ble_hci_uart_rx_evt_cb = 0x40000b30; -r_ble_hci_uart_rx_le_evt = 0x40000b34; -r_ble_hci_uart_rx_pkt_type = 0x40000b38; -r_ble_hci_uart_rx_skip_acl = 0x40000b3c; -r_ble_hci_uart_rx_skip_cmd = 0x40000b40; -r_ble_hci_uart_rx_skip_evt = 0x40000b44; -r_ble_hci_uart_rx_sync_loss = 0x40000b48; -r_ble_hci_uart_set_acl_free_cb = 0x40000b4c; -r_ble_hci_uart_sync_lost = 0x40000b50; -r_ble_hci_uart_trans_reset = 0x40000b54; -r_ble_hci_uart_tx_char = 0x40000b58; -r_ble_hci_uart_tx_pkt_type = 0x40000b5c; -r_ble_hw_encrypt_block = 0x40000b68; -r_ble_hw_get_public_addr = 0x40000b6c; -r_ble_hw_get_static_addr = 0x40000b70; -r_ble_hw_periodiclist_add = 0x40000b74; -r_ble_hw_periodiclist_clear = 0x40000b78; -r_ble_hw_periodiclist_rmv = 0x40000b7c; -r_ble_hw_resolv_list_cur_entry = 0x40000b80; -r_ble_hw_resolv_list_set = 0x40000b88; -r_ble_hw_rng_init = 0x40000b8c; -r_ble_hw_rng_start = 0x40000b90; -r_ble_hw_rng_stop = 0x40000b94; -r_ble_hw_rx_local_is_resolved = 0x40000b98; -r_ble_hw_rx_local_is_rpa = 0x40000b9c; -r_ble_hw_whitelist_add = 0x40000ba0; -r_ble_hw_whitelist_dev_num = 0x40000ba8; -r_ble_hw_whitelist_get_base = 0x40000bac; -r_ble_hw_whitelist_search = 0x40000bb4; -r_ble_hw_whitelist_sort = 0x40000bb8; -r_ble_ll_acl_data_in = 0x40000bbc; -r_ble_ll_addr_is_id = 0x40000bc0; -r_ble_ll_addr_subtype = 0x40000bc4; -r_ble_ll_adv_active_chanset_clear = 0x40000bc8; -r_ble_ll_adv_active_chanset_is_pri = 0x40000bcc; -r_ble_ll_adv_active_chanset_is_sec = 0x40000bd0; -r_ble_ll_adv_active_chanset_set_pri = 0x40000bd4; -r_ble_ll_adv_active_chanset_set_sec = 0x40000bd8; -r_ble_ll_adv_aux_calculate = 0x40000bdc; -r_ble_ll_adv_aux_conn_rsp_pdu_make = 0x40000be0; -r_ble_ll_adv_aux_pdu_make = 0x40000be4; -r_ble_ll_adv_aux_scannable_pdu_make = 0x40000be8; -r_ble_ll_adv_aux_txed = 0x40000bec; -r_ble_ll_adv_can_chg_whitelist = 0x40000bf0; -r_ble_ll_adv_chk_rpa_timeout = 0x40000bf4; -r_ble_ll_adv_clear_all = 0x40000bf8; -r_ble_ll_adv_conn_req_rxd = 0x40000bfc; -r_ble_ll_adv_enabled = 0x40000c04; -r_ble_ll_adv_ext_set_adv_data = 0x40000c0c; -r_ble_ll_adv_ext_set_scan_rsp = 0x40000c18; -r_ble_ll_adv_final_chan = 0x40000c1c; -r_ble_ll_adv_first_chan = 0x40000c20; -r_ble_ll_adv_flags_clear = 0x40000c24; -r_ble_ll_adv_flags_set = 0x40000c28; -r_ble_ll_adv_get_chan_num = 0x40000c2c; -r_ble_ll_adv_get_local_rpa = 0x40000c30; -r_ble_ll_adv_get_peer_rpa = 0x40000c34; -r_ble_ll_adv_hci_set_random_addr = 0x40000c38; -r_ble_ll_adv_init = 0x40000c3c; -r_ble_ll_adv_next_chan = 0x40000c44; -r_ble_ll_adv_pdu_make = 0x40000c48; -r_ble_ll_adv_periodic_check_data_itvl = 0x40000c4c; -r_ble_ll_adv_periodic_estimate_data_itvl = 0x40000c54; -r_ble_ll_adv_periodic_send_sync_ind = 0x40000c58; -r_ble_ll_adv_periodic_set_info_transfer = 0x40000c60; -r_ble_ll_adv_periodic_set_param = 0x40000c64; -r_ble_ll_adv_pre_process = 0x40000c68; -r_ble_ll_adv_put_acad_chM_update_ind = 0x40000c6c; -r_ble_ll_adv_put_aux_ptr = 0x40000c70; -r_ble_ll_adv_put_syncinfo = 0x40000c74; -r_ble_ll_adv_rd_max_adv_data_len = 0x40000c78; -r_ble_ll_adv_rd_sup_adv_sets = 0x40000c7c; -r_ble_ll_adv_read_txpwr = 0x40000c80; -r_ble_ll_adv_rpa_timeout = 0x40000c8c; -r_ble_ll_adv_rpa_update = 0x40000c90; -r_ble_ll_adv_scan_req_rxd = 0x40000c98; -r_ble_ll_adv_scan_rsp_legacy_pdu_make = 0x40000c9c; -r_ble_ll_adv_scan_rsp_pdu_make = 0x40000ca0; -r_ble_ll_adv_scheduled = 0x40000ca4; -r_ble_ll_adv_set_random_addr = 0x40000cb8; -r_ble_ll_adv_sm_deinit = 0x40000cc4; -r_ble_ll_adv_sm_event_init = 0x40000cc8; -r_ble_ll_adv_sm_find_configured = 0x40000ccc; -r_ble_ll_adv_sm_get = 0x40000cd0; -r_ble_ll_adv_sm_reset = 0x40000cd8; -r_ble_ll_adv_sm_start = 0x40000cdc; -r_ble_ll_adv_sm_start_periodic = 0x40000ce0; -r_ble_ll_adv_sm_stop = 0x40000ce4; -r_ble_ll_adv_sm_stop_limit_reached = 0x40000ce8; -r_ble_ll_adv_sm_stop_periodic = 0x40000cec; -r_ble_ll_adv_sm_stop_timeout = 0x40000cf0; -r_ble_ll_adv_sync_get_pdu_len = 0x40000cf8; -r_ble_ll_adv_update_adv_scan_rsp_data = 0x40000d00; -r_ble_ll_adv_update_data_mbuf = 0x40000d04; -r_ble_ll_adv_update_did = 0x40000d08; -r_ble_ll_adv_update_periodic_data = 0x40000d0c; -r_ble_ll_auth_pyld_tmo_event_send = 0x40000d14; -r_ble_ll_calc_offset_ticks_us_for_rampup = 0x40000d18; -r_ble_ll_calc_session_key = 0x40000d1c; -r_ble_ll_calc_ticks_per_slot = 0x40000d20; -r_ble_ll_chk_txrx_octets = 0x40000d28; -r_ble_ll_chk_txrx_time = 0x40000d2c; -r_ble_ll_conn_adjust_pyld_len = 0x40000d30; -r_ble_ll_conn_auth_pyld_timer_cb = 0x40000d34; -r_ble_ll_conn_auth_pyld_timer_start = 0x40000d38; -r_ble_ll_conn_calc_dci = 0x40000d3c; -r_ble_ll_conn_calc_dci_csa1 = 0x40000d40; -r_ble_ll_conn_calc_itvl_ticks = 0x40000d44; -r_ble_ll_conn_chk_csm_flags = 0x40000d48; -r_ble_ll_conn_chk_phy_upd_start = 0x40000d4c; -r_ble_ll_conn_comp_event_send = 0x40000d50; -r_ble_ll_conn_create_cancel = 0x40000d5c; -r_ble_ll_conn_cth_flow_enable = 0x40000d64; -r_ble_ll_conn_cth_flow_error_fn = 0x40000d68; -r_ble_ll_conn_cth_flow_have_credit = 0x40000d6c; -r_ble_ll_conn_cth_flow_is_enabled = 0x40000d70; -r_ble_ll_conn_cth_flow_process_cmd = 0x40000d74; -r_ble_ll_conn_cth_flow_set_buffers = 0x40000d78; -r_ble_ll_conn_ext_master_init = 0x40000d84; -r_ble_ll_conn_find_active_conn = 0x40000d88; -r_ble_ll_conn_get_active_conn = 0x40000d8c; -r_ble_ll_conn_get_anchor = 0x40000d90; -r_ble_ll_conn_hcc_params_set_fallback = 0x40000d94; -r_ble_ll_conn_hci_cancel_conn_complete_event = 0x40000d98; -r_ble_ll_conn_hci_chk_conn_params = 0x40000d9c; -r_ble_ll_conn_hci_chk_scan_params = 0x40000da0; -r_ble_ll_conn_hci_disconnect_cmd = 0x40000da4; -r_ble_ll_conn_hci_le_ltk_neg_reply = 0x40000da8; -r_ble_ll_conn_hci_le_ltk_reply = 0x40000dac; -r_ble_ll_conn_hci_le_rd_phy = 0x40000db0; -r_ble_ll_conn_hci_le_start_encrypt = 0x40000db8; -r_ble_ll_conn_hci_param_nrr = 0x40000dbc; -r_ble_ll_conn_hci_param_rr = 0x40000dc0; -r_ble_ll_conn_hci_rd_auth_pyld_tmo = 0x40000dc4; -r_ble_ll_conn_hci_rd_chan_map = 0x40000dc8; -r_ble_ll_conn_hci_rd_rem_ver_cmd = 0x40000dcc; -r_ble_ll_conn_hci_rd_rssi = 0x40000dd0; -r_ble_ll_conn_hci_read_rem_features = 0x40000dd4; -r_ble_ll_conn_hci_set_data_len = 0x40000ddc; -r_ble_ll_conn_hci_update = 0x40000de0; -r_ble_ll_conn_hci_wr_auth_pyld_tmo = 0x40000de4; -r_ble_ll_conn_init_phy = 0x40000de8; -r_ble_ll_conn_is_empty_pdu = 0x40000df0; -r_ble_ll_conn_is_lru = 0x40000df4; -r_ble_ll_conn_master_init = 0x40000df8; -r_ble_ll_conn_module_reset = 0x40000e04; -r_ble_ll_conn_num_comp_pkts_event_send = 0x40000e0c; -r_ble_ll_conn_process_conn_params = 0x40000e14; -r_ble_ll_conn_req_peer_sca = 0x40000e18; -r_ble_ll_conn_set_csa = 0x40000e20; -r_ble_ll_conn_set_ext_con_params = 0x40000e24; -r_ble_ll_conn_set_global_chanmap = 0x40000e28; -r_ble_ll_conn_set_phy = 0x40000e2c; -r_ble_ll_conn_set_txpwr_by_handle = 0x40000e30; -r_ble_ll_conn_set_unknown_rx_octets = 0x40000e34; -r_ble_ll_conn_sm_get = 0x40000e3c; -r_ble_ll_conn_tx_pkt_in = 0x40000e4c; -r_ble_ll_conn_update_eff_data_len = 0x40000e50; -r_ble_ll_ctrl_chanmap_req_make = 0x40000e54; -r_ble_ll_ctrl_conn_param_pdu_make = 0x40000e5c; -r_ble_ll_ctrl_conn_param_pdu_proc = 0x40000e60; -r_ble_ll_ctrl_conn_param_reply = 0x40000e64; -r_ble_ll_ctrl_datalen_upd_make = 0x40000e6c; -r_ble_ll_ctrl_enc_allowed_pdu = 0x40000e70; -r_ble_ll_ctrl_enc_allowed_pdu_rx = 0x40000e74; -r_ble_ll_ctrl_enc_req_make = 0x40000e7c; -r_ble_ll_ctrl_find_new_phy = 0x40000e80; -r_ble_ll_ctrl_initiate_dle = 0x40000e84; -r_ble_ll_ctrl_len_proc = 0x40000e88; -r_ble_ll_ctrl_min_used_chan_rsp = 0x40000e8c; -r_ble_ll_ctrl_phy_from_phy_mask = 0x40000e90; -r_ble_ll_ctrl_phy_req_rsp_make = 0x40000e94; -r_ble_ll_ctrl_phy_tx_transition_get = 0x40000e98; -r_ble_ll_ctrl_phy_update_cancel = 0x40000e9c; -r_ble_ll_ctrl_phy_update_ind_make = 0x40000ea0; -r_ble_ll_ctrl_phy_update_proc_complete = 0x40000ea4; -r_ble_ll_ctrl_proc_rsp_timer_cb = 0x40000eac; -r_ble_ll_ctrl_proc_stop = 0x40000eb4; -r_ble_ll_ctrl_proc_with_instant_initiated = 0x40000ebc; -r_ble_ll_ctrl_rej_ext_ind_make = 0x40000ec0; -r_ble_ll_ctrl_reject_ind_send = 0x40000ec4; -r_ble_ll_ctrl_rx_chanmap_req = 0x40000ec8; -r_ble_ll_ctrl_rx_conn_param_req = 0x40000ecc; -r_ble_ll_ctrl_rx_enc_req = 0x40000ed8; -r_ble_ll_ctrl_rx_enc_rsp = 0x40000edc; -r_ble_ll_ctrl_rx_feature_req = 0x40000ee0; -r_ble_ll_ctrl_rx_pause_enc_req = 0x40000ee8; -r_ble_ll_ctrl_rx_pause_enc_rsp = 0x40000eec; -r_ble_ll_ctrl_rx_periodic_sync_ind = 0x40000ef4; -r_ble_ll_ctrl_rx_phy_req = 0x40000ef8; -r_ble_ll_ctrl_rx_phy_rsp = 0x40000efc; -r_ble_ll_ctrl_rx_phy_update_ind = 0x40000f00; -r_ble_ll_ctrl_rx_ping_rsp = 0x40000f04; -r_ble_ll_ctrl_rx_reject_ind = 0x40000f08; -r_ble_ll_ctrl_rx_sca_req = 0x40000f0c; -r_ble_ll_ctrl_rx_sca_rsp = 0x40000f10; -r_ble_ll_ctrl_rx_start_enc_req = 0x40000f14; -r_ble_ll_ctrl_rx_start_enc_rsp = 0x40000f18; -r_ble_ll_ctrl_rx_version_ind = 0x40000f1c; -r_ble_ll_ctrl_sca_req_rsp_make = 0x40000f20; -r_ble_ll_ctrl_start_enc_send = 0x40000f24; -r_ble_ll_ctrl_start_rsp_timer = 0x40000f28; -r_ble_ll_ctrl_terminate_start = 0x40000f2c; -r_ble_ll_ctrl_update_features = 0x40000f34; -r_ble_ll_ctrl_version_ind_make = 0x40000f38; -r_ble_ll_data_buffer_overflow = 0x40000f3c; -r_ble_ll_disconn_comp_event_send = 0x40000f44; -r_ble_ll_event_comp_pkts = 0x40000f4c; -r_ble_ll_event_dbuf_overflow = 0x40000f50; -r_ble_ll_event_send = 0x40000f54; -r_ble_ll_event_tx_pkt = 0x40000f58; -r_ble_ll_ext_adv_phy_mode_to_local_phy = 0x40000f5c; -r_ble_ll_ext_scan_parse_adv_info = 0x40000f64; -r_ble_ll_ext_scan_parse_aux_ptr = 0x40000f68; -r_ble_ll_flush_pkt_queue = 0x40000f6c; -r_ble_ll_generate_dh_key_v1 = 0x40000f70; -r_ble_ll_generate_dh_key_v2 = 0x40000f74; -r_ble_ll_get_addr_type = 0x40000f7c; -r_ble_ll_get_our_devaddr = 0x40000f84; -r_ble_ll_get_tx_pwr_compensation = 0x40000f88; -r_ble_ll_hci_acl_rx = 0x40000f8c; -r_ble_ll_hci_adv_mode_ext = 0x40000f90; -r_ble_ll_hci_adv_set_enable = 0x40000f94; -r_ble_ll_hci_cb_set_ctrlr_to_host_fc = 0x40000f9c; -r_ble_ll_hci_cb_set_event_mask = 0x40000fa0; -r_ble_ll_hci_cb_set_event_mask2 = 0x40000fa4; -r_ble_ll_hci_chk_phy_masks = 0x40000fa8; -r_ble_ll_hci_cmd_rx = 0x40000fb0; -r_ble_ll_hci_disconnect = 0x40000fbc; -r_ble_ll_hci_ev_conn_update = 0x40000fc4; -r_ble_ll_hci_ev_databuf_overflow = 0x40000fc8; -r_ble_ll_hci_ev_datalen_chg = 0x40000fcc; -r_ble_ll_hci_ev_encrypt_chg = 0x40000fd0; -r_ble_ll_hci_ev_hw_err = 0x40000fd4; -r_ble_ll_hci_ev_le_csa = 0x40000fd8; -r_ble_ll_hci_ev_ltk_req = 0x40000fdc; -r_ble_ll_hci_ev_phy_update = 0x40000fe0; -r_ble_ll_hci_ev_rd_rem_used_feat = 0x40000fe4; -r_ble_ll_hci_ev_rd_rem_ver = 0x40000fe8; -r_ble_ll_hci_ev_rem_conn_parm_req = 0x40000fec; -r_ble_ll_hci_ev_sca_update = 0x40000ff0; -r_ble_ll_hci_ev_send_adv_set_terminated = 0x40000ff4; -r_ble_ll_hci_ev_send_scan_req_recv = 0x40000ff8; -r_ble_ll_hci_ev_send_scan_timeout = 0x40000ffc; -r_ble_ll_hci_ev_send_vendor_err = 0x40001000; -r_ble_ll_hci_ext_scan_set_enable = 0x40001008; -r_ble_ll_hci_get_num_cmd_pkts = 0x4000100c; -r_ble_ll_hci_info_params_cmd_proc = 0x40001010; -r_ble_ll_hci_init = 0x40001014; -r_ble_ll_hci_init_support_cmd_base_on_lmp_ver = 0x40001018; -r_ble_ll_hci_is_event_enabled = 0x4000101c; -r_ble_ll_hci_is_le_event_enabled = 0x40001020; -r_ble_ll_hci_le_cmd_send_cmd_status = 0x40001028; -r_ble_ll_hci_le_encrypt = 0x4000102c; -r_ble_ll_hci_le_rand = 0x40001030; -r_ble_ll_hci_le_rd_max_data_len = 0x40001034; -r_ble_ll_hci_le_rd_sugg_data_len = 0x40001038; -r_ble_ll_hci_le_read_bufsize = 0x4000103c; -r_ble_ll_hci_le_read_supp_states = 0x40001044; -r_ble_ll_hci_le_set_def_phy = 0x40001048; -r_ble_ll_hci_le_wr_sugg_data_len = 0x4000104c; -r_ble_ll_hci_link_ctrl_cmd_proc = 0x40001050; -r_ble_ll_hci_npl_init = 0x40001054; -r_ble_ll_hci_post_gen_dhkey_cmp_evt = 0x40001058; -r_ble_ll_hci_post_rd_p256_pubkey_cmp_evt = 0x4000105c; -r_ble_ll_hci_rd_bd_addr = 0x40001060; -r_ble_ll_hci_rd_local_supp_cmd = 0x40001064; -r_ble_ll_hci_rd_local_supp_feat = 0x40001068; -r_ble_ll_hci_rd_local_version = 0x4000106c; -r_ble_ll_hci_scan_set_enable = 0x40001070; -r_ble_ll_hci_send_adv_report = 0x40001074; -r_ble_ll_hci_send_dir_adv_report = 0x40001078; -r_ble_ll_hci_send_noop = 0x40001084; -r_ble_ll_hci_set_adv_data = 0x40001088; -r_ble_ll_hci_set_le_event_mask = 0x4000108c; -r_ble_ll_hci_set_scan_rsp_data = 0x40001090; -r_ble_ll_hci_status_params_cmd_proc = 0x40001094; -r_ble_ll_hci_vs_cmd_proc = 0x40001098; -r_ble_ll_hci_vs_rd_static_addr = 0x4000109c; -r_ble_ll_hw_err_timer_cb = 0x400010a0; -r_ble_ll_hw_error = 0x400010a4; -r_ble_ll_init_alloc_conn_comp_ev = 0x400010ac; -r_ble_ll_init_get_conn_comp_ev = 0x400010b0; -r_ble_ll_is_addr_empty = 0x400010b8; -r_ble_ll_is_controller_busy = 0x400010bc; -r_ble_ll_is_on_resolv_list = 0x400010c0; -r_ble_ll_is_our_devaddr = 0x400010c4; -r_ble_ll_is_rpa = 0x400010c8; -r_ble_ll_is_valid_adv_mode = 0x400010cc; -r_ble_ll_is_valid_own_addr_type = 0x400010d0; -r_ble_ll_is_valid_public_addr = 0x400010d4; -r_ble_ll_is_valid_random_addr = 0x400010d8; -r_ble_ll_misc_options_set = 0x400010e0; -r_ble_ll_modify_sca = 0x400010e4; -r_ble_ll_pdu_max_tx_octets_get = 0x400010ec; -r_ble_ll_pdu_tx_time_get = 0x400010f0; -r_ble_ll_phy_to_phy_mode = 0x400010f4; -r_ble_ll_qa_enable = 0x400010f8; -r_ble_ll_rand_data_get = 0x40001100; -r_ble_ll_rand_init = 0x4000110c; -r_ble_ll_rand_prand_get = 0x40001110; -r_ble_ll_rand_sample = 0x40001114; -r_ble_ll_rand_start = 0x40001118; -r_ble_ll_read_local_p256_pub_key = 0x4000111c; -r_ble_ll_read_rf_path_compensation = 0x40001120; -r_ble_ll_read_supp_features = 0x40001124; -r_ble_ll_read_supp_states = 0x40001128; -r_ble_ll_resolv_clear_all_pl_bit = 0x40001134; -r_ble_ll_resolv_clear_all_wl_bit = 0x40001138; -r_ble_ll_resolv_enable_cmd = 0x40001140; -r_ble_ll_resolv_enabled = 0x40001144; -r_ble_ll_resolv_gen_rpa = 0x40001150; -r_ble_ll_resolv_get_addr_pointer = 0x40001154; -r_ble_ll_resolv_get_index = 0x40001158; -r_ble_ll_resolv_get_irk_pointer = 0x4000115c; -r_ble_ll_resolv_get_list = 0x40001160; -r_ble_ll_resolv_get_priv_addr = 0x40001164; -r_ble_ll_resolv_get_rpa_tmo = 0x40001168; -r_ble_ll_resolv_irk_nonzero = 0x40001170; -r_ble_ll_resolv_list_add = 0x40001174; -r_ble_ll_resolv_list_chg_allowed = 0x40001178; -r_ble_ll_resolv_list_clr = 0x4000117c; -r_ble_ll_resolv_list_find = 0x40001180; -r_ble_ll_resolv_list_read_size = 0x40001184; -r_ble_ll_resolv_list_reset = 0x40001188; -r_ble_ll_resolv_local_addr_rd = 0x40001190; -r_ble_ll_resolv_peer_addr_rd = 0x40001194; -r_ble_ll_resolv_peer_rpa_any = 0x40001198; -r_ble_ll_resolv_reset = 0x4000119c; -r_ble_ll_resolv_rpa = 0x400011a0; -r_ble_ll_resolv_rpa_timer_cb = 0x400011a4; -r_ble_ll_resolv_set_local_rpa = 0x400011a8; -r_ble_ll_resolv_set_peer_rpa = 0x400011ac; -r_ble_ll_resolv_set_rpa_tmo = 0x400011b0; -r_ble_ll_resolve_set_priv_mode = 0x400011b4; -r_ble_ll_rxpdu_alloc = 0x400011b8; -r_ble_ll_scan_add_scan_rsp_adv = 0x400011bc; -r_ble_ll_scan_adv_decode_addr = 0x400011c0; -r_ble_ll_scan_aux_data_ref = 0x400011c4; -r_ble_ll_scan_aux_data_unref = 0x400011c8; -r_ble_ll_scan_can_chg_whitelist = 0x400011cc; -r_ble_ll_scan_check_periodic_sync = 0x400011d0; -r_ble_ll_scan_classify_filter_aux_init = 0x400011d4; -r_ble_ll_scan_classify_filter_init = 0x400011d8; -r_ble_ll_scan_common_init = 0x400011dc; -r_ble_ll_scan_continue_en = 0x400011e0; -r_ble_ll_scan_dup_check_ext = 0x400011e8; -r_ble_ll_scan_dup_check_legacy = 0x400011ec; -r_ble_ll_scan_dup_move_to_head = 0x400011f0; -r_ble_ll_scan_dup_new = 0x400011f4; -r_ble_ll_scan_dup_update_ext = 0x400011f8; -r_ble_ll_scan_dup_update_legacy = 0x400011fc; -r_ble_ll_scan_enabled = 0x40001200; -r_ble_ll_scan_end_adv_evt = 0x40001204; -r_ble_ll_scan_ext_initiator_start = 0x4000120c; -r_ble_ll_scan_get_addr_data_from_legacy = 0x40001210; -r_ble_ll_scan_get_addr_from_ext_adv = 0x40001214; -r_ble_ll_scan_get_cur_sm = 0x40001218; -r_ble_ll_scan_get_ext_adv_report = 0x4000121c; -r_ble_ll_scan_get_local_rpa = 0x40001220; -r_ble_ll_scan_get_next_adv_prim_chan = 0x40001224; -r_ble_ll_scan_get_peer_rpa = 0x40001228; -r_ble_ll_scan_have_rxd_scan_rsp = 0x4000122c; -r_ble_ll_scan_initiator_start = 0x40001234; -r_ble_ll_scan_is_inside_window = 0x40001238; -r_ble_ll_scan_move_window_to = 0x4000123c; -r_ble_ll_scan_npl_reset = 0x40001240; -r_ble_ll_scan_parse_auxptr = 0x40001244; -r_ble_ll_scan_parse_ext_hdr = 0x40001248; -r_ble_ll_scan_record_new_adv = 0x40001250; -r_ble_ll_scan_refresh_nrpa = 0x40001254; -r_ble_ll_scan_reset = 0x40001258; -r_ble_ll_scan_rx_pkt_in = 0x4000125c; -r_ble_ll_scan_rx_pkt_in_restore_addr_data = 0x40001268; -r_ble_ll_scan_rxed = 0x4000126c; -r_ble_ll_scan_send_truncated = 0x40001274; -r_ble_ll_scan_set_peer_rpa = 0x4000127c; -r_ble_ll_scan_set_perfer_addr = 0x40001280; -r_ble_ll_scan_sm_start = 0x40001288; -r_ble_ll_scan_sm_stop = 0x4000128c; -r_ble_ll_scan_time_hci_to_ticks = 0x40001290; -r_ble_ll_scan_update_aux_data = 0x40001294; -r_ble_ll_scan_whitelist_enabled = 0x40001298; -r_ble_ll_set_default_privacy_mode = 0x4000129c; -r_ble_ll_set_default_sync_transfer_params = 0x400012a0; -r_ble_ll_set_public_addr = 0x400012ac; -r_ble_ll_set_random_addr = 0x400012b0; -r_ble_ll_set_sync_transfer_params = 0x400012b4; -r_ble_ll_state_get = 0x400012b8; -r_ble_ll_state_set = 0x400012bc; -r_ble_ll_sync_adjust_ext_hdr = 0x400012c0; -r_ble_ll_sync_cancel = 0x400012c4; -r_ble_ll_sync_cancel_complete_event = 0x400012c8; -r_ble_ll_sync_check_acad = 0x400012cc; -r_ble_ll_sync_check_failed = 0x400012d0; -r_ble_ll_sync_enabled = 0x400012dc; -r_ble_ll_sync_established = 0x400012ec; -r_ble_ll_sync_filter_enabled = 0x400012f0; -r_ble_ll_sync_find = 0x400012f4; -r_ble_ll_sync_get_cur_sm = 0x400012f8; -r_ble_ll_sync_get_handle = 0x400012fc; -r_ble_ll_sync_get_sm = 0x40001300; -r_ble_ll_sync_info_event = 0x40001304; -r_ble_ll_sync_init = 0x40001308; -r_ble_ll_sync_list_add = 0x4000130c; -r_ble_ll_sync_list_clear = 0x40001310; -r_ble_ll_sync_list_empty = 0x40001314; -r_ble_ll_sync_list_get_free = 0x40001318; -r_ble_ll_sync_list_remove = 0x4000131c; -r_ble_ll_sync_list_search = 0x40001320; -r_ble_ll_sync_list_size = 0x40001324; -r_ble_ll_sync_lost_event = 0x40001328; -r_ble_ll_sync_next_event = 0x4000132c; -r_ble_ll_sync_on_list = 0x40001330; -r_ble_ll_sync_periodic_ind = 0x40001338; -r_ble_ll_sync_phy_mode_to_aux_phy = 0x4000133c; -r_ble_ll_sync_phy_mode_to_hci = 0x40001340; -r_ble_ll_sync_reserve = 0x4000134c; -r_ble_ll_sync_reset = 0x40001350; -r_ble_ll_sync_reset_sm = 0x40001354; -r_ble_ll_sync_send_per_adv_rpt = 0x4000135c; -r_ble_ll_sync_send_sync_ind = 0x40001360; -r_ble_ll_sync_send_truncated_per_adv_rpt = 0x40001364; -r_ble_ll_sync_sm_clear = 0x40001368; -r_ble_ll_sync_terminate = 0x4000136c; -r_ble_ll_sync_transfer = 0x40001370; -r_ble_ll_sync_transfer_get = 0x40001374; -r_ble_ll_sync_transfer_received = 0x40001378; -r_ble_ll_trace_u32 = 0x40001384; -r_ble_ll_trace_u32x2 = 0x40001388; -r_ble_ll_trace_u32x3 = 0x4000138c; -r_ble_ll_tx_flat_mbuf_pducb = 0x40001390; -r_ble_ll_update_max_tx_octets_phy_mode = 0x4000139c; -r_ble_ll_usecs_to_ticks_round_up = 0x400013a0; -r_ble_ll_utils_calc_access_addr = 0x400013a4; -r_ble_ll_utils_calc_dci_csa2 = 0x400013a8; -r_ble_ll_utils_calc_num_used_chans = 0x400013ac; -r_ble_ll_utils_calc_window_widening = 0x400013b0; -r_ble_ll_utils_csa2_perm = 0x400013b4; -r_ble_ll_utils_csa2_prng = 0x400013b8; -r_ble_ll_utils_remapped_channel = 0x400013bc; -r_ble_ll_whitelist_add = 0x400013c0; -r_ble_ll_whitelist_chg_allowed = 0x400013c4; -r_ble_ll_whitelist_read_size = 0x400013cc; -r_ble_ll_write_rf_path_compensation = 0x400013d8; -r_ble_lll_adv_aux_schedule = 0x400013e0; -r_ble_lll_adv_aux_schedule_first = 0x400013e4; -r_ble_lll_adv_aux_schedule_next = 0x400013e8; -r_ble_lll_adv_aux_scheduled = 0x400013ec; -r_ble_lll_adv_aux_set_start_time = 0x400013f0; -r_ble_lll_adv_coex_dpc_calc_pti_update_itvl = 0x400013f4; -r_ble_lll_adv_coex_dpc_process_pri = 0x400013f8; -r_ble_lll_adv_coex_dpc_process_sec = 0x400013fc; -r_ble_lll_adv_coex_dpc_pti_get = 0x40001400; -r_ble_lll_adv_coex_dpc_update = 0x40001404; -r_ble_lll_adv_coex_dpc_update_on_adv_start = 0x40001408; -r_ble_lll_adv_coex_dpc_update_on_aux_scheduled = 0x4000140c; -r_ble_lll_adv_coex_dpc_update_on_data_updated = 0x40001410; -r_ble_lll_adv_coex_dpc_update_on_event_end = 0x40001414; -r_ble_lll_adv_coex_dpc_update_on_event_scheduled = 0x40001418; -r_ble_lll_adv_done = 0x4000141c; -r_ble_lll_adv_event_done = 0x40001424; -r_ble_lll_adv_event_rmvd_from_sched = 0x40001428; -r_ble_lll_adv_get_sec_pdu_len = 0x40001430; -r_ble_lll_adv_make_done = 0x40001438; -r_ble_lll_adv_periodic_done = 0x4000143c; -r_ble_lll_adv_periodic_event_done = 0x40001440; -r_ble_lll_adv_periodic_rmvd_from_sched = 0x40001444; -r_ble_lll_adv_periodic_schedule_first = 0x40001448; -r_ble_lll_adv_pri_schedule_tx_pdu = 0x40001458; -r_ble_lll_adv_reschedule_event = 0x4000145c; -r_ble_lll_adv_reschedule_periodic_event = 0x40001460; -r_ble_lll_adv_sec_event_done = 0x4000146c; -r_ble_lll_adv_sec_schedule_next_aux = 0x40001470; -r_ble_lll_adv_secondary_tx_start_cb = 0x40001474; -r_ble_lll_adv_sm_deinit = 0x40001478; -r_ble_lll_adv_sm_event_init = 0x4000147c; -r_ble_lll_adv_sm_event_restore = 0x40001480; -r_ble_lll_adv_sm_event_store = 0x40001484; -r_ble_lll_adv_sm_init = 0x40001488; -r_ble_lll_adv_sm_reset = 0x4000148c; -r_ble_lll_adv_start = 0x40001490; -r_ble_lll_adv_stop = 0x40001494; -r_ble_lll_adv_sync_next_scheduled = 0x40001498; -r_ble_lll_adv_sync_schedule = 0x4000149c; -r_ble_lll_adv_sync_tx_done = 0x400014a0; -r_ble_lll_adv_sync_tx_end = 0x400014a4; -r_ble_lll_adv_sync_tx_start_cb = 0x400014a8; -r_ble_lll_adv_tx_done = 0x400014ac; -r_ble_lll_adv_tx_start_cb = 0x400014b0; -r_ble_lll_adv_update_rsp_offset = 0x400014b4; -r_ble_lll_aux_scan_cb = 0x400014b8; -r_ble_lll_aux_scan_drop = 0x400014bc; -r_ble_lll_aux_scan_drop_event_cb = 0x400014c0; -r_ble_lll_calc_us_convert_tick_unit = 0x400014c4; -r_ble_lll_conn_can_send_next_pdu = 0x400014cc; -r_ble_lll_conn_check_opcode_matched = 0x400014d0; -r_ble_lll_conn_coex_dpc_process = 0x400014d4; -r_ble_lll_conn_coex_dpc_pti_get = 0x400014d8; -r_ble_lll_conn_coex_dpc_update = 0x400014dc; -r_ble_lll_conn_coex_dpc_update_on_event_end = 0x400014e0; -r_ble_lll_conn_coex_dpc_update_on_event_scheduled = 0x400014e4; -r_ble_lll_conn_coex_dpc_update_on_event_started = 0x400014e8; -r_ble_lll_conn_cth_flow_alloc_credit = 0x400014ec; -r_ble_lll_conn_current_sm_over = 0x400014f4; -r_ble_lll_conn_event_is_over = 0x40001510; -r_ble_lll_conn_event_start_cb = 0x40001514; -r_ble_lll_conn_free_rx_mbuf = 0x40001518; -r_ble_lll_conn_get_addr_info_from_rx_buf = 0x4000151c; -r_ble_lll_conn_get_ce_end_time = 0x40001520; -r_ble_lll_conn_get_next_sched_time = 0x40001524; -r_ble_lll_conn_master_common_init = 0x40001530; -r_ble_lll_conn_master_new = 0x40001534; -r_ble_lll_conn_module_reset = 0x40001540; -r_ble_lll_conn_pre_process = 0x40001548; -r_ble_lll_conn_recv_ack = 0x40001554; -r_ble_lll_conn_recv_valid_packet = 0x40001558; -r_ble_lll_conn_reset_pending_sched = 0x4000155c; -r_ble_lll_conn_sched_next_anchor = 0x40001564; -r_ble_lll_conn_sched_next_event = 0x40001568; -r_ble_lll_conn_sm_new = 0x40001574; -r_ble_lll_conn_sm_npl_deinit = 0x40001578; -r_ble_lll_conn_sm_npl_init = 0x4000157c; -r_ble_lll_conn_superversion_timer_cb = 0x40001580; -r_ble_lll_conn_timeout = 0x40001584; -r_ble_lll_conn_update_anchor = 0x40001588; -r_ble_lll_conn_update_conn_ind_params = 0x4000158c; -r_ble_lll_conn_update_tx_buffer = 0x40001594; -r_ble_lll_deinit = 0x40001598; -r_ble_lll_dtm_calculate_itvl = 0x4000159c; -r_ble_lll_dtm_ctx_free = 0x400015a0; -r_ble_lll_dtm_end_test = 0x400015a8; -r_ble_lll_dtm_ev_rx_restart_cb = 0x400015ac; -r_ble_lll_dtm_ev_tx_resched_cb = 0x400015b0; -r_ble_lll_dtm_reset = 0x400015b8; -r_ble_lll_dtm_rx_create_ctx = 0x400015bc; -r_ble_lll_dtm_rx_isr_end = 0x400015c0; -r_ble_lll_dtm_rx_isr_start = 0x400015c4; -r_ble_lll_dtm_rx_pkt_in = 0x400015c8; -r_ble_lll_dtm_rx_sched_cb = 0x400015cc; -r_ble_lll_dtm_rx_start = 0x400015d0; -r_ble_lll_dtm_rx_test = 0x400015d4; -r_ble_lll_dtm_set_next = 0x400015d8; -r_ble_lll_dtm_tx_done = 0x400015e0; -r_ble_lll_dtm_tx_sched_cb = 0x400015e4; -r_ble_lll_dtm_tx_test = 0x400015e8; -r_ble_lll_dtm_wfr_timer_exp = 0x400015ec; -r_ble_lll_event_rx_pkt = 0x400015f0; -r_ble_lll_ext_scan_coex_dpc_process = 0x400015f4; -r_ble_lll_ext_scan_coex_dpc_pti_get = 0x400015f8; -r_ble_lll_ext_scan_coex_dpc_update = 0x400015fc; -r_ble_lll_ext_scan_coex_dpc_update_on_start = 0x40001600; -r_ble_lll_hci_dtm_rx_test = 0x40001604; -r_ble_lll_hci_dtm_rx_test_v2 = 0x40001608; -r_ble_lll_hci_dtm_tx_test = 0x4000160c; -r_ble_lll_hci_dtm_tx_test_ext = 0x40001610; -r_ble_lll_hci_dtm_tx_test_v2 = 0x40001614; -r_ble_lll_hci_dtm_tx_test_v2_ext = 0x40001618; -r_ble_lll_init = 0x4000161c; -r_ble_lll_init_pre_process = 0x40001620; -r_ble_lll_per_adv_coex_dpc_calc_pti_update_itvl = 0x40001628; -r_ble_lll_per_adv_coex_dpc_process = 0x4000162c; -r_ble_lll_per_adv_coex_dpc_pti_get = 0x40001630; -r_ble_lll_per_adv_coex_dpc_update = 0x40001634; -r_ble_lll_per_adv_coex_dpc_update_on_data_updated = 0x40001638; -r_ble_lll_per_adv_coex_dpc_update_on_scheduled = 0x4000163c; -r_ble_lll_per_adv_coex_dpc_update_on_start = 0x40001640; -r_ble_lll_rfmgmt_is_enabled = 0x40001660; -r_ble_lll_rfmgmt_release = 0x40001664; -r_ble_lll_rfmgmt_scan_changed = 0x40001670; -r_ble_lll_rfmgmt_sched_changed = 0x40001674; -r_ble_lll_rfmgmt_set_sleep_cb = 0x40001678; -r_ble_lll_rfmgmt_ticks_to_enabled = 0x4000167c; -r_ble_lll_rx_pdu_in = 0x40001688; -r_ble_lll_rx_pkt_in = 0x4000168c; -r_ble_lll_rx_pkt_isr = 0x40001690; -r_ble_lll_scan_abort_aux_sched = 0x40001694; -r_ble_lll_scan_chk_resume = 0x4000169c; -r_ble_lll_scan_clean_cur_aux_data = 0x400016a0; -r_ble_lll_scan_coex_event_cb = 0x400016a4; -r_ble_lll_scan_common_init = 0x400016a8; -r_ble_lll_scan_deinit = 0x400016ac; -r_ble_lll_scan_duration_period_timers_restart = 0x400016b0; -r_ble_lll_scan_duration_period_timers_stop = 0x400016b4; -r_ble_lll_scan_duration_timer_cb = 0x400016b8; -r_ble_lll_scan_event_proc = 0x400016bc; -r_ble_lll_scan_ext_adv_init = 0x400016c0; -r_ble_lll_scan_has_sent_scan_req = 0x400016c8; -r_ble_lll_scan_npl_reset = 0x400016d4; -r_ble_lll_scan_npl_restore = 0x400016d8; -r_ble_lll_scan_npl_store = 0x400016dc; -r_ble_lll_scan_period_timer_cb = 0x400016e0; -r_ble_lll_scan_process_adv_in_isr = 0x400016e4; -r_ble_lll_scan_req_backoff = 0x400016ec; -r_ble_lll_scan_sched_next_aux = 0x40001700; -r_ble_lll_scan_sched_remove = 0x40001704; -r_ble_lll_scan_start = 0x40001708; -r_ble_lll_scan_start_rx = 0x4000170c; -r_ble_lll_scan_timer_cb = 0x40001718; -r_ble_lll_sched_adv_new = 0x4000171c; -r_ble_lll_sched_adv_resched_pdu = 0x40001720; -r_ble_lll_sched_adv_reschedule = 0x40001724; -r_ble_lll_sched_aux_scan = 0x40001728; -r_ble_lll_sched_conn_overlap = 0x4000172c; -r_ble_lll_sched_dtm = 0x40001738; -r_ble_lll_sched_execute_item = 0x40001744; -r_ble_lll_sched_insert_if_empty = 0x4000174c; -r_ble_lll_sched_is_overlap = 0x40001750; -r_ble_lll_sched_master_new = 0x40001754; -r_ble_lll_sched_next_time = 0x40001758; -r_ble_lll_sched_overlaps_current = 0x4000175c; -r_ble_lll_sched_periodic_adv = 0x40001760; -r_ble_lll_sched_rmv_elem = 0x40001764; -r_ble_lll_sched_rmv_elem_type = 0x40001768; -r_ble_lll_sched_run = 0x4000176c; -r_ble_lll_sched_scan_req_over_aux_ptr = 0x40001770; -r_ble_lll_sched_slave_new = 0x40001774; -r_ble_lll_sched_stop = 0x40001778; -r_ble_lll_sched_sync = 0x4000177c; -r_ble_lll_sched_sync_overlaps_current = 0x40001780; -r_ble_lll_sync_chain_start_cb = 0x40001788; -r_ble_lll_sync_coex_dpc_process = 0x4000178c; -r_ble_lll_sync_coex_dpc_pti_get = 0x40001790; -r_ble_lll_sync_coex_dpc_update = 0x40001794; -r_ble_lll_sync_current_sm_over = 0x40001798; -r_ble_lll_sync_deinit = 0x4000179c; -r_ble_lll_sync_event_end_cb = 0x400017a4; -r_ble_lll_sync_get_event_end_time = 0x400017ac; -r_ble_lll_sync_init = 0x400017b4; -r_ble_lll_sync_new = 0x400017b8; -r_ble_lll_sync_reset = 0x400017bc; -r_ble_lll_sync_reset_sm = 0x400017c0; -r_ble_lll_sync_rmvd_from_sched = 0x400017c4; -r_ble_lll_sync_schedule_chain = 0x400017cc; -r_ble_lll_sync_stop = 0x400017d0; -r_ble_lll_sync_trnasfer_sched = 0x400017d4; -r_ble_phy_access_addr_get = 0x400017d8; -r_ble_phy_calculate_rxtx_ifs = 0x400017dc; -r_ble_phy_calculate_rxwindow = 0x400017e0; -r_ble_phy_calculate_txrx_ifs = 0x400017e4; -r_ble_phy_check_bb_status = 0x400017e8; -r_ble_phy_complete_rx_info = 0x400017ec; -r_ble_phy_data_make = 0x400017f4; -r_ble_phy_disable = 0x400017f8; -r_ble_phy_disable_irq = 0x400017fc; -r_ble_phy_disable_whitening = 0x40001800; -r_ble_phy_enable_whitening = 0x40001804; -r_ble_phy_encrypt_disable = 0x40001808; -r_ble_phy_get_current_phy = 0x40001810; -r_ble_phy_get_packet_counter = 0x40001814; -r_ble_phy_get_packet_status = 0x40001818; -r_ble_phy_get_pyld_time_offset = 0x4000181c; -r_ble_phy_get_rx_phy_mode = 0x40001820; -r_ble_phy_get_seq_end_st = 0x40001824; -r_ble_phy_max_data_pdu_pyld = 0x40001830; -r_ble_phy_mode_config = 0x40001834; -r_ble_phy_mode_convert = 0x40001838; -r_ble_phy_mode_write = 0x4000183c; -r_ble_phy_module_init = 0x40001844; -r_ble_phy_reset_bb_monitor = 0x4000184c; -r_ble_phy_resolv_list_disable = 0x40001850; -r_ble_phy_resolv_list_enable = 0x40001854; -r_ble_phy_restart_sequence = 0x40001858; -r_ble_phy_rx_set_start_time_forcibly = 0x4000185c; -r_ble_phy_rxpdu_copy = 0x40001860; -r_ble_phy_seq_encrypt_enable = 0x40001864; -r_ble_phy_seq_encrypt_set_pkt_cntr = 0x40001868; -r_ble_phy_sequence_end_isr = 0x4000186c; -r_ble_phy_sequence_get_mode = 0x40001870; -r_ble_phy_sequence_is_running = 0x40001874; -r_ble_phy_sequence_is_waiting_rsp = 0x40001878; -r_ble_phy_sequence_single_end = 0x4000187c; -r_ble_phy_sequence_tx_end_invoke = 0x40001880; -r_ble_phy_sequence_update_conn_ind_params = 0x40001884; -r_ble_phy_set_coex_pti = 0x4000188c; -r_ble_phy_set_conn_ind_pdu = 0x40001890; -r_ble_phy_set_conn_mode = 0x40001894; -r_ble_phy_set_dev_address = 0x40001898; -r_ble_phy_set_rx_pwr_compensation = 0x4000189c; -r_ble_phy_set_single_packet_rx_sequence = 0x400018ac; -r_ble_phy_set_single_packet_tx_sequence = 0x400018b0; -r_ble_phy_set_tx_rx_transition = 0x400018b4; -r_ble_phy_set_txend_cb = 0x400018b8; -r_ble_phy_setchan = 0x400018bc; -r_ble_phy_start_rx_immediately = 0x400018c0; -r_ble_phy_state_get = 0x400018c4; -r_ble_phy_timer_config_start_time = 0x400018c8; -r_ble_phy_timer_start_now = 0x400018cc; -r_ble_phy_timer_stop = 0x400018d0; -r_ble_phy_tx_set_start_time = 0x400018d4; -r_ble_phy_txpwr_set = 0x400018dc; -r_ble_phy_update_ifs = 0x400018e8; -r_ble_phy_xcvr_state_get = 0x400018ec; -r_ble_plf_set_log_level = 0x400018f0; -r_ble_rtc_wake_up_cpu_init = 0x400018f4; -r_ble_rtc_wake_up_state_clr = 0x400018f8; -r_ble_vendor_hci_register = 0x400018fc; -r_bt_rf_coex_cfg_set = 0x40001900; -r_bt_rf_coex_coded_txrx_time_upper_lim = 0x40001904; -r_bt_rf_coex_dft_pti_set = 0x40001908; -r_bt_rf_coex_hook_deinit = 0x4000190c; -r_bt_rf_coex_hook_init = 0x40001910; -r_bt_rf_coex_hook_st_set = 0x40001914; -r_bt_rf_coex_hooks_p_set_default = 0x40001918; -r_btdm_disable_adv_delay = 0x4000191c; -r_btdm_switch_phy_coded = 0x40001920; -r_esp_wait_disabled = 0x40001924; -r_get_be16 = 0x40001928; -r_get_be24 = 0x4000192c; -r_get_be32 = 0x40001930; -r_get_be64 = 0x40001934; -r_get_le16 = 0x40001938; -r_get_le24 = 0x4000193c; -r_get_le32 = 0x40001940; -r_get_le64 = 0x40001944; -r_get_local_irk_offset = 0x40001948; -r_get_local_rpa_offset = 0x4000194c; -r_get_max_skip = 0x40001950; -r_get_peer_id_offset = 0x40001954; -r_get_peer_irk_offset = 0x40001958; -r_get_peer_rpa_offset = 0x4000195c; -r_hal_timer_disable_irq = 0x4000196c; -r_hal_timer_process = 0x40001978; -r_hal_timer_read = 0x4000197c; -r_hal_timer_read_tick = 0x40001980; -r_hal_timer_set_cb = 0x40001984; -r_hal_timer_start = 0x4000198c; -r_hal_timer_task_start = 0x40001998; -r_ll_assert = 0x4000199c; -r_mem_init_mbuf_pool = 0x400019a0; -r_mem_malloc_mbuf_pool = 0x400019a4; -r_mem_malloc_mbufpkt_pool = 0x400019a8; -r_mem_malloc_mempool = 0x400019ac; -r_mem_malloc_mempool_ext = 0x400019b0; -r_mem_malloc_mempool_gen = 0x400019b4; -r_mem_pullup_obj = 0x400019b8; -r_os_cputime_get32 = 0x400019c0; -r_os_cputime_ticks_to_usecs = 0x400019c4; -r_os_cputime_timer_init = 0x400019c8; -r_os_cputime_timer_relative = 0x400019cc; -r_os_cputime_timer_start = 0x400019d0; -r_os_cputime_timer_stop = 0x400019d4; -r_os_cputime_usecs_to_ticks = 0x400019d8; -r_os_mbuf_adj = 0x400019dc; -r_os_mbuf_appendfrom = 0x400019e4; -r_os_mbuf_cmpf = 0x400019e8; -r_os_mbuf_cmpm = 0x400019ec; -r_os_mbuf_concat = 0x400019f0; -r_os_mbuf_copydata = 0x400019f4; -r_os_mbuf_copyinto = 0x400019f8; -r_os_mbuf_dup = 0x400019fc; -r_os_mbuf_extend = 0x40001a00; -r_os_mbuf_free = 0x40001a04; -r_os_mbuf_free_chain = 0x40001a08; -r_os_mbuf_get = 0x40001a0c; -r_os_mbuf_get_pkthdr = 0x40001a10; -r_os_mbuf_leadingspace = 0x40001a14; -r_os_mbuf_len = 0x40001a18; -r_os_mbuf_off = 0x40001a1c; -r_os_mbuf_pack_chains = 0x40001a20; -r_os_mbuf_pool_init = 0x40001a24; -r_os_mbuf_prepend = 0x40001a28; -r_os_mbuf_prepend_pullup = 0x40001a2c; -r_os_mbuf_pullup = 0x40001a30; -r_os_mbuf_trailingspace = 0x40001a34; -r_os_mbuf_trim_front = 0x40001a38; -r_os_mbuf_widen = 0x40001a3c; -r_os_memblock_from = 0x40001a40; -r_os_memblock_get = 0x40001a44; -r_os_memblock_put_from_cb = 0x40001a4c; -r_os_mempool_clear = 0x40001a50; -r_os_mempool_ext_clear = 0x40001a54; -r_os_mempool_ext_init = 0x40001a58; -r_os_mempool_init = 0x40001a60; -r_os_mempool_is_sane = 0x40001a68; -r_os_mqueue_get = 0x40001a74; -r_os_mqueue_init = 0x40001a78; -r_os_mqueue_put = 0x40001a7c; -r_os_msys_count = 0x40001a80; -r_os_msys_get = 0x40001a84; -r_os_msys_get_pkthdr = 0x40001a88; -r_os_msys_num_free = 0x40001a8c; -r_os_msys_register = 0x40001a90; -r_os_msys_reset = 0x40001a94; -r_pri_phy_valid = 0x40001a98; -r_put_be16 = 0x40001a9c; -r_put_be24 = 0x40001aa0; -r_put_be32 = 0x40001aa4; -r_put_be64 = 0x40001aa8; -r_put_le16 = 0x40001aac; -r_put_le24 = 0x40001ab0; -r_put_le32 = 0x40001ab4; -r_put_le64 = 0x40001ab8; -r_rtc0_timer_handler = 0x40001abc; -r_sdkconfig_get_opts = 0x40001ac0; -r_sdkconfig_set_opts = 0x40001ac4; -r_sec_phy_valid = 0x40001ac8; -r_swap_buf = 0x40001acc; -r_swap_in_place = 0x40001ad0; -/* Data (.data, .bss, .rodata) */ -ble_lll_dtm_module_env_p = 0x3fcdffc4; -g_ble_lll_dtm_prbs15_data = 0x3ff4fee4; -g_ble_lll_dtm_prbs9_data = 0x3ff4fde4; -g_channel_rf_to_index = 0x3ff4fdbc; -g_ble_lll_rfmgmt_data = 0x3fcdff7c; -g_ble_sleep_enter_cb = 0x3fcdff78; -g_ble_sleep_exit_cb = 0x3fcdff74; -ble_lll_sched_env_p = 0x3fcdff70; -ble_ll_env_p = 0x3fcdff6c; -g_ble_ll_pdu_header_tx_time_ro = 0x3ff4fdb4; -ble_ll_adv_env_p = 0x3fcdff68; -ble_ll_conn_env_p = 0x3fcdff64; -ble_ll_conn_required_phy_mask = 0x3ff4fdb0; -ble_ll_valid_conn_phy_mask = 0x3ff4fdaf; -ble_ll_hci_env_p = 0x3fcdff60; -g_debug_le_private_key = 0x3ff4fd6c; -g_ecc_key = 0x3fcdfefc; -ble_ll_rand_env_p = 0x3fcdfef8; -ble_ll_resolv_env_p = 0x3fcdfef4; -g_ble_ll_resolve_hdr = 0x3fcdfeec; -g_device_mode_default = 0x3fcdfe68; -ble_ll_scan_classify_filter_aux_check_cb = 0x3fcdfee8; -ble_ll_scan_classify_filter_check_cb = 0x3fcdfee4; -ble_ll_scan_env_p = 0x3fcdfee0; -g_ble_ll_supp_cmds_ro = 0x3ff4fd3c; -ble_ll_sync_env_p = 0x3fcdfedc; -g_ble_sca_ppm_tbl_ro = 0x3ff4fd2c; -priv_config_opts = 0x3fcdfe48; -ble_hci_uart_reset_cmd = 0x3ff4fd28; -ble_hci_trans_env_p = 0x3fcdfed8; -ble_hci_trans_mode = 0x3fcdfe44; -ble_hci_trans_funcs_ptr = 0x3fcdfed4; -r_ble_lll_stub_funcs_ptr = 0x3fcdfed0; -r_ble_stub_funcs_ptr = 0x3fcdfecc; -r_ext_funcs_p = 0x3fcdfec8; -r_npl_funcs = 0x3fcdfec4; -ble_hw_env_p = 0x3fcdfec0; -ble_phy_module_env_p = 0x3fcdfebc; -g_ble_phy_chan_freq_ro = 0x3ff4fd00; -g_ble_phy_mode_pkt_start_off_ro = 0x3ff4fcf8; -g_ble_phy_rxtx_ifs_compensation_ro = 0x3ff4fce8; -g_ble_phy_t_rxaddrdelay_ro = 0x3ff4fce4; -g_ble_phy_t_rxenddelay_ro = 0x3ff4fce0; -g_ble_phy_t_txdelay_ro = 0x3ff4fcdc; -g_ble_phy_t_txenddelay_ro = 0x3ff4fcd8; -g_ble_phy_txrx_ifs_compensation_ro = 0x3ff4fcc8; -hal_timer_env_p = 0x3fcdfeb8; -r_osi_coex_funcs_p = 0x3fcdfeb4; -bt_rf_coex_hooks = 0x3fcdfeac; -bt_rf_coex_hooks_p = 0x3fcdfea8; -coex_hook_st_group_tab = 0x3ff4fcbc; -coex_hook_st_group_to_coex_schm_st_tab = 0x3ff4fcb8; -s_ble_act_count_by_group = 0x3fcdfea4; -s_ble_coex_st_map = 0x3fcdfe90; -bt_rf_coex_cfg_cb = 0x3fcdfe74; -bt_rf_coex_cfg_p = 0x3fcdfe70; -bt_rf_coex_cfg_rom = 0x3ff4fc9c; -bt_rf_coex_pti_dft_p = 0x3fcdfe6c; -bt_rf_coex_pti_dft_rom = 0x3fcdfe04; -conn_dynamic_pti_param_rom = 0x3ff4fc84; -conn_phy_coded_max_data_time_param_rom = 0x3ff4fc80; -ext_adv_dynamic_pti_param_rom = 0x3ff4fc4c; -ext_scan_dynamic_param_rom = 0x3ff4fc14; -legacy_adv_dynamic_pti_param_rom = 0x3ff4fbf4; -per_adv_dynamic_pti_param_rom = 0x3ff4fbd8; -sync_dynamic_param_rom = 0x3ff4fbc0; -g_ble_plf_log_level = 0x3fcdfe00; -g_msys_pool_list = 0x3fcdfdf8; -g_os_mempool_list = 0x3fcdfdf0; - - /*************************************** Group rom_pp ***************************************/ From 2aba487a9c39a13168683bcfe3677de389d34435 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 1 Oct 2024 11:28:10 +0200 Subject: [PATCH 19/56] fix(esp_wifi): Add null pointer checks to WiFi-netif APIs Added null pointer checks to WiFi-netif API functions to prevent potential crashes from invalid arguments, updated unit tests. Closes https://github.com/espressif/esp-idf/issues/8702 --- .../test_app_esp_netif/main/esp_netif_test.c | 16 ++++++++++++++++ components/esp_wifi/src/wifi_netif.c | 8 +++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/components/esp_netif/test_apps/test_app_esp_netif/main/esp_netif_test.c b/components/esp_netif/test_apps/test_app_esp_netif/main/esp_netif_test.c index 79f70ac27a98..eaca5bb1e738 100644 --- a/components/esp_netif/test_apps/test_app_esp_netif/main/esp_netif_test.c +++ b/components/esp_netif/test_apps/test_app_esp_netif/main/esp_netif_test.c @@ -336,6 +336,21 @@ TEST(esp_netif, dhcp_server_state_transitions_mesh) #endif // CONFIG_ESP_WIFI_ENABLED && CONFIG_ESP_WIFI_SOFTAP_SUPPORT #ifdef CONFIG_ESP_WIFI_ENABLED +/* + * This checks some semi-public API for null dereference + */ +TEST(esp_netif, wifi_netif_api_null_deref) +{ + esp_wifi_destroy_if_driver(NULL); // returns void: just checking if won't crash + TEST_ASSERT_NOT_EQUAL(ESP_OK, esp_wifi_get_if_mac(NULL, NULL)); + TEST_ASSERT_NOT_EQUAL(true, esp_wifi_is_if_ready_when_started(NULL)); + TEST_ASSERT_NOT_EQUAL(ESP_OK, esp_wifi_register_if_rxcb(NULL, NULL, NULL)); +} + +/* + * This test validates convenience API esp_netif_create_wifi() which creates WiFi station + * or API with the specified inherent network config. + */ TEST(esp_netif, create_custom_wifi_interfaces) { esp_netif_t *ap = NULL; @@ -516,6 +531,7 @@ TEST_GROUP_RUNNER(esp_netif) RUN_TEST_CASE(esp_netif, create_delete_multiple_netifs) RUN_TEST_CASE(esp_netif, find_netifs) #ifdef CONFIG_ESP_WIFI_ENABLED + RUN_TEST_CASE(esp_netif, wifi_netif_api_null_deref) RUN_TEST_CASE(esp_netif, create_custom_wifi_interfaces) RUN_TEST_CASE(esp_netif, create_destroy_default_wifi) #endif diff --git a/components/esp_wifi/src/wifi_netif.c b/components/esp_wifi/src/wifi_netif.c index 4fe30acfce52..a89238d63863 100644 --- a/components/esp_wifi/src/wifi_netif.c +++ b/components/esp_wifi/src/wifi_netif.c @@ -114,6 +114,9 @@ wifi_netif_driver_t esp_wifi_create_if_driver(wifi_interface_t wifi_if) esp_err_t esp_wifi_get_if_mac(wifi_netif_driver_t ifx, uint8_t mac[6]) { + if (ifx == NULL || mac == NULL) { + return ESP_ERR_INVALID_ARG; + } wifi_interface_t wifi_interface = ifx->wifi_if; return esp_wifi_get_mac(wifi_interface, mac); @@ -123,7 +126,7 @@ bool esp_wifi_is_if_ready_when_started(wifi_netif_driver_t ifx) { #ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT // WiFi rxcb to be register wifi rxcb on start for AP only, station gets it registered on connect event - return (ifx->wifi_if == WIFI_IF_AP); + return (ifx && ifx->wifi_if == WIFI_IF_AP); #else return false; #endif @@ -131,6 +134,9 @@ bool esp_wifi_is_if_ready_when_started(wifi_netif_driver_t ifx) esp_err_t esp_wifi_register_if_rxcb(wifi_netif_driver_t ifx, esp_netif_receive_t fn, void * arg) { + if (ifx == NULL || fn == NULL || arg == NULL) { + return ESP_ERR_INVALID_ARG; + } if (ifx->base.netif != arg) { ESP_LOGE(TAG, "Invalid argument: supplied netif=%p does not equal to interface netif=%p", arg, ifx->base.netif); return ESP_ERR_INVALID_ARG; From 067e4952d9e45265f4ae29299730ff5a0b8b95dc Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 17 Sep 2024 18:14:54 +0200 Subject: [PATCH 20/56] fix(transport): Fix websocket mem-corruption while reading headers Closes https://github.com/espressif/esp-idf/issues/14473 --- components/tcp_transport/transport_ws.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tcp_transport/transport_ws.c b/components/tcp_transport/transport_ws.c index 9e17a50aa64d..845529e01674 100644 --- a/components/tcp_transport/transport_ws.c +++ b/components/tcp_transport/transport_ws.c @@ -283,7 +283,7 @@ static int ws_connect(esp_transport_handle_t t, const char *host, int port, int } int header_len = 0; do { - if ((len = esp_transport_read(ws->parent, ws->buffer + header_len, WS_BUFFER_SIZE - header_len, timeout_ms)) <= 0) { + if ((len = esp_transport_read(ws->parent, ws->buffer + header_len, WS_BUFFER_SIZE - 1 - header_len, timeout_ms)) <= 0) { ESP_LOGE(TAG, "Error read response for Upgrade header %s", ws->buffer); return -1; } From 79cb7d5c0c04d63e5379cb1579543ae025da08ae Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 16 Jul 2024 16:41:25 +0200 Subject: [PATCH 21/56] fix(lwip): Add default IPv6 input filter to drop traffic if ipv6 not assigned * Makes LWIP_HOOK_IP6_INPUT default to LWIP_HOOK_IP6_INPUT_DEFAULT * Updated the stub hook implementation to actually filter out all IPv6 packets if the input netif has no link local address. --- components/lwip/Kconfig | 10 ++++++--- .../lwip/port/hooks/lwip_default_hooks.c | 22 +++++++++++++++---- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index e2c68a8c1f91..9d06da336e88 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -1199,11 +1199,15 @@ menu "LWIP" choice LWIP_HOOK_IP6_INPUT prompt "IPv6 packet input" depends on LWIP_IPV6 - default LWIP_HOOK_IP6_INPUT_NONE + default LWIP_HOOK_IP6_INPUT_DEFAULT help Enables custom IPv6 packet input. - Setting this to "default" provides weak implementation - stub that could be overwritten in application code. + Setting this to "default" provides weak IDF implementation, + which drops all incoming IPv6 traffic if the interface has no link local address. + (this default implementation is "weak" and could be still overwritten + in the application if some additional IPv6 input packet filtering is needed) + Setting this to "none" removes this default filter and conforms to the lwIP + implementation (which accepts multicasts even if the interface has no link local address) Setting this to "custom" provides hook's declaration only and expects the application to implement it. diff --git a/components/lwip/port/hooks/lwip_default_hooks.c b/components/lwip/port/hooks/lwip_default_hooks.c index 251aae0f485a..6c094fdf0470 100644 --- a/components/lwip/port/hooks/lwip_default_hooks.c +++ b/components/lwip/port/hooks/lwip_default_hooks.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -56,11 +56,25 @@ const ip_addr_t *__weak lwip_hook_ip6_select_source_address(struct netif *netif, #endif #ifdef CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT +/** + * @brief The default IPv6 input hook checks if we already have an IPv6 address (netif->ip6_addr[0] is link local), + * so we drop all incoming IPv6 packets if the input netif has no LL address. + * + * LWIP accepts IPv6 multicast packets even if the ip6_addr[] for the given address wasn't set, + * this may cause trouble if we enable IPv6 SLAAC (LWIP_IPV6_AUTOCONFIG), but have not created any LL address. + * If the router sends a packet to all nodes 0xff01::1 with RDNSS servers, it would be accepted and rewrite + * DNS server info with IPv6 values (which won't be routable without any IPv6 address assigned) + */ int __weak lwip_hook_ip6_input(struct pbuf *p, struct netif *inp) { - LWIP_UNUSED_ARG(p); - LWIP_UNUSED_ARG(inp); - + /* Check if the first IPv6 address (link-local) is unassigned (all zeros). + * If the address is empty, it indicates that no link-local address has been configured, + * and the interface should not accept incoming IPv6 traffic. */ + if (ip6_addr_isany(ip_2_ip6(&inp->ip6_addr[0]))) { + /* We don't have an LL address -> eat this packet here, so it won't get accepted on the input netif */ + pbuf_free(p); + return 1; + } return 0; } #endif From a991b5df81c78c6e1442d1965e9ea16b4d277ae4 Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Thu, 26 Sep 2024 16:38:58 +0800 Subject: [PATCH 22/56] fix(bt): Update bt lib for ESP32(a2a7457) - Fixed assert in ke_mem.c at line 409 when controller reset - Added config for BLE instant passed workaround - Fixed connection can't be established when initiating and advertising coexist --- components/bt/controller/esp32/Kconfig.in | 17 +++++++++++++++++ components/bt/controller/lib_esp32 | 2 +- components/bt/include/esp32/include/esp_bt.h | 19 ++++++++++++++++++- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/components/bt/controller/esp32/Kconfig.in b/components/bt/controller/esp32/Kconfig.in index 1d7572cb0836..7de2ac7c8c22 100644 --- a/components/bt/controller/esp32/Kconfig.in +++ b/components/bt/controller/esp32/Kconfig.in @@ -440,6 +440,23 @@ config BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD If you set `BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it may cause adv packets lost more. +menu "BLE disconnect when instant passed" + config BTDM_BLE_LLCP_CONN_UPDATE + bool "BLE ACL connection update procedure" + depends on (BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM) + default n + help + If this option is enabled, Controller will terminate the connection + when instant passed during connection update procedure. + + config BTDM_BLE_LLCP_CHAN_MAP_UPDATE + bool "BLE ACL channel map update procedure" + depends on (BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM) + default n + help + If this option is enabled, Controller will terminate the connection + when instant passed in channel map update procedure. +endmenu config BTDM_RESERVE_DRAM hex diff --git a/components/bt/controller/lib_esp32 b/components/bt/controller/lib_esp32 index f5114d2a70e3..c3f6258cfbd7 160000 --- a/components/bt/controller/lib_esp32 +++ b/components/bt/controller/lib_esp32 @@ -1 +1 @@ -Subproject commit f5114d2a70e33a352adc5a3ad5d44c8537aa13da +Subproject commit c3f6258cfbd776d51e30bd6168f42b0cf5d73ea8 diff --git a/components/bt/include/esp32/include/esp_bt.h b/components/bt/include/esp32/include/esp_bt.h index cf442169a840..0c2680715f69 100644 --- a/components/bt/include/esp32/include/esp_bt.h +++ b/components/bt/include/esp32/include/esp_bt.h @@ -55,7 +55,7 @@ extern "C" { * * @note Please do not modify this value. */ -#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20240722 +#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20240926 /** * @brief Bluetooth Controller mode @@ -178,6 +178,21 @@ the adv packet will be discarded until the memory is restored. */ #else #define BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX 0 #endif + +#ifdef CONFIG_BTDM_BLE_LLCP_CONN_UPDATE +#define BTDM_BLE_LLCP_CONN_UPDATE (1<<0) +#else +#define BTDM_BLE_LLCP_CONN_UPDATE (0<<0) +#endif + +#ifdef CONFIG_BTDM_BLE_LLCP_CHAN_MAP_UPDATE +#define BTDM_BLE_LLCP_CHAN_MAP_UPDATE (1<<1) +#else +#define BTDM_BLE_LLCP_CHAN_MAP_UPDATE (0<<1) +#endif + +#define BTDM_BLE_LLCP_DISC_FLAG (BTDM_BLE_LLCP_CONN_UPDATE | BTDM_BLE_LLCP_CHAN_MAP_UPDATE) + /** * @brief Default Bluetooth Controller configuration */ @@ -206,6 +221,7 @@ the adv packet will be discarded until the memory is restored. */ .hli = BTDM_CTRL_HLI, \ .dup_list_refresh_period = SCAN_DUPL_CACHE_REFRESH_PERIOD, \ .ble_scan_backoff = BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX, \ + .ble_llcp_disc_flag = BTDM_BLE_LLCP_DISC_FLAG, \ .magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \ } @@ -258,6 +274,7 @@ typedef struct { bool hli; /*!< True if using high level interrupt; false otherwise. Configurable in menuconfig. */ uint16_t dup_list_refresh_period; /*!< Scan duplicate filtering list refresh period in seconds. Configurable in menuconfig.*/ bool ble_scan_backoff; /*!< True if BLE scan backoff is enabled; false otherwise. Configurable in menuconfig.*/ + uint8_t ble_llcp_disc_flag; /*!< BLE disconnect flag when instant passed. Configurable in menuconfig. */ uint32_t magic; /*!< Magic number */ } esp_bt_controller_config_t; From c7d169e38a017d095c69a6fb4840fa1f8c9452f6 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Wed, 16 Oct 2024 20:49:57 +0800 Subject: [PATCH 23/56] fix(bt/ble): Update esp32 libbtdm_app.a (17db8bd) - Added a verification step for the Access Address within the CONNECT_IND PDU --- components/bt/controller/esp32/Kconfig.in | 9 +++++++++ components/bt/controller/lib_esp32 | 2 +- components/bt/include/esp32/include/esp_bt.h | 10 +++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/components/bt/controller/esp32/Kconfig.in b/components/bt/controller/esp32/Kconfig.in index 7de2ac7c8c22..8855fb062fc0 100644 --- a/components/bt/controller/esp32/Kconfig.in +++ b/components/bt/controller/esp32/Kconfig.in @@ -406,6 +406,15 @@ config BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU. +config BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS + bool "Enable enhanced Access Address check in CONNECT_IND" + default n + help + Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU. + This improves security by ensuring that only connection requests with valid Access Addresses are accepted. + If disabled, only basic checks are applied, improving compatibility. + + config BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP bool "BLE adv report flow control supported" depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) diff --git a/components/bt/controller/lib_esp32 b/components/bt/controller/lib_esp32 index c3f6258cfbd7..171c4a7653d2 160000 --- a/components/bt/controller/lib_esp32 +++ b/components/bt/controller/lib_esp32 @@ -1 +1 @@ -Subproject commit c3f6258cfbd776d51e30bd6168f42b0cf5d73ea8 +Subproject commit 171c4a7653d2ef56edecaa832bdd4faedd403d77 diff --git a/components/bt/include/esp32/include/esp_bt.h b/components/bt/include/esp32/include/esp_bt.h index 0c2680715f69..77d04eddb186 100644 --- a/components/bt/include/esp32/include/esp_bt.h +++ b/components/bt/include/esp32/include/esp_bt.h @@ -55,7 +55,7 @@ extern "C" { * * @note Please do not modify this value. */ -#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20240926 +#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20241015 /** * @brief Bluetooth Controller mode @@ -193,6 +193,12 @@ the adv packet will be discarded until the memory is restored. */ #define BTDM_BLE_LLCP_DISC_FLAG (BTDM_BLE_LLCP_CONN_UPDATE | BTDM_BLE_LLCP_CHAN_MAP_UPDATE) +#ifdef CONFIG_BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS +#define BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED CONFIG_BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS +#else +#define BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED 0 +#endif + /** * @brief Default Bluetooth Controller configuration */ @@ -222,6 +228,7 @@ the adv packet will be discarded until the memory is restored. */ .dup_list_refresh_period = SCAN_DUPL_CACHE_REFRESH_PERIOD, \ .ble_scan_backoff = BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX, \ .ble_llcp_disc_flag = BTDM_BLE_LLCP_DISC_FLAG, \ + .ble_aa_check = BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED, \ .magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \ } @@ -275,6 +282,7 @@ typedef struct { uint16_t dup_list_refresh_period; /*!< Scan duplicate filtering list refresh period in seconds. Configurable in menuconfig.*/ bool ble_scan_backoff; /*!< True if BLE scan backoff is enabled; false otherwise. Configurable in menuconfig.*/ uint8_t ble_llcp_disc_flag; /*!< BLE disconnect flag when instant passed. Configurable in menuconfig. */ + bool ble_aa_check; /*!< True if adds a verification step for the Access Address within the CONNECT_IND PDU; false otherwise. Configurable in menuconfig. */ uint32_t magic; /*!< Magic number */ } esp_bt_controller_config_t; From d9cfaead169b876f6483e7097f97cf4e8e7ef34f Mon Sep 17 00:00:00 2001 From: gongyantao Date: Fri, 25 Oct 2024 11:16:11 +0800 Subject: [PATCH 24/56] fix(bt): fix some issues in bt controller 1: Store local device name into NVDS when handling hci_wr_local_name_cmd. 2: Set default device name during link manager initialization. 3: Set the QoS value to the minimum value if the calculated QoS is less than the minumum. --- components/bt/controller/lib_esp32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32 b/components/bt/controller/lib_esp32 index 171c4a7653d2..5c4a62c1d457 160000 --- a/components/bt/controller/lib_esp32 +++ b/components/bt/controller/lib_esp32 @@ -1 +1 @@ -Subproject commit 171c4a7653d2ef56edecaa832bdd4faedd403d77 +Subproject commit 5c4a62c1d4577d1352d28708c790ba2b4f741842 From e55594531891ed39805bf7aa0a1a9e5d408c85a5 Mon Sep 17 00:00:00 2001 From: Daniel Mangum Date: Sun, 10 Nov 2024 19:55:18 -0500 Subject: [PATCH 25/56] fix(usb_host): return ESP_ERR_NO_MEM on failed alloc in client register Fixes issue where ESP_ERR_NO_MEM was being silently discarded after cleaning up after a failed malloc in usb_host_client_register. Signed-off-by: Daniel Mangum --- components/usb/usb_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/usb/usb_host.c b/components/usb/usb_host.c index b2e5ed137a91..d1932e8f4d59 100644 --- a/components/usb/usb_host.c +++ b/components/usb/usb_host.c @@ -698,7 +698,7 @@ esp_err_t usb_host_client_register(const usb_host_client_config_t *client_config vSemaphoreDelete(event_sem); } heap_caps_free(client_obj); - return ESP_OK; + return ret; } esp_err_t usb_host_client_deregister(usb_host_client_handle_t client_hdl) From 79b93d1db7652a3aefd6574d8d08ba0877b5615b Mon Sep 17 00:00:00 2001 From: "radek.tandler" Date: Mon, 29 Jul 2024 13:50:12 +0200 Subject: [PATCH 26/56] fix(storage/nvs): Fixed hadling of inconsistent values in NVS entry header feat(storage/nvs): Added test cases for damaged entries with correct CRC --- .../host_test/nvs_host_test/main/test_nvs.cpp | 153 +++++++++--------- components/nvs_flash/src/nvs_page.cpp | 135 ++++++++-------- components/nvs_flash/src/nvs_types.cpp | 140 +++++++++++++--- components/nvs_flash/src/nvs_types.hpp | 10 +- tools/ci/check_copyright_ignore.txt | 1 - 5 files changed, 272 insertions(+), 167 deletions(-) diff --git a/components/nvs_flash/host_test/nvs_host_test/main/test_nvs.cpp b/components/nvs_flash/host_test/nvs_host_test/main/test_nvs.cpp index 74628f8e65df..1da5e8ca808a 100644 --- a/components/nvs_flash/host_test/nvs_host_test/main/test_nvs.cpp +++ b/components/nvs_flash/host_test/nvs_host_test/main/test_nvs.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -547,8 +547,8 @@ TEST_CASE("readonly handle fails on writing", "[nvs]") TEMPORARILY_DISABLED(f.emu.setBounds(NVS_FLASH_SECTOR, NVS_FLASH_SECTOR + NVS_FLASH_SECTOR_COUNT_MIN);) TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); // first, creating namespace... TEST_ESP_OK(nvs_open("ro_ns", NVS_READWRITE, &handle_1)); @@ -575,14 +575,13 @@ TEST_CASE("nvs api tests", "[nvs]") const uint32_t NVS_FLASH_SECTOR_COUNT_MIN = 3; TEMPORARILY_DISABLED(f.emu.setBounds(NVS_FLASH_SECTOR, NVS_FLASH_SECTOR + NVS_FLASH_SECTOR_COUNT_MIN);) - TEST_ESP_ERR(nvs_open("namespace1", NVS_READWRITE, &handle_1), ESP_ERR_NVS_NOT_INITIALIZED); for (uint16_t i = NVS_FLASH_SECTOR; i < NVS_FLASH_SECTOR + NVS_FLASH_SECTOR_COUNT_MIN; ++i) { TEMPORARILY_DISABLED(f.emu.erase(i);) } TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); TEST_ESP_ERR(nvs_open("namespace1", NVS_READONLY, &handle_1), ESP_ERR_NVS_NOT_FOUND); @@ -643,11 +642,11 @@ TEST_CASE("deinit partition doesn't affect other partition's open handles", "[nv TEMPORARILY_DISABLED(f_other.emu.setBounds(NVS_FLASH_SECTOR, NVS_FLASH_SECTOR + NVS_FLASH_SECTOR_COUNT_MIN);) TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f_other.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); TEST_ESP_OK(nvs_open_from_partition(OTHER_PARTITION_NAME, "ns", NVS_READWRITE, &handle_1)); @@ -715,8 +714,8 @@ TEST_CASE("nvs iterators tests", "[nvs]") TEMPORARILY_DISABLED(f.emu.erase(i);) } TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); nvs_iterator_t it; nvs_entry_info_t info; @@ -748,8 +747,7 @@ TEST_CASE("nvs iterators tests", "[nvs]") int count = 0; nvs_iterator_t it = nullptr; esp_err_t res = nvs_entry_find(part, name, type, &it); - for (count = 0; res == ESP_OK; count++) - { + for (count = 0; res == ESP_OK; count++) { res = nvs_entry_next(&it); } CHECK(res == ESP_ERR_NVS_NOT_FOUND); // after finishing the loop or if no entry was found to begin with, @@ -858,14 +856,13 @@ TEST_CASE("nvs iterators tests", "[nvs]") nvs_release_iterator(it); } - SECTION("Iterating over multiple pages works correctly") { nvs_handle_t handle_3; const char *name_3 = "namespace3"; const int entries_created = 250; TEST_ESP_OK(nvs_open(name_3, NVS_READWRITE, &handle_3)); - for (size_t i = 0; i < entries_created; i++) { + for (size_t i = 0; i < entries_created; i++) { TEST_ESP_OK(nvs_set_u8(handle_3, to_string(i).c_str(), 123)); } @@ -922,8 +919,8 @@ TEST_CASE("Iterator with not matching type iterates correctly", "[nvs]") TEMPORARILY_DISABLED(f.emu.erase(i);) } TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); // writing string to namespace (a type which spans multiple entries) TEST_ESP_OK(nvs_open(NAMESPACE, NVS_READWRITE, &my_handle)); @@ -936,8 +933,8 @@ TEST_CASE("Iterator with not matching type iterates correctly", "[nvs]") // re-init to trigger cleaning up of broken items -> a corrupted string will be erased nvs_flash_deinit(); TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); CHECK(nvs_entry_find(NVS_DEFAULT_PART_NAME, NAMESPACE, NVS_TYPE_STR, &it) == ESP_OK); nvs_release_iterator(it); @@ -955,8 +952,8 @@ TEST_CASE("wifi test", "[nvs]") const uint32_t NVS_FLASH_SECTOR_COUNT_MIN = 3; TEMPORARILY_DISABLED(f.emu.setBounds(NVS_FLASH_SECTOR, NVS_FLASH_SECTOR + NVS_FLASH_SECTOR_COUNT_MIN);) TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); nvs_handle_t misc_handle; TEST_ESP_OK(nvs_open("nvs.net80211", NVS_READWRITE, &misc_handle)); @@ -1123,8 +1120,7 @@ class RandomTest { static_assert(nKeys == sizeof(values) / sizeof(values[0]), ""); auto randomRead = [&](size_t index) -> esp_err_t { - switch (types[index]) - { + switch (types[index]) { case nvs::ItemType::I32: { int32_t val; auto err = nvs_get_i32(handle, keys[index], &val); @@ -1204,8 +1200,7 @@ class RandomTest { }; auto randomWrite = [&](size_t index) -> esp_err_t { - switch (types[index]) - { + switch (types[index]) { case nvs::ItemType::I32: { int32_t val = static_cast(gen()); @@ -1323,7 +1318,7 @@ class RandomTest { return ESP_OK; } - esp_err_t handleExternalWriteAtIndex(uint8_t index, const void *value, const size_t len ) + esp_err_t handleExternalWriteAtIndex(uint8_t index, const void *value, const size_t len) { if (index == 9) { /* This is only done for small-page blobs for now*/ if (len > smallBlobLen) { @@ -1354,8 +1349,8 @@ TEST_CASE("monkey test", "[nvs][monkey]") TEMPORARILY_DISABLED(f.emu.setBounds(NVS_FLASH_SECTOR, NVS_FLASH_SECTOR + NVS_FLASH_SECTOR_COUNT_MIN);) TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); nvs_handle_t handle; TEST_ESP_OK(nvs_open("namespace1", NVS_READWRITE, &handle)); @@ -1375,8 +1370,8 @@ TEST_CASE("test for memory leaks in open/set", "[leaks]") const uint32_t NVS_FLASH_SECTOR_COUNT_MIN = 3; TEMPORARILY_DISABLED(f.emu.setBounds(NVS_FLASH_SECTOR, NVS_FLASH_SECTOR + NVS_FLASH_SECTOR_COUNT_MIN);) TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); for (int i = 0; i < 100000; ++i) { nvs_handle_t light_handle = 0; @@ -1405,7 +1400,7 @@ TEST_CASE("read/write failure (TW8406)", "[nvs]") ESP_ERROR_CHECK(nvs_open("LIGHT", NVS_READWRITE, &light_handle)); ESP_ERROR_CHECK(nvs_set_u8(light_handle, "RecordNum", number)); for (i = 0; i < number; ++i) { - sprintf(key, "light%d", i); + snprintf(key, sizeof(key), "light%d", i); ESP_ERROR_CHECK(nvs_set_blob(light_handle, key, data, sizeof(data))); } nvs_commit(light_handle); @@ -1415,7 +1410,7 @@ TEST_CASE("read/write failure (TW8406)", "[nvs]") REQUIRE(number == get_number); for (i = 0; i < number; ++i) { char data[76] = {0}; - sprintf(key, "light%d", i); + snprintf(key, sizeof(key), "light%d", i); ESP_ERROR_CHECK(nvs_get_blob(light_handle, key, data, &data_len)); } nvs_close(light_handle); @@ -1429,22 +1424,22 @@ TEST_CASE("nvs_flash_init checks for an empty page", "[nvs]") const size_t blob_size = nvs::Page::CHUNK_MAX_SIZE; uint8_t blob[blob_size] = {0}; PartitionEmulationFixture f(0, 8); - TEST_ESP_OK( nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 5) ); + TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 5)); nvs_handle_t handle; - TEST_ESP_OK( nvs_open("test", NVS_READWRITE, &handle) ); + TEST_ESP_OK(nvs_open("test", NVS_READWRITE, &handle)); // Fill first page - TEST_ESP_OK( nvs_set_blob(handle, "1a", blob, blob_size) ); + TEST_ESP_OK(nvs_set_blob(handle, "1a", blob, blob_size)); // Fill second page - TEST_ESP_OK( nvs_set_blob(handle, "2a", blob, blob_size) ); + TEST_ESP_OK(nvs_set_blob(handle, "2a", blob, blob_size)); // Fill third page - TEST_ESP_OK( nvs_set_blob(handle, "3a", blob, blob_size) ); - TEST_ESP_OK( nvs_commit(handle) ); + TEST_ESP_OK(nvs_set_blob(handle, "3a", blob, blob_size)); + TEST_ESP_OK(nvs_commit(handle)); nvs_close(handle); TEST_ESP_OK(nvs_flash_deinit_partition(NVS_DEFAULT_PART_NAME)); // first two pages are now full, third one is writable, last two are empty // init should fail - TEST_ESP_ERR( nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 3), - ESP_ERR_NVS_NO_FREE_PAGES ); + TEST_ESP_ERR(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 3), + ESP_ERR_NVS_NO_FREE_PAGES); // in case this test fails, to not affect other tests nvs_flash_deinit_partition(NVS_DEFAULT_PART_NAME); @@ -1455,19 +1450,19 @@ TEST_CASE("nvs page selection takes into account free entries also not just eras const size_t blob_size = nvs::Page::CHUNK_MAX_SIZE / 2; uint8_t blob[blob_size] = {0}; PartitionEmulationFixture f(0, 3); - TEST_ESP_OK( nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 3) ); + TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 3)); nvs_handle_t handle; - TEST_ESP_OK( nvs_open("test", NVS_READWRITE, &handle) ); + TEST_ESP_OK(nvs_open("test", NVS_READWRITE, &handle)); // Fill first page - TEST_ESP_OK( nvs_set_blob(handle, "1a", blob, blob_size / 3) ); - TEST_ESP_OK( nvs_set_blob(handle, "1b", blob, blob_size) ); + TEST_ESP_OK(nvs_set_blob(handle, "1a", blob, blob_size / 3)); + TEST_ESP_OK(nvs_set_blob(handle, "1b", blob, blob_size)); // Fill second page - TEST_ESP_OK( nvs_set_blob(handle, "2a", blob, blob_size) ); - TEST_ESP_OK( nvs_set_blob(handle, "2b", blob, blob_size) ); + TEST_ESP_OK(nvs_set_blob(handle, "2a", blob, blob_size)); + TEST_ESP_OK(nvs_set_blob(handle, "2b", blob, blob_size)); // The item below should be able to fit the first page. - TEST_ESP_OK( nvs_set_blob(handle, "3a", blob, 4) ); - TEST_ESP_OK( nvs_commit(handle) ); + TEST_ESP_OK(nvs_set_blob(handle, "3a", blob, 4)); + TEST_ESP_OK(nvs_commit(handle)); nvs_close(handle); TEST_ESP_OK(nvs_flash_deinit_partition(f.part()->get_partition_name())); @@ -1672,21 +1667,21 @@ TEST_CASE("Modification of values for Multi-page blobs are supported", "[nvs]") uint8_t blob4[blob_size] = { 0x33}; size_t read_size = blob_size; PartitionEmulationFixture f(0, 6); - TEST_ESP_OK( nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 6) ); + TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 6)); nvs_handle_t handle; memset(blob, 0x11, blob_size); memset(blob2, 0x22, blob_size); memset(blob3, 0x33, blob_size); memset(blob4, 0x44, blob_size); memset(blob_read, 0xff, blob_size); - TEST_ESP_OK( nvs_open("test", NVS_READWRITE, &handle) ); - TEST_ESP_OK( nvs_set_blob(handle, "abc", blob, blob_size) ); - TEST_ESP_OK( nvs_set_blob(handle, "abc", blob2, blob_size) ); - TEST_ESP_OK( nvs_set_blob(handle, "abc", blob3, blob_size) ); - TEST_ESP_OK( nvs_set_blob(handle, "abc", blob4, blob_size) ); - TEST_ESP_OK( nvs_get_blob(handle, "abc", blob_read, &read_size)); + TEST_ESP_OK(nvs_open("test", NVS_READWRITE, &handle)); + TEST_ESP_OK(nvs_set_blob(handle, "abc", blob, blob_size)); + TEST_ESP_OK(nvs_set_blob(handle, "abc", blob2, blob_size)); + TEST_ESP_OK(nvs_set_blob(handle, "abc", blob3, blob_size)); + TEST_ESP_OK(nvs_set_blob(handle, "abc", blob4, blob_size)); + TEST_ESP_OK(nvs_get_blob(handle, "abc", blob_read, &read_size)); CHECK(memcmp(blob4, blob_read, blob_size) == 0); - TEST_ESP_OK( nvs_commit(handle) ); + TEST_ESP_OK(nvs_commit(handle)); nvs_close(handle); TEST_ESP_OK(nvs_flash_deinit_partition(f.part()->get_partition_name())); @@ -1699,14 +1694,14 @@ TEST_CASE("Modification from single page blob to multi-page", "[nvs]") uint8_t blob_read[blob_size] = {0xff}; size_t read_size = blob_size; PartitionEmulationFixture f(0, 5); - TEST_ESP_OK( nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 5) ); + TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 5)); nvs_handle_t handle; - TEST_ESP_OK(nvs_open("Test", NVS_READWRITE, &handle) ); + TEST_ESP_OK(nvs_open("Test", NVS_READWRITE, &handle)); TEST_ESP_OK(nvs_set_blob(handle, "abc", blob, nvs::Page::CHUNK_MAX_SIZE / 2)); TEST_ESP_OK(nvs_set_blob(handle, "abc", blob, blob_size)); TEST_ESP_OK(nvs_get_blob(handle, "abc", blob_read, &read_size)); CHECK(memcmp(blob, blob_read, blob_size) == 0); - TEST_ESP_OK(nvs_commit(handle) ); + TEST_ESP_OK(nvs_commit(handle)); nvs_close(handle); TEST_ESP_OK(nvs_flash_deinit_partition(f.part()->get_partition_name())); @@ -1719,15 +1714,15 @@ TEST_CASE("Modification from multi-page to single page", "[nvs]") uint8_t blob_read[blob_size] = {0xff}; size_t read_size = blob_size; PartitionEmulationFixture f(0, 5); - TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 5) ); + TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 5)); nvs_handle_t handle; - TEST_ESP_OK(nvs_open("Test", NVS_READWRITE, &handle) ); + TEST_ESP_OK(nvs_open("Test", NVS_READWRITE, &handle)); TEST_ESP_OK(nvs_set_blob(handle, "abc", blob, blob_size)); TEST_ESP_OK(nvs_set_blob(handle, "abc", blob, nvs::Page::CHUNK_MAX_SIZE / 2)); TEST_ESP_OK(nvs_set_blob(handle, "abc2", blob, blob_size)); TEST_ESP_OK(nvs_get_blob(handle, "abc", blob_read, &read_size)); CHECK(memcmp(blob, blob_read, nvs::Page::CHUNK_MAX_SIZE) == 0); - TEST_ESP_OK(nvs_commit(handle) ); + TEST_ESP_OK(nvs_commit(handle)); nvs_close(handle); TEST_ESP_OK(nvs_flash_deinit_partition(f.part()->get_partition_name())); @@ -1765,7 +1760,6 @@ TEST_CASE("Check that orphaned blobs are erased during init", "[nvs]") TEST_ESP_OK(storage.writeItem(1, nvs::ItemType::BLOB, "key", blob, sizeof(blob))); - TEST_ESP_OK(storage.init(0, 5)); /* Check that multi-page item is still available.**/ TEST_ESP_OK(storage.readItem(1, nvs::ItemType::BLOB, "key", blob, sizeof(blob))); @@ -1785,21 +1779,21 @@ TEST_CASE("Check that orphaned blobs are erased during init", "[nvs]") TEST_CASE("nvs blob fragmentation test", "[nvs]") { PartitionEmulationFixture f(0, 4); - TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 4) ); + TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 4)); const size_t BLOB_SIZE = 3500; uint8_t *blob = (uint8_t *) malloc(BLOB_SIZE); CHECK(blob != NULL); memset(blob, 0xEE, BLOB_SIZE); const uint32_t magic = 0xff33eaeb; nvs_handle_t h; - TEST_ESP_OK( nvs_open("blob_tests", NVS_READWRITE, &h) ); + TEST_ESP_OK(nvs_open("blob_tests", NVS_READWRITE, &h)); for (int i = 0; i < 128; i++) { INFO("Iteration " << i << "...\n"); - TEST_ESP_OK( nvs_set_u32(h, "magic", magic) ); - TEST_ESP_OK( nvs_set_blob(h, "blob", blob, BLOB_SIZE) ); + TEST_ESP_OK(nvs_set_u32(h, "magic", magic)); + TEST_ESP_OK(nvs_set_blob(h, "blob", blob, BLOB_SIZE)); char seq_buf[16]; - sprintf(seq_buf, "seq%d", i); - TEST_ESP_OK( nvs_set_u32(h, seq_buf, i) ); + snprintf(seq_buf, sizeof(seq_buf), "seq%d", i); + TEST_ESP_OK(nvs_set_u32(h, seq_buf, i)); } free(blob); @@ -1818,12 +1812,12 @@ TEST_CASE("nvs code handles errors properly when partition is near to full", "[n /* Four pages should fit roughly 12 blobs*/ for (uint8_t count = 1; count <= 12; count++) { - sprintf(nvs_key, "key:%u", count); + snprintf(nvs_key, sizeof(nvs_key), "key:%u", count); TEST_ESP_OK(storage.writeItem(1, nvs::ItemType::BLOB, nvs_key, blob, sizeof(blob))); } for (uint8_t count = 13; count <= 20; count++) { - sprintf(nvs_key, "key:%u", count); + snprintf(nvs_key, sizeof(nvs_key), "key:%u", count); TEST_ESP_ERR(storage.writeItem(1, nvs::ItemType::BLOB, nvs_key, blob, sizeof(blob)), ESP_ERR_NVS_NOT_ENOUGH_SPACE); } } @@ -1864,14 +1858,14 @@ TEST_CASE("monkey test with old-format blob present", "[nvs][monkey]") TEMPORARILY_DISABLED(f.emu.setBounds(NVS_FLASH_SECTOR, NVS_FLASH_SECTOR + NVS_FLASH_SECTOR_COUNT_MIN);) TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); nvs_handle_t handle; TEST_ESP_OK(nvs_open("namespace1", NVS_READWRITE, &handle)); RandomTest test; - for ( uint8_t it = 0; it < 10; it++) { + for (uint8_t it = 0; it < 10; it++) { size_t count = 200; /* Erase index and chunks for the blob with "singlepage" key */ @@ -1910,8 +1904,8 @@ TEST_CASE("monkey test with old-format blob present", "[nvs][monkey]") TEST_ESP_OK(nvs_flash_deinit_partition(f.part()->get_partition_name())); /* Initialize again */ TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), - NVS_FLASH_SECTOR, - NVS_FLASH_SECTOR_COUNT_MIN)); + NVS_FLASH_SECTOR, + NVS_FLASH_SECTOR_COUNT_MIN)); TEST_ESP_OK(nvs_open("namespace1", NVS_READWRITE, &handle)); /* Perform random things */ @@ -1987,7 +1981,7 @@ TEST_CASE("Recovery from power-off during modification of blob present in old-fo TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 3)); TEST_ESP_OK(nvs_open("namespace1", NVS_READWRITE, &handle)); - TEST_ESP_OK( nvs_get_blob(handle, "singlepage", buf, &buflen)); + TEST_ESP_OK(nvs_get_blob(handle, "singlepage", buf, &buflen)); CHECK(memcmp(buf, hexdata, buflen) == 0); nvs::Page p2; @@ -2017,7 +2011,6 @@ TEST_CASE("Recovery from power-off during modification of blob present in old-fo size_t buflen = sizeof(hexdata); uint8_t buf[nvs::Page::CHUNK_MAX_SIZE]; - /* Power-off when blob was being written on the different page where its old version in old format * was present*/ nvs::Page p; @@ -2046,7 +2039,7 @@ TEST_CASE("Recovery from power-off during modification of blob present in old-fo TEST_ESP_OK(nvs::NVSPartitionManager::get_instance()->init_custom(f.part(), 0, 3)); TEST_ESP_OK(nvs_open("namespace1", NVS_READWRITE, &handle)); - TEST_ESP_OK( nvs_get_blob(handle, "singlepage", buf, &buflen)); + TEST_ESP_OK(nvs_get_blob(handle, "singlepage", buf, &buflen)); CHECK(memcmp(buf, hexdata, buflen) == 0); nvs::Page p3; diff --git a/components/nvs_flash/src/nvs_page.cpp b/components/nvs_flash/src/nvs_page.cpp index 23086c30f23f..2465ded21637 100644 --- a/components/nvs_flash/src/nvs_page.cpp +++ b/components/nvs_flash/src/nvs_page.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -9,16 +9,15 @@ #include #include "nvs_internal.h" -namespace nvs -{ +namespace nvs { Page::Page() : mPartition(nullptr) { } uint32_t Page::Header::calculateCrc32() { return esp_rom_crc32_le(0xffffffff, - reinterpret_cast(this) + offsetof(Header, mSeqNumber), - offsetof(Header, mCrc32) - offsetof(Header, mSeqNumber)); + reinterpret_cast(this) + offsetof(Header, mSeqNumber), + offsetof(Header, mCrc32) - offsetof(Header, mSeqNumber)); } esp_err_t Page::load(Partition *partition, uint32_t sectorNumber) @@ -45,7 +44,9 @@ esp_err_t Page::load(Partition *partition, uint32_t sectorNumber) const int BLOCK_SIZE = 128; uint32_t* block = new (std::nothrow) uint32_t[BLOCK_SIZE]; - if (!block) return ESP_ERR_NO_MEM; + if (!block) { + return ESP_ERR_NO_MEM; + } for (uint32_t i = 0; i < SPI_FLASH_SEC_SIZE; i += 4 * BLOCK_SIZE) { rc = mPartition->read_raw(mBaseAddress + i, block, 4 * BLOCK_SIZE); @@ -66,7 +67,7 @@ esp_err_t Page::load(Partition *partition, uint32_t sectorNumber) } else { mState = header.mState; mSeqNumber = header.mSeqNumber; - if(header.mVersion < NVS_VERSION) { + if (header.mVersion < NVS_VERSION) { return ESP_ERR_NVS_NEW_VERSION_FOUND; } else { mVersion = header.mVersion; @@ -91,7 +92,7 @@ esp_err_t Page::load(Partition *partition, uint32_t sectorNumber) return ESP_OK; } -esp_err_t Page::writeEntry(const Item& item) +esp_err_t Page::writeEntry(const Item &item) { uint32_t phyAddr; esp_err_t err = getEntryAddress(mNextFreeEntry, &phyAddr); @@ -100,7 +101,6 @@ esp_err_t Page::writeEntry(const Item& item) } err = mPartition->write(phyAddr, &item, sizeof(item)); - if (err != ESP_OK) { mState = PageState::INVALID; return err; @@ -189,7 +189,7 @@ esp_err_t Page::writeItem(uint8_t nsIndex, ItemType datatype, const char* key, c // primitive types should fit into one entry NVS_ASSERT_OR_RETURN(totalSize == ENTRY_SIZE || - isVariableLengthType(datatype), ESP_ERR_NVS_VALUE_TOO_LONG); + isVariableLengthType(datatype), ESP_ERR_NVS_VALUE_TOO_LONG); if (mNextFreeEntry == INVALID_ENTRY || mNextFreeEntry + entriesCount > ENTRY_COUNT) { // page will not fit this amount of data @@ -282,12 +282,12 @@ esp_err_t Page::readItem(uint8_t nsIndex, ItemType datatype, const char* key, vo return rc; } size_t willCopy = ENTRY_SIZE; - willCopy = (left < willCopy)?left:willCopy; + willCopy = (left < willCopy) ? left : willCopy; memcpy(dst, ditem.rawData, willCopy); left -= willCopy; dst += willCopy; } - if (Item::calculateCrc32(reinterpret_cast(data), item.varLength.dataSize) != item.varLength.dataCrc32) { + if (Item::calculateCrc32(reinterpret_cast(data), item.varLength.dataSize) != item.varLength.dataCrc32) { rc = eraseEntryAndSpan(index); if (rc != ESP_OK) { return rc; @@ -335,14 +335,14 @@ esp_err_t Page::cmpItem(uint8_t nsIndex, ItemType datatype, const char* key, con return rc; } size_t willCopy = ENTRY_SIZE; - willCopy = (left < willCopy)?left:willCopy; + willCopy = (left < willCopy) ? left : willCopy; if (memcmp(dst, ditem.rawData, willCopy)) { return ESP_ERR_NVS_CONTENT_DIFFERS; } left -= willCopy; dst += willCopy; } - if (Item::calculateCrc32(reinterpret_cast(data), item.varLength.dataSize) != item.varLength.dataCrc32) { + if (Item::calculateCrc32(reinterpret_cast(data), item.varLength.dataSize) != item.varLength.dataCrc32) { return ESP_ERR_NVS_NOT_FOUND; } @@ -385,7 +385,7 @@ esp_err_t Page::eraseEntryAndSpan(size_t index) if (rc != ESP_OK) { return rc; } - if (item.calculateCrc32() != item.crc32) { + if (!item.checkHeaderConsistency(index)) { mHashList.erase(index); rc = alterEntryState(index, EntryState::ERASED); --mUsedEntryCount; @@ -459,7 +459,7 @@ esp_err_t Page::updateFirstUsedEntry(size_t index, size_t span) return ESP_OK; } -esp_err_t Page::copyItems(Page& other) +esp_err_t Page::copyItems(Page &other) { if (mFirstUsedEntry == INVALID_ENTRY) { return ESP_ERR_NVS_NOT_FOUND; @@ -507,7 +507,10 @@ esp_err_t Page::copyItems(Page& other) NVS_ASSERT_OR_RETURN(end <= ENTRY_COUNT, ESP_FAIL); for (size_t i = readEntryIndex + 1; i < end; ++i) { - readEntry(i, entry); + err = readEntry(i, entry); + if (err != ESP_OK) { + return err; + } err = other.writeEntry(entry); if (err != ESP_OK) { return err; @@ -526,7 +529,7 @@ esp_err_t Page::mLoadEntryTable() mState == PageState::FULL || mState == PageState::FREEING) { auto rc = mPartition->read_raw(mBaseAddress + ENTRY_TABLE_OFFSET, mEntryTable.data(), - mEntryTable.byteSize()); + mEntryTable.byteSize()); if (rc != ESP_OK) { mState = PageState::INVALID; return rc; @@ -598,8 +601,7 @@ esp_err_t Page::mLoadEntryTable() --mUsedEntryCount; } ++mErasedEntryCount; - } - else { + } else { break; } } @@ -641,7 +643,7 @@ esp_err_t Page::mLoadEntryTable() return err; } - if (item.crc32 != item.calculateCrc32()) { + if (!item.checkHeaderConsistency(i)) { err = eraseEntryAndSpan(i); if (err != ESP_OK) { mState = PageState::INVALID; @@ -721,7 +723,7 @@ esp_err_t Page::mLoadEntryTable() return err; } - if (item.crc32 != item.calculateCrc32()) { + if (!item.checkHeaderConsistency(i)) { err = eraseEntryAndSpan(i); if (err != ESP_OK) { mState = PageState::INVALID; @@ -761,7 +763,6 @@ esp_err_t Page::mLoadEntryTable() return ESP_OK; } - esp_err_t Page::initialize() { NVS_ASSERT_OR_RETURN(mState == PageState::UNINITIALIZED, ESP_FAIL); @@ -793,7 +794,7 @@ esp_err_t Page::alterEntryState(size_t index, EntryState state) size_t wordToWrite = mEntryTable.getWordIndex(index); uint32_t word = mEntryTable.data()[wordToWrite]; err = mPartition->write_raw(mBaseAddress + ENTRY_TABLE_OFFSET + static_cast(wordToWrite) * 4, - &word, sizeof(word)); + &word, sizeof(word)); if (err != ESP_OK) { mState = PageState::INVALID; return err; @@ -809,7 +810,7 @@ esp_err_t Page::alterEntryRangeState(size_t begin, size_t end, EntryState state) esp_err_t err; for (ptrdiff_t i = end - 1; i >= static_cast(begin); --i) { err = mEntryTable.set(i, state); - if (err != ESP_OK){ + if (err != ESP_OK) { return err; } size_t nextWordIndex; @@ -821,7 +822,7 @@ esp_err_t Page::alterEntryRangeState(size_t begin, size_t end, EntryState state) if (nextWordIndex != wordIndex) { uint32_t word = mEntryTable.data()[wordIndex]; auto rc = mPartition->write_raw(mBaseAddress + ENTRY_TABLE_OFFSET + static_cast(wordIndex) * 4, - &word, 4); + &word, 4); if (rc != ESP_OK) { return rc; } @@ -843,7 +844,7 @@ esp_err_t Page::alterPageState(PageState state) return ESP_OK; } -esp_err_t Page::readEntry(size_t index, Item& dst) const +esp_err_t Page::readEntry(size_t index, Item &dst) const { uint32_t phyAddr; esp_err_t rc = getEntryAddress(index, &phyAddr); @@ -857,7 +858,7 @@ esp_err_t Page::readEntry(size_t index, Item& dst) const return ESP_OK; } -esp_err_t Page::findItem(uint8_t nsIndex, ItemType datatype, const char* key, size_t &itemIndex, Item& item, uint8_t chunkIdx, VerOffset chunkStart) +esp_err_t Page::findItem(uint8_t nsIndex, ItemType datatype, const char* key, size_t &itemIndex, Item &item, uint8_t chunkIdx, VerOffset chunkStart) { if (mState == PageState::CORRUPT || mState == PageState::INVALID || mState == PageState::UNINITIALIZED) { return ESP_ERR_NVS_NOT_FOUND; @@ -909,8 +910,7 @@ esp_err_t Page::findItem(uint8_t nsIndex, ItemType datatype, const char* key, si return rc; } - auto crc32 = item.calculateCrc32(); - if (item.crc32 != crc32) { + if (!item.checkHeaderConsistency(i)) { rc = eraseEntryAndSpan(i); if (rc != ESP_OK) { mState = PageState::INVALID; @@ -974,7 +974,6 @@ esp_err_t Page::findItem(uint8_t nsIndex, ItemType datatype, const char* key, si continue; } - if (datatype != ItemType::ANY && item.datatype != datatype) { if (key == nullptr && nsIndex == NS_ANY && chunkIdx == CHUNK_ANY) { continue; // continue for bruteforce search on blob indices. @@ -991,7 +990,7 @@ esp_err_t Page::findItem(uint8_t nsIndex, ItemType datatype, const char* key, si return ESP_ERR_NVS_NOT_FOUND; } -esp_err_t Page::getSeqNumber(uint32_t& seqNumber) const +esp_err_t Page::getSeqNumber(uint32_t &seqNumber) const { if (mState != PageState::UNINITIALIZED && mState != PageState::INVALID && mState != PageState::CORRUPT) { seqNumber = mSeqNumber; @@ -1000,7 +999,6 @@ esp_err_t Page::getSeqNumber(uint32_t& seqNumber) const return ESP_ERR_NVS_NOT_INITIALIZED; } - esp_err_t Page::setSeqNumber(uint32_t seqNumber) { if (mState != PageState::UNINITIALIZED) { @@ -1058,40 +1056,41 @@ size_t Page::getVarDataTailroom() const } else if (mState == PageState::FULL) { return 0; } - /* Skip one entry for blob data item precessing the data */ - return ((mNextFreeEntry < (ENTRY_COUNT-1)) ? ((ENTRY_COUNT - mNextFreeEntry - 1) * ENTRY_SIZE): 0); + /* Skip one entry for blob data item processing the data */ + return ((mNextFreeEntry < (ENTRY_COUNT - 1)) ? ((ENTRY_COUNT - mNextFreeEntry - 1) * ENTRY_SIZE) : 0); } const char* Page::pageStateToName(PageState ps) { switch (ps) { - case PageState::CORRUPT: - return "CORRUPT"; + case PageState::CORRUPT: + return "CORRUPT"; - case PageState::ACTIVE: - return "ACTIVE"; + case PageState::ACTIVE: + return "ACTIVE"; - case PageState::FREEING: - return "FREEING"; + case PageState::FREEING: + return "FREEING"; - case PageState::FULL: - return "FULL"; + case PageState::FULL: + return "FULL"; - case PageState::INVALID: - return "INVALID"; + case PageState::INVALID: + return "INVALID"; - case PageState::UNINITIALIZED: - return "UNINITIALIZED"; + case PageState::UNINITIALIZED: + return "UNINITIALIZED"; - default: - assert(0 && "invalid state value"); - return ""; + default: + assert(0 && "invalid state value"); + return ""; } } void Page::debugDump() const { - printf("state=%x (%s) addr=%x seq=%d\nfirstUsed=%d nextFree=%d used=%d erased=%d\n", (uint32_t) mState, pageStateToName(mState), mBaseAddress, mSeqNumber, static_cast(mFirstUsedEntry), static_cast(mNextFreeEntry), mUsedEntryCount, mErasedEntryCount); + printf("state=%x (%s) addr=%x seq=%d\nfirstUsed=%d nextFree=%d used=%d erased=%d\n", + (uint32_t) mState, pageStateToName(mState), mBaseAddress, mSeqNumber, static_cast(mFirstUsedEntry), static_cast(mNextFreeEntry), mUsedEntryCount, mErasedEntryCount); size_t skip = 0; for (size_t i = 0; i < ENTRY_COUNT; ++i) { printf("%3d: ", static_cast(i)); @@ -1108,7 +1107,9 @@ void Page::debugDump() const Item item; readEntry(i, item); if (skip == 0) { - printf("W ns=%2u type=%2u span=%3u key=\"%s\" chunkIdx=%d len=%d\n", item.nsIndex, static_cast(item.datatype), item.span, item.key, item.chunkIndex, (item.span != 1)?((int)item.varLength.dataSize):-1); + printf("W ns=%2u type=%2u span=%3u key=\"%s\" chunkIdx=%d len=%d\n", + item.nsIndex, static_cast(item.datatype), item.span, item.key, item.chunkIndex, (item.span != 1)?((int)item.varLength.dataSize):-1); + if (item.span > 0 && item.span <= ENTRY_COUNT - i) { skip = item.span - 1; } else { @@ -1129,24 +1130,24 @@ esp_err_t Page::calcEntries(nvs_stats_t &nvsStats) nvsStats.total_entries += ENTRY_COUNT; switch (mState) { - case PageState::UNINITIALIZED: - case PageState::CORRUPT: - nvsStats.free_entries += ENTRY_COUNT; - break; + case PageState::UNINITIALIZED: + case PageState::CORRUPT: + nvsStats.free_entries += ENTRY_COUNT; + break; - case PageState::FULL: - case PageState::ACTIVE: - nvsStats.used_entries += mUsedEntryCount; - nvsStats.free_entries += ENTRY_COUNT - mUsedEntryCount; // it's equivalent free + erase entries. - break; + case PageState::FULL: + case PageState::ACTIVE: + nvsStats.used_entries += mUsedEntryCount; + nvsStats.free_entries += ENTRY_COUNT - mUsedEntryCount; // it's equivalent free + erase entries. + break; - case PageState::INVALID: - return ESP_ERR_INVALID_STATE; - break; + case PageState::INVALID: + return ESP_ERR_INVALID_STATE; + break; - default: - assert(false && "Unhandled state"); - break; + default: + assert(false && "Unhandled state"); + break; } return ESP_OK; } diff --git a/components/nvs_flash/src/nvs_types.cpp b/components/nvs_flash/src/nvs_types.cpp index a9369a4e272d..24073fc30697 100644 --- a/components/nvs_flash/src/nvs_types.cpp +++ b/components/nvs_flash/src/nvs_types.cpp @@ -1,28 +1,22 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "nvs_types.hpp" - +#include "nvs_page.hpp" +#include "esp_log.h" #include "esp_rom_crc.h" -namespace nvs -{ +#define TAG "nvs" + +namespace nvs { uint32_t Item::calculateCrc32() const { uint32_t result = 0xffffffff; const uint8_t* p = reinterpret_cast(this); result = esp_rom_crc32_le(result, p + offsetof(Item, nsIndex), - offsetof(Item, crc32) - offsetof(Item, nsIndex)); + offsetof(Item, crc32) - offsetof(Item, nsIndex)); result = esp_rom_crc32_le(result, p + offsetof(Item, key), sizeof(key)); result = esp_rom_crc32_le(result, p + offsetof(Item, data), sizeof(data)); return result; @@ -33,7 +27,7 @@ uint32_t Item::calculateCrc32WithoutValue() const uint32_t result = 0xffffffff; const uint8_t* p = reinterpret_cast(this); result = esp_rom_crc32_le(result, p + offsetof(Item, nsIndex), - offsetof(Item, datatype) - offsetof(Item, nsIndex)); + offsetof(Item, datatype) - offsetof(Item, nsIndex)); result = esp_rom_crc32_le(result, p + offsetof(Item, key), sizeof(key)); result = esp_rom_crc32_le(result, p + offsetof(Item, chunkIndex), sizeof(chunkIndex)); return result; @@ -46,4 +40,114 @@ uint32_t Item::calculateCrc32(const uint8_t* data, size_t size) return result; } +bool Item::checkHeaderConsistency(const uint8_t entryIndex) const +{ + // calculate and check the crc32 + if (crc32 != calculateCrc32()) { + ESP_LOGD(TAG, "CRC32 mismatch for entry %d", entryIndex); + return false; + } + + // validate the datatype and check the rest of the header fields + switch (datatype) { + // Entries occupying just one entry + case ItemType::U8: + case ItemType::I8: + case ItemType::U16: + case ItemType::I16: + case ItemType::U32: + case ItemType::I32: + case ItemType::U64: + case ItemType::I64: { + if (span != 1) { + ESP_LOGD(TAG, "Invalid span %u for datatype %#04x", (unsigned int)span, (unsigned int)datatype); + return false; + } + break; + } + + // Special case for BLOB_IDX + case ItemType::BLOB_IDX: { + // span must be 1 + if (span != 1) { + ESP_LOGD(TAG, "Invalid span %u for BLOB_IDX", (unsigned int)span); + return false; + } + + // chunkIndex must be CHUNK_ANY + if (chunkIndex != CHUNK_ANY) { + ESP_LOGD(TAG, "Invalid chunk index %u for BLOB_IDX", (unsigned int)chunkIndex); + return false; + } + + // check maximum data length + // the maximal data length is determined by: + // maximum number of chunks. Chunks are stored in uin8_t, but are logically divided into two "VerOffset" ranges of values (0 based and 128 based) + // maximum theoretical number of entries in the chunk (Page::ENTRY_COUNT - 1) and the number of bytes entry can store (Page::ENTRY_SIZE) + const uint32_t maxDataSize = (uint32_t)((UINT8_MAX / 2) * (Page::ENTRY_COUNT - 1) * Page::ENTRY_SIZE); + if (blobIndex.dataSize > maxDataSize) { + ESP_LOGD(TAG, "Data size %u bytes exceeds maximum possible size %u bytes for BLOB_IDX", (unsigned int)blobIndex.dataSize, (unsigned int)maxDataSize); + return false; + } + break; + } + + // Entries with variable length data + case ItemType::SZ: + case ItemType::BLOB: + case ItemType::BLOB_DATA: { + uint16_t maxAvailableVDataSize; + uint8_t maxAvailablePageSpan; + uint8_t spanCalcFromLen; + + // for BLOB_DATA, chunkIndex must NOT be CHUNK_ANY as this value is used to search ALL chunks in findItem + if (datatype == ItemType::BLOB_DATA) { + // chunkIndex must not be CHUNK_ANY + if (chunkIndex == CHUNK_ANY) { + ESP_LOGD(TAG, "Invalid chunk index %u for BLOB_DATA", (unsigned int)chunkIndex); + return false; + } + } + + // variable length and span checks + + // based on the entryIndex determine the maximum variable length capacity in bytes to the end of the page + maxAvailableVDataSize = ((Page::ENTRY_COUNT - entryIndex) - 1) * Page::ENTRY_SIZE; + + // check if the variable data length is not exceeding the maximum capacity available till the end of the page + if (varLength.dataSize > maxAvailableVDataSize) { + ESP_LOGD(TAG, "Variable data length %u bytes exceeds page boundary. Maximum calculated from the current entry position within page is %u bytes for datatype %#04x ", (unsigned int)varLength.dataSize, (unsigned int)maxAvailableVDataSize, (unsigned int)datatype); + return false; + } + + // based on the entryIndex determine the maximum possible span up to the end of the page + maxAvailablePageSpan = Page::ENTRY_COUNT - entryIndex; + + // this check ensures no data is read beyond the end of the page + if (span > maxAvailablePageSpan) { + ESP_LOGD(TAG, "Span %u exceeds page boundary. Maximum calculated from the current entry position within page is %u for datatype %#04x ", (unsigned int)span, (unsigned int)maxAvailablePageSpan, (unsigned int)datatype); + return false; + } + + // here we have both span and varLength.dataSize within the page boundary. Check if these values are consistent + spanCalcFromLen = (uint8_t)(((size_t) varLength.dataSize + Page::ENTRY_SIZE - 1) / Page::ENTRY_SIZE); + spanCalcFromLen ++; // add overhead entry + + // this check ensures that the span is equal to the number of entries required to store the data plus the overhead entry + if (span != spanCalcFromLen) { + ESP_LOGD(TAG, "Span %i does not match span %u calculated from variable data length %u bytes for datatype %#04x", (unsigned int)span, (unsigned int)spanCalcFromLen, (unsigned int)varLength.dataSize, (unsigned int)datatype); + return false; + } + break; + } + + // Invalid datatype + default: { + ESP_LOGD(TAG, "Invalid datatype %#04x", (unsigned int)datatype); + return false; + } + } + return true; +} + } // namespace nvs diff --git a/components/nvs_flash/src/nvs_types.hpp b/components/nvs_flash/src/nvs_types.hpp index 53d3555693df..5eda9abcd990 100644 --- a/components/nvs_flash/src/nvs_types.hpp +++ b/components/nvs_flash/src/nvs_types.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -108,6 +108,14 @@ class Item dst = *reinterpret_cast(data); return ESP_OK; } + + // Returns true if item's header: + // crc32 matches the calculated crc32 + // and datatype is one of the supported types + // and span is within the allowed range for the datatype and below the maximum calculated from the entryIndex + // + // Parameter entryIndex is used to calculate the maximum span for the given entry + bool checkHeaderConsistency(const uint8_t entryIndex) const; }; } // namespace nvs diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index ad0eb8d82213..f7a58a0b91fb 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -719,7 +719,6 @@ components/nvs_flash/src/nvs_partition.cpp components/nvs_flash/src/nvs_partition_lookup.cpp components/nvs_flash/src/nvs_partition_lookup.hpp components/nvs_flash/src/nvs_test_api.h -components/nvs_flash/src/nvs_types.cpp components/nvs_flash/src/partition.hpp components/nvs_flash/test/test_nvs.c components/nvs_flash/test_nvs_host/esp_error_check_stub.cpp From 1ef4eb21cc4bdbb4836fde910243c87406a13d8b Mon Sep 17 00:00:00 2001 From: Zhang Hai Peng Date: Thu, 14 Nov 2024 22:13:35 +0800 Subject: [PATCH 27/56] fix(bt/bluedroid): Fixed classic bt build fail when enable dynamic memory and disable BLE (cherry picked from commit 59d20e80d300825e06431dad9d22241884905a2d) Co-authored-by: zhanghaipeng --- .../bt/host/bluedroid/common/include/common/bt_target.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index 4d0321cf8e33..e3ebfef040aa 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -187,11 +187,16 @@ #define BLE_50_FEATURE_SUPPORT FALSE #endif +#if (UC_BT_BLE_ENABLED ==TRUE) #if (UC_BT_BLE_42_FEATURES_SUPPORTED == TRUE || BLE_50_FEATURE_SUPPORT == FALSE) #define BLE_42_FEATURE_SUPPORT TRUE #else #define BLE_42_FEATURE_SUPPORT FALSE #endif +#else +#define BLE_42_FEATURE_SUPPORT FALSE +#define BLE_50_FEATURE_SUPPORT FALSE +#endif /* UC_BT_BLE_ENABLED */ #if (UC_BT_BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE) #define BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER TRUE From db3f58fc4f13d8c439057df573a12d700bd4d702 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Fri, 27 Sep 2024 15:23:18 +0800 Subject: [PATCH 28/56] docs(wifi/espnow): Update the description for ESP-NOW frame --- components/esp_wifi/include/esp_now.h | 10 +++++-- docs/en/api-reference/network/esp_now.rst | 29 ++++++++++++------- docs/zh_CN/api-reference/network/esp_now.rst | 30 ++++++++++++-------- 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/components/esp_wifi/include/esp_now.h b/components/esp_wifi/include/esp_now.h index 3e8e8e299d3b..0e3dd85ab662 100644 --- a/components/esp_wifi/include/esp_now.h +++ b/components/esp_wifi/include/esp_now.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -48,7 +48,8 @@ extern "C" { #define ESP_NOW_MAX_TOTAL_PEER_NUM 20 /*!< Maximum number of ESPNOW total peers */ #define ESP_NOW_MAX_ENCRYPT_PEER_NUM 6 /*!< Maximum number of ESPNOW encrypted peers */ -#define ESP_NOW_MAX_DATA_LEN 250 /*!< Maximum length of ESPNOW data which is sent very time */ +#define ESP_NOW_MAX_IE_DATA_LEN 250 /**< Maximum data length in a vendor-specific element */ +#define ESP_NOW_MAX_DATA_LEN ESP_NOW_MAX_IE_DATA_LEN /**< Maximum length of data sent in each ESPNOW transmission for v1.0 */ /** * @brief Status of sending ESPNOW data . @@ -134,7 +135,10 @@ esp_err_t esp_now_init(void); esp_err_t esp_now_deinit(void); /** - * @brief Get the version of ESPNOW + * @brief Get the version of ESPNOW. Currently, ESPNOW supports one version: v1.0. + * + * The v1.0 devices can receive packets if the packet length is less than or equal to ESP_NOW_MAX_IE_DATA_LEN. + * For packets exceeding this length, the v1.0 devices will discard the packet entirely. * * @param version ESPNOW version * diff --git a/docs/en/api-reference/network/esp_now.rst b/docs/en/api-reference/network/esp_now.rst index 43dc8814ac5d..9c2f263503f1 100644 --- a/docs/en/api-reference/network/esp_now.rst +++ b/docs/en/api-reference/network/esp_now.rst @@ -12,7 +12,12 @@ CTR with CBC-MAC Protocol(CCMP) is used to protect the action frame for security Frame Format ------------ -ESP-NOW uses a vendor-specific action frame to transmit ESP-NOW data. The default ESP-NOW bit rate is 1 Mbps. The format of the vendor-specific action frame is as follows: +ESP-NOW uses a vendor-specific action frame to transmit ESP-NOW data. The default ESP-NOW bit rate is 1 Mbps. + +Currently, ESP-NOW supports one version: v1.0. The maximum packet length supported by v1.0 devices is ESP_NOW_MAX_DATA_LEN bytes. +The v1.0 devices can receive packets if the packet length is less than or equal to ESP_NOW_MAX_IE_DATA_LEN. For packets exceeding this length, the v1.0 devices will discard the packet entirely. + +The format of the vendor-specific action frame is as follows: .. highlight:: none @@ -21,28 +26,32 @@ ESP-NOW uses a vendor-specific action frame to transmit ESP-NOW data. The defaul ------------------------------------------------------------------------------------------------------------ | MAC Header | Category Code | Organization Identifier | Random Values | Vendor Specific Content | FCS | ------------------------------------------------------------------------------------------------------------ - 24 bytes 1 byte 3 bytes 4 bytes 7~257 bytes 4 bytes + 24 bytes 1 byte 3 bytes 4 bytes 7-x bytes 4 bytes - Category Code: The Category Code field is set to the value(127) indicating the vendor-specific category. - Organization Identifier: The Organization Identifier contains a unique identifier (0x18fe34), which is the first three bytes of MAC address applied by Espressif. - Random Value: The Random Value filed is used to prevents relay attacks. -- Vendor Specific Content: The Vendor Specific Content contains vendor-specific fields as follows: +- Vendor Specific Content: The Vendor Specific Content contains one vendor-specific element field, x = 257(250 + 7). + +The format of the vendor-specific element frame is as follows: .. highlight:: none :: - ------------------------------------------------------------------------------- - | Element ID | Length | Organization Identifier | Type | Version | Body | - ------------------------------------------------------------------------------- - 1 byte 1 byte 3 bytes 1 byte 1 byte 0~250 bytes + ------------------------------------------------------------------------------------------ + | Element ID | Length | Organization Identifier | Type | Reserved | Version | Body | + ------------------------------------------------------------------------------------------ + 7~4 bits | 3~0 bits + 1 byte 1 byte 3 bytes 1 byte 1 byte 0-250 bytes + - Element ID: The Element ID field is set to the value (221), indicating the vendor-specific element. -- Length: The length is the total length of Organization Identifier, Type, Version and Body. -- Organization Identifier: The Organization Identifier contains a unique identifier(0x18fe34), which is the first three bytes of MAC address applied by Espressif. +- Length: The length is the total length of Organization Identifier, Type, Version and Body, the maximum value is 255. +- Organization Identifier: The Organization Identifier contains a unique identifier (0x18fe34), which is the first three bytes of MAC address applied by Espressif. - Type: The Type field is set to the value (4) indicating ESP-NOW. - Version: The Version field is set to the version of ESP-NOW. -- Body: The Body contains the ESP-NOW data. +- Body: The Body contains the actual ESP-NOW data to be transmitted. As ESP-NOW is connectionless, the MAC header is a little different from that of standard frames. The FromDS and ToDS bits of FrameControl field are both 0. The first address field is set to the destination address. The second address field is set to the source address. The third address field is set to broadcast address (0xff:0xff:0xff:0xff:0xff:0xff). diff --git a/docs/zh_CN/api-reference/network/esp_now.rst b/docs/zh_CN/api-reference/network/esp_now.rst index b5b024e56600..bfdff2820797 100644 --- a/docs/zh_CN/api-reference/network/esp_now.rst +++ b/docs/zh_CN/api-reference/network/esp_now.rst @@ -12,37 +12,43 @@ CTR 与 CBC-MAC 协议 (CCMP) 可用来保护动作帧的安全。ESP-NOW 广泛 帧格式 ------------ -ESP-NOW 使用各个供应商的动作帧传输数据,默认比特率为 1 Mbps。各个供应商的动作帧格式为: +ESP-NOW 使用供应商的动作帧传输数据,默认比特率为 1 Mbps。目前 ESP-NOW 支持一个版本: v1.0。v1.0 的设备支持的最大数据包长度为 ESP_NOW_MAX_DATA_LEN bytes。 +v1.0 设备可以接收长度不超过 ESP_NOW_MAX_IE_DATA_LEN 的数据包,而对于长度超过 ESP_NOW_MAX_IE_DATA_LEN 的数据包,会丢弃数据包。 + +供应商的动作帧格式为: .. highlight:: none :: - ----------------------------------------------------------------------------------------- + ----------------------------------------------------------------------------- | MAC 报头 | 分类代码 | 组织标识符 | 随机值 | 供应商特定内容 | FCS | - ----------------------------------------------------------------------------------------- - 24 字节 1 字节 3 字节 4 字节 7~257 字节 4 字节 + ----------------------------------------------------------------------------- + 24 字节 1 字节 3 字节 4 字节 7-x 字节 4 字节 - 分类代码:分类代码字段可用于指示各个供应商的类别(比如 127)。 - 组织标识符:组织标识符包含一个唯一标识符 (比如 0x18fe34),为乐鑫指定的 MAC 地址的前三个字节。 - 随机值:防止重放攻击。 -- 供应商特定内容:供应商特定内容包含供应商特定字段,如下所示: +- 供应商特定内容:供应商特定内容包含一个特定供应商元素字段,x = 257(250+7)。 + +特定供应商元素的帧格式为: .. highlight:: none :: - ---------------------------------------------------------------------------------------- - | 元素 ID | 长度 | 组织标识符 | 类型 | 版本 | 正文 | - ---------------------------------------------------------------------------------------- - 1 字节 1 字节 3 字节 1 字节 1 字节 0~250 字节 + --------------------------------------------------------------------------- + | 元素 ID | 长度 | 组织标识符 | 类型 | 保留 | 版本 | 正文 | + --------------------------------------------------------------------------- + 7~4 比特| 3~0 比特 + 1 字节 1 字节 3 字节 1 字节 1 字节 0-250 字节 - 元素 ID:元素 ID 字段可用于指示特定于供应商的元素。 -- 长度:长度是组织标识符、类型、版本和正文的总长度。 -- 组织标识符:组织标识符包含一个唯一标识符 (比如 0x18fe34),为乐鑫指定的 MAC 地址的前三个字节。 +- 长度:长度是组织标识符、类型、版本和正文的总长度,最大值为 255。 +- 组织标识符:组织标识符包含一个唯一标识符(比如 0x18fe34),为乐鑫指定的 MAC 地址的前三个字节。 - 类型:类型字段设置为 4,代表 ESP-NOW。 - 版本:版本字段设置为 ESP-NOW 的版本。 -- 正文:正文包含 ESP-NOW 数据。 +- 正文:正文包含实际要发送的 ESP-NOW 数据。 由于 ESP-NOW 是无连接的,因此 MAC 报头与标准帧略有不同。FrameControl 字段的 FromDS 和 ToDS 位均为 0。第一个地址字段用于配置目标地址。第二个地址字段用于配置源地址。第三个地址字段用于配置广播地址 (0xff:0xff:0xff:0xff:0xff:0xff)。 From 362d806dbb784c5f00c47fc66380fdcfe07255bc Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 14 Nov 2024 10:07:52 +0800 Subject: [PATCH 29/56] fix(wifi): Optimization for wifi components 1. fix(wifi/pm): Fixed the tbtt interval update error when AP's beacon interval changed Closes https://github.com/espressif/esp-idf/issues/14720 2. fix(wifi/mesh): Enlarge the mesh TX task stack 3. fix(wifi/espnow): Added check for espnow type and length on v1.0 4. fix(wifi/mesh): Fixed delete group id error in wifi mesh Closes https://github.com/espressif/esp-idf/issues/14735 --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 225cc5d2dc05..7b8497e19252 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 225cc5d2dc0509c4d348343736427cb1679a60d4 +Subproject commit 7b8497e1925284a9e891ed535699c34fe486506f From 88e3e21a9f9c970aebf4a0f4da7179fcef8dd718 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Thu, 14 Nov 2024 21:42:00 +0800 Subject: [PATCH 30/56] fix(esp_system): deselect all modem modules clk source selection before clk init --- .../include/esp_private/esp_modem_clock.h | 8 +++++++- components/esp_hw_support/modem_clock.c | 13 ++++++++++++- components/esp_system/port/soc/esp32c6/clk.c | 1 + components/esp_system/port/soc/esp32h2/clk.c | 2 ++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/components/esp_hw_support/include/esp_private/esp_modem_clock.h b/components/esp_hw_support/include/esp_private/esp_modem_clock.h index a09d450ac37e..b048442fc0b1 100644 --- a/components/esp_hw_support/include/esp_private/esp_modem_clock.h +++ b/components/esp_hw_support/include/esp_private/esp_modem_clock.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -107,9 +107,15 @@ void modem_clock_select_lp_clock_source(periph_module_t module, modem_clock_lpcl /** * @brief Disable lowpower clock source selection + * @param module modem module */ void modem_clock_deselect_lp_clock_source(periph_module_t module); +/** +* @brief Disable all modem module's lowpower clock source selection + */ +void modem_clock_deselect_all_module_lp_clock_source(void); + /** * @brief Reset wifi mac */ diff --git a/components/esp_hw_support/modem_clock.c b/components/esp_hw_support/modem_clock.c index fb21ea0126eb..245080679880 100644 --- a/components/esp_hw_support/modem_clock.c +++ b/components/esp_hw_support/modem_clock.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -338,6 +338,17 @@ void IRAM_ATTR modem_clock_module_disable(periph_module_t module) modem_clock_device_disable(MODEM_CLOCK_instance(), deps); } +void modem_clock_deselect_all_module_lp_clock_source(void) +{ +#if SOC_WIFI_SUPPORTED + modem_clock_hal_deselect_all_wifi_lpclk_source(MODEM_CLOCK_instance()->hal); +#endif +#if SOC_BT_SUPPORTED + modem_clock_hal_deselect_all_ble_rtc_timer_lpclk_source(MODEM_CLOCK_instance()->hal); +#endif + modem_clock_hal_deselect_all_coex_lpclk_source(MODEM_CLOCK_instance()->hal); +} + void modem_clock_select_lp_clock_source(periph_module_t module, modem_clock_lpclk_src_t src, uint32_t divider) { assert(IS_MODEM_MODULE(module)); diff --git a/components/esp_system/port/soc/esp32c6/clk.c b/components/esp_system/port/soc/esp32c6/clk.c index eaeaa7a648d2..a52ab2d7a95e 100644 --- a/components/esp_system/port/soc/esp32c6/clk.c +++ b/components/esp_system/port/soc/esp32c6/clk.c @@ -82,6 +82,7 @@ __attribute__((weak)) void esp_clk_init(void) wdt_hal_write_protect_enable(&rtc_wdt_ctx); #endif + modem_clock_deselect_all_module_lp_clock_source(); #if defined(CONFIG_RTC_CLK_SRC_EXT_CRYS) select_rtc_slow_clk(SOC_RTC_SLOW_CLK_SRC_XTAL32K); #elif defined(CONFIG_RTC_CLK_SRC_EXT_OSC) diff --git a/components/esp_system/port/soc/esp32h2/clk.c b/components/esp_system/port/soc/esp32h2/clk.c index 4a6634d177b9..33e91a2f318e 100644 --- a/components/esp_system/port/soc/esp32h2/clk.c +++ b/components/esp_system/port/soc/esp32h2/clk.c @@ -21,6 +21,7 @@ #include "soc/i2s_reg.h" #include "soc/pcr_reg.h" #include "hal/wdt_hal.h" +#include "esp_private/esp_modem_clock.h" #include "esp_private/periph_ctrl.h" #include "esp_private/esp_clk.h" #include "esp_private/esp_pmu.h" @@ -81,6 +82,7 @@ __attribute__((weak)) void esp_clk_init(void) wdt_hal_write_protect_enable(&rtc_wdt_ctx); #endif + modem_clock_deselect_all_module_lp_clock_source(); #if defined(CONFIG_RTC_CLK_SRC_EXT_CRYS) select_rtc_slow_clk(SOC_RTC_SLOW_CLK_SRC_XTAL32K); #elif defined(CONFIG_RTC_CLK_SRC_EXT_OSC) From fc4e17ecee138fcf02e3cd5c2ab7e4706646c659 Mon Sep 17 00:00:00 2001 From: Tan Yan Quan Date: Thu, 14 Nov 2024 15:56:21 +0800 Subject: [PATCH 31/56] fix(802.15.4): add case for 2015 frame enh-ack --- components/ieee802154/esp_ieee802154.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/ieee802154/esp_ieee802154.c b/components/ieee802154/esp_ieee802154.c index 796b161a7bb2..db80ef88200c 100644 --- a/components/ieee802154/esp_ieee802154.c +++ b/components/ieee802154/esp_ieee802154.c @@ -298,6 +298,7 @@ esp_ieee802154_state_t esp_ieee802154_get_state(void) case IEEE802154_STATE_CCA: case IEEE802154_STATE_TX: case IEEE802154_STATE_RX_ACK: + case IEEE802154_STATE_TX_ENH_ACK: return ESP_IEEE802154_RADIO_TRANSMIT; default: @@ -390,7 +391,8 @@ __attribute__((weak)) void esp_ieee802154_ed_failed(uint16_t error) __attribute__((weak)) esp_err_t esp_ieee802154_enh_ack_generator(uint8_t *frame, esp_ieee802154_frame_info_t *frame_info, uint8_t* enhack_frame) { - return ESP_OK; + ESP_EARLY_LOGE(IEEE802154_TAG, "Not implement for the enh-ack generating handler"); + return ESP_FAIL; } __attribute__((weak)) void esp_ieee802154_timer0_done(void) From 2412bf019df35a4320af61c0dadf0682b9cd61cc Mon Sep 17 00:00:00 2001 From: Erhan Kurubas Date: Fri, 13 Sep 2024 11:37:37 +0300 Subject: [PATCH 32/56] docs(jtag): update OpenOCD related sections --- components/xtensa/trax/test/gdbinit | 2 +- docs/en/api-guides/jtag-debugging/esp32.inc | 2 +- docs/en/api-guides/jtag-debugging/index.rst | 2 ++ docs/en/api-guides/jtag-debugging/tips-and-quirks.rst | 4 +++- docs/zh_CN/api-guides/jtag-debugging/esp32.inc | 2 +- docs/zh_CN/api-guides/jtag-debugging/index.rst | 2 ++ docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst | 2 ++ 7 files changed, 12 insertions(+), 4 deletions(-) diff --git a/components/xtensa/trax/test/gdbinit b/components/xtensa/trax/test/gdbinit index 05496f4c6ebf..5f589bdcd563 100644 --- a/components/xtensa/trax/test/gdbinit +++ b/components/xtensa/trax/test/gdbinit @@ -3,7 +3,7 @@ set confirm off # Start OpenOCD and run to the entry function file test.elf -target remote | openocd -c "log_output openocd.log; set ESP_RTOS none; set ESP_FLASH_SIZE 0; set ESP32_ONLYCPU 1" -f board/esp32-ethernet-kit-3.3v.cfg -c "gdb_port pipe; init; reset halt" +target remote | openocd -c "log_output openocd.log; set ESP_RTOS none; set ESP_FLASH_SIZE 0; set ESP_ONLYCPU 1" -f board/esp32-ethernet-kit-3.3v.cfg -c "gdb_port pipe; init; reset halt" thb entry c diff --git a/docs/en/api-guides/jtag-debugging/esp32.inc b/docs/en/api-guides/jtag-debugging/esp32.inc index 6358a022f6db..f4b25c50da60 100644 --- a/docs/en/api-guides/jtag-debugging/esp32.inc +++ b/docs/en/api-guides/jtag-debugging/esp32.inc @@ -112,7 +112,7 @@ - Description * - ``ESP32_FLASH_VOLTAGE`` - When using 1.8 V flash ESP32 based modules, set this variable to ``1.8``. Refer to :ref:`jtag-debugging-tip-code-flash-voltage`. - * - ``ESP32_ONLYCPU`` + * - ``ESP_ONLYCPU`` - For multi-core targets, can be set to ``1`` to only enable single core debugging. --- diff --git a/docs/en/api-guides/jtag-debugging/index.rst b/docs/en/api-guides/jtag-debugging/index.rst index 812a51dbcf38..1bb146d538aa 100644 --- a/docs/en/api-guides/jtag-debugging/index.rst +++ b/docs/en/api-guides/jtag-debugging/index.rst @@ -217,6 +217,8 @@ OpenOCD flashing command ``program_esp`` has the following format: - ``exit`` - Optional. Finally exit OpenOCD. - ``compress`` - Optional. Compress image file before programming. - ``encrypt`` - Optional. Encrypt binary before writing to flash. Same functionality with ``idf.py encrypted-flash`` + - ``no_clock_boost`` - Optional. Disable setting target clock frequency to its maximum possible value before programming. Clock boost is enabled by default. + - ``restore_clock`` - Optional. Restore clock frequency to its initial value after programming. Disabled by default. You are now ready to start application debugging. Follow the steps described in the section below. diff --git a/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst b/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst index f1cb5340293f..68b15663cbca 100644 --- a/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst +++ b/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst @@ -82,7 +82,7 @@ GDB has a Python extension for FreeRTOS support. ESP-IDF automatically loads thi The MTDI pin of ESP32, being among four pins used for JTAG communication, is also one of ESP32's bootstrapping pins. On power up ESP32 is sampling binary level on MTDI to set it's internal voltage regulator used to supply power to external SPI flash chip. If binary level on MDTI pin on power up is low, the voltage regulator is set to deliver 3.3 V, if it is high, then the voltage is set to 1.8 V. The MTDI pin should have a pull-up or may rely on internal weak pull down resistor (see `ESP32 Series Datasheet `_ for details), depending on the type of SPI chip used. Once JTAG is connected, it overrides the pull-up or pull-down resistor that is supposed to do the bootstrapping. - To handle this issue OpenOCD's board configuration file (e.g. ``board\esp32-wrover-kit-3.3v.cfg`` for ESP-WROVER-KIT board) provides ``ESP32_FLASH_VOLTAGE`` parameter to set the idle state of the ``TDO`` line to a specified binary level, therefore reducing the chance of a bad bootup of application due to incorrect flash voltage. + To handle this issue OpenOCD's board configuration file (e.g. ``board\esp32-wrover-kit-3.3v.cfg`` for ESP-WROVER-KIT board) provides ``ESP32_FLASH_VOLTAGE`` parameter to set the idle state of the ``TDO`` line to a specified binary level, therefore reducing the chance of a bad boot-up of application due to incorrect flash voltage. Check specification of ESP32 module connected to JTAG, what is the power supply voltage of SPI flash chip. Then set ``ESP32_FLASH_VOLTAGE`` accordingly. Most WROOM modules use 3.3 V flash. WROVER earlier than ESP32-WROVER-B use 1.8 V flash, while ESP32-WROVER-B and -E modules use 3.3 V flash. @@ -177,6 +177,8 @@ It is important to set the variable before including the ESP-specific configurat - Set to ``0`` to disable Flash breakpoints support. * - ``ESP_SEMIHOST_BASEDIR`` - Set to the path (on the host) which will be the default directory for semihosting functions. + * - ``ESP_ONLYCPU`` + - For multi-core targets, can be set to ``1`` to only enable single core debugging. .. include:: {IDF_TARGET_PATH_NAME}.inc :start-after: openocd-target-specific-config-vars diff --git a/docs/zh_CN/api-guides/jtag-debugging/esp32.inc b/docs/zh_CN/api-guides/jtag-debugging/esp32.inc index b37cdf585931..2195a44d005e 100644 --- a/docs/zh_CN/api-guides/jtag-debugging/esp32.inc +++ b/docs/zh_CN/api-guides/jtag-debugging/esp32.inc @@ -112,7 +112,7 @@ - 描述 * - ``ESP32_FLASH_VOLTAGE`` - 如果 ESP32 模组集成的是 1.8 V 的 flash,将该变量设置为 ``1.8``,详情请参考 :ref:`jtag-debugging-tip-code-flash-voltage` - * - ``ESP32_ONLYCPU`` + * - ``ESP_ONLYCPU`` - 对于多核芯片,将该值设置为 ``1`` 可以仅启用单核调试功能 --- diff --git a/docs/zh_CN/api-guides/jtag-debugging/index.rst b/docs/zh_CN/api-guides/jtag-debugging/index.rst index 683808d87b8f..76b8ae6e841b 100644 --- a/docs/zh_CN/api-guides/jtag-debugging/index.rst +++ b/docs/zh_CN/api-guides/jtag-debugging/index.rst @@ -217,6 +217,8 @@ OpenOCD 安装完成后就可以配置 {IDF_TARGET_NAME} 目标(即带 JTAG - ``exit`` - 烧写完成后退出 OpenOCD(可选) - ``compress`` - 烧写开始前压缩镜像文件(可选) - ``encrypt`` - 烧写到 flash 前加密二进制文件,与 ``idf.py encrypted-flash`` 功能相同(可选) +- ``no_clock_boost`` - 禁用在烧写前将目标时钟频率设置为其最大可能值(可选)。默认情况下禁用该选项,即默认启用时钟提升。 +- ``restore_clock`` - 可选。烧写完成后将时钟频率恢复到初始值。默认情况下不启用。 现在可以调试应用程序了,请按照以下章节中的步骤进行操作。 diff --git a/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst b/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst index af3f6658de4d..4a6ad7ae54d9 100644 --- a/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst +++ b/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst @@ -177,6 +177,8 @@ TCL 语言中为变量赋值的语法是: - 设置成 ``0`` 可以关闭对 flash 断点的支持。 * - ``ESP_SEMIHOST_BASEDIR`` - 设置 semihosting 在主机端的默认目录。 + * - ``ESP_ONLYCPU`` + - 对于多核芯片,将该值设置为 ``1`` 可以仅启用单核调试功能 .. include:: {IDF_TARGET_PATH_NAME}.inc :start-after: openocd-target-specific-config-vars From c2138be7eec5fd006999b674ebe5991a42fbb001 Mon Sep 17 00:00:00 2001 From: Song Ruo Jing Date: Tue, 24 Oct 2023 11:40:35 +0800 Subject: [PATCH 33/56] feat(soc): support SOC_GPIO_IN_RANGE_MAX/SOC_GPIO_OUT_RANGE_MAX --- components/soc/esp32/include/soc/Kconfig.soc_caps.in | 8 ++++++++ components/soc/esp32/include/soc/soc_caps.h | 3 +++ components/soc/esp32c2/include/soc/Kconfig.soc_caps.in | 8 ++++++++ components/soc/esp32c2/include/soc/soc_caps.h | 4 ++++ components/soc/esp32c3/include/soc/Kconfig.soc_caps.in | 8 ++++++++ components/soc/esp32c3/include/soc/soc_caps.h | 4 ++++ components/soc/esp32c6/include/soc/Kconfig.soc_caps.in | 8 ++++++++ components/soc/esp32c6/include/soc/soc_caps.h | 4 ++++ components/soc/esp32h2/include/soc/Kconfig.soc_caps.in | 8 ++++++++ components/soc/esp32h2/include/soc/soc_caps.h | 3 +++ components/soc/esp32s2/include/soc/Kconfig.soc_caps.in | 8 ++++++++ components/soc/esp32s2/include/soc/soc_caps.h | 3 +++ components/soc/esp32s3/include/soc/Kconfig.soc_caps.in | 8 ++++++++ components/soc/esp32s3/include/soc/soc_caps.h | 4 ++++ components/soc/linux/include/soc/Kconfig.soc_caps.in | 8 ++++++++ components/soc/linux/include/soc/soc_caps.h | 6 +++++- 16 files changed, 94 insertions(+), 1 deletion(-) diff --git a/components/soc/esp32/include/soc/Kconfig.soc_caps.in b/components/soc/esp32/include/soc/Kconfig.soc_caps.in index a2c5772ee6b6..b16d12e80776 100644 --- a/components/soc/esp32/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32/include/soc/Kconfig.soc_caps.in @@ -283,6 +283,14 @@ config SOC_GPIO_VALID_GPIO_MASK hex default 0xFFFFFFFFFF +config SOC_GPIO_IN_RANGE_MAX + int + default 39 + +config SOC_GPIO_OUT_RANGE_MAX + int + default 33 + config SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK hex default 0xEF0FEA diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index 001ed9f4710a..a3c6d384ea1b 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -169,6 +169,9 @@ // GPIO >= 34 are input only #define SOC_GPIO_VALID_OUTPUT_GPIO_MASK (SOC_GPIO_VALID_GPIO_MASK & ~(0ULL | BIT34 | BIT35 | BIT36 | BIT37 | BIT38 | BIT39)) +#define SOC_GPIO_IN_RANGE_MAX 39 +#define SOC_GPIO_OUT_RANGE_MAX 33 + // digital I/O pad powered by VDD3P3_CPU or VDD_SPI(GPIO_NUM: 1, 3, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19, 21, 22, 23) #define SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK 0xEF0FEAULL diff --git a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in index 231e4b17a15d..513a4426a390 100644 --- a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in @@ -239,6 +239,14 @@ config SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP bool default y +config SOC_GPIO_IN_RANGE_MAX + int + default 20 + +config SOC_GPIO_OUT_RANGE_MAX + int + default 20 + config SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK int default 0 diff --git a/components/soc/esp32c2/include/soc/soc_caps.h b/components/soc/esp32c2/include/soc/soc_caps.h index 578bc8e8740b..fd044ac909f1 100644 --- a/components/soc/esp32c2/include/soc/soc_caps.h +++ b/components/soc/esp32c2/include/soc/soc_caps.h @@ -119,6 +119,10 @@ #define SOC_GPIO_VALID_GPIO_MASK ((1U< Date: Fri, 30 Aug 2024 19:16:47 +0800 Subject: [PATCH 34/56] feat(coex): support GPIO debug --- components/esp_coex/CMakeLists.txt | 4 +- components/esp_coex/Kconfig | 197 +++++++++++++ components/esp_coex/esp32/esp_coex_adapter.c | 13 +- .../esp_coex/esp32c2/esp_coex_adapter.c | 13 +- .../esp_coex/esp32c3/esp_coex_adapter.c | 13 +- .../esp_coex/esp32c6/esp_coex_adapter.c | 13 +- .../esp_coex/esp32h2/esp_coex_adapter.c | 15 +- .../esp_coex/esp32s2/esp_coex_adapter.c | 13 +- .../esp_coex/esp32s3/esp_coex_adapter.c | 13 +- components/esp_coex/include/esp_coexist.h | 13 +- .../include/private/esp_coexist_adapter.h | 1 + .../include/private/esp_coexist_debug.h | 145 +++++++++ components/esp_coex/src/coexist_debug.c | 277 ++++++++++++++++++ .../esp_coex/src/coexist_debug_diagram.c | 59 ++++ 14 files changed, 778 insertions(+), 11 deletions(-) create mode 100644 components/esp_coex/include/private/esp_coexist_debug.h create mode 100644 components/esp_coex/src/coexist_debug.c create mode 100644 components/esp_coex/src/coexist_debug_diagram.c diff --git a/components/esp_coex/CMakeLists.txt b/components/esp_coex/CMakeLists.txt index 8918bdd600bc..a17cf060a049 100644 --- a/components/esp_coex/CMakeLists.txt +++ b/components/esp_coex/CMakeLists.txt @@ -13,7 +13,9 @@ if(CONFIG_ESP_COEX_SW_COEXIST_ENABLE OR CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE) endif() if(CONFIG_ESP_WIFI_ENABLED) - list(APPEND srcs "${idf_target}/esp_coex_adapter.c") + list(APPEND srcs "${idf_target}/esp_coex_adapter.c" + "src/coexist_debug_diagram.c" + "src/coexist_debug.c") endif() idf_component_register(SRCS "${srcs}" diff --git a/components/esp_coex/Kconfig b/components/esp_coex/Kconfig index d5de082a3c37..3494445ad4b5 100644 --- a/components/esp_coex/Kconfig +++ b/components/esp_coex/Kconfig @@ -33,4 +33,201 @@ menu "Wireless Coexistence" help If enabled, coexist power management will be enabled. + config ESP_COEX_GPIO_DEBUG + bool "GPIO debugging for coexistence" + default n + depends on !PM_SLP_DISABLE_GPIO && !PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP + help + Support coexistence GPIO debugging + + if (ESP_COEX_GPIO_DEBUG) + + choice ESP_COEX_GPIO_DEBUG_DIAG + prompt "Debugging Diagram" + default ESP_COEX_GPIO_DEBUG_DIAG_GENERAL + help + Select type of debugging diagram + + config ESP_COEX_GPIO_DEBUG_DIAG_GENERAL + bool "General" + config ESP_COEX_GPIO_DEBUG_DIAG_WIFI + bool "Wi-Fi" + + endchoice + + config ESP_COEX_GPIO_DEBUG_IO_COUNT + int "Max number of debugging GPIOs" + range 0 12 + default 12 + + config ESP_COEX_GPIO_DEBUG_IO_IDX0 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 0) + int "Actual IO num for Debug IO ID0" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 15 if IDF_TARGET_ESP32 + default 4 if IDF_TARGET_ESP32S2 + default 19 if IDF_TARGET_ESP32C3 + default 4 if IDF_TARGET_ESP32S3 + default 18 if IDF_TARGET_ESP32C2 + default 4 if IDF_TARGET_ESP32C6 + default 2 if IDF_TARGET_ESP32C5 + default 4 if IDF_TARGET_ESP32C61 + default 1 + + config ESP_COEX_GPIO_DEBUG_IO_IDX1 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 1) + int "Actual IO num for Debug IO ID1" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 2 if IDF_TARGET_ESP32 + default 5 if IDF_TARGET_ESP32S2 + default 18 if IDF_TARGET_ESP32C3 + default 5 if IDF_TARGET_ESP32S3 + default 4 if IDF_TARGET_ESP32C2 + default 5 if IDF_TARGET_ESP32C6 + default 3 if IDF_TARGET_ESP32C5 + default 5 if IDF_TARGET_ESP32C61 + default 2 + + config ESP_COEX_GPIO_DEBUG_IO_IDX2 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 2) + int "Actual IO num for Debug IO ID2" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 0 if IDF_TARGET_ESP32 + default 6 if IDF_TARGET_ESP32S2 + default 4 if IDF_TARGET_ESP32C3 + default 6 if IDF_TARGET_ESP32S3 + default 5 if IDF_TARGET_ESP32C2 + default 6 if IDF_TARGET_ESP32C6 + default 4 if IDF_TARGET_ESP32C5 + default 6 if IDF_TARGET_ESP32C61 + default 3 + + config ESP_COEX_GPIO_DEBUG_IO_IDX3 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 3) + int "Actual IO num for Debug IO ID3" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 4 if IDF_TARGET_ESP32 + default 7 if IDF_TARGET_ESP32S2 + default 5 if IDF_TARGET_ESP32C3 + default 7 if IDF_TARGET_ESP32S3 + default 6 if IDF_TARGET_ESP32C2 + default 7 if IDF_TARGET_ESP32C6 + default 5 if IDF_TARGET_ESP32C5 + default 7 if IDF_TARGET_ESP32C61 + default 4 + + config ESP_COEX_GPIO_DEBUG_IO_IDX4 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 4) + int "Actual IO num for Debug IO ID4" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 5 if IDF_TARGET_ESP32 + default 8 if IDF_TARGET_ESP32S2 + default 6 if IDF_TARGET_ESP32C3 + default 15 if IDF_TARGET_ESP32S3 + default 7 if IDF_TARGET_ESP32C2 + default 8 if IDF_TARGET_ESP32C6 + default 27 if IDF_TARGET_ESP32C5 + default 0 if IDF_TARGET_ESP32C61 + default 5 + + config ESP_COEX_GPIO_DEBUG_IO_IDX5 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 5) + int "Actual IO num for Debug IO ID5" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 18 if IDF_TARGET_ESP32 + default 9 if IDF_TARGET_ESP32S2 + default 7 if IDF_TARGET_ESP32C3 + default 16 if IDF_TARGET_ESP32S3 + default 8 if IDF_TARGET_ESP32C2 + default 10 if IDF_TARGET_ESP32C6 + default 6 if IDF_TARGET_ESP32C5 + default 1 if IDF_TARGET_ESP32C61 + default 6 + + config ESP_COEX_GPIO_DEBUG_IO_IDX6 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 6) + int "Actual IO num for Debug IO ID6" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 19 if IDF_TARGET_ESP32 + default 10 if IDF_TARGET_ESP32S2 + default 8 if IDF_TARGET_ESP32C3 + default 17 if IDF_TARGET_ESP32S3 + default 9 if IDF_TARGET_ESP32C2 + default 11 if IDF_TARGET_ESP32C6 + default 7 if IDF_TARGET_ESP32C5 + default 8 if IDF_TARGET_ESP32C61 + default 7 + + config ESP_COEX_GPIO_DEBUG_IO_IDX7 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 7) + int "Actual IO num for Debug IO ID7" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 22 if IDF_TARGET_ESP32 + default 11 if IDF_TARGET_ESP32S2 + default 9 if IDF_TARGET_ESP32C3 + default 18 if IDF_TARGET_ESP32S3 + default 10 if IDF_TARGET_ESP32C2 + default 2 if IDF_TARGET_ESP32C6 + default 26 if IDF_TARGET_ESP32C5 + default 2 if IDF_TARGET_ESP32C61 + default 8 + + config ESP_COEX_GPIO_DEBUG_IO_IDX8 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 8) + int "Actual IO num for Debug IO ID8" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 13 if IDF_TARGET_ESP32 + default 12 if IDF_TARGET_ESP32S2 + default 10 if IDF_TARGET_ESP32C3 + default 10 if IDF_TARGET_ESP32S3 + default 1 if IDF_TARGET_ESP32C2 + default 15 if IDF_TARGET_ESP32C6 + default 24 if IDF_TARGET_ESP32C5 + default 3 if IDF_TARGET_ESP32C61 + default 9 + + config ESP_COEX_GPIO_DEBUG_IO_IDX9 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 9) + int "Actual IO num for Debug IO ID9" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 12 if IDF_TARGET_ESP32 + default 13 if IDF_TARGET_ESP32S2 + default 0 if IDF_TARGET_ESP32C3 + default 11 if IDF_TARGET_ESP32S3 + default 0 if IDF_TARGET_ESP32C2 + default 23 if IDF_TARGET_ESP32C6 + default 23 if IDF_TARGET_ESP32C5 + default 9 if IDF_TARGET_ESP32C61 + default 10 + + config ESP_COEX_GPIO_DEBUG_IO_IDX10 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 10) + int "Actual IO num for Debug IO ID10" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 14 if IDF_TARGET_ESP32 + default 14 if IDF_TARGET_ESP32S2 + default 3 if IDF_TARGET_ESP32C3 + default 12 if IDF_TARGET_ESP32S3 + default 3 if IDF_TARGET_ESP32C2 + default 22 if IDF_TARGET_ESP32C6 + default 16 if IDF_TARGET_ESP32C5 + default 13 if IDF_TARGET_ESP32C61 + default 11 + + config ESP_COEX_GPIO_DEBUG_IO_IDX11 + depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 11) + int "Actual IO num for Debug IO ID11" + range 0 SOC_GPIO_OUT_RANGE_MAX + default 27 if IDF_TARGET_ESP32 + default 15 if IDF_TARGET_ESP32S2 + default 2 if IDF_TARGET_ESP32C3 + default 13 if IDF_TARGET_ESP32S3 + default 2 if IDF_TARGET_ESP32C2 + default 21 if IDF_TARGET_ESP32C6 + default 0 if IDF_TARGET_ESP32C5 + default 12 if IDF_TARGET_ESP32C61 + default 12 + + endif + endmenu # Wireless Coexistence diff --git a/components/esp_coex/esp32/esp_coex_adapter.c b/components/esp_coex/esp32/esp_coex_adapter.c index d3b297036dae..fbd93f6a6ad2 100644 --- a/components/esp_coex/esp32/esp_coex_adapter.c +++ b/components/esp_coex/esp32/esp_coex_adapter.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -20,6 +20,7 @@ #include "esp_timer.h" #include "private/esp_coexist_adapter.h" #include "esp32/rom/ets_sys.h" +#include "private/esp_coexist_debug.h" #define TAG "esp_coex_adapter" @@ -206,6 +207,15 @@ static int32_t esp_coex_internal_semphr_give_wrapper(void *semphr) return (int32_t)xSemaphoreGive(((modem_static_queue_t *)semphr)->handle); } +static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev) +{ +#if CONFIG_ESP_COEX_GPIO_DEBUG + return esp_coexist_debug_matrix_init(evt, sig, rev); +#else + return ESP_ERR_NOT_SUPPORTED; +#endif +} + coex_adapter_funcs_t g_coex_adapter_funcs = { ._version = COEX_ADAPTER_VERSION, ._spin_lock_create = esp_coex_common_spin_lock_create_wrapper, @@ -227,5 +237,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._timer_done = esp_coex_common_timer_done_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, + ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_coex/esp32c2/esp_coex_adapter.c b/components/esp_coex/esp32c2/esp_coex_adapter.c index 25805bc7ed15..4954fb9f8506 100644 --- a/components/esp_coex/esp32c2/esp_coex_adapter.c +++ b/components/esp_coex/esp32c2/esp_coex_adapter.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -22,6 +22,7 @@ #include "esp_private/esp_clk.h" #include "private/esp_coexist_adapter.h" #include "esp32c2/rom/ets_sys.h" +#include "private/esp_coexist_debug.h" #define TAG "esp_coex_adapter" @@ -142,6 +143,15 @@ static int32_t IRAM_ATTR esp_coex_semphr_give_from_isr_wrapper(void *semphr, voi return (int32_t)xSemaphoreGiveFromISR(semphr, hptw); } +static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev) +{ +#if CONFIG_ESP_COEX_GPIO_DEBUG + return esp_coexist_debug_matrix_init(evt, sig, rev); +#else + return ESP_ERR_NOT_SUPPORTED; +#endif +} + coex_adapter_funcs_t g_coex_adapter_funcs = { ._version = COEX_ADAPTER_VERSION, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, @@ -161,5 +171,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._timer_done = esp_coex_common_timer_done_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, + ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_coex/esp32c3/esp_coex_adapter.c b/components/esp_coex/esp32c3/esp_coex_adapter.c index 9dd290e5afd2..56454a5aaf3b 100644 --- a/components/esp_coex/esp32c3/esp_coex_adapter.c +++ b/components/esp_coex/esp32c3/esp_coex_adapter.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -23,6 +23,7 @@ #include "private/esp_coexist_adapter.h" #include "esp32c3/rom/ets_sys.h" #include "soc/system_reg.h" +#include "private/esp_coexist_debug.h" #define TAG "esp_coex_adapter" @@ -148,6 +149,15 @@ static int32_t IRAM_ATTR esp_coex_semphr_give_from_isr_wrapper(void *semphr, voi return (int32_t)xSemaphoreGiveFromISR(semphr, hptw); } +static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev) +{ +#if CONFIG_ESP_COEX_GPIO_DEBUG + return esp_coexist_debug_matrix_init(evt, sig, rev); +#else + return ESP_ERR_NOT_SUPPORTED; +#endif +} + coex_adapter_funcs_t g_coex_adapter_funcs = { ._version = COEX_ADAPTER_VERSION, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, @@ -165,5 +175,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._timer_done = esp_coex_common_timer_done_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, + ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_coex/esp32c6/esp_coex_adapter.c b/components/esp_coex/esp32c6/esp_coex_adapter.c index 1fde5726f868..81b4eef2b1e7 100644 --- a/components/esp_coex/esp32c6/esp_coex_adapter.c +++ b/components/esp_coex/esp32c6/esp_coex_adapter.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -22,6 +22,7 @@ #include "esp_private/esp_clk.h" #include "private/esp_coexist_adapter.h" #include "esp32c6/rom/ets_sys.h" +#include "private/esp_coexist_debug.h" #define TAG "esp_coex_adapter" @@ -142,6 +143,15 @@ static int32_t IRAM_ATTR esp_coex_semphr_give_from_isr_wrapper(void *semphr, voi return (int32_t)xSemaphoreGiveFromISR(semphr, hptw); } +static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev) +{ +#if CONFIG_ESP_COEX_GPIO_DEBUG + return esp_coexist_debug_matrix_init(evt, sig, rev); +#else + return ESP_ERR_NOT_SUPPORTED; +#endif +} + coex_adapter_funcs_t g_coex_adapter_funcs = { ._version = COEX_ADAPTER_VERSION, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, @@ -160,5 +170,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._timer_done = esp_coex_common_timer_done_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, + ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_coex/esp32h2/esp_coex_adapter.c b/components/esp_coex/esp32h2/esp_coex_adapter.c index 6cdfdd9bd99f..f00cade6f6bd 100644 --- a/components/esp_coex/esp32h2/esp_coex_adapter.c +++ b/components/esp_coex/esp32h2/esp_coex_adapter.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -21,7 +21,8 @@ #include "soc/rtc.h" #include "esp_private/esp_clk.h" #include "private/esp_coexist_adapter.h" -#include "esp32c6/rom/ets_sys.h" +#include "esp32h2/rom/ets_sys.h" +#include "private/esp_coexist_debug.h" #define TAG "esp_coex_adapter" @@ -134,6 +135,15 @@ static int32_t IRAM_ATTR esp_coex_semphr_give_from_isr_wrapper(void *semphr, voi return (int32_t)xSemaphoreGiveFromISR(semphr, hptw); } +static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev) +{ +#if CONFIG_ESP_COEX_GPIO_DEBUG + return esp_coexist_debug_matrix_init(evt, sig, rev); +#else + return ESP_ERR_NOT_SUPPORTED; +#endif +} + coex_adapter_funcs_t g_coex_adapter_funcs = { ._version = COEX_ADAPTER_VERSION, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, @@ -152,5 +162,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._timer_done = esp_coex_common_timer_done_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, + ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_coex/esp32s2/esp_coex_adapter.c b/components/esp_coex/esp32s2/esp_coex_adapter.c index c8d50258bfae..8611f76c3c66 100644 --- a/components/esp_coex/esp32s2/esp_coex_adapter.c +++ b/components/esp_coex/esp32s2/esp_coex_adapter.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -22,6 +22,7 @@ #include "esp_private/esp_clk.h" #include "private/esp_coexist_adapter.h" #include "esp32s2/rom/ets_sys.h" +#include "private/esp_coexist_debug.h" #define TAG "esp_coex_adapter" @@ -216,6 +217,15 @@ static int32_t esp_coex_internal_semphr_give_wrapper(void *semphr) return (int32_t)xSemaphoreGive(((modem_static_queue_t *)semphr)->handle); } +static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev) +{ +#if CONFIG_ESP_COEX_GPIO_DEBUG + return esp_coexist_debug_matrix_init(evt, sig, rev); +#else + return ESP_ERR_NOT_SUPPORTED; +#endif +} + coex_adapter_funcs_t g_coex_adapter_funcs = { ._version = COEX_ADAPTER_VERSION, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, @@ -233,5 +243,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._timer_done = esp_coex_common_timer_done_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, + ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_coex/esp32s3/esp_coex_adapter.c b/components/esp_coex/esp32s3/esp_coex_adapter.c index 6aa42b1a98a2..4765b925489d 100644 --- a/components/esp_coex/esp32s3/esp_coex_adapter.c +++ b/components/esp_coex/esp32s3/esp_coex_adapter.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -23,6 +23,7 @@ #include "private/esp_coexist_adapter.h" #include "esp32s3/rom/ets_sys.h" #include "soc/system_reg.h" +#include "private/esp_coexist_debug.h" #define TAG "esp_coex_adapter" @@ -222,6 +223,15 @@ static int32_t esp_coex_internal_semphr_give_wrapper(void *semphr) return (int32_t)xSemaphoreGive(((modem_static_queue_t *)semphr)->handle); } +static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev) +{ +#if CONFIG_ESP_COEX_GPIO_DEBUG + return esp_coexist_debug_matrix_init(evt, sig, rev); +#else + return ESP_ERR_NOT_SUPPORTED; +#endif +} + coex_adapter_funcs_t g_coex_adapter_funcs = { ._version = COEX_ADAPTER_VERSION, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, @@ -239,5 +249,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._timer_done = esp_coex_common_timer_done_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, + ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_coex/include/esp_coexist.h b/components/esp_coex/include/esp_coexist.h index 63e83dfcd073..8a865879dc58 100644 --- a/components/esp_coex/include/esp_coexist.h +++ b/components/esp_coex/include/esp_coexist.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -116,7 +116,7 @@ const char *esp_coex_version_get(void); * @deprecated Use esp_coex_status_bit_set() and esp_coex_status_bit_clear() instead. * Set coexist preference of performance * For example, if prefer to bluetooth, then it will make A2DP(play audio via classic bt) - * more smooth while wifi is runnning something. + * more smooth while wifi is running something. * If prefer to wifi, it will do similar things as prefer to bluetooth. * Default, it prefer to balance. * @@ -219,6 +219,15 @@ esp_err_t esp_external_coex_set_validate_high(bool is_high_valid); esp_err_t esp_coex_wifi_i154_enable(void); #endif +#if CONFIG_ESP_COEX_GPIO_DEBUG +/** + * @brief Enable coexist GPIO debug. + * To fully enable this feature, make sure functions in rom_funcs are out of ROM. + * @return : ESP_OK - success, other - failed + */ +esp_err_t esp_coexist_debug_init(void); +#endif + #ifdef __cplusplus } #endif diff --git a/components/esp_coex/include/private/esp_coexist_adapter.h b/components/esp_coex/include/private/esp_coexist_adapter.h index 539fd3ec632b..aca50a6161a2 100644 --- a/components/esp_coex/include/private/esp_coexist_adapter.h +++ b/components/esp_coex/include/private/esp_coexist_adapter.h @@ -46,6 +46,7 @@ typedef struct { void (* _timer_done)(void *ptimer); void (* _timer_setfn)(void *ptimer, void *pfunction, void *parg); void (* _timer_arm_us)(void *ptimer, uint32_t us, bool repeat); + int (* _debug_matrix_init)(int event, int signal, bool rev); int32_t _magic; } coex_adapter_funcs_t; diff --git a/components/esp_coex/include/private/esp_coexist_debug.h b/components/esp_coex/include/private/esp_coexist_debug.h new file mode 100644 index 000000000000..26147262c753 --- /dev/null +++ b/components/esp_coex/include/private/esp_coexist_debug.h @@ -0,0 +1,145 @@ +/* + * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "sdkconfig.h" + +#if CONFIG_ESP_COEX_GPIO_DEBUG +#include "esp_err.h" +#include "stdbool.h" +#include "soc/soc_caps.h" + +#define COEX_GPIO_DEBUG_IO_INVALID SOC_GPIO_PIN_COUNT + +/* Debug signal */ +#define COEX_GPIO_DEBUG_SIG_RES_US 10 +typedef enum { + COEX_GPIO_DEBUG_SIG_POSE, + COEX_GPIO_DEBUG_SIG_NEGA, +} coex_gpio_debug_sig_t; +#define COEX_GPIO_DEBUG_SIG_TO_DURATION(sig) ((sig - COEX_GPIO_DEBUG_SIG_NEGA) * COEX_GPIO_DEBUG_SIG_RES_US) +#define COEX_GPIO_DEBUG_SIG_CHECK_US 100 + +/* User diagram */ +#ifdef CONFIG_ESP_COEX_GPIO_DEBUG_DIAG_GENERAL +#define COEX_GPIO_DEBUG_DIAG_GENERAL 1 +#elif defined(CONFIG_ESP_COEX_GPIO_DEBUG_DIAG_WIFI) +#define COEX_GPIO_DEBUG_DIAG_WIFI 1 +#endif + +/* User configuration validity check */ +#define COEX_GPIO_DEBUG_IO_COUNT_MAX 12 +#define COEX_GPIO_DEBUG_IO_COUNT CONFIG_ESP_COEX_GPIO_DEBUG_IO_COUNT + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX0) +#define COEX_GPIO_DEBUG_IO_IDX0 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX0 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX0 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX1) +#define COEX_GPIO_DEBUG_IO_IDX1 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX1 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX1 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX2) +#define COEX_GPIO_DEBUG_IO_IDX2 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX2 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX2 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX3) +#define COEX_GPIO_DEBUG_IO_IDX3 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX3 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX3 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX4) +#define COEX_GPIO_DEBUG_IO_IDX4 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX4 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX4 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX5) +#define COEX_GPIO_DEBUG_IO_IDX5 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX5 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX5 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX6) +#define COEX_GPIO_DEBUG_IO_IDX6 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX6 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX6 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX7) +#define COEX_GPIO_DEBUG_IO_IDX7 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX7 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX7 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX8) +#define COEX_GPIO_DEBUG_IO_IDX8 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX8 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX8 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX9) +#define COEX_GPIO_DEBUG_IO_IDX9 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX9 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX9 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX10) +#define COEX_GPIO_DEBUG_IO_IDX10 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX10 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX10 +#endif + +#if !defined(CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX11) +#define COEX_GPIO_DEBUG_IO_IDX11 COEX_GPIO_DEBUG_IO_INVALID +#else +#define COEX_GPIO_DEBUG_IO_IDX11 CONFIG_ESP_COEX_GPIO_DEBUG_IO_IDX11 +#endif + +/* wifi callback -> debug */ +void wifi_set_gpio_debug_cb(void (* cb)(int, int)); +int wifi_gpio_debug_max_event_get(void); + +/* functions to check if in ROM */ +void lmacProcessTxComplete(void); +void lmacTxFrame(void); +void pm_update_by_connectionless_status(void); +void pm_sleep(void); +void pm_dream(void); +void pm_beacon_monitor_timeout_process(void); +void pm_connectionless_wake_window_timeout_process(void); +void pm_coex_schm_process(void); +void pm_tbtt_process(void); +void pm_rx_beacon_process(void); +void ppTask(void); +void wDev_IndicateFrame(void); +void pm_check_state(void); +void pm_tx_null_data_done_process(void); +void pm_start(void); +void pm_stop(void); + +/* coex callback -> debug */ +void coex_set_gpio_debug_cb(void (*cb)(int, int)); +int coex_gpio_debug_max_event_get(void); +esp_err_t coex_gpio_debug_matrix_init(void); + +/* debug -> coex wrapper */ +esp_err_t esp_coexist_debug_matrix_init(int evt, int sig, bool rev); + +/* debug <-> diagram */ +void wifi_bind_io_to_evt(uint8_t io_idx, uint8_t evt); +void coex_bind_io_to_evt(uint8_t io_idx, uint8_t evt); +void diagram_bind_io_to_evt(void); + +#endif diff --git a/components/esp_coex/src/coexist_debug.c b/components/esp_coex/src/coexist_debug.c new file mode 100644 index 000000000000..7c38eea8e515 --- /dev/null +++ b/components/esp_coex/src/coexist_debug.c @@ -0,0 +1,277 @@ +/* + * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +#include "private/esp_coexist_debug.h" + +#include +#include "esp_err.h" +#include "string.h" +#include "esp_attr.h" +#include "esp_log.h" + +#if CONFIG_IDF_TARGET_ESP32 +#include "esp32/rom/gpio.h" +#include "esp32/rom/ets_sys.h" +#elif defined(CONFIG_IDF_TARGET_ESP32S2) +#include "esp32s2/rom/gpio.h" +#include "esp32s2/rom/ets_sys.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C3) +#include "esp32c3/rom/gpio.h" +#include "esp32c3/rom/ets_sys.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C2) +#include "esp32c2/rom/gpio.h" +#include "esp32c2/rom/ets_sys.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C6) +#include "esp32c6/rom/gpio.h" +#include "esp32c6/rom/ets_sys.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C5) +#include "esp32c5/rom/gpio.h" +#include "esp32c5/rom/ets_sys.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C61) +#include "esp32c61/rom/gpio.h" +#include "esp32c61/rom/ets_sys.h" +#endif +#include "driver/gpio.h" +#include "soc/gpio_sig_map.h" +#include "esp_rom_gpio.h" +#include "soc/soc.h" + +#if CONFIG_ESP_COEX_GPIO_DEBUG +static char* TAG = "coexist debug"; + +__attribute__((weak)) void wifi_set_gpio_debug_cb(void (* cb)(int, int)) +{ + ESP_LOGW(TAG, "Not support: %s", __FUNCTION__); +} +__attribute__((weak)) int wifi_gpio_debug_max_event_get(void) +{ + ESP_LOGW(TAG, "Not support: %s", __FUNCTION__); + return 0; +} + +__attribute__((weak)) void coex_set_gpio_debug_cb(void (*cb)(int, int)) +{ + ESP_LOGW(TAG, "Not support: %s", __FUNCTION__); +} + +__attribute__((weak)) int coex_gpio_debug_max_event_get(void) +{ + ESP_LOGW(TAG, "Not support: %s", __FUNCTION__); + return 0; +} + +__attribute__((weak)) esp_err_t coex_gpio_debug_matrix_init(void) +{ + ESP_LOGW(TAG, "Not support: %s", __FUNCTION__); + return ESP_OK; +} + +/* Check if functions in ROM */ +static const void* rom_funcs[] = { +#if CONFIG_ESP_WIFI_ENABLED + lmacProcessTxComplete, + lmacTxFrame, + pm_update_by_connectionless_status, + pm_sleep, + pm_dream, + pm_beacon_monitor_timeout_process, + pm_connectionless_wake_window_timeout_process, + pm_coex_schm_process, + pm_tbtt_process, + pm_rx_beacon_process, + ppTask, + wDev_IndicateFrame, + pm_check_state, + pm_tx_null_data_done_process, + pm_start, + pm_stop, +#endif +}; +static const char* rom_funcs_name[] = { +#if CONFIG_ESP_WIFI_ENABLED + "lmacProcessTxComplete", + "lmacTxframe", + "pm_update_by_connectionless_status", + "pm_sleep", + "pm_dream", + "pm_beacon_monitor_timeout_process", + "pm_connectionless_wake_window_timeout_process", + "pm_coex_schm_process", + "pm_tbtt_process", + "pm_rx_beacon_process", + "ppTask", + "wDev_IndicateFrame", + "pm_check_state", + "pm_tx_null_data_done_process", + "pm_start", + "pm_stop", +#endif +}; + +static bool check_funcs_in_rom(void) +{ + bool in_rom = false; + for (uint8_t i = 0; i < sizeof(rom_funcs) / sizeof(void*); i++) { + if ((uint32_t)rom_funcs[i] >= SOC_IROM_MASK_LOW && (uint32_t)rom_funcs[i] <= SOC_IROM_MASK_HIGH) { + ESP_LOGE(TAG, "remove function from ROM: %s", rom_funcs_name[i]); + in_rom = true; + } + } + return in_rom; +} + +/* Define used IO nums */ +static const DRAM_ATTR gpio_num_t s_io_nums[COEX_GPIO_DEBUG_IO_COUNT_MAX] = { + COEX_GPIO_DEBUG_IO_IDX0, + COEX_GPIO_DEBUG_IO_IDX1, + COEX_GPIO_DEBUG_IO_IDX2, + COEX_GPIO_DEBUG_IO_IDX3, + COEX_GPIO_DEBUG_IO_IDX4, + COEX_GPIO_DEBUG_IO_IDX5, + COEX_GPIO_DEBUG_IO_IDX6, + COEX_GPIO_DEBUG_IO_IDX7, + COEX_GPIO_DEBUG_IO_IDX8, + COEX_GPIO_DEBUG_IO_IDX9, + COEX_GPIO_DEBUG_IO_IDX10, + COEX_GPIO_DEBUG_IO_IDX11, +}; + +/* Mapping from evt to IO */ +static DRAM_ATTR gpio_num_t *s_evt_io_map, *s_wifi_evt_io_map, *s_coex_evt_io_map; +static DRAM_ATTR uint8_t s_wifi_evt_max, s_coex_evt_max; + +inline static void bind_io_to_evt(gpio_num_t *ptrmap, uint8_t io, uint8_t evt) +{ + ptrmap[evt] = io; +} + +inline static void evt_set_signal(gpio_num_t io, coex_gpio_debug_sig_t sig) +{ + if (sig == COEX_GPIO_DEBUG_SIG_POSE) { + gpio_set_level(io, true); + } else if (sig == COEX_GPIO_DEBUG_SIG_NEGA) { + gpio_set_level(io, false); + } else { + gpio_set_level(io, true); + esp_rom_delay_us(COEX_GPIO_DEBUG_SIG_TO_DURATION(sig)); + gpio_set_level(io, false); + } +} + +void wifi_bind_io_to_evt(uint8_t io_idx, uint8_t evt) +{ + if (!s_wifi_evt_io_map || evt >= s_wifi_evt_max || io_idx >= COEX_GPIO_DEBUG_IO_COUNT) { + return; + } + ESP_LOGI(TAG, "Bind IO %u to Wi-Fi evt %u", s_io_nums[io_idx], evt); + bind_io_to_evt(s_wifi_evt_io_map, s_io_nums[io_idx], evt); +} + +void coex_bind_io_to_evt(uint8_t io_idx, uint8_t evt) +{ + if (!s_coex_evt_io_map || evt >= s_coex_evt_max || io_idx >= COEX_GPIO_DEBUG_IO_COUNT) { + return; + } + ESP_LOGI(TAG, "Bind IO %u to coexist evt %u", s_io_nums[io_idx], evt); + bind_io_to_evt(s_coex_evt_io_map, s_io_nums[io_idx], evt); +} + +IRAM_ATTR void wifi_set_gpio_debug(int evt, coex_gpio_debug_sig_t sig) +{ + if (evt >= s_wifi_evt_max || s_wifi_evt_io_map[evt] == COEX_GPIO_DEBUG_IO_INVALID) { + return; + } + evt_set_signal(s_wifi_evt_io_map[evt], sig); +} + +IRAM_ATTR void coex_set_gpio_debug(int evt, coex_gpio_debug_sig_t sig) +{ + if (evt >= s_coex_evt_max || s_coex_evt_io_map[evt] == COEX_GPIO_DEBUG_IO_INVALID) { + return; + } + evt_set_signal(s_coex_evt_io_map[evt], sig); +} + +esp_err_t esp_coexist_debug_matrix_init(int evt, int sig, bool rev) +{ + if (evt >= s_coex_evt_max || s_coex_evt_io_map[evt] == COEX_GPIO_DEBUG_IO_INVALID) { + return ESP_ERR_INVALID_ARG; + } + esp_rom_gpio_connect_out_signal(s_coex_evt_io_map[evt], sig, rev, false); + return ESP_OK; +} + +esp_err_t esp_coexist_debug_init(void) +{ + if (check_funcs_in_rom()) { + return ESP_ERR_INVALID_STATE; + } + + s_wifi_evt_max = wifi_gpio_debug_max_event_get(); + s_coex_evt_max = coex_gpio_debug_max_event_get(); + uint8_t evt_max = s_wifi_evt_max + s_coex_evt_max; + if (evt_max == 0) { + return ESP_ERR_NOT_SUPPORTED; + } + + /* Allocate binding map */ + s_evt_io_map = malloc(sizeof(gpio_num_t) * evt_max); + if (!s_evt_io_map) { + return ESP_ERR_NO_MEM; + } + /* Init to invalid IO num */ + for (uint8_t i = 0; i < evt_max; i++) { + s_evt_io_map[i] = COEX_GPIO_DEBUG_IO_INVALID; + } + s_wifi_evt_io_map = s_evt_io_map; + s_coex_evt_io_map = s_evt_io_map + s_wifi_evt_max; + + /* binding map configuration */ + diagram_bind_io_to_evt(); + + /* Register callback for Wi-Fi evt */ + wifi_set_gpio_debug_cb(wifi_set_gpio_debug); + + /* Register callback for coexist evt */ + coex_set_gpio_debug_cb(coex_set_gpio_debug); + + /* IO init and validity check */ + gpio_config_t io_conf = { + //disable interrupt + .intr_type = GPIO_INTR_DISABLE, + //set as output mode + .mode = GPIO_MODE_OUTPUT, + //bit mask of the pins that you want to set,e.g.GPIO18/19 + .pin_bit_mask = 0, + //disable pull-down mode + .pull_down_en = GPIO_PULLDOWN_DISABLE, + //enable pull-up mode + .pull_up_en = GPIO_PULLUP_ENABLE, + }; + + for (uint8_t i = 0; i < COEX_GPIO_DEBUG_IO_COUNT; i++) { + gpio_num_t io = s_io_nums[i]; + io_conf.pin_bit_mask = (1ULL << io); + gpio_config(&io_conf); + gpio_set_level(io, 0); + } + esp_rom_delay_us(COEX_GPIO_DEBUG_SIG_CHECK_US); + for (uint8_t i = 0; i < COEX_GPIO_DEBUG_IO_COUNT; i++) { + gpio_set_level(s_io_nums[i], true); + } + esp_rom_delay_us(COEX_GPIO_DEBUG_SIG_CHECK_US); + for (uint8_t i = 0; i < COEX_GPIO_DEBUG_IO_COUNT; i++) { + gpio_set_level(s_io_nums[i], false); + } + + /* Init coexist hardware signal */ + ESP_ERROR_CHECK(coex_gpio_debug_matrix_init()); + + return ESP_OK; +} + +#endif diff --git a/components/esp_coex/src/coexist_debug_diagram.c b/components/esp_coex/src/coexist_debug_diagram.c new file mode 100644 index 000000000000..ed2fd1c88e3c --- /dev/null +++ b/components/esp_coex/src/coexist_debug_diagram.c @@ -0,0 +1,59 @@ +/* + * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "private/esp_coexist_debug.h" + +#if CONFIG_ESP_COEX_GPIO_DEBUG +#ifdef COEX_GPIO_DEBUG_DIAG_GENERAL +void diagram_bind_io_to_evt(void) { + /* Bind IO to coexist evt */ +#if CONFIG_IDF_TARGET_ESP32 + coex_bind_io_to_evt(0, 8); + coex_bind_io_to_evt(0, 11); + coex_bind_io_to_evt(1, 16); +#else + coex_bind_io_to_evt(0, 0); + coex_bind_io_to_evt(1, 1); +#endif + /* Bind IO to Wi-Fi evt */ + wifi_bind_io_to_evt(2, 9); + wifi_bind_io_to_evt(3, 10); + wifi_bind_io_to_evt(4, 11); + + wifi_bind_io_to_evt(5, 0); + wifi_bind_io_to_evt(6, 1); +} +#elif defined(COEX_GPIO_DEBUG_DIAG_WIFI) +void diagram_bind_io_to_evt(void) { + /* Bind IO to coexist evt */ +#if CONFIG_IDF_TARGET_ESP32 + coex_bind_io_to_evt(0, 8); + coex_bind_io_to_evt(0, 11); + coex_bind_io_to_evt(1, 16); +#else + coex_bind_io_to_evt(0, 0); + coex_bind_io_to_evt(1, 1); +#endif + /* Bind IO to Wi-Fi evt */ + wifi_bind_io_to_evt(2, 9); + wifi_bind_io_to_evt(3, 10); + wifi_bind_io_to_evt(4, 11); + + wifi_bind_io_to_evt(5, 0); + wifi_bind_io_to_evt(6, 1); + + wifi_bind_io_to_evt(7, 3); + wifi_bind_io_to_evt(8, 4); + wifi_bind_io_to_evt(9, 5); + wifi_bind_io_to_evt(10, 6); + wifi_bind_io_to_evt(11, 7); +} +#else +void diagram_bind_io_to_evt(void) { +} +#endif + +#endif From c4752d8e09306f6aaa52ec14fb92cb4469c70e9d Mon Sep 17 00:00:00 2001 From: liuning Date: Tue, 10 Sep 2024 17:14:57 +0800 Subject: [PATCH 35/56] feat(coex): optimize connectionless coexist pwr, optimize wifi pwr with bt idle --- .../include/private/esp_coexist_internal.h | 14 +++++++++++++- components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld | 4 ++-- components/esp_rom/esp32c2/ld/esp32c2.rom.ld | 2 +- components/esp_rom/esp32c3/ld/esp32c3.rom.ld | 2 +- .../esp_rom/esp32c6/ld/esp32c6.rom.coexist.ld | 2 +- components/esp_rom/esp32s3/ld/esp32s3.rom.ld | 2 +- components/esp_wifi/esp32/esp_adapter.c | 2 +- components/esp_wifi/esp32c2/esp_adapter.c | 2 +- components/esp_wifi/esp32c3/esp_adapter.c | 2 +- components/esp_wifi/esp32c6/esp_adapter.c | 2 +- components/esp_wifi/esp32s2/esp_adapter.c | 2 +- components/esp_wifi/esp32s3/esp_adapter.c | 2 +- 12 files changed, 25 insertions(+), 13 deletions(-) diff --git a/components/esp_coex/include/private/esp_coexist_internal.h b/components/esp_coex/include/private/esp_coexist_internal.h index 20cea8a437b4..5eac40b708b7 100644 --- a/components/esp_coex/include/private/esp_coexist_internal.h +++ b/components/esp_coex/include/private/esp_coexist_internal.h @@ -28,6 +28,16 @@ typedef enum { COEX_SCHM_CALLBACK_TYPE_I154, } coex_schm_callback_type_t; +typedef enum { + COEX_SCHM_ST_TYPE_WIFI = 0, + COEX_SCHM_ST_TYPE_BLE, + COEX_SCHM_ST_TYPE_BT, +} coex_schm_st_type_t; + +#define COEX_STATUS_GET_WIFI_BITMAP (1 << COEX_SCHM_ST_TYPE_WIFI) +#define COEX_STATUS_GET_BLE_BITMAP (1 << COEX_SCHM_ST_TYPE_BLE) +#define COEX_STATUS_GET_BT_BITMAP (1 << COEX_SCHM_ST_TYPE_BT) + typedef void (* coex_func_cb_t)(uint32_t event, int sched_cnt); typedef esp_err_t (* coex_set_lpclk_source_callback_t)(void); typedef void (* coex_wifi_channel_change_cb_t)(uint8_t primary, uint8_t secondary); @@ -94,9 +104,11 @@ esp_err_t coex_preference_set(coex_prefer_t prefer); /** * @brief Get software coexist status. + * + * @param bitmap : bitmap of the module getting status. * @return : software coexist status */ -uint32_t coex_status_get(void); +uint32_t coex_status_get(uint8_t bitmap); /** * @brief WiFi requests coexistence. diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld index a4771c74096f..e309b51a41e3 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld @@ -64,8 +64,8 @@ hal_set_sta_tbtt = 0x40001e4c; pm_set_sleep_type = 0x40001e54; pm_tx_null_data_done_process = 0x40001eb0; //pm_tx_data_process = 0x40001eb4; -pm_attach = 0x40001eb8; -pm_coex_schm_process = 0x40001ebc; +/*pm_attach = 0x40001eb8;*/ +/*pm_coex_schm_process = 0x40001ebc;*/ pm_on_probe_resp_rx = 0x40001ecc; pm_send_probe_stop = 0x40001edc; hal_sniffer_rx_set_promis = 0x40001ef4; diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index 9a89e2ec2b8d..c39235c06999 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -1079,7 +1079,7 @@ coex_hw_timer_set = 0x4000219c; coex_schm_interval_set = 0x400021a0; coex_schm_lock = 0x400021a4; coex_schm_unlock = 0x400021a8; -coex_status_get = 0x400021ac; +/*coex_status_get = 0x400021ac;*/ coex_wifi_release = 0x400021b0; esp_coex_ble_conn_dynamic_prio_get = 0x400021b4; /*coex_hw_timer_tick_get = 0x400021b8;*/ diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld index 92bb484f1646..be86aa0a4cbd 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld @@ -946,7 +946,7 @@ coex_hw_timer_set = 0x400018e0; coex_schm_interval_set = 0x400018e4; coex_schm_lock = 0x400018e8; coex_schm_unlock = 0x400018ec; -coex_status_get = 0x400018f0; +/*coex_status_get = 0x400018f0;*/ coex_wifi_release = 0x400018f4; esp_coex_ble_conn_dynamic_prio_get = 0x400018f8; /* Data (.data, .bss, .rodata) */ diff --git a/components/esp_rom/esp32c6/ld/esp32c6.rom.coexist.ld b/components/esp_rom/esp32c6/ld/esp32c6.rom.coexist.ld index 5ff011973e23..46e175e17995 100644 --- a/components/esp_rom/esp32c6/ld/esp32c6.rom.coexist.ld +++ b/components/esp_rom/esp32c6/ld/esp32c6.rom.coexist.ld @@ -35,7 +35,7 @@ coex_hw_timer_set = 0x40000b30; coex_schm_interval_set = 0x40000b34; coex_schm_lock = 0x40000b38; coex_schm_unlock = 0x40000b3c; -coex_status_get = 0x40000b40; +/*coex_status_get = 0x40000b40;*/ coex_wifi_release = 0x40000b44; esp_coex_ble_conn_dynamic_prio_get = 0x40000b48; /* Data (.data, .bss, .rodata) */ diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld index da107450e39e..1bcd4b244e79 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -1230,7 +1230,7 @@ coex_hw_timer_set = 0x40005c04; coex_schm_interval_set = 0x40005c10; coex_schm_lock = 0x40005c1c; coex_schm_unlock = 0x40005c28; -coex_status_get = 0x40005c34; +/*coex_status_get = 0x40005c34;*/ coex_wifi_release = 0x40005c40; esp_coex_ble_conn_dynamic_prio_get = 0x40005c4c; /* Data (.data, .bss, .rodata) */ diff --git a/components/esp_wifi/esp32/esp_adapter.c b/components/esp_wifi/esp32/esp_adapter.c index a6c0b26d6dd2..25f2dda39339 100644 --- a/components/esp_wifi/esp32/esp_adapter.c +++ b/components/esp_wifi/esp32/esp_adapter.c @@ -448,7 +448,7 @@ static void coex_disable_wrapper(void) static IRAM_ATTR uint32_t coex_status_get_wrapper(void) { #if CONFIG_SW_COEXIST_ENABLE - return coex_status_get(); + return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP); #else return 0; #endif diff --git a/components/esp_wifi/esp32c2/esp_adapter.c b/components/esp_wifi/esp32c2/esp_adapter.c index 22aadef0c216..32a09b229531 100644 --- a/components/esp_wifi/esp32c2/esp_adapter.c +++ b/components/esp_wifi/esp32c2/esp_adapter.c @@ -384,7 +384,7 @@ static void coex_disable_wrapper(void) static IRAM_ATTR uint32_t coex_status_get_wrapper(void) { #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE - return coex_status_get(); + return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP); #else return 0; #endif diff --git a/components/esp_wifi/esp32c3/esp_adapter.c b/components/esp_wifi/esp32c3/esp_adapter.c index d08b7467ed40..bb403dd5d7a3 100644 --- a/components/esp_wifi/esp32c3/esp_adapter.c +++ b/components/esp_wifi/esp32c3/esp_adapter.c @@ -401,7 +401,7 @@ static void coex_disable_wrapper(void) static IRAM_ATTR uint32_t coex_status_get_wrapper(void) { #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE - return coex_status_get(); + return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP); #else return 0; #endif diff --git a/components/esp_wifi/esp32c6/esp_adapter.c b/components/esp_wifi/esp32c6/esp_adapter.c index e6e5cbf7112b..de5b1b94c46c 100644 --- a/components/esp_wifi/esp32c6/esp_adapter.c +++ b/components/esp_wifi/esp32c6/esp_adapter.c @@ -390,7 +390,7 @@ static void coex_disable_wrapper(void) static IRAM_ATTR uint32_t coex_status_get_wrapper(void) { #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE - return coex_status_get(); + return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP); #else return 0; #endif diff --git a/components/esp_wifi/esp32s2/esp_adapter.c b/components/esp_wifi/esp32s2/esp_adapter.c index 0f462cb59f89..e99c379fe998 100644 --- a/components/esp_wifi/esp32s2/esp_adapter.c +++ b/components/esp_wifi/esp32s2/esp_adapter.c @@ -439,7 +439,7 @@ static void coex_disable_wrapper(void) static IRAM_ATTR uint32_t coex_status_get_wrapper(void) { #if CONFIG_EXTERNAL_COEX_ENABLE - return coex_status_get(); + return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP); #else return 0; #endif diff --git a/components/esp_wifi/esp32s3/esp_adapter.c b/components/esp_wifi/esp32s3/esp_adapter.c index 7687d7ec4712..692fa7b958b6 100644 --- a/components/esp_wifi/esp32s3/esp_adapter.c +++ b/components/esp_wifi/esp32s3/esp_adapter.c @@ -456,7 +456,7 @@ static void coex_disable_wrapper(void) static IRAM_ATTR uint32_t coex_status_get_wrapper(void) { #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE - return coex_status_get(); + return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP); #else return 0; #endif From f208ffa32fd9643956e52554260f5629815a42e1 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Fri, 20 Sep 2024 16:06:59 +0800 Subject: [PATCH 36/56] fix(wifi): esp32c5 esp32c61 support external coex --- components/esp_coex/src/coexist.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/components/esp_coex/src/coexist.c b/components/esp_coex/src/coexist.c index e5d14779339c..b86abd282dfa 100644 --- a/components/esp_coex/src/coexist.c +++ b/components/esp_coex/src/coexist.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2018-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -174,7 +174,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex case EXTERN_COEX_WIRE_4: { esp_coex_external_set_txline(true); - gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_pin.tx_line], PIN_FUNC_GPIO); + gpio_func_sel(gpio_pin.tx_line, PIN_FUNC_GPIO); gpio_set_direction(gpio_pin.tx_line, GPIO_MODE_OUTPUT); REG_WRITE(GPIO_ENABLE_W1TC_REG, BIT(gpio_pin.tx_line)); esp_rom_gpio_connect_out_signal(gpio_pin.tx_line, EXTERNAL_COEX_SIGNAL_O1_TXLINE_IDX, false, false); @@ -183,7 +183,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex #endif case EXTERN_COEX_WIRE_3: { - gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_pin.priority], PIN_FUNC_GPIO); + gpio_func_sel(gpio_pin.priority, PIN_FUNC_GPIO); gpio_set_direction(gpio_pin.priority, GPIO_MODE_INPUT); esp_rom_gpio_connect_in_signal(gpio_pin.priority, EXTERNAL_COEX_SIGNAL_I1_IDX, false); REG_SET_FIELD(GPIO_PIN_REG(gpio_pin.priority), GPIO_PIN1_SYNC1_BYPASS, 2); @@ -192,7 +192,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex __attribute__((fallthrough)); case EXTERN_COEX_WIRE_2: { - gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_pin.grant], PIN_FUNC_GPIO); + gpio_func_sel(gpio_pin.grant, PIN_FUNC_GPIO); gpio_set_direction(gpio_pin.grant, GPIO_MODE_OUTPUT); REG_WRITE(GPIO_ENABLE_W1TC_REG, BIT(gpio_pin.grant)); esp_rom_gpio_connect_out_signal(gpio_pin.grant, EXTERNAL_COEX_SIGNAL_O0_IDX, false, false); @@ -200,7 +200,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex __attribute__((fallthrough)); case EXTERN_COEX_WIRE_1: { - gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_pin.request], PIN_FUNC_GPIO); + gpio_func_sel(gpio_pin.request, PIN_FUNC_GPIO); gpio_set_direction(gpio_pin.request, GPIO_MODE_INPUT); esp_rom_gpio_connect_in_signal(gpio_pin.request, EXTERNAL_COEX_SIGNAL_I0_IDX, false); REG_SET_FIELD(GPIO_PIN_REG(gpio_pin.request), GPIO_PIN1_SYNC1_BYPASS, 2); @@ -218,7 +218,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex { case EXTERN_COEX_WIRE_4: { - gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_pin.tx_line], PIN_FUNC_GPIO); + gpio_func_sel(gpio_pin.tx_line, PIN_FUNC_GPIO); gpio_set_direction(gpio_pin.tx_line, GPIO_MODE_INPUT); esp_rom_gpio_connect_in_signal(gpio_pin.tx_line, EXTERNAL_COEX_SIGNAL_I1_IDX, false); REG_SET_FIELD(GPIO_PIN_REG(gpio_pin.tx_line), GPIO_PIN1_SYNC1_BYPASS, 2); @@ -227,7 +227,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex __attribute__((fallthrough)); case EXTERN_COEX_WIRE_3: { - gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_pin.priority], PIN_FUNC_GPIO); + gpio_func_sel(gpio_pin.priority, PIN_FUNC_GPIO); gpio_set_direction(gpio_pin.priority, GPIO_MODE_OUTPUT); REG_WRITE(GPIO_ENABLE_W1TC_REG, BIT(gpio_pin.priority)); esp_rom_gpio_connect_out_signal(gpio_pin.priority, EXTERNAL_COEX_SIGNAL_O1_IDX, false, false); @@ -235,7 +235,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex __attribute__((fallthrough)); case EXTERN_COEX_WIRE_2: { - gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_pin.grant], PIN_FUNC_GPIO); + gpio_func_sel(gpio_pin.grant, PIN_FUNC_GPIO); gpio_set_direction(gpio_pin.grant, GPIO_MODE_INPUT); esp_rom_gpio_connect_in_signal(gpio_pin.grant, EXTERNAL_COEX_SIGNAL_I0_IDX, false); REG_SET_FIELD(GPIO_PIN_REG(gpio_pin.grant), GPIO_PIN1_SYNC1_BYPASS, 2); @@ -244,7 +244,7 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex __attribute__((fallthrough)); case EXTERN_COEX_WIRE_1: { - gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_pin.request], PIN_FUNC_GPIO); + gpio_func_sel(gpio_pin.request, PIN_FUNC_GPIO); gpio_set_direction(gpio_pin.request, GPIO_MODE_OUTPUT); REG_WRITE(GPIO_ENABLE_W1TC_REG, BIT(gpio_pin.request)); esp_rom_gpio_connect_out_signal(gpio_pin.request, EXTERNAL_COEX_SIGNAL_O0_IDX, false, false); From b27767df5d32c253076f36d9b14ff09598ad95f8 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Fri, 20 Sep 2024 15:49:07 +0800 Subject: [PATCH 37/56] fix(wifi): fix esp32c5 enable external coex fail issue --- components/esp_coex/src/coexist.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/esp_coex/src/coexist.c b/components/esp_coex/src/coexist.c index b86abd282dfa..e72bfa91fc48 100644 --- a/components/esp_coex/src/coexist.c +++ b/components/esp_coex/src/coexist.c @@ -6,6 +6,7 @@ #include "esp_coexist.h" #include "private/esp_coexist_internal.h" +#include "soc/soc_caps.h" #if CONFIG_EXTERNAL_COEX_ENABLE #include "esp_log.h" @@ -18,6 +19,10 @@ #include "esp_attr.h" #endif +#if SOC_MODEM_CLOCK_IS_INDEPENDENT +#include "esp_private/esp_modem_clock.h" +#endif + #if SOC_EXTERNAL_COEX_ADVANCE #define EXTERNAL_COEX_SIGNAL_I0_IDX EXTERN_ACTIVE_I_IDX #define EXTERNAL_COEX_SIGNAL_I1_IDX EXTERN_PRIORITY_I_IDX @@ -163,6 +168,9 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex return ESP_ERR_INVALID_ARG; } esp_coex_external_set_wire_type(wire_type); +#if SOC_MODEM_CLOCK_IS_INDEPENDENT + modem_clock_module_enable(PERIPH_COEX_MODULE); +#endif #if SOC_EXTERNAL_COEX_ADVANCE esp_coex_external_params(g_external_coex_params, 0, 0); #endif From 92666b514013a4410488032f10e31b58c4798568 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Fri, 20 Sep 2024 15:49:07 +0800 Subject: [PATCH 38/56] fix(wifi): fix modem_clock_module_enable mismatch issue --- components/esp_coex/src/coexist.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/components/esp_coex/src/coexist.c b/components/esp_coex/src/coexist.c index e72bfa91fc48..8a68fc24875f 100644 --- a/components/esp_coex/src/coexist.c +++ b/components/esp_coex/src/coexist.c @@ -13,10 +13,8 @@ #include "driver/gpio.h" #include "esp_rom_gpio.h" #include "hal/gpio_hal.h" -#include "hal/gpio_types.h" -#include "soc/gpio_periph.h" -#include "soc/gpio_struct.h" #include "esp_attr.h" +#include "esp_private/gpio.h" #endif #if SOC_MODEM_CLOCK_IS_INDEPENDENT @@ -168,12 +166,6 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex return ESP_ERR_INVALID_ARG; } esp_coex_external_set_wire_type(wire_type); -#if SOC_MODEM_CLOCK_IS_INDEPENDENT - modem_clock_module_enable(PERIPH_COEX_MODULE); -#endif -#if SOC_EXTERNAL_COEX_ADVANCE - esp_coex_external_params(g_external_coex_params, 0, 0); -#endif if(EXTERNAL_COEX_LEADER_ROLE == g_external_coex_params.work_mode) { switch (wire_type) @@ -267,7 +259,16 @@ esp_err_t esp_enable_extern_coex_gpio_pin(external_coex_wire_t wire_type, esp_ex return ESP_ERR_INVALID_ARG; #endif /* SOC_EXTERNAL_COEX_ADVANCE */ } +#if SOC_MODEM_CLOCK_IS_INDEPENDENT + modem_clock_module_enable(PERIPH_COEX_MODULE); +#endif +#if SOC_EXTERNAL_COEX_ADVANCE + esp_coex_external_params(g_external_coex_params, 0, 0); +#endif esp_err_t ret = esp_coex_external_set(EXTERN_COEX_PTI_MID, EXTERN_COEX_PTI_MID, EXTERN_COEX_PTI_HIGH); +#if SOC_MODEM_CLOCK_IS_INDEPENDENT + modem_clock_module_disable(PERIPH_COEX_MODULE); +#endif if (ESP_OK != ret) { return ESP_FAIL; } From 06aa7e08021fa6177106dcd53a47748ced7bb394 Mon Sep 17 00:00:00 2001 From: liuning Date: Mon, 23 Sep 2024 20:18:43 +0800 Subject: [PATCH 39/56] fix(coex): fix some coexist debug issues --- components/esp_coex/Kconfig | 4 +- .../include/private/esp_coexist_debug.h | 11 +++- components/esp_coex/src/coexist_debug.c | 50 ++++++++++--------- 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/components/esp_coex/Kconfig b/components/esp_coex/Kconfig index 3494445ad4b5..c690ec5474c0 100644 --- a/components/esp_coex/Kconfig +++ b/components/esp_coex/Kconfig @@ -210,7 +210,7 @@ menu "Wireless Coexistence" default 12 if IDF_TARGET_ESP32S3 default 3 if IDF_TARGET_ESP32C2 default 22 if IDF_TARGET_ESP32C6 - default 16 if IDF_TARGET_ESP32C5 + default 10 if IDF_TARGET_ESP32C5 default 13 if IDF_TARGET_ESP32C61 default 11 @@ -224,7 +224,7 @@ menu "Wireless Coexistence" default 13 if IDF_TARGET_ESP32S3 default 2 if IDF_TARGET_ESP32C2 default 21 if IDF_TARGET_ESP32C6 - default 0 if IDF_TARGET_ESP32C5 + default 9 if IDF_TARGET_ESP32C5 default 12 if IDF_TARGET_ESP32C61 default 12 diff --git a/components/esp_coex/include/private/esp_coexist_debug.h b/components/esp_coex/include/private/esp_coexist_debug.h index 26147262c753..80bfbbd5aa6f 100644 --- a/components/esp_coex/include/private/esp_coexist_debug.h +++ b/components/esp_coex/include/private/esp_coexist_debug.h @@ -108,7 +108,7 @@ typedef enum { #endif /* wifi callback -> debug */ -void wifi_set_gpio_debug_cb(void (* cb)(int, int)); +void wifi_set_gpio_debug_cb(void (* cb)(int, coex_gpio_debug_sig_t)); int wifi_gpio_debug_max_event_get(void); /* functions to check if in ROM */ @@ -128,9 +128,10 @@ void pm_check_state(void); void pm_tx_null_data_done_process(void); void pm_start(void); void pm_stop(void); +void pm_disconnected_wake(void); /* coex callback -> debug */ -void coex_set_gpio_debug_cb(void (*cb)(int, int)); +void coex_set_gpio_debug_cb(void (*cb)(int, coex_gpio_debug_sig_t)); int coex_gpio_debug_max_event_get(void); esp_err_t coex_gpio_debug_matrix_init(void); @@ -142,4 +143,10 @@ void wifi_bind_io_to_evt(uint8_t io_idx, uint8_t evt); void coex_bind_io_to_evt(uint8_t io_idx, uint8_t evt); void diagram_bind_io_to_evt(void); +/* coex -> debug + * configure single gpio debug event */ +esp_err_t coex_gpio_debug_matrix_config(int event); +/* debug -> internal use */ +esp_err_t esp_coexist_gpio_debug_matrix_config(int event); + #endif diff --git a/components/esp_coex/src/coexist_debug.c b/components/esp_coex/src/coexist_debug.c index 7c38eea8e515..b0cc341313f6 100644 --- a/components/esp_coex/src/coexist_debug.c +++ b/components/esp_coex/src/coexist_debug.c @@ -13,37 +13,19 @@ #include "esp_attr.h" #include "esp_log.h" -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/rom/gpio.h" -#include "esp32/rom/ets_sys.h" -#elif defined(CONFIG_IDF_TARGET_ESP32S2) -#include "esp32s2/rom/gpio.h" -#include "esp32s2/rom/ets_sys.h" -#elif defined(CONFIG_IDF_TARGET_ESP32C3) -#include "esp32c3/rom/gpio.h" -#include "esp32c3/rom/ets_sys.h" -#elif defined(CONFIG_IDF_TARGET_ESP32C2) -#include "esp32c2/rom/gpio.h" -#include "esp32c2/rom/ets_sys.h" -#elif defined(CONFIG_IDF_TARGET_ESP32C6) -#include "esp32c6/rom/gpio.h" -#include "esp32c6/rom/ets_sys.h" -#elif defined(CONFIG_IDF_TARGET_ESP32C5) -#include "esp32c5/rom/gpio.h" -#include "esp32c5/rom/ets_sys.h" -#elif defined(CONFIG_IDF_TARGET_ESP32C61) -#include "esp32c61/rom/gpio.h" -#include "esp32c61/rom/ets_sys.h" -#endif +#include "rom/ets_sys.h" #include "driver/gpio.h" #include "soc/gpio_sig_map.h" #include "esp_rom_gpio.h" #include "soc/soc.h" +#if SOC_MODEM_CLOCK_IS_INDEPENDENT +#include "esp_private/esp_modem_clock.h" +#endif #if CONFIG_ESP_COEX_GPIO_DEBUG static char* TAG = "coexist debug"; -__attribute__((weak)) void wifi_set_gpio_debug_cb(void (* cb)(int, int)) +__attribute__((weak)) void wifi_set_gpio_debug_cb(void (* cb)(int, coex_gpio_debug_sig_t)) { ESP_LOGW(TAG, "Not support: %s", __FUNCTION__); } @@ -53,7 +35,7 @@ __attribute__((weak)) int wifi_gpio_debug_max_event_get(void) return 0; } -__attribute__((weak)) void coex_set_gpio_debug_cb(void (*cb)(int, int)) +__attribute__((weak)) void coex_set_gpio_debug_cb(void (*cb)(int, coex_gpio_debug_sig_t)) { ESP_LOGW(TAG, "Not support: %s", __FUNCTION__); } @@ -89,6 +71,7 @@ static const void* rom_funcs[] = { pm_tx_null_data_done_process, pm_start, pm_stop, + pm_disconnected_wake, #endif }; static const char* rom_funcs_name[] = { @@ -109,6 +92,7 @@ static const char* rom_funcs_name[] = { "pm_tx_null_data_done_process", "pm_start", "pm_stop", + "pm_disconnected_wake", #endif }; @@ -205,6 +189,18 @@ esp_err_t esp_coexist_debug_matrix_init(int evt, int sig, bool rev) return ESP_OK; } +esp_err_t esp_coexist_gpio_debug_matrix_config(int event) +{ +#if SOC_MODEM_CLOCK_IS_INDEPENDENT + modem_clock_module_enable(PERIPH_COEX_MODULE); +#endif + esp_err_t ret = coex_gpio_debug_matrix_config(event); +#if SOC_MODEM_CLOCK_IS_INDEPENDENT + modem_clock_module_disable(PERIPH_COEX_MODULE); +#endif + return ret; +} + esp_err_t esp_coexist_debug_init(void) { if (check_funcs_in_rom()) { @@ -268,8 +264,14 @@ esp_err_t esp_coexist_debug_init(void) gpio_set_level(s_io_nums[i], false); } +#if SOC_MODEM_CLOCK_IS_INDEPENDENT + modem_clock_module_enable(PERIPH_COEX_MODULE); +#endif /* Init coexist hardware signal */ ESP_ERROR_CHECK(coex_gpio_debug_matrix_init()); +#if SOC_MODEM_CLOCK_IS_INDEPENDENT + modem_clock_module_disable(PERIPH_COEX_MODULE); +#endif return ESP_OK; } From da34a49d5f361e5f2a89c801cb074174070612a9 Mon Sep 17 00:00:00 2001 From: liuning Date: Fri, 11 Oct 2024 15:53:55 +0800 Subject: [PATCH 40/56] fix(coex): fix esp32c5 coexist hw timer issue --- components/esp_coex/esp32c2/esp_coex_adapter.c | 6 ++++++ components/esp_coex/esp32c6/esp_coex_adapter.c | 6 ++++++ components/esp_coex/esp32h2/esp_coex_adapter.c | 6 ++++++ components/esp_coex/include/private/esp_coexist_adapter.h | 1 + 4 files changed, 19 insertions(+) diff --git a/components/esp_coex/esp32c2/esp_coex_adapter.c b/components/esp_coex/esp32c2/esp_coex_adapter.c index 4954fb9f8506..b98c9c94742d 100644 --- a/components/esp_coex/esp32c2/esp_coex_adapter.c +++ b/components/esp_coex/esp32c2/esp_coex_adapter.c @@ -152,6 +152,11 @@ static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev) #endif } +static IRAM_ATTR int esp_coex_common_xtal_freq_get_wrapper(void) +{ + return rtc_clk_xtal_freq_get(); +} + coex_adapter_funcs_t g_coex_adapter_funcs = { ._version = COEX_ADAPTER_VERSION, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, @@ -172,5 +177,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, + ._xtal_freq_get = esp_coex_common_xtal_freq_get_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_coex/esp32c6/esp_coex_adapter.c b/components/esp_coex/esp32c6/esp_coex_adapter.c index 81b4eef2b1e7..4b920ce15951 100644 --- a/components/esp_coex/esp32c6/esp_coex_adapter.c +++ b/components/esp_coex/esp32c6/esp_coex_adapter.c @@ -152,6 +152,11 @@ static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev) #endif } +static IRAM_ATTR int esp_coex_common_xtal_freq_get_wrapper(void) +{ + return rtc_clk_xtal_freq_get(); +} + coex_adapter_funcs_t g_coex_adapter_funcs = { ._version = COEX_ADAPTER_VERSION, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, @@ -171,5 +176,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, + ._xtal_freq_get = esp_coex_common_xtal_freq_get_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_coex/esp32h2/esp_coex_adapter.c b/components/esp_coex/esp32h2/esp_coex_adapter.c index f00cade6f6bd..1fa2243ae9ab 100644 --- a/components/esp_coex/esp32h2/esp_coex_adapter.c +++ b/components/esp_coex/esp32h2/esp_coex_adapter.c @@ -144,6 +144,11 @@ static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev) #endif } +static IRAM_ATTR int esp_coex_common_xtal_freq_get_wrapper(void) +{ + return rtc_clk_xtal_freq_get(); +} + coex_adapter_funcs_t g_coex_adapter_funcs = { ._version = COEX_ADAPTER_VERSION, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, @@ -163,5 +168,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, + ._xtal_freq_get = esp_coex_common_xtal_freq_get_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_coex/include/private/esp_coexist_adapter.h b/components/esp_coex/include/private/esp_coexist_adapter.h index aca50a6161a2..15e8ef7114fe 100644 --- a/components/esp_coex/include/private/esp_coexist_adapter.h +++ b/components/esp_coex/include/private/esp_coexist_adapter.h @@ -47,6 +47,7 @@ typedef struct { void (* _timer_setfn)(void *ptimer, void *pfunction, void *parg); void (* _timer_arm_us)(void *ptimer, uint32_t us, bool repeat); int (* _debug_matrix_init)(int event, int signal, bool rev); + int (* _xtal_freq_get)(void); int32_t _magic; } coex_adapter_funcs_t; From 97a5f94f0fe317bd7005990fd2aaf57091686767 Mon Sep 17 00:00:00 2001 From: liuning Date: Fri, 11 Oct 2024 15:55:28 +0800 Subject: [PATCH 41/56] fix(coex): sync up coex head file --- components/esp_coex/test_md5/test_md5.sh | 54 +++++++++++++++++++----- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/components/esp_coex/test_md5/test_md5.sh b/components/esp_coex/test_md5/test_md5.sh index 65a32ebb49cc..299b5798a2b1 100755 --- a/components/esp_coex/test_md5/test_md5.sh +++ b/components/esp_coex/test_md5/test_md5.sh @@ -32,40 +32,74 @@ case $IDF_TARGET in esac LIB_DIR=${IDF_TARGET} -ELF_FILE=test.elf +COEX_ELF_FILE=coex.elf +TEST_ELF_FILE=test.elf FAILURES=0 function check_md5() +{ + if [ "$1" != "$2" ]; then + echo " error: MD5 mismatch!" + FAILURES=$(($FAILURES+1)) + fi +} + +function check_md5_file_lib() { FILENAME=$1 SYMBOL=$2 - ${PREFIX}ld --unresolved-symbols=ignore-all --entry 0 -o ${ELF_FILE} \ + ${PREFIX}ld --unresolved-symbols=ignore-all --entry 0 -o ${COEX_ELF_FILE} \ -u ${SYMBOL} \ ${IDF_PATH}/components/esp_coex/lib/${LIB_DIR}/*.a GDB_COMMAND="printf \"%s\\n\", (const char*) ${SYMBOL}" - MD5_FROM_LIB=$(${PREFIX}gdb -n -batch ${ELF_FILE} -ex "${GDB_COMMAND}") + MD5_FROM_LIB=$(${PREFIX}gdb -n -batch ${COEX_ELF_FILE} -ex "${GDB_COMMAND}") MD5_FROM_HEADER=$(md5sum ${FILENAME} | cut -c 1-7) - echo "Checking ${FILENAME}:" echo " ${MD5_FROM_HEADER} - from header file" echo " ${MD5_FROM_LIB} - from library" - if [ "${MD5_FROM_LIB}" != "${MD5_FROM_HEADER}" ]; then - echo " error: MD5 mismatch!" - FAILURES=$(($FAILURES+1)) - fi + check_md5 ${MD5_FROM_HEADER} ${MD5_FROM_LIB} +} + +function check_md5_libs() +{ + COEX_SYMBOL=$1 + TEST_SYMBOL=$2 + TEST_PATH=$3 + + ${PREFIX}ld --unresolved-symbols=ignore-all --entry 0 -o ${COEX_ELF_FILE} \ + -u ${COEX_SYMBOL} \ + ${IDF_PATH}/components/esp_coex/lib/${LIB_DIR}/*.a + + ${PREFIX}ld --unresolved-symbols=ignore-all --entry 0 -o ${TEST_ELF_FILE} \ + -u ${TEST_SYMBOL} \ + ${TEST_PATH}/*.a + + COEX_GDB_COMMAND="printf \"%s\\n\", (const char*) ${COEX_SYMBOL}" + TEST_GDB_COMMAND="printf \"%s\\n\", (const char*) ${TEST_SYMBOL}" + COEX_MD5_FROM_LIB=$(${PREFIX}gdb -n -batch ${COEX_ELF_FILE} -ex "${COEX_GDB_COMMAND}") + TEST_MD5_FROM_LIB=$(${PREFIX}gdb -n -batch ${TEST_ELF_FILE} -ex "${TEST_GDB_COMMAND}") + + echo "Checking ${TEST_PATH}/${TEST_SYMBOL} " + echo " ${COEX_MD5_FROM_LIB} - from coexist library" + echo " ${TEST_MD5_FROM_LIB} - from test library" + check_md5 ${COEX_MD5_FROM_LIB} ${TEST_MD5_FROM_LIB} } echo "Checking libraries for target ${IDF_TARGET}..." -check_md5 ${IDF_PATH}/components/esp_coex/include/private/esp_coexist_adapter.h g_coex_adapter_funcs_md5 +check_md5_file_lib ${IDF_PATH}/components/esp_coex/include/private/esp_coexist_adapter.h g_coex_adapter_funcs_md5 case $IDF_TARGET in esp32c6|esp32h2) - check_md5 ${IDF_PATH}/components/esp_coex/include/esp_coex_i154.h g_coex_i154_funcs_md5 + check_md5_file_lib ${IDF_PATH}/components/esp_coex/include/esp_coex_i154.h g_coex_i154_funcs_md5 ;; esac +if [[ ! "$IDF_TARGET" =~ ^(esp32h2)$ ]]; then + check_md5_libs g_coex_basic_md5 g_wifi_coex_basic_md5 ${IDF_PATH}/components/esp_wifi/lib/${LIB_DIR} +fi + if [ $FAILURES -gt 0 ]; then exit 1 fi From aba50498083e844973a4a6b7edc3cb4a65d42942 Mon Sep 17 00:00:00 2001 From: liuning Date: Fri, 11 Oct 2024 17:57:14 +0800 Subject: [PATCH 42/56] fix(coex): fix esp32c2/esp32c5/esp32c61 coexist memory leakage issue --- components/esp_coex/lib | 2 +- components/esp_rom/esp32c2/ld/esp32c2.rom.ld | 2 +- components/esp_wifi/lib | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_coex/lib b/components/esp_coex/lib index d17141ba292d..97df1ca6cbfb 160000 --- a/components/esp_coex/lib +++ b/components/esp_coex/lib @@ -1 +1 @@ -Subproject commit d17141ba292d6a4b7434c5080cb0b0e7ce170fc8 +Subproject commit 97df1ca6cbfb8105ed3121e72a73591a36220b33 diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index c39235c06999..e4d9f199a3d1 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -799,7 +799,7 @@ dbg_lmac_rxtx_statis_dump = 0x40001e90; dbg_lmac_hw_statis_dump = 0x40001e94; dbg_lmac_diag_statis_dump = 0x40001e98; dbg_lmac_ps_statis_dump = 0x40001e9c; -pp_timer_do_process = 0x40001ea0; +/*pp_timer_do_process = 0x40001ea0;*/ rcUpdateAMPDUParam = 0x40001ea4; rcUpdatePhyMode = 0x40001ea8; rcGetHighestRateIdx = 0x40001eac; diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 7b8497e19252..eaa36d56a58b 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 7b8497e1925284a9e891ed535699c34fe486506f +Subproject commit eaa36d56a58ba6ab8d16ebce7683a3b93b690d41 From ca1e8810e1aa5419e70f721a90cb1e8688e6e4a1 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Tue, 12 Nov 2024 21:21:17 +0800 Subject: [PATCH 43/56] fix(esp_pm): fix missed ccompare update when another core is already in do_switch --- components/esp_pm/pm_impl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/esp_pm/pm_impl.c b/components/esp_pm/pm_impl.c index f58f79729ce6..65898ac083c6 100644 --- a/components/esp_pm/pm_impl.c +++ b/components/esp_pm/pm_impl.c @@ -612,6 +612,7 @@ static void IRAM_ATTR do_switch(pm_mode_t new_mode) } #ifdef CONFIG_FREERTOS_SYSTICK_USES_CCOUNT if (s_need_update_ccompare[core_id]) { + update_ccompare(); s_need_update_ccompare[core_id] = false; } #endif From fc71bdb6adbe6e05d796095cd85bd9fdd19d5f34 Mon Sep 17 00:00:00 2001 From: Abhinav Kudnar Date: Fri, 21 Jun 2024 17:41:30 +0530 Subject: [PATCH 44/56] fix(nimble): Nimble Error logs in case of memory overflow/failure --- components/bt/host/nimble/nimble | 2 +- components/bt/porting/mem/bt_osi_mem.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index e08302d66d77..0255fee0e641 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit e08302d66d77a29e65dffe2c336e4dcda4e80e51 +Subproject commit 0255fee0e6417595cb6e5a8affbc3562098647ce diff --git a/components/bt/porting/mem/bt_osi_mem.c b/components/bt/porting/mem/bt_osi_mem.c index 69c656dd6a9a..b5173fba792f 100644 --- a/components/bt/porting/mem/bt_osi_mem.c +++ b/components/bt/porting/mem/bt_osi_mem.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -7,18 +7,26 @@ #include "esp_attr.h" #include "esp_heap_caps.h" #include "sdkconfig.h" +#include "esp_log.h" +#include IRAM_ATTR void *bt_osi_mem_malloc(size_t size) { + void *mem = NULL; #ifdef CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL - return heap_caps_malloc(size, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT); + mem = heap_caps_malloc(size, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT); #elif CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL - return heap_caps_malloc(size, MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT); + mem = heap_caps_malloc(size, MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT); #elif CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_IRAM_8BIT - return heap_caps_malloc_prefer(size, 2, MALLOC_CAP_INTERNAL|MALLOC_CAP_IRAM_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT); + mem = heap_caps_malloc_prefer(size, 2, MALLOC_CAP_INTERNAL|MALLOC_CAP_IRAM_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT); #else - return malloc(size); + mem = malloc(size); #endif + if(!mem){ + ESP_LOGI("ESP_LOG_INFO","malloc failed (size %zu)",size); + assert(mem != NULL); + } + return mem; } IRAM_ATTR void *bt_osi_mem_calloc(size_t n, size_t size) From effce8fd46d1a0353eaeda413c6c76cea2707726 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Tue, 12 Nov 2024 22:04:08 +0800 Subject: [PATCH 45/56] fix(esp_pm): fix deadlock in pm_mode switching --- components/esp_pm/pm_impl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/esp_pm/pm_impl.c b/components/esp_pm/pm_impl.c index 65898ac083c6..0ec103d23938 100644 --- a/components/esp_pm/pm_impl.c +++ b/components/esp_pm/pm_impl.c @@ -94,6 +94,9 @@ #endif static portMUX_TYPE s_switch_lock = portMUX_INITIALIZER_UNLOCKED; +static portMUX_TYPE s_cpu_freq_switch_lock[portNUM_PROCESSORS] = { + [0 ... (portNUM_PROCESSORS - 1)] = portMUX_INITIALIZER_UNLOCKED +}; /* The following state variables are protected using s_switch_lock: */ /* Current sleep mode; When switching, contains old mode until switch is complete */ static pm_mode_t s_mode = PM_MODE_CPU_MAX; @@ -625,6 +628,7 @@ static void IRAM_ATTR do_switch(pm_mode_t new_mode) s_is_switching = true; bool config_changed = s_config_changed; s_config_changed = false; + portENTER_CRITICAL_ISR(&s_cpu_freq_switch_lock[core_id]); portEXIT_CRITICAL_ISR(&s_switch_lock); rtc_cpu_freq_config_t new_config = s_cpu_freq_by_mode[new_mode]; @@ -664,6 +668,7 @@ static void IRAM_ATTR do_switch(pm_mode_t new_mode) } portENTER_CRITICAL_ISR(&s_switch_lock); + portEXIT_CRITICAL_ISR(&s_cpu_freq_switch_lock[core_id]); s_mode = new_mode; s_is_switching = false; portEXIT_CRITICAL_ISR(&s_switch_lock); From dc99a90d4c41a66619e7beaf5006d71ea2c8c579 Mon Sep 17 00:00:00 2001 From: yiwenxiu Date: Thu, 14 Nov 2024 14:55:33 +0800 Subject: [PATCH 46/56] feat(openthread): flush ipv6 addr in openthread ci cases --- examples/openthread/ot_ci_function.py | 20 ++++++++++++++++++++ examples/openthread/pytest_otbr.py | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/examples/openthread/ot_ci_function.py b/examples/openthread/ot_ci_function.py index cb5385433efe..b640f1655fa6 100644 --- a/examples/openthread/ot_ci_function.py +++ b/examples/openthread/ot_ci_function.py @@ -441,6 +441,26 @@ def get_domain() -> str: return str(role) +def flush_ipv6_addr_by_interface() -> None: + interface_name = get_host_interface_name() + print(f'flush ipv6 addr : {interface_name}') + command_show_addr = f'ip -6 addr show dev {interface_name}' + command_show_route = f'ip -6 route show dev {interface_name}' + addr_before = subprocess.getoutput(command_show_addr) + route_before = subprocess.getoutput(command_show_route) + print(f'Before flush, IPv6 addresses: \n{addr_before}') + print(f'Before flush, IPv6 routes: \n{route_before}') + subprocess.run(['ip', 'link', 'set', interface_name, 'down']) + subprocess.run(['ip', '-6', 'addr', 'flush', 'dev', interface_name]) + subprocess.run(['ip', '-6', 'route', 'flush', 'dev', interface_name]) + subprocess.run(['ip', 'link', 'set', interface_name, 'up']) + time.sleep(5) + addr_after = subprocess.getoutput(command_show_addr) + route_after = subprocess.getoutput(command_show_route) + print(f'After flush, IPv6 addresses: \n{addr_after}') + print(f'After flush, IPv6 routes: \n{route_after}') + + class tcp_parameter: def __init__(self, tcp_type:str='', addr:str='::', port:int=12345, listen_flag:bool=False, recv_flag:bool=False, timeout:float=15.0, tcp_bytes:bytes=b''): diff --git a/examples/openthread/pytest_otbr.py b/examples/openthread/pytest_otbr.py index e2eaed76e54e..0af1b36e4281 100644 --- a/examples/openthread/pytest_otbr.py +++ b/examples/openthread/pytest_otbr.py @@ -74,8 +74,8 @@ def fixture_Init_avahi() -> bool: @pytest.fixture(name='Init_interface') def fixture_Init_interface() -> bool: print('Init interface') - ocf.init_interface_ipv6_address() - ocf.reset_host_interface() + ocf.flush_ipv6_addr_by_interface() + # The sleep time is set based on experience; reducing it might cause the host to be unready. time.sleep(30) ocf.set_interface_sysctl_options() return True From 1608b89ff0e2a1f75b90a9608c20eaa5a0b84e3c Mon Sep 17 00:00:00 2001 From: "nilesh.kale" Date: Mon, 14 Oct 2024 17:08:51 +0530 Subject: [PATCH 47/56] fix(esp_http_client): Fix ota failure with openssl server If the TLS server (e.g., openssl) closes connection with encrypted close-notify alert then `errno` is not explicitly set on the socket by LwIP stack. For this scenario, we must rely only on `ERR_TCP_TRANSPORT_CONNECTION_CLOSED_BY_FIN` return value as the connection close case and do the graceful connection closure. Closes https://github.com/espressif/esp-idf/issues/14724 --- components/esp_http_client/esp_http_client.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/components/esp_http_client/esp_http_client.c b/components/esp_http_client/esp_http_client.c index 375a7b213d06..6095490fb697 100644 --- a/components/esp_http_client/esp_http_client.c +++ b/components/esp_http_client/esp_http_client.c @@ -1192,15 +1192,15 @@ int esp_http_client_read(esp_http_client_handle_t client, char *buffer, int len) ESP_LOGD(TAG, "need_read=%d, byte_to_read=%d, rlen=%d, ridx=%d", need_read, byte_to_read, rlen, ridx); if (rlen <= 0) { + esp_log_level_t sev = ESP_LOG_WARN; + /* Check for cleanly closed connection */ + if (rlen == ERR_TCP_TRANSPORT_CONNECTION_CLOSED_BY_FIN && client->response->is_chunked) { + /* Explicit call to parser for invoking `message_complete` callback */ + http_parser_execute(client->parser, client->parser_settings, res_buffer->data, 0); + /* ...and lowering the message severity, as closed connection from server side is expected in chunked transport */ + sev = ESP_LOG_DEBUG; + } if (errno != 0) { - esp_log_level_t sev = ESP_LOG_WARN; - /* Check for cleanly closed connection */ - if (rlen == ERR_TCP_TRANSPORT_CONNECTION_CLOSED_BY_FIN && client->response->is_chunked) { - /* Explicit call to parser for invoking `message_complete` callback */ - http_parser_execute(client->parser, client->parser_settings, res_buffer->data, 0); - /* ...and lowering the message severity, as closed connection from server side is expected in chunked transport */ - sev = ESP_LOG_DEBUG; - } ESP_LOG_LEVEL(sev, TAG, "esp_transport_read returned:%d and errno:%d ", rlen, errno); } From 78a4ea29f3cd6b3ce0772eb7a6ee87003cb2d9b6 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Tue, 29 Oct 2024 11:56:16 +0800 Subject: [PATCH 48/56] feat(openthread): update openthread submodule and border router lib --- .../include/esp_openthread_border_router.h | 10 +++++ .../openthread/include/esp_openthread_types.h | 2 + .../openthread/include/esp_radio_spinel.h | 11 ++++++ .../include/esp_radio_spinel_platform.h | 28 ++++++++++++++ components/openthread/lib | 2 +- components/openthread/openthread | 2 +- .../openthread-core-esp32x-ftd-config.h | 10 +++++ .../openthread-core-esp32x-spinel-config.h | 21 +++++++++- .../src/esp_openthread_netif_glue.c | 15 ++++++++ .../src/port/esp_openthread_radio_spinel.cpp | 27 +++++++++++-- .../src/spinel/esp_radio_spinel.cpp | 38 ++++++++++++++++++- examples/openthread/ot_ci_function.py | 2 +- 12 files changed, 158 insertions(+), 10 deletions(-) create mode 100644 components/openthread/include/esp_radio_spinel_platform.h diff --git a/components/openthread/include/esp_openthread_border_router.h b/components/openthread/include/esp_openthread_border_router.h index de4b8ee6048b..8960fc861d58 100644 --- a/components/openthread/include/esp_openthread_border_router.h +++ b/components/openthread/include/esp_openthread_border_router.h @@ -66,6 +66,16 @@ esp_netif_t *esp_openthread_get_backbone_netif(void); */ void esp_openthread_register_rcp_failure_handler(esp_openthread_rcp_failure_handler handler); +/** + * @brief Registers the callback for spinel compatibility error. + * + * @note This function must be called before esp_openthread_init. + * + * @param[in] callback The callback. + * + */ +void esp_openthread_set_compatibility_error_callback(esp_openthread_compatibility_error_callback callback); + /** * @brief Deinitializes the connection to RCP. * diff --git a/components/openthread/include/esp_openthread_types.h b/components/openthread/include/esp_openthread_types.h index debc464066dc..ce1d258a3dce 100644 --- a/components/openthread/include/esp_openthread_types.h +++ b/components/openthread/include/esp_openthread_types.h @@ -200,6 +200,8 @@ typedef struct { typedef void (*esp_openthread_rcp_failure_handler)(void); +typedef void (*esp_openthread_compatibility_error_callback)(void); + #ifdef __cplusplus } #endif diff --git a/components/openthread/include/esp_radio_spinel.h b/components/openthread/include/esp_radio_spinel.h index d9b08529e6f4..66924e9e709c 100644 --- a/components/openthread/include/esp_radio_spinel.h +++ b/components/openthread/include/esp_radio_spinel.h @@ -47,6 +47,7 @@ typedef struct { typedef void (*esp_radio_spinel_rcp_failure_handler)(void); /* The handler for rcp failure.*/ typedef esp_err_t (*esp_radio_spinel_uart_init_handler)(const esp_radio_spinel_uart_config_t *uart_config_t, int *uart_fd); /* The handler for UART initialization.*/ typedef esp_err_t (*esp_radio_spinel_uart_deinit_handler)(const esp_radio_spinel_uart_config_t *uart_config_t, int *uart_fd); /* The handler for UART deinitialization.*/ +typedef void (*esp_radio_spinel_compatibility_error_callback)(void); typedef struct { @@ -392,6 +393,16 @@ esp_err_t esp_radio_spinel_rcp_deinit(esp_radio_spinel_idx_t idx); */ esp_err_t esp_radio_spinel_rcp_version_get(char *running_rcp_version, esp_radio_spinel_idx_t idx); +/** + * @brief Registers the callback for spinel compatibility error. + * + * @note This function must be called before esp_radio_spinel_init. + * + * @param[in] callback The callback. + * + */ +void esp_radio_spinel_set_compatibility_error_callback(esp_radio_spinel_compatibility_error_callback callback); + #ifdef __cplusplus } #endif diff --git a/components/openthread/include/esp_radio_spinel_platform.h b/components/openthread/include/esp_radio_spinel_platform.h new file mode 100644 index 000000000000..d6ce8717161b --- /dev/null +++ b/components/openthread/include/esp_radio_spinel_platform.h @@ -0,0 +1,28 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "sdkconfig.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get frame counter. + * + * @param[in] idx The index of 802.15.4 related protocol stack. + * + * @return + * - The frame counter + * + */ +uint32_t esp_radio_spinel_extern_get_frame_counter(esp_radio_spinel_idx_t idx); + +#ifdef __cplusplus +} +#endif diff --git a/components/openthread/lib b/components/openthread/lib index 203c78501e9a..55f18e4cc6a2 160000 --- a/components/openthread/lib +++ b/components/openthread/lib @@ -1 +1 @@ -Subproject commit 203c78501e9a6ea9ca3a929e6f9b6b9691ef16ee +Subproject commit 55f18e4cc6a249974247fd408aad79b1049d4b31 diff --git a/components/openthread/openthread b/components/openthread/openthread index f32c18bc0840..005c5cefc22a 160000 --- a/components/openthread/openthread +++ b/components/openthread/openthread @@ -1 +1 @@ -Subproject commit f32c18bc0840f400182456e58ae3900fc2fb4af7 +Subproject commit 005c5cefc22aaf0396e4327ee7f2e0ad32a7733b diff --git a/components/openthread/private_include/openthread-core-esp32x-ftd-config.h b/components/openthread/private_include/openthread-core-esp32x-ftd-config.h index ec9480150594..42ea9d9546c6 100644 --- a/components/openthread/private_include/openthread-core-esp32x-ftd-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-ftd-config.h @@ -261,6 +261,16 @@ #define OPENTHREAD_POSIX_CONFIG_RCP_TIME_SYNC_INTERVAL (60 * 1000 * 1000) #endif +/** + * @def OPENTHREAD_SPINEL_CONFIG_COMPATIBILITY_ERROR_CALLBACK_ENABLE + * + * Enables compatibility error callback in Spinel + */ +#ifndef OPENTHREAD_SPINEL_CONFIG_COMPATIBILITY_ERROR_CALLBACK_ENABLE +#define OPENTHREAD_SPINEL_CONFIG_COMPATIBILITY_ERROR_CALLBACK_ENABLE 1 +#endif + + #endif /** diff --git a/components/openthread/private_include/openthread-core-esp32x-spinel-config.h b/components/openthread/private_include/openthread-core-esp32x-spinel-config.h index 3c9def784040..0b257baebae9 100644 --- a/components/openthread/private_include/openthread-core-esp32x-spinel-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-spinel-config.h @@ -41,7 +41,6 @@ * */ #ifndef OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT -// TZ-567: Set OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT to 3 after adding rcp failure notification mechanism #define OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT 3 #endif @@ -77,3 +76,23 @@ #ifndef OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT #define OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT CONFIG_OPENTHREAD_MAC_MAX_CSMA_BACKOFFS_DIRECT #endif + + +/** + * @def OPENTHREAD_SPINEL_CONFIG_COMPATIBILITY_ERROR_CALLBACK_ENABLE + * + * Enables compatibility error callback in Spinel + */ +#ifndef OPENTHREAD_SPINEL_CONFIG_COMPATIBILITY_ERROR_CALLBACK_ENABLE +#define OPENTHREAD_SPINEL_CONFIG_COMPATIBILITY_ERROR_CALLBACK_ENABLE 1 +#endif + +/** + * @def OPENTHREAD_SPINEL_CONFIG_MAX_SRC_MATCH_ENTRIES + * + * Defines size of the local source match table used by RadioSpinel + * when OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT is used. + */ +#ifndef OPENTHREAD_SPINEL_CONFIG_MAX_SRC_MATCH_ENTRIES +#define OPENTHREAD_SPINEL_CONFIG_MAX_SRC_MATCH_ENTRIES 12 +#endif diff --git a/components/openthread/src/esp_openthread_netif_glue.c b/components/openthread/src/esp_openthread_netif_glue.c index e7184698682c..dd623aa5f783 100644 --- a/components/openthread/src/esp_openthread_netif_glue.c +++ b/components/openthread/src/esp_openthread_netif_glue.c @@ -16,6 +16,7 @@ #include "esp_log.h" #include "esp_netif.h" #include "esp_openthread.h" +#include "esp_openthread_border_router.h" #include "esp_openthread_common_macro.h" #include "esp_openthread_lock.h" #include "esp_openthread_netif_glue_priv.h" @@ -33,6 +34,7 @@ #include "openthread/ip6.h" #include "openthread/link.h" #include "openthread/message.h" +#include "openthread/platform/infra_if.h" #include "openthread/thread.h" typedef struct { @@ -381,3 +383,16 @@ esp_netif_t *esp_openthread_get_netif(void) { return s_openthread_netif; } + +otError otPlatGetInfraIfLinkLayerAddress(otInstance *aInstance, uint32_t aIfIndex, otPlatInfraIfLinkLayerAddress *aInfraIfLinkLayerAddress) +{ + esp_netif_t *backbone_netif = esp_openthread_get_backbone_netif(); + if (esp_netif_get_netif_impl_index(backbone_netif) != aIfIndex) { + ESP_LOGE(OT_PLAT_LOG_TAG, "Failed to get LL address, error: Invalid If index"); + return OT_ERROR_FAILED; + } else { + esp_netif_get_mac(backbone_netif, aInfraIfLinkLayerAddress->mAddress); + aInfraIfLinkLayerAddress->mLength = 6; + return OT_ERROR_NONE; + } +} diff --git a/components/openthread/src/port/esp_openthread_radio_spinel.cpp b/components/openthread/src/port/esp_openthread_radio_spinel.cpp index b851c5608b51..67cb2bb66ae4 100644 --- a/components/openthread/src/port/esp_openthread_radio_spinel.cpp +++ b/components/openthread/src/port/esp_openthread_radio_spinel.cpp @@ -54,6 +54,8 @@ static const char *radiospinel_workflow = "radio_spinel"; static const esp_openthread_radio_config_t *s_esp_openthread_radio_config = NULL; +static esp_openthread_compatibility_error_callback s_compatibility_error_callback = NULL; + static void esp_openthread_radio_config_set(const esp_openthread_radio_config_t *config) { s_esp_openthread_radio_config = config; @@ -64,6 +66,22 @@ static const esp_openthread_radio_config_t *esp_openthread_radio_config_get(void return s_esp_openthread_radio_config; } +static void ot_spinel_compatibility_error_callback(void *context) +{ + OT_UNUSED_VARIABLE(context); + if (s_compatibility_error_callback) { + s_compatibility_error_callback(); + } else { + ESP_LOGE(OT_PLAT_LOG_TAG, "None callback to handle compatibility error of openthread spinel"); + assert(false); + } +} + +void esp_openthread_set_compatibility_error_callback(esp_openthread_compatibility_error_callback callback) +{ + s_compatibility_error_callback = callback; +} + esp_err_t esp_openthread_radio_init(const esp_openthread_platform_config_t *config) { spinel_iid_t iidList[ot::Spinel::kSpinelHeaderMaxNumIid]; @@ -89,7 +107,8 @@ esp_err_t esp_openthread_radio_init(const esp_openthread_platform_config_t *conf "Spinel interface init failed"); #endif s_spinel_driver.Init(s_spinel_interface.GetSpinelInterface(), true, iidList, ot::Spinel::kSpinelHeaderMaxNumIid); - s_radio.Init(/*skip_rcp_compatibility_check=*/false, /*reset_radio=*/true, &s_spinel_driver, s_radio_caps); + s_radio.SetCompatibilityErrorCallback(ot_spinel_compatibility_error_callback, esp_openthread_get_instance()); + s_radio.Init(/*skip_rcp_compatibility_check=*/false, /*reset_radio=*/true, &s_spinel_driver, s_radio_caps, /*RCP_time_sync=*/true); #if CONFIG_OPENTHREAD_RADIO_SPINEL_SPI // CONFIG_OPENTHREAD_RADIO_SPINEL_SPI ESP_RETURN_ON_ERROR(s_spinel_interface.GetSpinelInterface().AfterRadioInit(), OT_PLAT_LOG_TAG, "Spinel interface init failed"); #endif @@ -336,15 +355,15 @@ void otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCoun } #if CONFIG_OPENTHREAD_DIAG -otError otPlatDiagProcess(otInstance *instance, int argc, char *argv[], char *output, size_t output_max_len) +otError otPlatDiagProcess(otInstance *aInstance, uint8_t aArgsLength, char *aArgs[]) { // deliver the platform specific diags commands to radio only ncp. char cmd[OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE] = {'\0'}; char *cur = cmd; char *end = cmd + sizeof(cmd); - for (int index = 0; index < argc; index++) { - cur += snprintf(cur, static_cast(end - cur), "%s ", argv[index]); + for (int index = 0; index < aArgsLength; index++) { + cur += snprintf(cur, static_cast(end - cur), "%s ", aArgs[index]); } return s_radio.PlatDiagProcess(cmd); diff --git a/components/openthread/src/spinel/esp_radio_spinel.cpp b/components/openthread/src/spinel/esp_radio_spinel.cpp index fbf794046df9..79ae1efbe772 100644 --- a/components/openthread/src/spinel/esp_radio_spinel.cpp +++ b/components/openthread/src/spinel/esp_radio_spinel.cpp @@ -10,9 +10,11 @@ #include "platform/exit_code.h" #include "radio_spinel.hpp" #include "esp_radio_spinel.h" +#include "esp_radio_spinel_platform.h" #include "esp_radio_spinel_adapter.hpp" #include "esp_radio_spinel_uart_interface.hpp" #include "spinel_driver.hpp" +#include "openthread/link.h" #define SPINEL_VENDOR_PROPERTY_BIT_PENDINGMODE BIT(0) #define SPINEL_VENDOR_PROPERTY_BIT_COORDINATOR BIT(1) @@ -39,6 +41,8 @@ static otRadioCaps s_radio_caps = (OT_RADIO_CAPS_ENERGY_SCAN | OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_SLEEP_TO_TX); +static esp_radio_spinel_compatibility_error_callback s_radio_spinel_compatibility_error_callback = NULL; + static esp_radio_spinel_idx_t get_index_from_instance(otInstance *instance) { // TZ-563: Implement the function to get the esp radio spinel idx from otInstance for multipan rcp @@ -67,6 +71,22 @@ static void esp_radio_spinel_restore_vendor_properities(void *context) } } +static void radio_spinel_compatibility_error_callback(void *context) +{ + OT_UNUSED_VARIABLE(context); + if (s_radio_spinel_compatibility_error_callback) { + s_radio_spinel_compatibility_error_callback(); + } else { + ESP_LOGE(ESP_SPINEL_LOG_TAG, "None callback to handle compatibility error of openthread spinel"); + assert(false); + } +} + +void esp_openthread_set_compatibility_error_callback(esp_radio_spinel_compatibility_error_callback callback) +{ + s_radio_spinel_compatibility_error_callback = callback; +} + void ReceiveDone(otInstance *aInstance, otRadioFrame *aFrame, otError aError) { esp_radio_spinel_idx_t idx = get_index_from_instance(aInstance); @@ -242,12 +262,13 @@ esp_err_t esp_radio_spinel_uart_interface_enable(const esp_radio_spinel_uart_con void esp_radio_spinel_init(esp_radio_spinel_idx_t idx) { spinel_iid_t iidList[ot::Spinel::kSpinelHeaderMaxNumIid]; + otInstance *instance = get_instance_from_index(idx); // Multipan is not currently supported iidList[0] = 0; s_spinel_driver[idx].Init(s_spinel_interface[idx].GetSpinelInterface(), true, iidList, ot::Spinel::kSpinelHeaderMaxNumIid); - s_radio[idx].Init(/*skip_rcp_compatibility_check=*/false, /*reset_radio=*/true, &s_spinel_driver[idx], s_radio_caps); - otInstance *instance = get_instance_from_index(idx); + s_radio[idx].SetCompatibilityErrorCallback(radio_spinel_compatibility_error_callback, instance); + s_radio[idx].Init(/*skip_rcp_compatibility_check=*/false, /*reset_radio=*/true, &s_spinel_driver[idx], s_radio_caps, false); s_radio[idx].SetVendorRestorePropertiesCallback(esp_radio_spinel_restore_vendor_properities, instance); } @@ -405,6 +426,19 @@ esp_err_t esp_radio_spinel_set_rcp_ready(esp_radio_spinel_idx_t idx) return ESP_OK; } +// TZ-1261 +uint32_t otLinkGetFrameCounter(otInstance *aInstance) +{ + esp_radio_spinel_idx_t idx = get_index_from_instance(aInstance); + return esp_radio_spinel_extern_get_frame_counter(idx); +} + +__attribute__((weak)) uint32_t esp_radio_spinel_extern_get_frame_counter(esp_radio_spinel_idx_t idx) +{ + ESP_LOGW(ESP_SPINEL_LOG_TAG, "None function to get frame counter"); + return 0; +} + namespace ot { namespace Spinel { diff --git a/examples/openthread/ot_ci_function.py b/examples/openthread/ot_ci_function.py index b640f1655fa6..98819499c479 100644 --- a/examples/openthread/ot_ci_function.py +++ b/examples/openthread/ot_ci_function.py @@ -144,7 +144,7 @@ def changeDeviceRole(dut:IdfDut, role:str) -> None: def getDataset(dut:IdfDut) -> str: clean_buffer(dut) execute_command(dut, 'dataset active -x') - dut_data = dut.expect(r'\n(\w{212})\r', timeout=5)[1].decode() + dut_data = dut.expect(r'\n(\w+)\r', timeout=5)[1].decode() return str(dut_data) From aa67538038bbcdb02b3e17cf38824d2558bbab78 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Fri, 27 Sep 2024 15:44:24 +0800 Subject: [PATCH 49/56] fix(coex): fix 802.15.4 external coexistence --- components/esp_coex/include/esp_coex_i154.h | 2 ++ components/esp_coex/lib | 2 +- .../ieee802154/driver/esp_ieee802154_dev.c | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/components/esp_coex/include/esp_coex_i154.h b/components/esp_coex/include/esp_coex_i154.h index 942de3561397..b8cb8171e689 100644 --- a/components/esp_coex/include/esp_coex_i154.h +++ b/components/esp_coex/include/esp_coex_i154.h @@ -18,6 +18,8 @@ typedef enum { void esp_coex_ieee802154_txrx_pti_set(ieee802154_coex_event_t event); void esp_coex_ieee802154_ack_pti_set(ieee802154_coex_event_t event); void esp_coex_ieee802154_coex_break_notify(void); +void esp_coex_ieee802154_extcoex_tx_stage(void); +void esp_coex_ieee802154_extcoex_rx_stage(void); #endif #endif diff --git a/components/esp_coex/lib b/components/esp_coex/lib index 97df1ca6cbfb..b6082e49c47f 160000 --- a/components/esp_coex/lib +++ b/components/esp_coex/lib @@ -1 +1 @@ -Subproject commit 97df1ca6cbfb8105ed3121e72a73591a36220b33 +Subproject commit b6082e49c47f42cf43db7dad7eac395365912b5a diff --git a/components/ieee802154/driver/esp_ieee802154_dev.c b/components/ieee802154/driver/esp_ieee802154_dev.c index 6801fe63e86e..7e80e998196b 100644 --- a/components/ieee802154/driver/esp_ieee802154_dev.c +++ b/components/ieee802154/driver/esp_ieee802154_dev.c @@ -341,8 +341,23 @@ IEEE802154_NOINLINE IEEE802154_STATIC bool stop_current_operation(void) return true; } +FORCE_INLINE_ATTR void extcoex_tx_stage_start(void) +{ +#if CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE + esp_coex_ieee802154_extcoex_tx_stage(); +#endif +} + +FORCE_INLINE_ATTR void extcoex_rx_stage_start(void) +{ +#if CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE + esp_coex_ieee802154_extcoex_rx_stage(); +#endif +} + static void enable_rx(void) { + extcoex_rx_stage_start(); set_next_rx_buffer(); IEEE802154_SET_TXRX_PTI(IEEE802154_SCENE_RX); @@ -403,6 +418,7 @@ static IRAM_ATTR void isr_handle_tx_done(void) NEEDS_NEXT_OPT(true); } else if (s_ieee802154_state == IEEE802154_STATE_TX || s_ieee802154_state == IEEE802154_STATE_TX_CCA) { if (ieee802154_frame_is_ack_required(s_tx_frame) && ieee802154_ll_get_rx_auto_ack()) { + extcoex_rx_stage_start(); ieee802154_set_state(IEEE802154_STATE_RX_ACK); #if !CONFIG_IEEE802154_TEST receive_ack_timeout_timer_start(200000); // 200ms for receive ack timeout @@ -423,6 +439,7 @@ static IRAM_ATTR void isr_handle_rx_done(void) if (s_ieee802154_state == IEEE802154_STATE_RX) { if (ieee802154_frame_is_ack_required(s_rx_frame[s_rx_index]) && ieee802154_frame_get_version(s_rx_frame[s_rx_index]) <= IEEE802154_FRAME_VERSION_1 && ieee802154_ll_get_tx_auto_ack()) { + extcoex_tx_stage_start(); // auto tx ack only works for the frame with version 0b00 and 0b01 s_rx_frame_info[s_rx_index].pending = ieee802154_ack_config_pending_bit(s_rx_frame[s_rx_index]); ieee802154_set_state(IEEE802154_STATE_TX_ACK); @@ -432,6 +449,7 @@ static IRAM_ATTR void isr_handle_rx_done(void) s_rx_frame_info[s_rx_index].pending = ieee802154_ack_config_pending_bit(s_rx_frame[s_rx_index]); // For 2015 enh-ack, SW should generate an enh-ack then send it manually if (esp_ieee802154_enh_ack_generator(s_rx_frame[s_rx_index], &s_rx_frame_info[s_rx_index], s_enh_ack_frame) == ESP_OK) { + extcoex_tx_stage_start(); #if !CONFIG_IEEE802154_TEST // Send the Enh-Ack frame if generator succeeds. ieee802154_ll_set_tx_addr(s_enh_ack_frame); @@ -456,6 +474,7 @@ static IRAM_ATTR void isr_handle_rx_done(void) static IRAM_ATTR void isr_handle_ack_tx_done(void) { + extcoex_rx_stage_start(); ieee802154_receive_done((uint8_t *)s_rx_frame[s_rx_index], &s_rx_frame_info[s_rx_index]); NEEDS_NEXT_OPT(true); } @@ -831,6 +850,7 @@ IEEE802154_STATIC void tx_init(const uint8_t *frame) // set rx pointer for ack frame set_next_rx_buffer(); } + extcoex_tx_stage_start(); } static inline esp_err_t ieee802154_transmit_internal(const uint8_t *frame, bool cca) From d7f69d03c0666e0b89e791f7c3fcf76e8b08335c Mon Sep 17 00:00:00 2001 From: zwx Date: Mon, 9 Sep 2024 20:38:29 +0800 Subject: [PATCH 50/56] feat(openthread): support alloc nat64 session from psram --- components/openthread/Kconfig | 18 +++++++++++----- .../private_include/esp_openthread_common.hpp | 21 +++++++++++++++++++ .../private_include/esp_openthread_platform.h | 13 ++++++++++-- .../src/esp_openthread_platform.cpp | 10 +++++++++ 4 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 components/openthread/private_include/esp_openthread_common.hpp diff --git a/components/openthread/Kconfig b/components/openthread/Kconfig index df26b9a86959..a718dba2f5fc 100644 --- a/components/openthread/Kconfig +++ b/components/openthread/Kconfig @@ -278,12 +278,20 @@ menu "OpenThread" help Select this option to enable border router features in OpenThread. - config OPENTHREAD_PLATFORM_MSGPOOL_MANAGEMENT - bool 'Allocate message pool buffer from PSRAM' + menu "Thread Memory Allocation Config" depends on OPENTHREAD_ENABLED && (SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC) - default n - help - If enabled, the message pool is managed by platform defined logic. + config OPENTHREAD_MEM_ALLOC_EXTERNAL + bool 'Allocate memory from PSRAM' + default y + help + Select this option to allocate buffer from PSRAM for Thread + + config OPENTHREAD_PLATFORM_MSGPOOL_MANAGEMENT + bool 'Allocate message pool buffer from PSRAM' + default n + help + If enabled, the message pool is managed by platform defined logic. + endmenu config OPENTHREAD_NUM_MESSAGE_BUFFERS int "The number of openthread message buffers" diff --git a/components/openthread/private_include/esp_openthread_common.hpp b/components/openthread/private_include/esp_openthread_common.hpp new file mode 100644 index 000000000000..c4dbf749ee8c --- /dev/null +++ b/components/openthread/private_include/esp_openthread_common.hpp @@ -0,0 +1,21 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "esp_heap_caps.h" +#include +#include "common/new.hpp" + +template +inline T *New(uint32_t alloc_caps, Args &&...args) +{ + void *p = heap_caps_calloc(1, sizeof(T), alloc_caps); + if (p != nullptr) { + return new (p) T(std::forward(args)...); + } + return nullptr; +} diff --git a/components/openthread/private_include/esp_openthread_platform.h b/components/openthread/private_include/esp_openthread_platform.h index 6919e914be29..3999322a8d1b 100644 --- a/components/openthread/private_include/esp_openthread_platform.h +++ b/components/openthread/private_include/esp_openthread_platform.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -84,7 +84,7 @@ void esp_openthread_platform_workflow_unregister(const char *name); * @brief Initializes the platform-specific support for the OpenThread stack. * * @note This function is not called by and will not call the OpenThread library. - * The user needs to call otInstanceInitSingle to intialize the OpenThread + * The user needs to call otInstanceInitSingle to initialize the OpenThread * stack after calling this function. * * @param[in] init_config The initialization configuration. @@ -146,6 +146,15 @@ esp_err_t esp_openthread_platform_process(otInstance *instance, const esp_openth * */ void esp_openthread_set_storage_name(const char *name); + +/** + * @brief Gets the caps of memory allocation. + * + * @return + * - The caps of the memory. + */ +uint32_t esp_openthread_get_alloc_caps(void); + #ifdef __cplusplus } // end of extern "C" #endif diff --git a/components/openthread/src/esp_openthread_platform.cpp b/components/openthread/src/esp_openthread_platform.cpp index 8beb8143dc4a..51bfd7790427 100644 --- a/components/openthread/src/esp_openthread_platform.cpp +++ b/components/openthread/src/esp_openthread_platform.cpp @@ -204,3 +204,13 @@ esp_err_t esp_openthread_platform_process(otInstance *instance, const esp_openth } return ESP_OK; } + +uint32_t esp_openthread_get_alloc_caps(void) +{ + return +#if CONFIG_OPENTHREAD_PLATFORM_MALLOC_CAP_SPIRAM + (MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); +#else + (MALLOC_CAP_DEFAULT | MALLOC_CAP_8BIT); +#endif +} From eaa23bc704e3cb5064d13168eb688781626e11d7 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Wed, 20 Nov 2024 15:36:28 +0800 Subject: [PATCH 51/56] fix(openthread): fix a naming error of esp radio spinel --- components/openthread/src/spinel/esp_radio_spinel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/openthread/src/spinel/esp_radio_spinel.cpp b/components/openthread/src/spinel/esp_radio_spinel.cpp index 79ae1efbe772..4674e7731226 100644 --- a/components/openthread/src/spinel/esp_radio_spinel.cpp +++ b/components/openthread/src/spinel/esp_radio_spinel.cpp @@ -82,7 +82,7 @@ static void radio_spinel_compatibility_error_callback(void *context) } } -void esp_openthread_set_compatibility_error_callback(esp_radio_spinel_compatibility_error_callback callback) +void esp_radio_spinel_set_compatibility_error_callback(esp_radio_spinel_compatibility_error_callback callback) { s_radio_spinel_compatibility_error_callback = callback; } From 72a74a622b30a7475798ec0b9b7cd09cd015380e Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Fri, 8 Nov 2024 12:32:54 +0100 Subject: [PATCH 52/56] fix(tools): re-raise ImportError without module name The ImportError or ModuleNotFoundError might be raised without specifying a module name. In this not so common situation, re-raise the exception to print all the information that could assist in identifying the problem. Signed-off-by: Frantisek Hrbata --- tools/idf.py | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/tools/idf.py b/tools/idf.py index b446b7ee21f7..8db9ddf4211a 100755 --- a/tools/idf.py +++ b/tools/idf.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD # # SPDX-License-Identifier: Apache-2.0 # @@ -8,7 +8,6 @@ # # You don't have to use idf.py, you can use cmake directly # (or use cmake in an IDE) - # WARNING: we don't check for Python build-time dependencies until # check_environment() function below. If possible, avoid importing # any external libraries here - put in external script, or import in @@ -18,14 +17,20 @@ import codecs import json import locale -import os import os.path import subprocess import sys -from collections import Counter, OrderedDict, _OrderedDictKeysView +from collections import Counter +from collections import OrderedDict +from collections.abc import KeysView from importlib import import_module from pkgutil import iter_modules -from typing import Any, Callable, Dict, List, Optional, Union +from typing import Any +from typing import Callable +from typing import Dict +from typing import List +from typing import Optional +from typing import Union # pyc files remain in the filesystem when switching between branches which might raise errors for incompatible # idf.py extensions. Therefore, pyc file generation is turned off: @@ -40,13 +45,19 @@ if os.getenv('IDF_COMPONENT_MANAGER') != '0': from idf_component_manager import idf_extensions except ImportError as e: - # For example, importing click could cause this. - print((f'Cannot import module "{e.name}". This usually means that "idf.py" was not ' + print((f'{e}\n' + f'This usually means that "idf.py" was not ' f'spawned within an ESP-IDF shell environment or the python virtual ' f'environment used by "idf.py" is corrupted.\n' f'Please use idf.py only in an ESP-IDF shell environment. If problem persists, ' f'please try to install ESP-IDF tools again as described in the Get Started guide.'), file=sys.stderr) + if e.name is None: + # The ImportError or ModuleNotFoundError might be raised without + # specifying a module name. In this not so common situation, re-raise + # the exception to print all the information that could assist in + # identifying the problem. + raise sys.exit(1) @@ -120,7 +131,7 @@ def _safe_relpath(path: str, start: Optional[str]=None) -> str: return os.path.abspath(path) -def init_cli(verbose_output: List=None) -> Any: +def init_cli(verbose_output: Optional[List]=None) -> Any: # Click is imported here to run it after check_environment() import click @@ -186,7 +197,7 @@ def __init__(self, callback: Callable, name: str, aliases: List, dependencies: O self.action_args = action_args self.aliases = aliases - def __call__(self, context: click.core.Context, global_args: PropertyDict, action_args: Dict=None) -> None: + def __call__(self, context: click.core.Context, global_args: PropertyDict, action_args: Optional[Dict]=None) -> None: if action_args is None: action_args = self.action_args @@ -287,7 +298,7 @@ class Scope(object): SCOPES = ('default', 'global', 'shared') - def __init__(self, scope: Union['Scope', str]=None) -> None: + def __init__(self, scope: Optional[Union['Scope', str]]=None) -> None: # noqa: F821 if scope is None: self._scope = 'default' elif isinstance(scope, str) and scope in self.SCOPES: @@ -310,7 +321,7 @@ def __str__(self) -> str: class Option(click.Option): """Option that knows whether it should be global""" - def __init__(self, scope: Union[Scope, str]=None, deprecated: Union[Dict, str, bool]=False, hidden: bool=False, **kwargs: str) -> None: + def __init__(self, scope: Optional[Union[Scope, str]]=None, deprecated: Union[Dict, str, bool]=False, hidden: bool=False, **kwargs: str) -> None: """ Keyword arguments additional to Click's Option class: @@ -348,7 +359,7 @@ def get_help_record(self, ctx: click.core.Context) -> Any: class CLI(click.MultiCommand): """Action list contains all actions with options available for CLI""" - def __init__(self, all_actions: Dict=None, verbose_output: List=None, help: str=None) -> None: + def __init__(self, all_actions: Optional[Dict]=None, verbose_output: Optional[List]=None, help: Optional[str]=None) -> None: super(CLI, self).__init__( chain=True, invoke_without_command=True, @@ -432,7 +443,7 @@ def get_command(self, ctx: click.core.Context, name: str) -> Optional[Action]: return Action(name=name, callback=callback.unwrapped_callback) return None - def _print_closing_message(self, args: PropertyDict, actions: _OrderedDictKeysView) -> None: + def _print_closing_message(self, args: PropertyDict, actions: KeysView) -> None: # print a closing message of some kind # if any(t in str(actions) for t in ('flash', 'dfu', 'uf2', 'uf2-app')): @@ -560,7 +571,7 @@ def execute_tasks(self, tasks: List, **kwargs: str) -> OrderedDict: dependecies_processed = True - # If task have some dependecies they have to be executed before the task. + # If task have some dependencies they have to be executed before the task. for dep in task.dependencies: if dep not in tasks_to_run.keys(): # If dependent task is in the list of unprocessed tasks move to the front of the list @@ -697,7 +708,7 @@ def main() -> None: # Check the environment only when idf.py is invoked regularly from command line. checks_output = None if SHELL_COMPLETE_RUN else check_environment() - # Check existance of the current working directory to prevent exceptions from click cli. + # Check existence of the current working directory to prevent exceptions from click cli. try: os.getcwd() except FileNotFoundError as e: From 8c485371b92340233323b7d6b4065a49a4e30cb0 Mon Sep 17 00:00:00 2001 From: xiongweichao Date: Wed, 13 Nov 2024 14:53:34 +0800 Subject: [PATCH 53/56] fix(bt/bluedroid): Fixed the incorrect error code returned when receiving an invalid command --- components/bt/host/bluedroid/stack/avrc/avrc_pars_tg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/bluedroid/stack/avrc/avrc_pars_tg.c b/components/bt/host/bluedroid/stack/avrc/avrc_pars_tg.c index c30bf94a3b96..fe04ca8f326d 100644 --- a/components/bt/host/bluedroid/stack/avrc/avrc_pars_tg.c +++ b/components/bt/host/bluedroid/stack/avrc/avrc_pars_tg.c @@ -71,7 +71,7 @@ static tAVRC_STS avrc_pars_vendor_cmd(tAVRC_MSG_VENDOR *p_msg, tAVRC_COMMAND *p_ p++; /* skip the reserved byte */ BE_STREAM_TO_UINT16 (len, p); if ((len + 4) != (p_msg->vendor_len)) { - status = AVRC_STS_INTERNAL_ERR; + status = AVRC_STS_NOT_FOUND; } if (status != AVRC_STS_NO_ERROR) { From 2322404be676f842b29ae04c424aaa378bb3aa4a Mon Sep 17 00:00:00 2001 From: Jin Cheng Date: Tue, 22 Oct 2024 21:23:21 +0800 Subject: [PATCH 54/56] fix(bt/bluedroid): AG should send OK or other error codes to HF client when it is driven by HF to initiate a call. --- .../bluetooth/bluedroid/classic_bt/hfp_ag/main/bt_app_hf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/bt_app_hf.c b/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/bt_app_hf.c index 2fdb3395ef90..b6924bbdecb3 100644 --- a/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/bt_app_hf.c +++ b/examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/bt_app_hf.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -32,7 +32,7 @@ const char *c_hf_evt_str[] = { "AUDIO_STATE_EVT", /*!< AUDIO CONNECTION STATE CONTROL */ "VR_STATE_CHANGE_EVT", /*!< VOICE RECOGNITION CHANGE */ "VOLUME_CONTROL_EVT", /*!< AUDIO VOLUME CONTROL */ - "UNKNOW_AT_CMD", /*!< UNKNOW AT COMMAND RECIEVED */ + "UNKNOW_AT_CMD", /*!< UNKNOWN AT COMMAND RECEIVED */ "IND_UPDATE", /*!< INDICATION UPDATE */ "CIND_RESPONSE_EVT", /*!< CALL & DEVICE INDICATION */ "COPS_RESPONSE_EVT", /*!< CURRENT OPERATOR EVENT */ @@ -355,7 +355,7 @@ void bt_app_hf_cb(esp_hf_cb_event_t event, esp_hf_cb_param_t *param) case ESP_HF_IND_UPDATE_EVT: { - ESP_LOGI(BT_HF_TAG, "--UPDATE INDCATOR!"); + ESP_LOGI(BT_HF_TAG, "--UPDATE INDICATOR!"); esp_hf_call_status_t call_state = 1; esp_hf_call_setup_status_t call_setup_state = 2; esp_hf_network_state_t ntk_state = 1; @@ -460,6 +460,7 @@ void bt_app_hf_cb(esp_hf_cb_event_t event, esp_hf_cb_param_t *param) if (param->out_call.type == ESP_HF_DIAL_NUM) { // dia_num ESP_LOGI(BT_HF_TAG, "--Dial number \"%s\".", param->out_call.num_or_loc); + esp_hf_ag_cmee_send(param->out_call.remote_addr, ESP_HF_AT_RESPONSE_CODE_OK, ESP_HF_CME_AG_FAILURE); esp_hf_ag_out_call(param->out_call.remote_addr,1,0,1,0,param->out_call.num_or_loc,0); } else if (param->out_call.type == ESP_HF_DIAL_MEM) { // dia_mem From 3db49748149f29730442a8efe35d58aefda71502 Mon Sep 17 00:00:00 2001 From: Jin Cheng Date: Fri, 8 Nov 2024 12:51:23 +0800 Subject: [PATCH 55/56] fix(bt/controller): Fixed some controller bugs on ESP32 - Fixed wrong logic in handling sniff transaction collision at slave side - Fixed the issue ACL is stopped too early before eSCO --- components/bt/controller/lib_esp32 | 2 +- components/esp_rom/esp32/ld/esp32.rom.ld | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32 b/components/bt/controller/lib_esp32 index 5c4a62c1d457..4f9869a760c7 160000 --- a/components/bt/controller/lib_esp32 +++ b/components/bt/controller/lib_esp32 @@ -1 +1 @@ -Subproject commit 5c4a62c1d4577d1352d28708c790ba2b4f741842 +Subproject commit 4f9869a760c7f6982d2d4d6b56ef46c1b2488611 diff --git a/components/esp_rom/esp32/ld/esp32.rom.ld b/components/esp_rom/esp32/ld/esp32.rom.ld index a24ff27f0712..c6abfb4559be 100644 --- a/components/esp_rom/esp32/ld/esp32.rom.ld +++ b/components/esp_rom/esp32/ld/esp32.rom.ld @@ -663,6 +663,7 @@ PROVIDE ( ld_acl_rsw_frm_cbk = 0x40033bb0 ); PROVIDE ( ld_sco_modify = 0x40031778 ); PROVIDE ( lm_cmd_cmp_send = 0x40051838 ); PROVIDE ( ld_sco_frm_cbk = 0x400349dc ); +PROVIDE ( ld_sco_evt_stop_cbk = 0x40031d78 ); PROVIDE ( ld_acl_sco_rsvd_check = 0x4002fa94 ); PROVIDE ( ld_acl_sniff_frm_cbk = 0x4003482c ); PROVIDE ( ld_inq_end = 0x4003ab48 ); From 2a715e4203f1c4860aa89a20f2f8c821f8b27a57 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Fri, 25 Oct 2024 19:33:55 +0800 Subject: [PATCH 56/56] feat(twt): twt add parameter to enable keep alive --- components/esp_wifi/include/esp_wifi_he.h | 9 +++++++++ components/esp_wifi/include/esp_wifi_he_types.h | 1 + components/esp_wifi/lib | 2 +- examples/wifi/itwt/main/Kconfig.projbuild | 6 ++++++ examples/wifi/itwt/main/itwt.c | 12 ++++++++++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/components/esp_wifi/include/esp_wifi_he.h b/components/esp_wifi/include/esp_wifi_he.h index 67880654ab4e..28da4912644a 100644 --- a/components/esp_wifi/include/esp_wifi_he.h +++ b/components/esp_wifi/include/esp_wifi_he.h @@ -143,6 +143,15 @@ esp_err_t esp_wifi_enable_rx_statistics(bool rx_stats, bool rx_mu_stats); */ esp_err_t esp_wifi_enable_tx_statistics(esp_wifi_aci_t aci, bool tx_stats); +/** + * @brief Set WiFi TWT config + * + * @param[in] config pointer to the WiFi TWT configure structure. + * + * @return + * - ESP_OK: succeed + */ +esp_err_t esp_wifi_sta_twt_config(wifi_twt_config_t *config); #ifdef __cplusplus } diff --git a/components/esp_wifi/include/esp_wifi_he_types.h b/components/esp_wifi/include/esp_wifi_he_types.h index 397cd088f5ae..4e49c90a7894 100644 --- a/components/esp_wifi/include/esp_wifi_he_types.h +++ b/components/esp_wifi/include/esp_wifi_he_types.h @@ -252,6 +252,7 @@ typedef enum { /** Argument structure for twt configuration */ typedef struct { bool post_wakeup_event; /**< post twt wakeup event */ + bool twt_enable_keep_alive; /**< twt enable send qos null to keep alive */ } wifi_twt_config_t; /** Argument structure for WIFI_EVENT_TWT_WAKEUP event */ diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index eaa36d56a58b..e94341d8f696 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit eaa36d56a58ba6ab8d16ebce7683a3b93b690d41 +Subproject commit e94341d8f69625a0c01ce19acc47b05039f849bb diff --git a/examples/wifi/itwt/main/Kconfig.projbuild b/examples/wifi/itwt/main/Kconfig.projbuild index 9eb0e46e7be5..8d8dd52b2e18 100644 --- a/examples/wifi/itwt/main/Kconfig.projbuild +++ b/examples/wifi/itwt/main/Kconfig.projbuild @@ -38,6 +38,12 @@ menu "Example Configuration" help Set static gateway address. + config EXAMPLE_TWT_ENABLE_KEEP_ALIVE_QOS_NULL + bool "enable keep alive qos null" + default n + help + Enable send QOS NULL to keep alive during TWT. + menu "iTWT Configuration" config EXAMPLE_ITWT_TRIGGER_ENABLE bool "trigger-enabled" diff --git a/examples/wifi/itwt/main/itwt.c b/examples/wifi/itwt/main/itwt.c index 7706afdb8b66..6722beb56c80 100644 --- a/examples/wifi/itwt/main/itwt.c +++ b/examples/wifi/itwt/main/itwt.c @@ -48,6 +48,12 @@ static const char *TAG = "itwt"; #define DEFAULT_PWD CONFIG_EXAMPLE_WIFI_PASSWORD #define ITWT_SETUP_SUCCESS 1 +#if CONFIG_EXAMPLE_TWT_ENABLE_KEEP_ALIVE_QOS_NULL +bool keep_alive_enabled = true; +#else +bool keep_alive_enabled = false; +#endif + #if CONFIG_EXAMPLE_ITWT_TRIGGER_ENABLE uint8_t trigger_enabled = 1; #else @@ -259,6 +265,12 @@ static void wifi_itwt(void) ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); + wifi_twt_config_t wifi_twt_config = { + .post_wakeup_event = false, + .twt_enable_keep_alive = keep_alive_enabled, + }; + ESP_ERROR_CHECK(esp_wifi_sta_twt_config(&wifi_twt_config)); + esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20); esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N | WIFI_PROTOCOL_11AX); esp_wifi_set_ps(WIFI_PS_MIN_MODEM);