Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RED LIGHT: Improve Error Messages in early failure situations and possibly compile time: #545

Closed
tyeth opened this issue Feb 8, 2024 · 3 comments · Fixed by #570
Closed
Labels
bug Something isn't working Status: Needs Investigation

Comments

@tyeth
Copy link
Contributor

tyeth commented Feb 8, 2024

My fault no doubt as playing with different framework versions in platformio, but got a malloc error assigning device id, probably setup without use_psram, but all I saw as a user was "nothing on serial" (takes too long to reconnect and not repeated message) and red light. There is a mounted drive, showing valid secrets etc and bootlog looked okay (showing mac etc).

Eventually I noticed the red light stopped and started again (when rebooting), so I removed enough usb devices and shut enough things that my serial monitor was able to reconnect fast enough to catch the boot error message (I've not seen it again in ten reboots - too slow to reconnect serial monitor in windows):

---- Opened the serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
Adafruit.io WipperSnapper
-------Device Information-------
Firmware Version: 1.0.0-beta.76
Board ID: feather-esp32s3-tft
Adafruit.io User: tyeth
WiFi Network: THERMAL
MAC Address: F4:12:FA:59:C1:B8
-------------------------------
ESP32 CPU0 RESET REASON: NO_MEAN
ESP32 CPU1 RESET REASON: POWERON_RESET
E ERROR: Unable to create device uid, Malloc failure
ERROR [WDT RESET]: Unable to generate Device UID
---- Closed serial port COM45 due to disconnection from the machine ----

Solution is to at least get all messages to repeat, or provide some compile time warning if wrong setting for board (psram etc)

@tyeth
Copy link
Contributor Author

tyeth commented Feb 8, 2024

To catch the message, because at boot the device dettaches serial/msc then reattaches the serial monitor catches the reboot attach of serial then dettach and reattach again, but it takes time (like 1sec) to attach. The only way to catch the message is to start serial monitoring manually after the reboot brings up serial the first time (before dettach and reattach) then it consumes the 1second while the device quickly does the reattach, meaning it's ready to receive the early boot message.

---- Opened the serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
Adafruit.io WipperSnapper
-------Device Information-------
Firmware Version: 1.0.0-beta.76
Board ID: feather-esp32s3-tft
Adafruit.io User: tyeth
WiFi Network: THERMAL
MAC Address: F4:12:FA:59:C1:B8
-------------------------------
ESP32 CPU0 RESET REASON: NO_MEAN
ESP32 CPU1 RESET REASON: POWERON_RESET
E ERROR: Unable to create device uid, Malloc failure
ERROR [WDT RESET]: Unable to generate Device UID
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed the serial port COM45 ----
---- Opened the serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed the serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
**** Failed to open the serial port COM45 ****
---- Reopened serial port COM45 ----
Adafruit.io WipperSnapper
-------Device Information-------
Firmware Version: 1.0.0-beta.76
Board ID: feather-esp32s3-tft
Adafruit.io User: tyeth
WiFi Network: free4all_2G
MAC Address: F4:12:FA:59:C1:B8
-------------------------------
ESP32 CPU0 RESET REASON: NO_MEAN
ESP32 CPU1 RESET REASON: POWERON_RESET
E (4097) task_wdt: delete_entry(232): task not found
ERROR: Unable to create device uid, Malloc failure
ERROR [WDT RESET]: Unable to generate Device UID
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----
---- Closed serial port COM45 due to disconnection from the machine ----
---- Reopened serial port COM45 ----

@brentru brentru added Status: Needs Investigation bug Something isn't working labels Feb 8, 2024
@brentru
Copy link
Member

brentru commented Feb 8, 2024

@tyeth Which board were you using? Could you share the Platformio .ini config here?

Regarding this error:

E (4097) task_wdt: delete_entry(232): task not found

Could you split this out into another issue and label it "bug" and set status to "needs investigation" so we can investigate it more?

@tyeth
Copy link
Contributor Author

tyeth commented Feb 9, 2024

PlatformIO.ini (was swapping about platform + platform_packages and also build flags for both boards:
s3 tft feather and s3 reverse tft feather

; PlatformIO Project Configuration File for Adafruit.IO WipperSnapper Firmware
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

; PlatformIO Defaults
[platformio]
description = "Adafruit.IO WipperSnapper Firmware"
default_envs = adafruit_feather_esp32s3_tft, adafruit_magtag29_esp32s2, adafruit_feather_esp32s3, featheresp32s2, adafruit_feather_esp32s2_reversetft, adafruit_metro_esp32s2, adafruit_qtpy_esp32s2, adafruit_feather_esp32s3_reversetft, adafruit_feather_esp32s3_nopsram, adafruit_feather_esp32s2_tft, adafruit_qtpy_esp32, adafruit_qtpy_esp32c3, featheresp32, adafruit_qtpy_esp32s3_nopsram, featheresp32v2, huzzah, adafruit_pyportal_m4, adafruit_pyportal_m4_titano


; Common Build Environment
; https://docs.platformio.org/en/latest/projectconf/section_env.html
[env]
framework = arduino
monitor_speed = 115200
lib_compat_mode = strict
lib_deps =
    adafruit/Adafruit Zero DMA Library
    adafruit/Adafruit TinyUSB Library
    adafruit/Adafruit NeoPixel
    adafruit/Adafruit SPIFlash
    adafruit/Adafruit DotStar
    adafruit/ENS160 - Adafruit Fork
    adafruit/Adafruit SleepyDog Library
    adafruit/Adafruit AHTX0
    adafruit/Adafruit BME280 Library
    adafruit/Adafruit BMP280 Library
    adafruit/Adafruit BMP3XX Library
    adafruit/Adafruit DPS310
    adafruit/Adafruit INA219
    adafruit/Adafruit HTS221
    adafruit/Adafruit HTU21DF Library
    adafruit/Adafruit HTU31D Library
    adafruit/Adafruit LTR390 Library
    adafruit/Adafruit LTR329 and LTR303
    adafruit/Adafruit PCT2075
    adafruit/Adafruit SCD30
    adafruit/Adafruit SGP30 Sensor
    adafruit/Adafruit SGP40 Sensor
    adafruit/Adafruit Si7021 Library
    adafruit/Adafruit VCNL4020 Library
    adafruit/Adafruit VCNL4040
    adafruit/Adafruit MCP9808 Library
    adafruit/Adafruit MCP9600 Library
    adafruit/Adafruit MPL115A2
    adafruit/Adafruit MPRLS Library
    adafruit/Adafruit MS8607
    adafruit/Adafruit TMP117
    adafruit/Adafruit TSL2591 Library
    adafruit/Adafruit_VL53L0X
    adafruit/Adafruit VL53L1X
    adafruit/Adafruit_VL6180X
    adafruit/Adafruit PM25 AQI Sensor
    adafruit/Adafruit VEML7700 Library
    adafruit/Adafruit LC709203F
    adafruit/Adafruit LPS2X
    adafruit/Adafruit LPS35HW
    adafruit/Adafruit seesaw Library
    adafruit/Adafruit BME680 Library
    adafruit/Adafruit MAX1704X
    adafruit/Adafruit ADT7410 Library
    adafruit/Adafruit GFX Library
    adafruit/Adafruit STMPE610
    adafruit/Adafruit TouchScreen
    adafruit/Adafruit MQTT Library
    bblanchon/ArduinoJson
    PaulStoffregen/OneWire
    https://github.com/milesburton/Arduino-Temperature-Control-Library.git
    https://github.com/Sensirion/arduino-sht.git
    https://github.com/Sensirion/arduino-i2c-scd4x.git
    https://github.com/Sensirion/arduino-i2c-sen5x.git
    https://github.com/adafruit/WiFiNINA.git
    https://github.com/Starmbi/hp_BH1750.git

; Common build environment for ESP32 platform
[common:esp32]
platform = espressif32
; @ 6.5
platform_packages = 
    platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
    platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
;    tools/
;platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
;platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/1643/framework-arduinoespressif32-release_v5.1-f45a4361b2.zip
lib_ignore = WiFiNINA
debug_tool = esp-builtin
monitor_filters = esp32_exception_decoder, time

; Common build environment for ESP8266 platform
[common:esp8266]
platform = espressif8266
lib_ignore = WiFiNINA, Adafruit TinyUSB Library

; Common build environment for Atmel/Microchip SAMDx platform
[common:atsamd]
platform = atmelsam
lib_ldf_mode = deep


[common:rp2040]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
; platform_packages =
;    framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico
;    framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#master
board = rpipicow
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
build_flags = -DUSE_TINYUSB
; Once https://github.com/platformio/platformio-core > 6.1.11 these can be removed
lib_ignore = WiFiNINA, Adafruit Zero DMA Library
lib_compat_mode = soft  ; can be strict once pio detects SleepyDog on RP2040

; ESP32-x Boards ;

; Adafruit ESP32 Feather
[env:featheresp32]
extends = common:esp32
board = featheresp32
build_flags = -DARDUINO_FEATHER_ESP32
board_build.filesystem = littlefs


; Adafruit ESP32 Feather V2
[env:featheresp32v2]
extends = common:esp32
board = adafruit_feather_esp32_v2
board_build.partitions = default_8MB.csv
build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32_V2
board_build.filesystem = littlefs

; Adafruit Feather ESP32-S2
[env:featheresp32s2]
extends = common:esp32
board = featheresp32-s2
build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32S2
extra_scripts = pre:rename_usb_config.py

; Adafruit Feather ESP32-S2 TFT
[env:adafruit_feather_esp32s2_tft]
extends = common:esp32
board = adafruit_feather_esp32s2_tft
build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32S2_TFT
extra_scripts = pre:rename_usb_config.py

; Adafruit Feather ESP32-S2 Reverse TFT
[env:adafruit_feather_esp32s2_reversetft]
extends = common:esp32
board = adafruit_feather_esp32s2_reversetft
build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32S2_REVTFT
extra_scripts = pre:rename_usb_config.py

; Adafruit Feather ESP32-S3 2MB PSRAM
[env:adafruit_feather_esp32s3]
extends = common:esp32
board = adafruit_feather_esp32s3
build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32S3
extra_scripts = pre:rename_usb_config.py

; Adafruit Feather ESP32-S3 NO PSRAM
[env:adafruit_feather_esp32s3_nopsram]
extends = common:esp32
board = adafruit_feather_esp32s3_nopsram
build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32S3_NOPSRAM
extra_scripts = pre:rename_usb_config.py

; Adafruit Feather ESP32-S3 TFT
[env:adafruit_feather_esp32s3_tft]
extends = common:esp32
board = adafruit_feather_esp32s3_tft
build_type = debug
;set partition to tinyuf2-partitions-4MB.csv as of idf 5.1
board_build.partitions = tinyuf2-partitions-4MB.csv
build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32S3_TFT -DCORE_DEBUG_LEVEL=5
; -DCONFIG_ESP_CONSOLE_USB_CDC=y -DUSE_PSRAM=1
; -DDEBUG_SERIAL=Serial1
extra_scripts = pre:rename_usb_config.py

; Adafruit Feather ESP32-S3 Reverse TFT
[env:adafruit_feather_esp32s3_reversetft]
extends = common:esp32
board = adafruit_feather_esp32s3_reversetft
build_type = debug
;set partition to tinyuf2-partitions-4MB.csv as of idf 5.1
board_build.partitions = tinyuf2-partitions-4MB.csv
build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT -DCORE_DEBUG_LEVEL=5 -DCONFIG_ESP_CONSOLE_USB_CDC=y
; -DDEBUG_SERIAL=Serial1
debug_tool = esp-builtin
extra_scripts = pre:rename_usb_config.py

; Adafruit Magtag ESP32-S2
[env:adafruit_magtag29_esp32s2]
extends = common:esp32
board = adafruit_magtag29_esp32s2
build_flags = -DARDUINO_MAGTAG29_ESP32S2
extra_scripts = pre:rename_usb_config.py

; Adafruit Metro ESP32-S2
[env:adafruit_metro_esp32s2]
extends = common:esp32
board = adafruit_metro_esp32s2
build_flags = -DARDUINO_METRO_ESP32S2
extra_scripts =  pre:rename_usb_config.py

; Adafruit QT Py ESP32 Pico
[env:adafruit_qtpy_esp32]
extends = common:esp32
board = adafruit_qtpy_esp32
build_flags = -DARDUINO_ADAFRUIT_QTPY_ESP32

; Adafruit QT Py ESP32-C3
[env:adafruit_qtpy_esp32c3]
extends = common:esp32
board = adafruit_qtpy_esp32c3
build_flags = -DARDUINO_ADAFRUIT_QTPY_ESP32C3

; Adafruit QT Py ESP32-S2
[env:adafruit_qtpy_esp32s2]
extends = common:esp32
board = adafruit_qtpy_esp32s2
build_flags = -DARDUINO_ADAFRUIT_QTPY_ESP32S2
extra_scripts =  pre:rename_usb_config.py

; Adafruit QT Py ESP32-S3 NO PSRAM
[env:adafruit_qtpy_esp32s3_nopsram]
extends = common:esp32
board = adafruit_qtpy_esp32s3_nopsram
build_flags = -DARDUINO_ADAFRUIT_QTPY_ESP32S3_NOPSRAM
extra_scripts = pre:rename_usb_config.py

; ESP8266 Boards

; Adafruit Feather HUZZAH ESP8266
[env:huzzah]
extends=common:esp8266
board = huzzah
build_flags = -DARDUINO_ESP8266_ADAFRUIT_HUZZAH
board_build.filesystem = littlefs
upload_port = /dev/cu.SLAB_USBtoUART

; SAMD51 Boards ;

; Adafruit PyPortal M4
[env:adafruit_pyportal_m4]
extends = common:atsamd
board = adafruit_pyportal_m4
build_flags = -DUSE_TINYUSB=1
              -DADAFRUIT_PYPORTAL

; Adafruit PyPortal M4 Titano
[env:adafruit_pyportal_m4_titano]
extends = common:atsamd
board = adafruit_pyportal_m4_titano
; build_type = debug
; upload_protocol = jlink
; debug_tool = jlink
; monitor_port = jlink
; debug_init_break =
lib_ignore = USBHost
build_flags = -DUSE_TINYUSB=1
              -DADAFRUIT_PYPORTAL_M4_TITANO

; Adafruit Metro M4 Airlift Lite
[env:adafruit_metro_m4_airliftlite]
extends = common:atsamd
board = adafruit_metro_m4_airliftlite
build_flags = -DUSE_TINYUSB=1
              -DADAFRUIT_METRO_M4_AIRLIFT_LITE
upload_port = /dev/cu.usbmodem1201


[env:raspberypi_picow]
extends = common:rp2040

[env:raspberypi_picow_debug]
extends = common:rp2040
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
; platform_packages =
;    framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico
;    framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#master
board = rpipicow
build_type = debug
framework = arduino
debug_tool = cmsis-dap
upload_protocol = cmsis-dap
; board can use both Arduino cores -- we select Arduino-Pico here
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
debug_init_break = tbreak runNetFSM
build_flags =
    -DDEBUG
    -DWIFICC=CYW43_COUNTRY_UK
    -DDEBUG_RP2040_WIRE
    -DDEBUG_RP2040_SPI
    -DDEBUG_RP2040_CORE
    -DDEBUG_RP2040_WIFI
    -DNDEBUG
    -DLWIP_DEBUG
    -DDEBUG_RP2040_PORT=Serial1
    -DDEBUG_RP2040_UART_1
    -DDEBUG_RP2040_UART=1
    -Og
    ; Enable debug stack protection
    -fstack-protector
    ; Enable Exceptions
    -DPIO_FRAMEWORK_ARDUINO_ENABLE_EXCEPTIONS
    ; Enable RTTI
    -DPIO_FRAMEWORK_ARDUINO_ENABLE_RTTI
    ; ; Enable default USB Stack of Pico SDK USB Stack with none of below usb options
    ; Adafruit TinyUSB
    -DUSE_TINYUSB
    ; ; No USB stack
    ; build_flags = -DPIO_FRAMEWORK_ARDUINO_NO_USB
    ; -DPIO_FRAMEWORK_ARDUINO_ENABLE_IPV6
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Status: Needs Investigation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants