Deep Dive w/Scott: Raspberry Pi TinyUSB episode artwork

EPISODE · Sep 17, 2021 · 2H 17M

Deep Dive w/Scott: Raspberry Pi TinyUSB

from Adafruit Industries · host Adafruit Industries

Join Scott as he explores bare metal programming a Raspberry Pi to try and get TinyUSB going on one. He'll also answer any questions folks have. Chat with Scott and lot of others on the Adafruit Discord at https://adafru.it/discord. 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. 0:00 Getting started & mic trouble 0:07:27 Hello 0:08:32 housekeeping 0:11:30 Diving in to Tiny USB and CP on raspberry Pi ( see show and tell ) 0:13:40 desktop setup CM-4 compute module setup 0:15:00 Jeff Geerling (sp)for examples of GPU(s) on pcie header 0:15:50 Macropad shortcuts 0:16:40 Development workflow, serial, gdb, source code 0:17:47 what about peripherals 0:19:50 Biggest advantage - HDMI 0:21:32 CrowdSupply Piunora https://www.crowdsupply.com/diodes-delight/piunora 0:24:25 sometimes / rpi4-osdev bare metal github documentation https://github.com/isometimes/rpi4-osdev 0:26:35 boochow micropython-raspberrypi - https://github.com/boochow/micropython-raspberrypi 0:27:40 hathach/tinyusb 0:28:00 could you have 4 instances of CP across the 4 cores run independent of each other? 0:28:30 CP on virtualized HW. wow... that's going in a new direction! 0:28:40 other links / useful tabs ( maybe @tannewt can save all his tabs :-) ) https://github.com/s-matyukevich/raspberry-pi-os/blob/master/docs/lesson03/rpi-os.md https://github.com/isometimes/rpi4-osdev https://pinout.xyz/pinout/jtag# https://github.com/torvalds/linux/blob/1d597682d3e669ec7021aa33d088ed3d136a5149/drivers/usb/dwc2/params.c https://www.raspberrypi.org/documentation/computers/config_txt.html#enable_jtag_gpio https://github.com/hathach/tinyusb/blob/master/docs/contributing/porting.rst https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/bcm2711.dtsi 0:20:00 interrupts 0:31:15 code startup ( multi core start up ) 0:31:41 stack pointer 0:32:40 code from tinyusb 0:33:40 shrinking the code to get it all building 0:34:49 rPi USB licensed from synopsys 0:36:05 board_init in family.c from tiny usb / blink LED 0:36:53 uart prints / debugging 0:38:00 rebuild to get to “hello to gdb” / OpenOCD 0:39:49 it takes 7 seconds for the gpu to boot 0:41:02 start with jlink - since uart output didn’t work 0:41:49 set breakpoint at board_init 0:42:35 now there is garbage on the stack 0:44:23 exception vector table base address 0:46:00 set more of the system registers 0:48:12 two different rpi interrupt controllers 0:51:30 gdb jump start 0:52:30 read about Exception classed (D1.10.4) 0:54:20 Decode the ESR ESR_EL2 0x200_0000 1:03:10 check if there is interrupt pending *0xf300b20b 1:05:19 // print() and add an infinite loop 1:05:55 don’t trust the debugger yet 1:06:45 link to https://github.com/rsta2/circle ( while waiting for rebuild ) 1:09:00 blink and hello to gdb2 print worked 1:09:30 look at Circle ( from rsta2 ) initialization armstub/armstub8.S - from u-boot 1:12:30 concern about taking GPL code 1:13:25 tweek NOP and print 1:16:45 how is the stack backtrace initialized? 1:21:55 Stack overflow - what is the current execution mode 1:23:24 try qemu simulation 1:24:20 there isn’t a pi4 board definition, maybe a similar pi3 - see stackexchange type=raspi3 1:25:40 cpu kicks on with qemu 1:26:15 Is there a virtual jlink for qemu? 1:27:17 QEMU Raspberry Pi 3 support ( github ) 1:27:44 debug linux kernel with gdb and qemu ( stackoverflow ) 1:26:10 same place in qemu / gdb emulation ( in board init ) 1:30:19 qemu uart ( stackoverflow ) 1:30:40 The Arm Docs are quite handy sometimes like https://developer.arm.com/documentation/den0013/d/Boot-Code/Booting-a-bare-metal-system?lang=en 1:37:42 - how to reset qemu ? 1:40:00 qemu pc log ( stackexchange ) QEMU/Monitor 1:46:45 qemu’s documentation ( gitlab.io/qemu ) 1:56:52 quit qemu ( mon stop ? ) Found Ctrl-A X when running with -nographic https://superuser.com/questions/1087859/how-to-quit-the-qemu-monitor-when-not-using-a-gui 2:00:00 stackoverflow documentation on tracing / profiling in qemu 2:07:10 tracing QEMU guest execution ( wordpress ) 2:10:00 what does qemu trace ( stackoverflow ) 2:15:15 wrap up 2:16:33 does the STM32 circuit python work? 2:17:18 cat cam See Deep Dive Repo for an index archive of previous deep dives: https://github.com/adafruit/deep-dive-notes Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- 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/ -----------------------------------------

Join Scott as he explores bare metal programming a Raspberry Pi to try and get TinyUSB going on one. He'll also answer any questions folks have. Chat with Scott and lot of others on the Adafruit Discord at https://adafru.it/discord. 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. 0:00 Getting started & mic trouble 0:07:27 Hello 0:08:32 housekeeping 0:11:30 Diving in to Tiny USB and CP on raspberry Pi ( see show and tell ) 0:13:40 desktop setup CM-4 compute module setup 0:15:00 Jeff Geerling (sp)for examples of GPU(s) on pcie header 0:15:50 Macropad shortcuts 0:16:40 Development workflow, serial, gdb, source code 0:17:47 what about peripherals 0:19:50 Biggest advantage - HDMI 0:21:32 CrowdSupply Piunora https://www.crowdsupply.com/diodes-delight/piunora 0:24:25 sometimes / rpi4-osdev bare metal github documentation https://github.com/isometimes/rpi4-osdev 0:26:35 boochow micropython-raspberrypi - https://github.com/boochow/micropython-raspberrypi 0:27:40 hathach/tinyusb 0:28:00 could you have 4 instances of CP across the 4 cores run independent of each other? 0:28:30 CP on virtualized HW. wow... that's going in a new direction! 0:28:40 other links / useful tabs ( maybe @tannewt can save all his tabs :-) ) https://github.com/s-matyukevich/raspberry-pi-os/blob/master/docs/lesson03/rpi-os.md https://github.com/isometimes/rpi4-osdev https://pinout.xyz/pinout/jtag# https://github.com/torvalds/linux/blob/1d597682d3e669ec7021aa33d088ed3d136a5149/drivers/usb/dwc2/params.c https://www.raspberrypi.org/documentation/computers/config_txt.html#enable_jtag_gpio https://github.com/hathach/tinyusb/blob/master/docs/contributing/porting.rst https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/bcm2711.dtsi 0:20:00 interrupts 0:31:15 code startup ( multi core start up ) 0:31:41 stack pointer 0:32:40 code from tinyusb 0:33:40 shrinking the code to get it all building 0:34:49 rPi USB licensed from synopsys 0:36:05 board_init in family.c from tiny usb / blink LED 0:36:53 uart prints / debugging 0:38:00 rebuild to get to “hello to gdb” / OpenOCD 0:39:49 it takes 7 seconds for the gpu to boot 0:41:02 start with jlink - since uart output didn’t work 0:41:49 set breakpoint at board_init 0:42:35 now there is garbage on the stack 0:44:23 exception vector table base address 0:46:00 set more of the system registers 0:48:12 two different rpi interrupt controllers 0:51:30 gdb jump start 0:52:30 read about Exception classed (D1.10.4) 0:54:20 Decode the ESR ESR_EL2 0x200_0000 1:03:10 check if there is interrupt pending *0xf300b20b 1:05:19 // print() and add an infinite loop 1:05:55 don’t trust the debugger yet 1:06:45 link to https://github.com/rsta2/circle ( while waiting for rebuild ) 1:09:00 blink and hello to gdb2 print worked 1:09:30 look at Circle ( from rsta2 ) initialization armstub/armstub8.S - from u-boot 1:12:30 concern about taking GPL code 1:13:25 tweek NOP and print 1:16:45 how is the stack backtrace initialized? 1:21:55 Stack overflow - what is the current execution mode 1:23:24 try qemu simulation 1:24:20 there isn’t a pi4 board definition, maybe a similar pi3 - see stackexchange type=raspi3 1:25:40 cpu kicks on with qemu 1:26:15 Is there a virtual jlink for qemu? 1:27:17 QEMU Raspberry Pi 3 support ( github ) 1:27:44 debug linux kernel with gdb and qemu ( stackoverflow ) 1:26:10 same place in qemu / gdb emulation ( in board init ) 1:30:19 qemu uart ( stackoverflow ) 1:30:40 The Arm Docs are quite handy sometimes like https://developer.arm.com/documentation/den0013/d/Boot-Code/Booting-a-bare-metal-system?lang=en 1:37:42 - how to reset qemu ? 1:40:00 qemu pc log ( stackexchange ) QEMU/Monitor 1:46:45 qemu’s documentation ( gitlab.io/qemu ) 1:56:52 quit qemu ( mon stop ? ) Found Ctrl-A X when running with -nographic https://superuser.com/questions/1087859/how-to-quit-the-qemu-monitor-when-not-using-a-gui 2:00:00 stackoverflow documentation on tracing / profiling in qemu 2:07:10 tracing QEMU guest execution ( wordpress ) 2:10:00 what does qemu trace ( stackoverflow ) 2:15:15 wrap up 2:16:33 does the STM32 circuit python work? 2:17:18 cat cam See Deep Dive Repo for an index archive of previous deep dives: https://github.com/adafruit/deep-dive-notes Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- 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/ -----------------------------------------

NOW PLAYING

Deep Dive w/Scott: Raspberry Pi TinyUSB

0:00 2:17:32

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

API Intersection Stoplight Building a successful API requires more than just coding. It starts with collaborative design, focuses on creating a great developer experience, and ends with getting your company on board, maintaining consistency, and maximizing your API’s profitability.In the API Intersection, you’ll learn from experienced API practitioners who transformed their organizations, and get tangible advice to build quality APIs with collaborative API-first design.Jason Harmon brings over a decade of industry-recognized REST API experience to discuss topics around API design, governance, identity/auth versioning, and more.They’ll answer listener questions, and discuss best practices on API design (definition, modeling, grammar), Governance (multi-team design, reviewing new API’s), Platform Transformation (culture, internal education, versioning) and more.They’ll also chat with experienced API practitioners from a wide array of industries to draw out practical takeaways and insights you can use.H TV Podcast Industries Chris Jones, Derek O'Neill and John Harrison. TV Podcast Industries TV Podcast Industries is a podcast that provides discussions and reviews of various TV shows, including recent popular series like Alien Earth, The Sandman, The Last of Us, The Boys, and Daredevil Born Again. They also cover shows such as Ironheart, Star Trek: Picard, The Rings of Power, and many more, spanning both Marvel and DC universes, as well as other genres. Heart to Heart Podcast One on One / Next Level Studios In the Heart to Heart Podcast, we talk to some of our favorite & most interesting people in the entertainment industry so you can feel empowered and learn that even in the most challenging of industries, where there’s a will there’s a way.Whether you’re an actor, a writer, a casting director, a talent rep, or just someone interested in the behind the scene happenings of the entertainment industry, this podcast will have something for you. NOW, this isn’t just another How To podcast for actors. Plenty of those shows already exist. In Heart to Heart, every guest will share stories inspired by their sometimes winding path to success on their own terms. Revisionist History Pushkin Industries Revisionist History is Malcolm Gladwell's journey through the overlooked and the misunderstood. Every episode re-examines something from the past—an event, a person, an idea, even a song—and asks whether we got it right the first time. From Pushkin Industries. Because sometimes the past deserves a second chance.To get early access to ad-free episodes and extra content, subscribe to Pushkin+ in Apple Podcasts or at pushkin.fm/plus.iHeartMedia is the exclusive podcast partner of Pushkin Industries.

Frequently Asked Questions

How long is this episode of Adafruit Industries?

This episode is 2 hours and 17 minutes long.

When was this Adafruit Industries episode published?

This episode was published on September 17, 2021.

What is this episode about?

Join Scott as he explores bare metal programming a Raspberry Pi to try and get TinyUSB going on one. He'll also answer any questions folks have. Chat with Scott and lot of others on the Adafruit Discord at https://adafru.it/discord. Deep Dive...

Can I download this Adafruit Industries episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!