Deep Dive w/Scott: ESP Hacking #adafruit
Join Scott as he answers questions and debugs an issue on the ESP32-S3. Tim is hosting next week as Scott moves his office out of the house.
0:00 Starting
2:03 getting started
4:00 foamy guy streaming next week Scott should be back following week
6:30 does the I2S library do both left and right channels / yes
6:58 new office description
7:59 option for green screen
8:35 likely will not work from home
8:47 cats stay at home no cat cam
13:25 wifi configuration in CP load credentials when loading
16:10 tiny code reader to read qr code
16:38 Metro ESP32-s2 issue 8288 watchdog timer
18:40 yield to freertos in CP maybe garbage collection?
19:44 replicate on new branch idf-4 still
24:50 review circuitpython/ports/espressif/Makefile
26:37 flash stays in bootloader
28:10 switch from flash target to regular target
29:36 try DEBUG=1 build
30:25 maybe switch to 82x branch
30:55 main is where CP works on 9.0 since mpy files change
32:50 warnings come from IDF not CP ( stricter rules for warnings from CP )
34:00 erase flash and build
34:50 no output, but CP drive popped up
35:50 look at flash and ram settings ( mpconfigboard.h )
36:45 it takes a while to boot 16MB flash esp32s2
37:05 expecting to get debug logging
37:35 copy debug config settings
39:00 still no debug output
40:20 may need to connect to debug serial ?
42:30 metro rp2040 has rx/tx switch
43:00 we have serial debug!
44:06 reset and observe the tio timestamps reviewing boot messages
45:00 tio showing duration since last message
45:47 try power cycle
46:10 first time after erasing flash the is extra delay
46:55 install new code.py
47:27 both cpus reset by watchdog we can reproduce the issue
47:55 saved program counter check map file addresses
49:21 check linker script
50:55 does CP do any JIT ?
51:30 Construct call add log message
52:45 could try address to line (addr2line)
53:35 not getting to the above iserted line
54:27 add another ESP_LOGI log statement in SPI.c construct
55:35 looking for where in the flow we are getting...
57:20 rebooting ... now we are "boot looping"
58:10 got above log messages!
58:42 look at espressif IDF docs for watchdog timer errors
1:00:10 disable or change watchdog timer ?
1:01:28 menuconfig increase interrupt timer watchdog
1:02:50 place panic handler in ram
1:03:05 do a make clean after menuconfig
1:05:20 would be nice to get a backtrace
1:06:00 3 seconds from last log till WDT
1:07:25 add more log messages CP DIO bindings also busio
1:09:40 could be USB issue maybe disable USB
1:11:10 esp code similar to imx
1:12:00 try without USB seems to be code.py related
1:12:30 maybe background task?
1:13:20 background tasks like filling audio buffers ...
1:13:50 adding logging to background_callback.c
1:15:03 partial rebuild for CP changes
1:15:20 MMU present ?
1:15:44 backtrace !
1:16:30 python tools decode backtrace lock acquisition aborting! (uses addr2line)
1:19:04 iram_0_0seg the panic code?
1:20:25 linker script magic
1:22:10 "no I don't understand what's going on"
1:23:00 "DO NOT USE FOR MASS PRODUCTION" ( psram or flash timing )
1:23:51 spi_timing_psram_tuning where the warning comes from
1:25:00 maybe turn off autodetecton
1:26:24 back to esp-idf github repo (v4.4 code)
1:27:16 ESP32 platform preferred platform
1:28:30 exp removed the warning what else?
1:32:40 maybe turn off psram tuning in menuconfig ?
1:33:15 what branch are we on CP is 8 months of fixes behind
1:34:35 would I use CP over C? ( yes ), but then it is work related and I find bugs
1:35:50 CP development workflow is easier
1:36:20 continue to merge and update with newer IDF code
1:37:20 make clean
1:37:50 prefer CP because it is portable
1:38:45 will the update fix it?
1:39:20 we don't use octal flash that much on other esp boards
1:40:06 micropython vs. circuit python tradeoffs pro/con
1:41:06 still get the backtrace
1:42:20 building in wrong directory :-)
1:43:33 git remote add espressif
1:44:00 git fetch unshallow
1:45:10 "1 core mode" sounds suspect
1:45:50 make clean / flash
1:46:20 deactivate ?
1:47:31 missing .h file ? esp_bt.h
1:51:00 turning BLE off
1:52:00 still aborted
1:52:30 verify idf version still in 1-core mode
1:53:00 idf builds prefer to not use multiple cores
1:53:35 menuconfig
1:55:40 rebuilding
1:55:55 menuconfig based on multiple kconfig files
1:56:30 http server / micropython vs. cp question
1:57:45 still aborted after slowing flash down
1:59:58 maybe logging is causing errors? ( consider log early api )
2:00:35 back to the original problem
2:01:17 GH issue github.com/adafruit/circuitpython/issues/8288
2:02:05 Wrap up discord open all the time
Visit the Adafruit shop online - http://www.adafruit.com
-----------------------------------------
LIVE CHAT IS HERE! http://adafru.it/discord
Subscribe to Adafruit on YouTube: http://adafru.it/subscribe
New tutorials on the Adafruit Learning System: http://learn.adafruit.com/
-----------------------------------------