 Hello everyone. Oh don't fall off kitty. Come on. Don't step there. Sorry the cat's getting on my lap and he has tipped my water over before and I have a full glass so making sure he doesn't knock everything over. Okay so oh I guess I don't need my headphones. Do I? Forgot that. It's a habit. If you haven't watched my stream before, welcome. Check the time codes in the document or in the description below. It tends to be a pretty long stream so you may want to check that out. He stepped on the have an IO board and he stepped on the like pin headers bit and almost fell over. We've all been there. Stepping on pin headers is no fun. So I'll just take a little while to get going. Hey PT. Well since we just got started I was kind of right on time. So hello unexpected maker. Hello Bruce. Hello Beata. Hi Randall. PT. Hello Andrew. Hello Bruce again and Mark. Thanks for stopping by. I'm just gonna I'll take a couple minutes before I get going. Hello Anthony. Oh I should also say that if folks do you find that YouTube will be on a bit of a delay because of because I have the auto captions on. So it's normal latency on YouTube. If you want I think Twitch is going so you could hop on Twitch and it'll have less less of that. Bruce says did you change your lighting? I think it's just the time change right? It is to light out. I do have the shade down somewhat. Don't bite these. He's like when he is all purring and stuff he just wants to rub his face on a running and I've seen him like bite it. Can I cat cam over here? Come with me. Come with me cat cam. Can you see him? I can hold it there. Say hi Spook. He's gonna ruin my keyboard. I guess a good lap cat cam. Let me say hi to some more folks and then we'll do housekeeping. Hello King or North. Hello X micron. Hello Cedar Grove. Hi Paul. Argon 1 and 2. Nice. Hello. Hello Andy Roberts. Hello Chi. Hello foamy guy. He's a happy kitty. It is nice that he's been doing better. He's actually able to get up on the desk all by himself. Oh and I didn't pause the videos coming back to me yet. Simon says hi Spook I hope you're doing well. He's doing really good. It's been really awesome. He's been doing much better so thank you. Okay housekeeping. If folks want to take so David I think is out today if you want to drop like titles that I could put in the YouTube chat or like that I could put in the time codes put them in the YouTube chat I'm actually gonna try to pull the the chat logs back out and maybe use those in the description because I think they are time-coded for me as well. I'll take a time code here to set it up. Hello everyone my name is Scott let me put cat cam back now that the cat stopped my lap. This is obviously a pretty relaxed stream here we've got going on. If you don't know my name is Scott and I work for Adafruit on Circuit Python. Adafruit is an open source hardware company open source hardware and software company based out of New York City and I work for them remotely so I'm actually in Seattle here which is why my times are usually in Pacific first that's the time zone I'm in. Circuit Python is a version of Python for generally microcontrollers which are little inexpensive computers have like tens of hertz of tens of megahertz I should say of CPU power and up to maybe like a few K or few up to a megabyte of RAM and flash. However I've been working on getting that on the Raspberry Pi so Circuit Python is actually going to come to a world where we have a giga RAM gig or more of RAM and flash and hundreds or even over a gigahertz of CPU power so it's going to be pretty wild. We'll talk about that in just a bit. If you want to chat with me and others we have a chat a discord chat that lasts kind of all week. You can go to adafru.it slash discord to join there. That's a way to just keep keep attentive of what's going on besides these besides these deep dives. These deep dives happen every week normally Fridays at 2 p.m. Pacific occasionally I shift it to Thursday if I do want to do it on that day or do it on that week but not on that Friday but I haven't done that in a while. She says everyone here is very nice on discord. Yes we do have a code of conduct so if there are mean people we we try to get them nicer and if that's not the case we'll we'll boot them out. Normally Fridays 2 p.m. Pacific we go for about two hours so we got lots of time for questions. Go ahead and ask questions if you have them. I'm happy to take two tours and tangents and answer things the best that I can. I should say in terms of timing next week will be on Friday as well but the week after is Thanksgiving here in the U.S. so I'm just going to skip that week so be aware of that. And that's it. So last week I was having USB troubles and I did a couple things that I talked about on the stream to fix it. One thing I did was I got this like fancy USB card and I tried to plug in like the salier and that just like didn't work. So I was very very frustrated. I actually returned it so don't don't take that as my endorsement for that USB card and I actually picked up a less expensive version that doesn't do quite as high speed but has the same approach and it turns out that it like I was using the card just before the stream and has the same problem so let me just highlight this right now and maybe somebody who works in the Linux kernel can fix this bug for me because I think it is actually it may be a software bug not a hardware bug but these are the errors that I'm seeing. It says error transfer event TRB DMA pointer not part of the current TD and it's been it's really frustrating that this isn't working and I think this card that I have is like half the price and it still seems to work okay. Generally this is the first trouble I had with it. I was running a salier on it yesterday and it worked okay so I might just hang on to this one but yeah she says lol the error seems to assume a lot of prior knowledge yes it does yeah so this is the first I've seen it the other thing that I did to fix my issues was I actually got a new motherboard I think I mentioned that and so this weekend I swapped in the new motherboard and that's what I'm using now and I already made the other one so hopefully they'll fix the other one as well. So that's been my adventures in poor USB support. It actually does make me consider like maybe trying to do development on Windows that might be hearsay but if they have a USB stack that is more resilient than Linux like they've been doing a lot of good work and I I think maybe I should try it yeah I know that's kind of blasphemy but so there was a USB port problem with the old motherboard I think so so so this is what I wish mother board mother boards were clear about right like it's the topology is PCI connects to USB and then so there's a bottleneck there in terms of like how much you can how much data you can go from USB to there and then everything downstream of that is basically shared right so a root hub usually has like one or one to four ports and then you'll have intermediate hubs that split that out to give you more ports so I wish the motherboards were super clear about like these plugs these USB plugs go back to this hub that go back to this root hub Bruce says I've had less issues on my Windows laptop and USB versus attempting the same with an arch laptop not a definitive endorsement yeah like the hubs the hubs themselves like what chipsets they are matters on to so on Linux what you can do is you can do us LS USB USB T and one thing that I don't understand is why this view does not have the names of the actual devices like I'm really trying not to heart or trying hard not to end up as a Linux USB developer like I kind of want to just do it and fix it all or like start working on it but at the same time like I'm sure it's a very difficult problem which is just really frustrating so so this USB LS USB T can give you an idea of like here's these root the root hubs and then everything that's from there is a is a shared resource sort of thing so I think what happened on my other motherboard is like somehow one of the the hubs that was on the motherboard failed so like a bunch of the ports no longer worked and if I booted it up I could see that there was like descriptor things descriptor enumeration errors so it's all very familiar given all the USB work I've done yeah Bruce says my only issue is WSL 2 and sharing ports there's a workaround but I do wish I could just assign a port to the lightweight yeah let me try that mark I mean I don't really want to like I would I think I would try to do it outside of WSL but again I haven't tried it oh there you go that's kind of weird the IDs are nested to the interface that is better though thank you mark like these should be higher level not lower level yeah it's been so frustrating it's USB stuff it's working though we've got three camera feeds coming in or three video feeds so it's not I'm asking a lot of it to be fair I'm sure I'm on that mm-hmm not a fan of building certified on Windows maybe it works yes yeah I haven't tried it so this is just my ignorance being like maybe that world's better I could be very wrong I do like a lot of things it gives more information but that doesn't mean that it's easier to do other board issues are a common thing mine aren't making my computer do weird things at times yeah this is not a cheap motherboard it's like the asus crosshair hero 8 like it's like the top of their line that's not like twice as much as the previous one one thing I didn't know about was LS top oh which is pretty neat I don't remember what I was following but it gives you like a diagram of your CPU basically CPU and memory so I've got like the 16 core right yeah it's it's not showing me everything but it's showing me like the cache all the caches and the CPU and stuff which is really neat so you can see like core 0 to core 15 so it's 16 core 32 thread and then here's like my the PCI tree for like my hard drive my network other stuff as well that's been pretty neat to you and there is an equivalent for PCI as well so you could do like LS PCI but I really like I would love to see like a comprehensive like view of the world is and then tie that back to like the actual motherboard and like how many of how does how does a motherboard breakout all sorts of like PCI and USB lanes and stuff so yeah that's been a saga the other saga that I'm going through nice it's a new tool for mark we can trade tools the other saga that I've got going on is I'm like super close so let me take a time actually so let's talk about the Raspberry Pi as you know I've been working on getting circuit by the running on the Raspberry Pi and that's not the Pico for those of you who are new to the stream that's actually that's actually on the Raspberry Pi Broadcom chips and I've gotten I've gotten flash working or SD cards working almost the problem is the almost bit from time to time I'm getting to the point where I can't like something crashes or it gets in an infinite loop and it stops working which is extremely frustrating so if I just power on so I've got a zero to W here I don't think I showed this last time I don't know I don't remember exactly how far I was but so here's a zero to W is is here and it's underneath my like debug hat thing so it's got it's got the USB serial output and also an SWD connector and lock that focus so I've got power here so let me just plug it into power and before we do USB I'll just show you that I do have a number of things working up and going so if we look here here's the Raspberry Pi's output so you can see it's enumerating the card and I'm actually reading the partitions so there's like the MBR which is the master boot record in the front that tells the OS how things are split across how things are split across the card and so what we can see here is we have one partition that starts so turns out 2048 is the number of sectors in a megabyte so this is that one megabyte and it goes for 255 more so it's 200 the first 256 megabytes are the boot drive and then the second partition here is what will be circuit Python and so you can see that we're successfully reading the card we're doing the frame buffer stuff which I forgot to plug in so you will see that so now I'm so this is not over USB this is over USB to serial but I can do import OS OS dot Lister and now I get the files that it's created on there I can open code.py for reading and I think it's just empty actually because it's doing the like I haven't allowed circuit Python to write the drive so I can't write it from here but it does run if it was non-empty so that's cool I don't think I showed last time I don't think we had your sending communication to it working so I did get interrupts working mostly there's actually a bug that maybe I'll get sucked into here but as you can see I can type in so I do have the you are interrupts working successfully which is what I think last week I left off with is like we got your out but we do not get your in so your in is working and then once I got that working I also got USB once interrupts were running USB was running too which is pretty neat so then I went was working on the SD card stuff and that has just been also very frustrating if you saw me on show and tell on Wednesday I was like a little disheveled because I had like woken up and like been working and working and working trying to get it a demo going for show and tell and I like made a little progress but not quite enough progress so let's just see what works hopefully it won't take the stream down because the USB is definitely not super happy with me but I'm going to plug in into the second USB port another one and let's just flick it on and see happens I was looking a little rough I took a shower after that I took a break it was good I'm just like so close hey oh so here I'm a little closer so circuit pie showed up when I turned it on let's see if I can load it I can't like it's trying but if we go back here now it's hung so let me turn it off so hopefully hopefully everything is working it appears everything's working still and let's just take another gander at this back trace before we move on to other stuff LS Topo ASCII oops that's not what I want okay so let's GDB in okay so this is what it was doing when I looked earlier I might have to take a look at this this is a new bug for me I'm like in the IRQ but if I do a back trace like it's broken and let's see registers yes I'm not sure where I'm at arm interesting it's not telling me that we're in something particular and then what I just realized also is that I could look at that interrupt controller state pending one I wonder if it's a an interrupt that we're not servicing correctly a lot of nested PCI bridges I think that stuff is really cool and I think it's important for people to think broadly not just about their CPU but the memory structures around it I think the RP2040 did a good job and Apple does a good job with their M1s I think that's one one thing that sets them apart okay here so we're it looks like timer one is pending I wonder if this is an issue like I wonder if maybe one thing that could cause this is if there's a write happening to the file system and then timer one is turning on to turn on the tick let's just see if I can't I do have other stuff to show so uh don't let me spend all the the whole time on this we've made a lot of progress on the BLE apps that I want to talk take a look at but this is this is why I haven't gotten to it yet it's because I've just been sucked in like I'm so close to having circuit python working like you would expect on these things that it's just like incredibly frustrating for me um so I wonder I wonder wonder wonder wonder why I wonder if we're stuck in an interrupt loop so an interrupt loop happens if uh an interrupt occurs but you don't clear it oh if that were the case supervisors shared no this is the wrong supervisor directory I want the broad call one supervisor shared port port is what I want so what we can see here get raw ticks we're using the system timer and then here's the timer interrupts where we reset it and then we clear the bit I wonder if we just didn't do that whether that would be a problem it won't auto reload then so the other thing that I've done is um I actually have it building images now so you'll see that it actually created a disk image here um which allows me I'll just show this first I'm going to unplug I really need to get power switches for these microbees so I'm going to plug in the SD card but instead of doing my manual thing I'm actually going to show you with rpi imager so I can run the raspberry pi imager here hit choose os use custom and then it's already up in this directory for the zero to build so I'm just going to select the zip file collect select the SD card and I'm just going to let it write so this is what I was I'm experimenting with is that um it does the imager may erase the whole thing which is kind of unfortunate but if you look at the output here it actually says that it zeroed out the first and last megabyte of the drive so what I have is the the circuit pi drive lives within those bounds so that hopefully when you do an imager it will actually preserve it you should always back it up if you really care but um I think at least for me the way that that this is like it should preserve circuit pi I don't actually need to use the imager every time I could just copy to the drive itself but I thought I'd show that I do have disk image artifacts coming being spit out now which is what we would need to end up in the pi imager so I was figuring that out yesterday I'm pretty happy with how it turned out I can just show briefly how it's done momentarily and let me just show in the make file here we have this new disk image step and it depends on the kernel image and what we do is first we create kind of an empty file of 256 megabytes we format it with an mbr we format it we add a partition for the remainder I guess this should be one megabyte and then we do a fat file system in at that offset and then what we do is it turns out there's this package called m tools which is like took me a while to find because I was going to thinking I would have to like create a loop device and mount it and blah blah blah but turns out a lot of these tools you can use directly with the file you just have to be you have to know the right way to do it so m copy what it does is it takes dash i meaning for image so it says like here's this file and at the one megabyte offset there's a fat file system so copy these files into it and this first line ends just like the second one so it's like the colon means the disk you're doing on the line and the second one is like if it was c colon something c colon like in this case it's colon colon so this copies these files from my file system into that image then I zip it up and then I remove the irregular image um so I was really happy that I got that building so this will allow you when you install circuitry done for the raspberry pi to do it by just using the imager to image an sd card and it snags you can see here that it's snagging like the boot code and the start elf and all that stuff that's usually in your boot drive boot drive and putting it all on there for you which I'm pretty happy about um which is why I'm like so close there's a couple of the things I want to do uh but like this drive stuff is just so close that it's frustrating me a lot um so let's see how it does here if we don't do the tick stuff maybe that's our problem um I don't know why it goes straight to the rebel there must be like some random character here that's happening so now I'm going to plug in the other cable I need to actually imagine if you can use a new f2 to flash a pie I thought about it um what we could do is like provide an image that does you have two all right circuit pie showed up open it no we can we can it's just slow for some reason the flash stuff is really slow which is unfortunate but let's push our luck do you wish to do with this file I wish to open it um okay so where's my output so let's try all the things here so let's close pie imager and do to dev serial so what we have here is on the left we're connected to the serial via usb directly and then on the top right is the mirrored version of that via the usb to serial so now what we have in this this corner here is the code dot pie so let's just try that if we hit print hello world and hit save okay so that didn't do anything but we we stopped to the timer from working and the timer is the thing that counts down to do the auto reload so let's just hit control d and we can see it said hello world so that's super exciting so it did it it successfully wrote live from internet I don't know let's try it again and again it didn't reload because the timer is not on but if we hit d again it's so it's almost working we've narrowed down the reason that it's not working so I'm going to keep in this vein even though I have some really other some other exciting stuff to show as well pierce it so it's going to be an image and not a uf2 makes sense I think an image makes sense we could potentially actually do tiny uf2 that's one thing to think about is we could we could basically have another bootloader where tiny uf2 would just act like normal but I think for the pie ecosystem it makes sense to have images as well mark says do you think the pie foundation are designing an arm a processor with a uf2 bootloader built in surely that's the future I mean it would be cool it would be cool they have their bootloader right like they have a bootloader the bootcode.bin or whatever so they could actually do uf2 actually I wonder if we could run bootcode.bin yeah I think that would be neat it's not necessarily as clear about what what a uf2 bootloader or Raspberry Pi means though given that the files that it boots are on SD cards and like the the bootloader knows how to read in a file system on the SD it's not not like on the micros where you're like running directly from things it's not as clear so it's not as as clear what uf2 means in that world we could fake it but it's not like you could have uf2 write kernel 8 image only and stuff but that's not necessarily what you actually want but yeah okay so let's see what I messed up I want to do ocular so something is different between the BCM 2711 and the 2837 which is the um so here's the notes about that actually do we have are we jlngton we're not jlngton okay so i'm gonna disable usb since we're gonna jlink it I wanted to see if the svd file looks correct for the timer because it's possible that our address for the timer is wrong and that would mess everything up so my theory is that we're successfully enabling it but we're not successfully saying that it's been handled so that looks correct we can see that the m1 bit is set and that's the bit that we're not correctly clearing and if we look at c1 why that's not happy so so the channels zero and two are used by the gpo and then c1 is the one that we're trying to set so the other thing that could be happening is that if my irq handling code's not correct uh that could be a problem too so let's take a look at the peripherals code and make sure that uh interrupt handlers are right and they're probably not oh no maybe they are that's right i have them in the same so this is the timer one irq handler so that looks correct so let's um enable these and let's just do a print here let's make sure we are ticking so i'm gonna make again but i'm not going to use raspberry pi imager um i don't have the network boot going which actually has been working pretty well this week but because i'm on the zero two w and didn't want to mess with it i haven't net booted so i'm gonna do it the old school move the sd card way everyone's distracted by do you mind dev questions that are related to eight different libraries than not this specific effort for raspberry pi circuit python i don't mind at all i'm happy to go down other routes i've i've had really good discussions about things that are unrelated to what i'm working on so that's totally cool and if it's too big of a topic i'll let you know my like i gotta change my setup for this i don't i think i've talked about it but i have like a proximity sensor next to my track ball that tells me how my hand is there and it's just like every time i'm like ending up moving my track ball and it gets me out of range and i type ends everywhere okay so i just i'm just gonna copy the kernel image back over so this is the old way i was doing it it's a lot faster than the imager because the imager is copying everything and i really need really really really need to get some usb switches so i don't i'm having to plug and unplug which is just not not a fun thing to do so before we connect usb well we can see that the tick is working just fine it's still going so i guess let's just see what usb does the switch on this usb cord is like really disappointing so the ticks are still going it's gonna be even slower i wonder like this could be that like the infinite loop sort of deal it's kind of hard to tell if there's anything happening in between because obviously just spewing ticks so disable i don't think i actually showed i i don't think i've showed you this code it is weird to me i don't feel like it should be it's just in the wrong spot i need to switch it to a touch sensor does usb device boot work on the zero two i i don't know i haven't tried the usb boot mode oh so um and lim home has a question that says i i tried to submit a pr to platform detect but it failed testing related to pilot and the no self use check i see there are some items in the file using disable no self use and others using enable no self use is there a rhyme or reason when to enable or disable the no self use check aka we're in the file to put the function object so um i think a better way to fix that is to what you can do is you can mark a function as static you can do at static method and then actually remove the self from it like you shouldn't actually need self in the arguments if you're not using it you want a static method instead but obviously i'm not sure melissa knows that that's why you've seen it other ways in that in that code so you could ask melissa who's code that is but you could also just make them static methods and then pilot won't complain dexter asks have you used the leds on your dev board much uh just briefly i was using it um i was using one of them just as a trigger so when i was doing a salier i was having one line go high when i wanted to start the recording and i was using one of the led lines for that so it's kind of nice to be able to visually see it too but they're most useful right at the start when you really have no like if you don't have prints or anything working leds are really nice but at this point because like i've made a lot of progress they they become less and less useful um okay so this is the interrupt handling code and yeah i should just cover the vealy stuff but i've been so deep into this stuff already so here's how the so this is like if it's not the the pi four then this is what happens so while anything is pending um so the basic pending register is interesting and i think i kind of showed it um it's still ticking um the basic pending register is here it's here so um it's here so one thing that's interesting about the basic pending register it's kind of this hodge project of interrupts lines there's like these individual ones and i thought usb was there too oh yeah usb is here it's a weird order that it's rendering it um and then there's also these pending ones so so these are arm ones these are these two pending ones so these pending bits are aggregates of other stuff um and then these are individual ones so uh if pending one or pending two is set then you have to look at the second register which is what i just did um so here's pending one and you can see that timer one is is on um i don't know why ticks are enabled perpetually that makes me think that they're not working correctly or something so while any of them are pending we get the current pending um we get the now we try to find the interrupt ID so we say interrupt count is that is the interrupt count which is higher than any of the values and then we look at the locals first which is the first eight um and if any of those are set then we do that and we break if we haven't found anything now we look in the um the last directed ones and the the number translation to the bit is here and then finally we do the two pending registers and there could be a problem here but it seems to be okay it could explain why it's so slow if the tick is always on so uh let's keep going down so so this is all the ways to find the interrupt number that's active if nothing's found we break out of that loop that handles all of them otherwise we call the interrupt handler which is where this tick call is in so clearly that's working and there's this current interrupt thing that allows us to say whether we're in interrupt or not and then there's this enable interrupt stuff and this is where I suspect there could be a problem so if it's not the pi four and the number is less than 32 we use enable one or two or basic for the last eight get enable is the same and then disable irq looks correct which makes me wonder why ticks are always on like I thought they should be on on demand and if they're not that would explain why would explain why it's not I just had this slot in my brain of like did I get the and mmu actually set up correctly as well or are we running without caches I think we're running with the same caches so this looks correct for disable but it's also possible that it's not like the addresses could be wrong maybe if we go back here see this is oh wait no that enable disable is what's weird is that uh that's numbers higher all right let's get rid of these ticks the ticks are bothering me um let's we remove them here but let's do enable tick do you have to flash anything to the pi to get this to work or can I make the image and try it on a 3b plus um you could definitely try it on a 3b plus I think the challenge with the 3b plus is I'm not sure that um it has anywhere to do the usb so that's the problem is that um you have to have native usb broken out directly from the board so that's why the zeros are great is because they have the micro b connector um otherwise you'll have to do it kind of through the ur interface so I'm I'll probably like you'll be able to make a build for it and in fact you could probably just reuse the same build and it would be just fine um but I don't think I want to actually release builds for devices that don't have the the usb plugs on the pi for you can actually like the power c um yeah the pi zero will be better for the usb behavior um but the original zero I'm haven't added support for yet it shouldn't be too hard but it's just like I got to focus it's a different cpu it's not different peripheral so it's the a different problem okay so let's stop this madness stop this ticking madness I really need a switch switches are so much nicer all right we're no longer ticking it shouldn't be running all the time though try the zero two then back in a bit yeah zero two is super close that's what I'm running on right now I actually picked up a second one during during digi during show and tell kevin from digikey was like we have them in stock right now and actually let's let's we could take a look if they they it showed us two and then it kept showing us two which was weird oh that's what then results oh yeah so you might actually be able to buy one looks like they're still in stock it says they're still in stock here yeah digikey has two in stock all the time interesting that's how they're limiting people buying them does that mean I could have bought two I should have just bought two then oh I'm kicking myself I bought a second one because I always want to have a backup for something here I actually bought a second pi 400 as well oh bruce says I bought four oh well if anybody wants to pick them up I recommend it kicking myself from I'm not going to order another one but yeah two's a two's a great way good to have backups if you're doing anything with it it loads code that acts as sd card reader by default but could be pointed to circuit by them instead huh so yeah it looks like they're still in stock on digikey I don't know how many they got but they're listed weird but the description is zero to w so maybe it's kind of sneaky yeah the flirt cases I saw them on amazon for like 13 bucks did I copy it over I think I did I think one more has some pi zero two stashed if I ever needed them and I could probably ask the pi folks if I ever like broke two of them and really needed another one I'm sure I could beg so here's an enable ticks oh the enable ticks could be on because of the display it could be wow is it just like super slow is that the problem it's just slowing everything down because we're ticking all the time this is a case where could be beneficial to like set up in high and low to see how long ticks take I wonder if I should do that let's um turn the display off and see how well everything works that will isolate my issues boards zero two don't need this sd card stuff anymore it's interesting because I don't actually have a display connected this all works now I think the time I think the supervisor tick is for the display update scheduling as it's still writing the code dot pi it did seem to be quicker and we see that it's not starting ticks so in the second one got a circuit pi drive it's just really slow which I'm not sure why it's it's asking me what I want to do with the file like you know I want to open it so there's the auto reload enable we're not in the rebel so it's working pretty well anybody want to try it want to sacrifice a two zero zero two well it'll probably work sacrifice an sd card who wants to try it cool I think that's working well enough for me I wonder if um yeah Bruce has four of them I wonder why the timer thing is having so much problem so much trouble get some module is killing you I'll I'll send you a build if you would like me to I'll send you this build but I just ran I'll post it on the discord here I love that it's 12 megabytes that's mostly all of the other files so that's for the zero two w turn and burn that I hear try something yeah trying the zero two w build for a circuit pipe on I haven't tried to build circuit pi then yet but and pi built quick enough on the four core two gig vm on my desktop that's good all mine are too big what do you mean by too big like physically too big one thing I have is I have these um I don't know where these got I think I think we carry them in the store but I've got these um sd card holder things really handy and then I just have them in a small ate a fruit box which is nice yeah you can use that old four gig card circuit pi then's not going to know what to do with itself with four whole gigs it should it should set up so circuit pi is that giant and maybe that's why it's slow it says two terabytes free I think this card I was experimenting with this card earlier I might have messed it up 32 gigs shouldn't be too big try it so any card that's more than 256 megabytes should work because that's how big the images so the way that it works is that the image that I dropped in there is has a single partition just for boot and then I have circuit python code that looks at the partition table and if there's only one partition and it's only that 256 megabytes of the start of the card it actually goes and writes the second partition in the nbr for the rest of the card so they're like in raspberry pi you have this problem where you download the image and you have to put it in a card that's at least as large as the image but then like you have to run something I think to resize it to get the rest of the thing so this circuit python image is the first 256 megabytes circuit python checks the nbr and modifies it to add that second one to this add the second partition if if there's room so I kind of want to just erase this entire card because I was testing it earlier and I had a bug I had a bug that so fat might have messed up and that's that might be causing some of my problems here 128 megabyte cards are too small although we could rearrange it so that it would work but generally they're too small so let's just art i imager this because I think it has a way to just erase it all like at the bottom here it just has a race did you settle on pin names is it the same as with blink on any pie or maybe we don't have GPIO yet do we so digital in out should work um I haven't added all the pin names yet though and that's a good point that I should take a look at what blinker calls everything um but I haven't I haven't that's one thing I have to do is actually get like four dot working um so what do we have now we just have one removable drive and it's eight gigs big that's right so cancel safely remove and now let's select our custom image this might not be good enough still it's possible we're going to end up finding that oh you know what we could do storage I think if we did storage dot erase file system it might actually work it can't restart but it can doesn't have to do the restart I forget how it works I can't remember whether it erases before it restarts or after not seeing anything yet is it supposed to present a serial port via usb um if it's your first time running it maybe wait a little while but ideally thank you for trying it um when I first formatted it it did take a little while to like create the file system so that's possible um what I recommend doing is if you have a usb to serial device or even just another circuit python device you can use for it is to look at this serial output on the pins at the top which is what I'm having my usb to serial converter do um that should be able to tell you how far it's getting if at all be what this gives me never said it would work I just said you could try it that's the way it goes around here yeah so it still has my own code which well it didn't restart but I can restart it manually I think it is now or let's just see see if our drive size is right so it popped up again just so slow hey oh at least okay so it formatted it the right size again looking for the soldering iron yeah dan had to do this earlier too I had dan test and he's like I gotta put headers on it I have various ways to have pie pins on a clue or a feather or a pico so having a unique pie pin name would make the same could work in all the pie hats and bonnets whatever way I do it I've been starting to just call it GPIO number just like the pinouts diagrams do but I'll add ones for like sda and scl and stuff and in fact linux has names for the pins too so I was thinking of those as well is there HDMI output I think I just turned it off unfortunately I could turn it back on and give you a build here I'll do a build with the display on and see why it's oh you know no I do have I did update the MMU stuff hammer headers to the rescue I'll do a display build here it's still pretty slow and I'm not sure why but at this point I can't let myself get distracted I just got to like try it so let's turn this this back on another build and we'll try it on I'll try it myself and then we I'll post this build as well thank you for help a hub test for this works on a four the build I sent you works on a four oh it's a question and lindholm says did you say this would work also work on a fat pie a 2b 2b plus 3 or 4 I have a 0 to doesn't mean I need to use one um so yeah it should work not this build but another build would work on the four the four as well there's no b after it is there I think it's for b it works on there and it works on the the compute module four as well but not the build I posted the builds are the builds I'm making our board specific basically if they have the same chip they should work across them but uh they have like the name of the board that it's built for built in it's not dynamically detected okay so this is the one with the display and I can I'll just test that it's working without it oh you know I haven't set up let's see if this works let's push my usb further no it's not ryan says just tested and usb boot does work great for circuit by them with the loop option that keeps it running so you can reload with just a power cycle hmm how do you set that up could you send me a link you like how the cats hanging out behind me here all right three thirties my deadline I've got to show some other stuff pi 400 is not going to be that interesting until uh we get usb host working there we go so if you haven't seen this before uh hdmi output does work um and I don't know why I don't know why we're getting that like getting straight into the serial but let's try pogo pin clamp I wonder if I should buy more I'm like hi should I hoard oh it's not working now could be let's see so usb is not happy this is my life this is what my like weak has been I was just like oh it doesn't work something's happening let me go in here and pull it up in the oh you can't see I need to see the frozen screen I just can't help myself I've got to see what the backtrace is and it's exactly that again what was it current interrupt 72 so we're not actually in the interrupt like somehow we ended up there I really wish there was a way to like like the embedded programming is a non-stop battle to convince yourself you're not insane when things aren't working right I feel ya I really do so current interrupt 72 is the maximum number so that means that we never got into the interrupt handler we're just in this weird state where like something happened this is like what this is my this is what my week has been let me tell ya like it's telling us we're in IRQ which is in boot there's a jump you IRQ so this is why it thinks we're in IRQ IRQ goes into IRQ entry branch of link IRQ exit it works what did you what did you get working Bruce running around to find all my stuff SD card image pi powered HDMI found where's my HDMI capture card so I have to I didn't share the HDMI build did I it's not working as well as the other one for some reason just the repel yeah yeah the repel's been pretty solid um and you can like do the OS stuff from there happens if I this is simple like what instruction am I on did I somehow get into this code not in an interrupt the current interrupt thing is all within the handle IRQ actually yeah if USB is not working you can get the repel on the ur pins I might disable that in the long run but until USB is reliable I'll leave that on obviously okay what happens if you call you ret when you're not how do we get there thanks for the digikey hint ordered two ordered my pi zero two with a bunch of other stuff to get for shipping nice I was so worried I saw oh there's only two left I didn't order anything else and now I'm really kicking myself one I should have realized I could buy a two maybe I will maybe I'll take a look I think there's a STM board that I probably can't help myself and pick up the nucleos are just so small or it's so cheap circle by the director will boot the repel without even needing an SD card alvaro says I'm probably going to have to rewatch the series circuit by fun plus pi for bare metal I just came out of a lf course and I'm a bit less clueless about embedded stuff would be nice to redo this work but with a beagle five yeah yeah for a new cpu architecture like that you'll have to figure out all the compiler stuff and then the boot initialization and then any mmu and interrupt stuff if you're clueless about embedded stuff start with a microcontroller the application level processors are are much more complicated I wouldn't jump straight to application level stuff so I don't know like if I just continue break again like I'm just on the same instruction like yeah I'll ask my next foundation that was my guess so it is interesting that what do you think all these fives are five is zero one king of north says thanks god I also just bought two of the pi zeros and a few other things that I needed to go to Canada there is still no risk five microcontroller with usb uh true but the c you could do the c3 I guess circuit by the money runs on the c3 but I thought there was isn't there like a giga device risk five controller with usb it could be wrong the chip on the beagle I thought the beagle five was canceled I think you got an early one though that my Belgian dealer has pi zero w2 with soldered headers should I be lazy if you want to support them I'm sure there's a lot better margins on the headers Dexter says see in blink on HDMI it looks like I still need the serial though yeah this is why I'm like so close yet not there it's almost working it's just like some sort of bug some sort of bug that's causing me problems like maybe it's a I don't know again like this is where I really want like a stack a back trace that starts from the top so that when the bottom clearly is broken and I can still see the rest of it and maybe I could just I maybe I should just dump it native usb yeah not simply an integrated usb to serial yeah but I'm saying like if you want yeah if you want to play around with embedded risk five you could do that you could do it on the s3 or on the s2 but with the low power core the low power core can be risk five it's not very fast though I mean maybe this is where I need like a trace it probably makes more sense to just do print debugging unfortunately uh let's switch gears I'm I've spent all week on this sort of stuff it sounds like folks have it building so if you want to fix it for me that would be awesome I might have a few changes in my code so I'll push those after the stream as a backup like my computer has been so unreliable it's like gotta get it out there but we've got 30 minutes left and I want to switch gears because we have some other exciting stuff that's finally finally getting there so let me take it the second time out time code of the day which I'll I'll probably scrub through and add a few more okay so the other the other update that I want to cover today is actually the state of the bili workflow stuff so um let me just clear my desk a little bit here might clear I mean just like unplug this pi zero so as we've talked about we've we said there are going to be two apps and so I want to show those off and because they're both available through test flight currently which means that I'll drop links in the discord chat and uh you asked for a reminder yep perfect half past 30 because you want another topic to present yeah so let's talk bili workflow and bili apps um let me find the links and I will post them again in the live broadcast chat um bye pier blowing snow yeah get home um okay so here's the link for glider so uh you can now apple has a program called test flight that allows you to test apps before they're in the app store officially so these ones have gone through a minimal review process from apple to allow us to send like public links like this um but and then it will auto update the apps and stuff so uh this first one that I just linked file glider is a generic iOS app for transferring files over bili to and from a device it uses the openly available protocol that we created for circuit python but it is not circuit python specific so um you should be able if you do bili work and you want to be able to transfer files um the file glider app will work with whatever um not just circuit python um in practice it's actually pretty nice for circuit python right now as well although it doesn't cover the serial link so there's the first one and I will show that in just a second um and then here is the uh other app that we have and it's called pi leap and pi leap is a an app to get you jump started with circuit python specifically so it's taking kind of like a clutch a curated list of learn guides and making it really easy to just get those on the device so more stuff here and get out my phone so that it's rotated you can see this is my hdmi for my screen here um so what I have here is I've got let me snip this off I've got my glasses that I didn't my halloween costume on I'm going to finally take these off the off the glasses so I can set them on the table and do I care about this rubber band no for me to just cut the rubber band okay so what we've got here is we've got the led glasses I've got a circuit playground blue fruit and it will actually work with other boards um but this is what I got so far so here's what it's currently doing can I fit it all on the display here let me clear out my notifications and then um so here's my phone and test flight uh this is what test flight looks like um obviously I'm trying kde connected as well uh but here this is uh kind of how you can curate what things you have installed via test flight um so if I just go to file glider um I've actually already connected to um the circuit playground so it remembered that I was connected and I can just do explore and we can take a look at like this is the code that's running on the glasses right now um so I could modify that and in fact maybe I can do that um let's just do time oh it capitalized it import I don't know how many indents to do time is that slower I think that's slower so you could see that like uh file glider here had to like wait for the reconnect to happen and send that over so this is the this is the prosumer low level work with anything thing and I should also say what you can do is I think this probably says shrug still we don't actually have instructions um but because I'm connected through file glider I can go into the files app so if I pull up the files app now I see the name of the device here so actually it's it's already there so this is the top level and you can click file glider and see the devices that you're connected to so if you're connected to more than one device you should have multiple folders and you can click there and now I can see all the files again um so this allows other apps to edit the code over melee instead so if I hit code.py now it opens the code.py in pythonista what app is this I don't even know it's either that or like coder I think is what it's called um but if we you can see it blinking as the app like auto saves so if I just uh write it there and then it it saves in the background which makes it kind of like hard to tell when it's doing stuff like I don't even know did it go like we can make it real slow and again all of this is like not circuit python specific so that's pretty quick I expect to sleep the two seconds to be really slow maybe if I back out maybe that's slow so one thing you can do I think is um in file glider just here if I go back there and there's actually a log here so you can see which way is new we should change this so it's a reverse time but we can see like there this is like for the nerds out there um but you can see that it like wrote files and like there was concurrent list directories happening so that's it's meant this is meant to be low level it's meant to be very very much for debugging um so that's one of the options that's file glider and then let's show the other end of the spectrum here so um pi leap on the other hand is uh meant to be kind of like jump start get you going so what we have here the led glasses is uh this bottom one but if we do blink I've already downloaded it so there's a next an extra step where this symbol send button button send bundle button would be for downloading it but if I just hit send bundle now we can see that these lights stopped because it stopped communicating with the glasses and now we're blinking on the blue fruit so now if I go back and do the rainbows and send it now the blue fruit's doing rainbows so this is the opposite end of kind of what we're going for this is the I just got a blue a bluetooth device I don't know how to use it so I just want to like find this Adafruit learn guide and just start with that and get that going so that's really what pi leap is all about that's why kind of like it's the leap that you're making in my mind um and we're actively working on getting more things in this list it's all super early so if you find bugs please let us know um but the test lights are a way to test that so that is uh the first two and I just realized that I may not be able to reach the third thing I wanted to show um so let me just oh wait here it is so if anybody's an android user you may feel pretty left out because those are two iOS apps however we have an alternative for you and um security update available so here's my here's my android and uh this is chrome so this is not a separate app this is just chrome um but it's code dot circuit python dot org so this is live right now and it tells you to enable these two experimental flags that allow chrome on android to do experimental stuff now melissa has been working on this and she just told me earlier today or yesterday that it actually does work on mac linux and windows as well so if you're on chrome um you can do this web bluetooth stuff from the desktop as well so this is just the only option for android but it should work on other stuff as well so make sure you set these flags that'll enable the new bluetooth apis and then um these aren't connected right now i think they can only be connected to one thing at a time um so if you want to switch like this device can only be connected to one thing at a time so the way to reset that and let me just let's just unplug these for now um the way to switch what uh so there's a process called bonding which is like what device this device is like expecting to connect to and it remembers um johnny says are we done with circuit python on the raspberry pi yet we're very very close uh watch the earlier stuff there's just some a few crashes everything kind of works it just doesn't work reliably unfortunately um okay so to switch uh you're going to press the reset button so this is how circuit python likes to do things so we're going to press reset it's going to flash yellow for safe mode and then blue for bluetooth um and so we're going to do this and then when it's blue we're going to blink it and it restarts again but this time it's solid blue to tell us that it's basically like uh discoverable is the term so we're going to hit request bluetooth device it's not working refresh there we go nothing chrome needs permissions to scan for nearby devices oh you know what i updated my oh look i updated my android version that's why it's got a new permission so now i see serpi which is the device and i'll pair with that and it has this nice thing and i'll say pair and connect and i won't give it access to my contacts i actually haven't tested this beforehand johnny i was sending build test builds out earlier are you going to put some of the existing blue fruit bundles in there and like stuff from eight of box 14 i'm not sure if you have suggestions please uh let us know i i did not test this beforehand so this is and this is new android all right so let's let's just give it another i'm going to refresh that and then i'm going to do i don't have any secure stuff here so connected devices let's just forget so this is the like bonding side of um so we were cleared out this is the bonding side of android so let's reset here we refresh the page let's try it again all right so we didn't have to give those permissions again and connect no contacts i don't know why it's blinking red david says it did more or less the same thing to me less than 24 hours ago from chrome on windows 10 it didn't get past this stage um it's possible there's some bugs still so i know how we could debug this but we're just about out of time so i don't think i want to do that phil asked me to try to do a like quick uh one minute video so i think i might just try to do a quick one minute video on um on the ios apps now um one thing i should say is we just released a dan release 71 beta zero and if you're trying this android thing you're going to want to do that because it's got a fix for um using android with it so yeah this is not melissa's demo earlier this week worked but i'll have to chat with her about never got to step three yeah that's interesting yeah this is the problem with bluetooth so that's kind of finicky so uh if you are trying this um there's a way to debug and i think i showed this a number of weeks ago when i was actually working on it you can actually get the serial or the console javascript console output on your on chrome on your desktop um and it mirrors the rendering as well so that's that's how you would go about debugging this as you would see like the console output um there but unfortunately it doesn't look like it's happy with me so let's uh let's give up on that and let's see how i can explain pi leap and the other thing i should say is that i'm hoping to make a page on circuit python.org i thought i would get to that today but it's not looking like it i'm gonna put a page on circuit python.org where the test flight links are and then links out to like how to install the different apps and things for this so check that out um hopefully next week i just have been sucked into this raspberry pi stuff as you could tell okay so let me see if i can't do oh man i just went straight to twitter that's what i've been trained to do um let me so before i do this like one minute thing i'm just going into my bluetooth devices and making sure that i forget this because apple in particular is pretty picky when the like uh keys change so pi leap yeah so pi leap discovered that it's no longer connected let me just clear these up hello everyone this is scott from eta fruit and i just wanted to do a quick video uh on how to connect to a circuit python bluetooth device from an ios app we've got two app options here for you so the first thing you're going to want to do is press the reset button and then press it again when it's blinking blue um and then it will be solid blue that means that it's discoverable and then you can go into either app but preferably pi leap to start um and it will find the new device and now we're connected uh currently pi leap has three options for different uh sets of code that you can start with um we're gonna do we're already doing rainbows so we'll do blink you'll click here to download and then click a second time to send it but it's been cached for me so it's super quick to switch between projects and then we can switch back to rainbows or we can even do uh the glasses that are connected uh externally here so if we do that hopefully yeah it's got a lot more files to it so it takes a little bit longer but now we've got that third project um it's meant to get you started with circuit python really really quickly so that's pi leap uh check and check circuit python dot org for more information or eta fruit dot com for more information the second app that we've got for you is glider file glider file glider is uh much more low level uh file transfer so you can browse the files on the any device that does the file transfer protocol circuit python is doing so we can see here like what our boot out text is for example we can see a debug log um if we want to figure out what happened when things don't go right and last step uh we can also use the files app to browse all these files so if i do a quick off screen pull up the files app um from the top level what you'll see now is a file glider uh item and then you'll get folders oh oh i crashed it i was on a roll i don't know why it's not working well i found a bug um but normally what you would do is you would uh be able to click in here and get a folder for the uh device and then browse the files there um we can actually go back to glider here and just see if there's any logs at the bottom here about what we're wrong oh we need to make it uh so that we can see here there's an error here that says uh invalid internal status invalidating all received data so that's super helpful uh maybe what we'll do is i'll i'll kill glider i'll kill the files then let's go back and do you oh that's not all right so let's just pull it up again we're connected i've realized i'm over time there we go so so here's file glider let's we can do a time warp um now we can click here and it will load see if it works it might still be unhappy i'll have to send this video to Antonio webvious case says ugg stay off twitter i feel ya and so close you sounded really good up until i crashed thank you these are early i don't mind showing crashes on the live stream we we know that there's always crashes and that we can fix them but i'm not sure not sure what the issue here is um something's not happy i can't even like i can't hit back to go there either bummer the explorer still seems to work i think that the like the file there's a thing called the file provider and it runs separately there's an untitled folder that looks wrong so yeah i give these a shot let us know what you think obviously it's early i know it was way too long i wanted to think i was i was on time i'll i'll go back i'll go back and add time codes to this i can i can add time codes after the fact use the part when you were showing us earlier and add the voiceover that's true i could do that see the problem is i don't really like i don't have the skills to edit video so that's part of the problem um alvaro just said take two i'm not sure i'm not sure i'm not sure how to get it working again actually um um any questions about that we're just about to wrap up um we'll get it fixed it's not a big deal sad trombone but let let us know what you think uh you could do it in circuit pipe on dev or there are the source code is open as well um for both of those so uh and test flight has a way to give feedback as well so all of those kind of should work in terms of giving us feedback about how it works but we're so close just like just like this other stuff on the raspberry pie like so close reboot the phone reset the blue fruit yeah hopefully it wasn't a circuit python side issue although melissa did find one issue when she was doing the android stuff but yeah let let us know what you think um if you are an app developer want to give a shot making better apps for it oh yeah david said um so now we need black and pilot on the phone i would i love this idea of having like a more structured code editor um but it's a lot of work and we've been doing a lot of this basic mobile work already that i kind of want to i think we want to wait and and give it a little bit of time thanks minnesota menta have a great weekend i'll try to i don't know what i feel like doing that those i feel like i need to check in with people uh but if you do the if you sign up for the test flight you'll you'll just get um auto updated which is cool um the code dot circuit python.org should work uh should work externally she says i think on android you could attach the circuit python device as a usb storage device and then use emacs and termux yeah perhaps i would actually like to see usb support and code dot circuit python.org as well i think that would be neat any fat last questions i'd love to figure out why the raspberry pi stuff's not stable like if we're doing an e-ret what happens if you e-ret when you're not in an exception it should probably tell me so i'm not connected anymore that's the thing that my brain's just gonna be like i'll send that link to the app folks and be like oh foamy guy says most android devices i've seen don't support the type of fat formatting of circuit pie drive on devices fat 12 probably by the way the pie worked for me in the end hdmi storage in usb serial thanks and bye wow it all worked did you was that with your own bill or android can communicate via serial through a to and from repel you can edit files if your storage is writable it's pretty wild but they the pie worked i don't know why it's crashing for me like that it's a very weird crash i wonder if i wonder i could probably fix my that's what i should do i could probably fix my stack on wonder yeah melissa did some work with web usb to update the esp devices so she would definitely have the skill to add it to code dot circuit python.org too the code dot circuit python.org looks really nice now all right well that's it on time i'll ask any other questions that come up otherwise i reiterate things so thank you all for hanging out with me here on the stream next week will be 2 p.m pacific on friday and the week after that will be a week off again that's a deep dive it'll be just like these two hours here if you want to chat with me and a lot of others outside of the deep dive you're welcome to join our discord server by going to the url adafru.it slash discord that's the middle box here the bottom one is youtube and that goes away at the end and thank you to patrick and and david for doing time codes david's not actually here today but i'll do my best to give some rough time codes and patrick puts them together on the deep dive repo which is awesome a great way to search for it i'm sponsored by adafruit so if you want to support me please support them by going to adafruit.com purchasing some hardware there and obviously they pay me to do all this work so it's been awesome um that's it thank you all so much for hanging out with me today and testing and and trying all these new exciting things are kind of all getting to this point of being like so close so thanks all for hanging out i'll pet the kitty he's on the chair behind me and uh we'll have a great weekend so thank you all i don't have to sit switch to cat cam because he's just hiding behind me like the chair kitty not quite as cute as you're not in the window have a great weekend everyone