Add an additional large delay time at start for pico w boards

This commit is contained in:
Jeff Epler 2022-12-07 13:28:34 -06:00
parent 676e40d62f
commit ff8d051eff
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

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)) {