Merge pull request #7313 from jepler/cyw43-additional-delay

Add an additional large delay time at start for pico w boards
This commit is contained in:
Dan Halbert 2022-12-07 19:17:45 -05:00 committed by GitHub
commit 295f7b490f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,6 +62,7 @@
#include "src/rp2_common/hardware_sync/include/hardware/sync.h"
#include "src/rp2_common/hardware_timer/include/hardware/timer.h"
#if CIRCUITPY_CYW43
#include "py/mphal.h"
#include "pico/cyw43_arch.h"
#endif
#include "src/common/pico_time/include/pico/time.h"
@ -143,6 +144,11 @@ safe_mode_t port_init(void) {
never_reset_pin_number(24);
never_reset_pin_number(25);
never_reset_pin_number(29);
// A small number of samples of pico w need an additional delay before
// initializing the cyw43 chip. Delays inside cyw43_arch_init_with_country
// are intended to meet the power on timing requirements, but apparently
// are inadequate. We'll back off this long delay based on future testing.
mp_hal_delay_ms(1000);
// Change this as a placeholder as to how to init with country code.
// Default country code is CYW43_COUNTRY_WORLDWIDE)
if (cyw43_arch_init_with_country(PICO_CYW43_ARCH_DEFAULT_COUNTRY_CODE)) {