Closed earlephilhower closed 1 year ago
From the discussion....
Seems like the other core is not doing anything yet:
Also, figured out why the sample application worked and my real application didn't.
extern "C" void initVariant() {
__isPicoW = CheckPicoW();
if (__isPicoW) {
cyw43_arch_init_with_country(WIFICC);
}
}
The sample application was setup to use a Pico while my real application uses a PicoW. Once I change the sample application to use a PicoW, it also freezes.
Regarding pinging the WDT in a while loop in a separate task, that's just a workaround to avoid the WTD triggering while calling code that takes too long and I can't or don't want to change, like connecting to WiFi.
For example, calling WifiMulti::run
can take longer than 8300ms, triggering the WTD.
So, back to the freeze, seems like the easiest way to repro this is to simply create a minimal application for PicoW and include the FreeRTOS.h header. It has nothing to do with using the WTD. That was just a coincidence. This is enough to repro:
#include <Arduino.h>
#include <FreeRTOS.h> // << Just including this causes the freeze
void setup()
{
Serial.begin(115200);
Serial.println("Hello world");
}
void loop()
{
Serial.println(millis());
delay(1000);
}
My platformio.ini
[platformio]
default_envs = earlephilhower
;
; Custom data group
; can be use in [env:***] via ${common.***}
[common]
picoprobe_tools_path = B:/Utils/Picoprobe
[env:earlephilhower]
platform = https://github.com/maxgerhardt/platform-raspberrypi#5a533d6b36844183bb72794bc53091206165e921
board = rpipicow
framework = arduino
board_build.core = earlephilhower
build_type = debug
upload_protocol = custom
upload_command = ${common.picoprobe_tools_path}/upload_openocd.bat "$BUILD_DIR/${PROGNAME}.elf" "$PROJECT_DIR"
debug_tool = custom
debug_server =
${common.picoprobe_tools_path}/debug_openocd.bat
debug_port = localhost:3333
lib_ldf_mode=chain+
Moved to an issue since we have a nice simple MCVE!
Discussed in https://github.com/earlephilhower/arduino-pico/discussions/1390