From 7dcb98421454114bfff8f5d69577791b77b89738 Mon Sep 17 00:00:00 2001 From: Alynx Zhou Date: Fri, 15 Dec 2023 21:38:14 +0800 Subject: [PATCH] Fix waveshare_rp2040_zero USB unrecognize after unplug and replug (#1421) Some RP2040-Zero boards from WaveShare can only be recognized via USB after flashing UF2 into it, and if you unplug and replug it, nothing happens on both USB host and device, RP2040-Zero seems just not booting. According to @ArkBrj, it seems that setting `PICO_FLASH_SPI_CLKDIV` to `2` makes the clock chip exceed the spec, setting it to `4` fixes this bug. I tested it with the blink program in pico-examples, this does fix the bug for me. Fixes . --- src/boards/include/boards/waveshare_rp2040_zero.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/boards/include/boards/waveshare_rp2040_zero.h b/src/boards/include/boards/waveshare_rp2040_zero.h index 281b4dc8..8dadd553 100644 --- a/src/boards/include/boards/waveshare_rp2040_zero.h +++ b/src/boards/include/boards/waveshare_rp2040_zero.h @@ -64,7 +64,7 @@ #define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1 #ifndef PICO_FLASH_SPI_CLKDIV -#define PICO_FLASH_SPI_CLKDIV 2 +#define PICO_FLASH_SPI_CLKDIV 4 #endif #ifndef PICO_FLASH_SIZE_BYTES @@ -72,7 +72,7 @@ #endif // All boards have B1 RP2040 -#ifndef PICO_RP2040_B0_SUPPORTED +#ifndef PICO_RP2040_B0_SUPPORTED #define PICO_RP2040_B0_SUPPORTED 0 #endif