Skip to content

Commit 60e7507

Browse files
authored
Merge pull request #426 from adafruit/update-idf-5.3.2
Update idf 5.3.2
2 parents 058c905 + 6430a48 commit 60e7507

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+109
-40649
lines changed

.github/actions/setup_toolchain/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ runs:
2020
if: inputs.toolchain == 'arm-gcc'
2121
uses: carlosperate/arm-none-eabi-gcc-action@v1
2222
with:
23-
# release: '12.3.Rel1'
24-
release: '11.2-2022.02'
23+
release: '13.3.Rel1'
2524

2625
- name: Pull ESP-IDF docker
2726
if: inputs.toolchain == 'esp-idf'

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
# ---------------------------------------
7878
# Build ESP
7979
# ---------------------------------------
80-
esp:
80+
espressif:
8181
needs: set-matrix
8282
uses: ./.github/workflows/build_util.yml
8383
secrets: inherit
@@ -86,7 +86,7 @@ jobs:
8686
boards: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)['espressif'].board) }}
8787
build-system: 'make'
8888
toolchain: 'esp-idf'
89-
toolchain_version: 'v5.1.4'
89+
toolchain_version: 'v5.3.2'
9090

9191
# ---------------------------------------
9292
# Build RISC-V

.idea/cmake.xml

Lines changed: 24 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tinyusb

Submodule tinyusb updated 1030 files

ports/espressif/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set(SDKCONFIG_DEFAULTS ${CMAKE_CURRENT_LIST_DIR}/sdkconfig.defaults ${CMAKE_CURR
1111
set(SDKCONFIG ${CMAKE_BINARY_DIR}/sdkconfig)
1212

1313
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
14+
idf_build_set_property(EXTRA_CMAKE_ARGS -DBOARD=${BOARD}) # Pass BOARD to bootloader
1415

1516
execute_process(COMMAND git describe --dirty --always --tags
1617
OUTPUT_VARIABLE GIT_VERSION)
@@ -23,8 +24,10 @@ string(REPLACE ../ "" GIT_SUBMODULE_VERSIONS ${GIT_SUBMODULE_VERSIONS})
2324
string(REPLACE lib/ "" GIT_SUBMODULE_VERSIONS ${GIT_SUBMODULE_VERSIONS})
2425
string(STRIP ${GIT_SUBMODULE_VERSIONS} GIT_SUBMODULE_VERSIONS)
2526

26-
add_compile_definitions(UF2_VERSION_BASE="${GIT_VERSION}")
27-
add_compile_definitions(UF2_VERSION="${GIT_VERSION} - ${GIT_SUBMODULE_VERSIONS}")
27+
add_compile_definitions(
28+
UF2_VERSION_BASE="${GIT_VERSION}"
29+
UF2_VERSION="${GIT_VERSION} - ${GIT_SUBMODULE_VERSIONS}"
30+
)
2831

2932
cmake_print_variables(GIT_VERSION GIT_SUBMODULE_VERSIONS)
3033

ports/espressif/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The project is composed of customizing the 2nd stage bootloader from IDF and UF2 factory application as 3rd stage bootloader.
44

5-
**Note**: IDF is actively developed and change very often, TinyUF2 is developed and tested with IDF v5.1.4. Should you have a problem please try to change your IDF version.
5+
**Note**: IDF is actively developed and change very often, TinyUF2 is developed and tested with IDF v5.3.2. Should you have a problem please try to change your IDF version.
66

77
Following boards are supported:
88

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
idf_component_register(SRCS boards.c board_flash.c ${BOARD_SOURCES}
22
INCLUDE_DIRS "." "${BOARD}" ${BOARD_INCLUDES} ${TOP}/src
3-
REQUIRES driver esp_timer app_update spi_flash led_strip lcd ssd1306 XPowersLib tinyusb_src)
3+
PRIV_REQUIRES driver usb
4+
REQUIRES esp_timer app_update spi_flash led_strip lcd ssd1306 XPowersLib tinyusb_src)

ports/espressif/boards/boards.c

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
#include "freertos/semphr.h"
2828

2929
#include "hal/gpio_ll.h"
30-
#include "hal/usb_hal.h"
30+
31+
#include "esp_private/usb_phy.h"
32+
#include "soc/usb_pins.h"
33+
3134
#include "soc/usb_periph.h"
3235
#include "esp_private/periph_ctrl.h"
3336

@@ -89,7 +92,6 @@ extern bool board_init_extension();
8992
#endif
9093

9194
extern int main(void);
92-
static void configure_pins(usb_hal_context_t* usb);
9395
static void internal_timer_cb(void* arg);
9496

9597
//--------------------------------------------------------------------+
@@ -257,16 +259,19 @@ void board_init(void) {
257259
esp_timer_create(&periodic_timer_args, &timer_hdl);
258260
}
259261

262+
static usb_phy_handle_t phy_hdl;
260263
void board_dfu_init(void) {
261-
// USB Controller Hal init
262-
periph_module_reset(PERIPH_USB_MODULE);
263-
periph_module_enable(PERIPH_USB_MODULE);
264-
265-
usb_hal_context_t hal = {
266-
.use_external_phy = false // use built-in PHY
264+
// Configure USB PHY
265+
usb_phy_config_t phy_conf = {
266+
.controller = USB_PHY_CTRL_OTG,
267+
.target = USB_PHY_TARGET_INT,
268+
.otg_mode = USB_OTG_MODE_DEVICE,
269+
// https://github.com/hathach/tinyusb/issues/2943#issuecomment-2601888322
270+
// Set speed to undefined (auto-detect) to avoid timinng/racing issue with S3 with host such as macOS
271+
.otg_speed = USB_PHY_SPEED_UNDEFINED,
267272
};
268-
usb_hal_init(&hal);
269-
configure_pins(&hal);
273+
274+
usb_new_phy(&phy_conf, &phy_hdl);
270275
}
271276

272277
void board_reset(void) {
@@ -345,7 +350,6 @@ void board_timer_stop(void) {
345350

346351
#if CONFIG_IDF_TARGET_ESP32S3
347352
#include "hal/usb_serial_jtag_ll.h"
348-
#include "hal/usb_fsls_phy_ll.h"
349353

350354
static void hw_cdc_reset_handler(void *arg) {
351355
portBASE_TYPE xTaskWoken = 0;
@@ -389,7 +393,7 @@ static void usb_switch_to_cdc_jtag(void) {
389393
gpio_set_level((gpio_num_t)USBPHY_DP_NUM, 0);
390394

391395
// Initialize CDC+JTAG ISR to listen for BUS_RESET
392-
usb_fsls_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG);
396+
usb_serial_jtag_ll_phy_enable_external(false);
393397
usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
394398
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
395399
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_BUS_RESET);
@@ -579,32 +583,3 @@ void dotstar_write(uint8_t const rgb[]) {
579583
}
580584

581585
#endif
582-
583-
//--------------------------------------------------------------------+
584-
// Helper
585-
//--------------------------------------------------------------------+
586-
static void configure_pins(usb_hal_context_t* usb) {
587-
/* usb_periph_iopins currently configures USB_OTG as USB Device.
588-
* Introduce additional parameters in usb_hal_context_t when adding support
589-
* for USB Host.
590-
*/
591-
for (const usb_iopin_dsc_t* iopin = usb_periph_iopins; iopin->pin != -1; ++iopin) {
592-
if ((usb->use_external_phy) || (iopin->ext_phy_only == 0)) {
593-
esp_rom_gpio_pad_select_gpio(iopin->pin);
594-
if (iopin->is_output) {
595-
esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false);
596-
} else {
597-
esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false);
598-
if ((iopin->pin != GPIO_MATRIX_CONST_ZERO_INPUT) && (iopin->pin != GPIO_MATRIX_CONST_ONE_INPUT)) {
599-
gpio_ll_input_enable(&GPIO, iopin->pin);
600-
}
601-
}
602-
esp_rom_gpio_pad_unhold(iopin->pin);
603-
}
604-
}
605-
606-
if (!usb->use_external_phy) {
607-
gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3);
608-
gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3);
609-
}
610-
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
idf_component_register(SRCS "bootloader_start.c"
2+
INCLUDE_DIRS "../../boards/${BOARD}"
3+
REQUIRES bootloader bootloader_support hal)
4+
5+
idf_build_get_property(target IDF_TARGET)
6+
7+
# TODO: [ESP32C5] IDF-9197 remove this when beta3 is removed
8+
if(CONFIG_IDF_TARGET_ESP32C5_MP_VERSION)
9+
set(target_folder "esp32c5/mp")
10+
elseif(CONFIG_IDF_TARGET_ESP32C5_BETA3_VERSION)
11+
set(target_folder "esp32c5/beta3")
12+
else()
13+
set(target_folder "${target}")
14+
endif()
15+
16+
# Use the linker script files from the actual bootloader
17+
set(scripts "${IDF_PATH}/components/bootloader/subproject/main/ld/${target_folder}/bootloader.ld"
18+
"${IDF_PATH}/components/bootloader/subproject/main/ld/${target_folder}/bootloader.rom.ld")
19+
20+
target_linker_script(${COMPONENT_LIB} INTERFACE "${scripts}")

0 commit comments

Comments
 (0)