Deep Dive w/Scott: Epic Memory Bug #adafruit

Subscribers:
458,000
Published on ● Video Link: https://www.youtube.com/watch?v=DQVXNNUGvbk



Duration: 2:16:28
1,301 views
24


Join Scott as he covers more fixes for CircuitPython 7.0.0 including an epic memory bug that he and Jeff debugged. Scott will answer questions as well. Visit the Adafruit shop online - http://www.adafruit.com


Deep Dive happens every week. Normally Fridays at 2pm Pacific but occasionally shifted to Thursday at 2pm. Typically goes for two hours or more. Questions are welcome. Next week will be on Friday.



Thanks to David (@dcd) for taking timecodes and notes.
0:00 Getting started

0:06:31 Hello/Welcome/Housekeeping
0:10:00 Hot Reload issue from UM
0:10:30 What’s after CP 7.0
0:12:30 Espressif (feature on Ask and Engineer) - not supported yet
0:13:36 WipperSnapper
0:14:55 RealPython podcast plug - https://realpython.com/podcasts/rpp/75/
0:18:24 Reviewing Closed issues - https://github.com/adafruit/circuitpython/issues
0:23:10 issue 5021 - Watch Dog Timer (WDT)
0:28:00 Magtag hacked to access debug UART - handy for debugging
0:31:50 trying controlling the neopix on my feather840 with the guide with no success. couldn't find adafruit_ble.services.nordic in docs to help troubleshoot bleuart
0:33:10 When you use this m_new_obj_with_finaliser does the class have to have a finaliser or does it handle it automatically?
0:34:00 https://github.com/2m/fish-history-merge mentioned in discord
0:35:00 more spoilers - don’t look :-)
0:36:26 Can CP do quad and/or octo SPI ?
0:37:30 TG1WDT_SYS_RST ( watch dog timer reset )
0:38:30 gc: collect() outputs (main.c)
0:40:46 mention of adding file name and line number to debug _FILE__, __LINE__ ( thanks Jeff )
0:43:45 gc_collect_ptr() marking heap memory chunks that have pointers
0:45:10 the costs of using dynamic memory (16 byte blocs in ATB )
0:40:00 __del and bitmaps for finalizers (FTB - finalizer table )
0:49:00 gc_mark_subtree()
0:52:45 0x3ff80000 printed
0:53:16 esp32-s2 technical reference - Address Mapping in Table 20:
0:56:20 similar MP bug with Cortex M7 memory that shut the the memory bus
0:57:30 memory protection unit discussion
0:58:00 “it shouldn’t do that” reading memory causes bus to hang
1:00:56 last time throught the loop - the block was “1”, now it’s “2”
1:01:33 How did we come up with the block size of 2?
1:04:30 gc_alloc() FTB_SET and finalizer changing numbers..
1:07:21 Micropython issue 7716
1:11:10 fix in pull #5245
1:12:20 turn off long living - and the bug went away
1:13:14 - youtube visualizations of left and right “heap before after” low addresses on the left, high on the right - https://www.youtube.com/watch?v=CD3lyGS_W9o
1:15:27 Short lived / Long Lived in CircuitPython 3.x ( no layers of indirection )
1:16:40 Long Lived rules (import, Q-strings, etc.) placed on right side
1:20:45 search for long_lived, also allocators with _ll in their name
1:22:25 So it does compaction if needed?
1:23:00 Long Lived only impacts the allocation process
1:23:40 I2c bug also fixed this week - not long lived
1:24:40 earlier memory issue deep dive https://www.youtube.com/watch?v=baa5ILZTRkQ
1:26:08 my debug output is garbled although I have 115200 set.
1:28:00 build status for merge
1:28:50 - need to build CP ESP32 with debug flag to get debug strings
1:29:39 GDB learn guide
1:30:15 What did you use to make the heap graphic? / ( see tools analyze_heap_dump.py )
1:32:25 let’s talk nRF = issue #5240 ( see also #5241 for rp2040 )
1:35:13 (the faked sleep modes) Explains why i see the same power usage regardless of sleep mode, even time.sleep
1:36:25 sublime merge review changes
1:37:47 issue #5211
1:42:06 RESETREAS ( why nRF52840 was reset )
1:49:46 NRF / deep-sleep-with-circuitpython/power-on-other-boards learn guide ( oh - that is still a draft )
1:50:12 So you said about time sleep -- does that need an RTC, or just based on internal clock?
1:52:11 Nordic nRF-PPk2 Power Profiler Kit II product 5048
1:54:05 “need to figure out exception class” to throw
1:56:55 having deep sleep in CP is a game changer - CP knows what you are using
2:13:20 wrapping up #5253
2:16:30 sign off


-----------------------------------------
LIVE CHAT IS HERE! http://adafru.it/discord

Adafruit on Instagram: https://www.instagram.com/adafruit

Subscribe to Adafruit on YouTube: http://adafru.it/subscribe

New tutorials on the Adafruit Learning System: http://learn.adafruit.com/
-----------------------------------------




Other Videos By Adafruit Industries


2021-09-013D Hangouts – Ratcatcher, MacPro Grill and Star Trek Visor
2021-08-31The Suicide Squad - Ratcatcher 2 Wand #3DPrinting #adafruit
2021-08-31John Park's CircuitPython Parsec: Color Helper Module @adafruit @johnedgarpark #adafruit
2021-08-31Phototransistor - Collin’s Lab Notes #adafruit #collinslabnotes
2021-08-31JP’s Product Pick of the Week 8/31/21 PowerBoost 1000C @adafruit @johnedgarpark #adafruit
2021-08-31The Great Search: SP4T Slide Switch #TheGreatSearch #DigiKey #Adafruit @DigiKey @Adafruit
2021-08-30Star Trek Visor #Timelapse #3DPrinting #adafruit
2021-08-30Voltage Divider - Collin’s Lab Notes #adafruit #collinslabnotes
2021-08-30CircuitPython Weekly Meeting for August 30th, 2021 @circuitpython #circuitpython #adafruit
2021-08-29Desk of Ladyada - Round & Round We Go!
2021-08-27Deep Dive w/Scott: Epic Memory Bug #adafruit
2021-08-27Don’t Forget That Ground Clip - Collin’s Lab Notes #adafruit #collinslabnotes
2021-08-26New Products 8/25/21 feat. Adafruit IS31FL3741 13x9 PWM RGB LED Matrix Driver - STEMMA QT / Qwiic!
2021-08-26PMSA003I Air Quality Sensor - Collin’s Lab Notes #adafruit #collinslabnotes
2021-08-26JOHN PARK'S WORKSHOP LIVE 8/26/21 Arduino Modular @adafruit @johnedgarpark #adafruit
2021-08-26EYE on NPI – ST's ST25DV-I2C-EVO Dynamic NFC/RFID Tags IC #EYEonNPI #DigiKey @ST_World @DigiKey
2021-08-26Adafruit Top Secret! August 25, 2021 #Adafruit #AdafruitTopSecret @Adafruit
2021-08-26Python on Hardware weekly video 146 #CircuitPython #Python #MicroPython @Adafruit
2021-08-26Made in NYC 8/25/2021 Featuring Slider Trinkey Manufacturing and Adafruit Testers in Action
2021-08-25ASK AN ENGINEER 8/25/2021 LIVE!
2021-08-25SHOW and TELL 8/25/2021 #ShowandTell



Tags:
adafruit
electronics
diy
arduino
hardware
opensource
projects
raspberry
pi
computer
raspberrypi
microcontrollers
limor
limorfried
ladyada
STEAM
STEM
python
microbit
circuitpython
neopixel
neopixels
raspberry pi
circuitplaygound
nyc
make
makers
micro:bit
adafrit
adafruit promo code
ada fruit
adafruit coupons
raspberry pi zero
micropython
machine learning
ai
tensorflow