Deep Dive w/Scott: Moving CircuitPython to Zephyr #adafruit
Join Scott as he works on moving CircuitPython onto Zephyr. Zephyr is a very popular real time operating system with broad support and great networking. He'll also answer any questions folks have. Scott's next deep dive will be in January.
0:00 Getting started
2:41 Hello everybody
5:41 Dan picked up CircuitMatter
6:14 ESP 32-P4 - (not in production) 300MHz
8:26 porting CircuitPython (CP) to other chipsets with Zephyr RTOS
9:55 Nordic - all in on Zephyr
10:20 Nordic nRF54H20 features
12:00 interest in CP with RTOS
21:40 CP on ESP chips already based on FreeRTOS
13:30 mynewt / nimble bluetooth apache / mynewt
14:23 Major vendors settled on Zephyr
14:40 Zephyr and Arduino
15:40 comparing nimble and zephyr github pages - zephyr much more active
17:10 Zephyr and linux ( devicetree / compiletime configuration decisions )
18:09 micropython and zephyr port ( limited... )
19:00 target is to port all supported boards to zephyr!
19:50 zephyr supported boards ( even adafruit ) see docs.zephyrproject/org/latest/boards
21:36 targeting nodic nRF54H20
22:03 airlift and wifi coprocessor w/zephyr build support
25:10 Over the Air (OTA) updates of CP?
26:27 CircuitPython build system - moving to zephyr build system
28:03 using python from inside cmake
29:37 west ( zephyr build ) - make building zephytr
32:23 still intend to use TinyUSB / probably not the zephyr file system, just the flash
34:30 sticking with CP drivers for sensors and stuff
35:42 new devices have fast and larger RAM - consider a high performance lvgl displayio
37:57 dive into how is west actualy building
39:16 look at CMakeLists.txt for CP
40:00 circuitpython_main
41:15 Python build cpbuild/build_circuitpython.py and make -J32
44:49 makeversionhdr.py and its dependency (based on time) - don't write the file if it did not change
49:00 qstr processing
58:16 build trace process ( trace.json ) and perfetto
1:05:00 looking into Zypher heap API k_heap functions vs sys_heap
1:19:23 menuconfig / west
1:26:10 what about CP and multicore support ( perahps arduing and CP at the same time? )
1:33:00 update the heap configuration setting in .config
1:35:00 looking through documents regarding Kconfig
1:41:49 looking for .ld build files
1:43:55 what linker script is being used
1:45:20 found linker_zypher_pre0.cmd
1:48:30 using github code search to examine zephyr code for __kernel_ram_end - ( in *.ld ) used for heaps
1:49:35 noticed some Device Tree pre-procesing
1:50:30 what about HEAP_MEM_POOL_SIZE mentions in sources ( and K_HEAP_DEFINED / K_HEAP_MEM_POOL_SIZE )jo)
1:50:57 some CMakeLists.txt "code" would be better as python :-)
1:52:04 found _system_heap / _SYSTEM_HEAP - and check the link map
1:52:57 zephyr/kernel/mempool.c z_heap_aligned_alloc()
1:54:42 review the link error output undefined references
1:56:36 try adding CONFIG_HEAP_MEM_POOL_SIZE to prj.conf ( gets warning )
1:58:10 use "west build -t menuconfig" to set HEAP_MEM_POOL_SIZE (default 0 to 32768) ( HEAP_MEM_POOL_ADD_SIZE_* )
1:59:28 observe CONFIG_KERNEL_MEM_POOL=Y in build/zephyr/config
2:00:15 spaces around "=" in the config file caused problems
2:01:07 sublime merge "starting to call zephyr"
2:02:08 follow along at https://github.com/tannewt/circuitpython.git
2:02:15 zephyr branch discovered using the github branch button
2:02:38 No "Deep Dive w/Scott till January"
2:03:46 expect "CircuitPython 2025" blog post around the start of new year
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/
-----------------------------------------