 One, if you're watching this after the fact, make sure and check the comments for time codes about when things are going to get going. There's some housekeeping waiting for folks that happens at the start, so be aware of that. I'm going to try to set the twitch title, because I don't think the twitch title is. Oh, and I have to pause this. So we're just getting warmed up. Check the description for the actual time when we do that. Turn off the green screen. Anybody know how to set the title on twitch? Maybe I can't. I tried to do it through restream, but it didn't work. How's this audio level? It looks like it should be okay. Okay. Kitty cam. Had to restart. Oh, it's got the, we're doing some drywall here. So you can, this is the top of a stair. So let me move that. Audio is fine. Good. Let me say hi to folks. So hi, Mark. Hi, Bruce. Hi, Johnny. Hi, Jim. Hi, Sean. Directly on the twitch page. See, I, no, see I'm not, I don't actually have access to the Adafruit account, although I am a mod now, which is good. Hi, Randall. Hi, Ham's Labs. Hi, Todd Bot. Hi, Omsai. Mark Gambler. Loose there in Telemann. And Keithy EE. Johnny's spoiling it a little bit. Maybe if I do it directly, it'll work again. So folks have questions. Go ahead and do that. I'll do housekeeping in just a smidge here. Hi, Gary. Looks like Restream's working as well. Let me just try update titles again. Maybe I can do it when it's, no, it says connect an account weird. Looks like it worked for, oh, you know, it has an at symbol in it. Maybe that's what it is. No, it's had that before. Yep. It's another ski weekend. Taking a, I'm having a three day weekend. We're gonna, we're renting a cabin out near the ski slope. So it's going to be really nice to get away and be within like 20 minute drive from the ski slope instead of two hours, which is going to be awesome. All right. I don't know. I'll just be John Park, although that retro reflective stuff is really cool. Status title. Yeah. Nope. All right. Well, the Twitch, for those of you on Twitch, the title's wrong. Unfortunately, I don't have a nice green screen. All right. Let's get going. I've got some, I got some mailbag to show off actually that I didn't realize I was going to have, but so we'll do that in a little bit. But I think we've got some folks. I know we're on a weird day. We're on our, our, our backup day. But let me just tick timecode and kick it off here. So hello, everybody. My name is Scott. I work for Adafruit on Circuit Python. I go by Tan Newt online. So if you see me there, that's what you'll see me as. Let's see. Adafruit is an open source hardware and software company based out of New York. I'm based in Seattle. So that's why my times tend to be in Pacific time. And if you want to support me or them, please go to Adafruit.com and purchase some hardware. I know that Feather RP2040s were a hot ticket yesterday. So that's exciting. So thank you all for, for purchasing those. I actually, I didn't know what the price was. I saw that they were $12 and I was like, wow, that's a really good price for a really good feather. So it's going to be good when there are more available. And I'm sure I know we have more chips than what we put in the store. So it shouldn't be like weeks and weeks until we do get more in. Circuit Python, if you don't know, is a very easy to use, easy to get going, easy to iterate on version of programming, Python programming for microcontrollers, which are little tiny boards. And I'll show, I usually show one off to, to emphasize how big they are. So here's the, I got a production version of the Feather RP2040 and nice Adafruit Black, which is awesome. And I was very lucky. I like earlier in the week when they were manufacturing them, they actually had some flash issues. And so a little more actually sent them to me. Oh, it looks like you need to be an editor to change stream details. Yeah, $12 is nearly ludicrous. Yeah, I mean, it's, it's a, it's $8 more than a Pico, but there's a lot more going on on this feather than there is. So for those of you who don't know, comparing, let's see, here's a Pico. I know I'm not done with housekeeping, but, but let's, let me, I don't, I didn't get the overhead going. So, so they're pretty similar size, and sorry for the shadow. So the feathers on top, the Pico's on the bottom. Some things that you have on top that you don't have on the bottom is a lipo charger. So you can plug in a lipo battery there. There's a STEMA QT connector there on the end. You have both a boot select button here and a reset button somewhere over here. It's eight megabytes of flash instead of two. And that was a last minute change. They were going to be four, but she had trouble with getting the four going. So she was like, Oh, we'll just do eight. So that's awesome. And let's see, we have silk screen labels on the top and the pinout is a standard feather pinout. So existing feather wings will work with it. And of course, it has a status RGB LED on there as well. So as you know, those of you who've, who've watched, I've actually had a the Rev A prototype of this, the green one that's been my kind of daily, daily driver in terms of this is the green one. This is a Rev A. This is the prototype version that I've been using because it's it's much more convenient. So yeah, so very exciting that these are out. There will be more coming. And let me not get too distracted. Bruce says, I saw some teaser from OLMX, where I think they had an HDMI connector. Yay. Awesome. Yes, Sean says I didn't get notice of stock. So sometimes early, early on, we don't actually do the email because I think actually a little more told told me that like there's actually 2000 people on the list to be notified. But we only put like 200 in the store. So that's why it's in the in the works. We didn't want to send out a bunch of emails and not have anywhere near the stock that we need for it. So hopefully going forwards, I think last night they were they were on during the live stream. So I think maybe next week that's probably a good time to check as well. I'm sitting in the discord. If you're in the discord, sometimes the links will go by when they're in stock. That's another way to tell. But don't be don't be too sad because I do know that we have a lot more chips, which is the thing that we're waiting for. So now it's just a matter of actually picking and placing them. Anyway, okay, so housekeeping. If you want to chat with me and a lot of others, you can go to the Adafruit discord server at adafru.it slash discord. That's the gray box here is the live broadcast chat. And there is a bug in the in the overlay thing from discord that makes it not have everything on there, which is a little unfortunate. The white box is YouTube. We're also on Periscope Twitter, which is Twitter, LinkedIn, and Twitch. But that chat is a chat window that's not broadcast. Okay, deep dives. This is a deep dive. It happens every week. It's normally on Fridays at 2 p.m. Pacific. But occasionally like today, it's shifted to Thursday. I'm taking tomorrow off. I'm going skiing and actually staying the night at an Airbnb for the Friday, Saturday night. So we won't be here. So take it a long weekend. That's why we're on Thursday. Typically goes for two hours or more, probably about two hours, about four o'clock today, because they don't have that much. Interesting. So John Park was trying to fix the title for me and says that the hashtag RP2040 violates some Twitch naming policy is the problem why we're having some trouble there. LancerTronics says what... Oh, wait. So questions are welcome. Next week, we'll be on Friday, doing a full week of work. Next week. And the last housekeeping before I get into questions is the cat is Spook, and he is epileptic. So he does have users from time to time. I'll just mute myself and watch him if that happens. But generally, he's been doing really well. So I wouldn't expect it. He's just curled up. Okay, that's housekeeping. I know David, DCD usually does time codes, but Thursdays he's unable to make it. So I'm going to try my best to do time codes here as we answer some questions. So I'll take a time code and answer LancerTronics. So... And if somebody else is dropping in there and wants to not conflict with me, just let me know. Asks what sort of questions or comments to go on Discord versus YouTube chat. Generally, I think Discord's a better place to be. You know, years ago now, we started the Adafruit Discord because we found that we had these common-set of people that would always hop in the chat for the live streams. And the nice thing about Discord is that it doesn't disappear after the live stream is done. So I think the Discord is strictly better than the YouTube chat if I had to say anything about it. Okay, so I do try to monitor both. So folks have questions. Omsai says, I don't see the reference times you're using. So I have a time stamp here, but if you just do by YouTube at a time, that will be close enough if you're doing that. Um, YouTube doesn't show time since start. Oh, I don't know how... I don't know how to... I don't know how David does it actually. But what I can do is if I switch to a question, what I'll do is I can drop the time code and if you couldn't snag the question, that would be really helpful. Or if I change subjects, I'll try to just drop the time in and then if somebody else summarizes, that's still helpful. Okay, so again, if you have questions, I'm open to answering them. I was actually in the zone working on stuff right before it, which is why I didn't have the YouTube created beforehand. I forgot to do it before JPE was streaming and when JPE streaming, I didn't like... I don't want to mess with any of the settings because I don't want to kick them off. So let's do mailbag. So I'll drop a time code in there for mailbag. So I did show the feather and my camera is in product showcase mode still. So there's the feather. I got that, but I actually got a goodie bag for a little more. This is the goodie bag and you can see I got a second feather and then because I was doing flash stuff, she actually dumped a bunch of flash chips in here for me. So if you... I don't know if you can see in the bag there. So you can see there's actually some flash chips and there's actually some RP2040s that she sent me to which I'm pretty excited about and those of you who have known, I actually made a Game Boy cart a while back to be able to use CircuitPython to program a Game Boy and I think these RP2040s are destined once I re-spin that PCB to go there. So I'm pretty excited about it. I just like made an offhand comment about like, oh, like it wouldn't... Now that I have a production feather, I can hot air the RP2040 off the old prototype feather and it was like, actually, well, I don't... She was like, I have chips. I can just send you chips. So she sent me chips too, which is great. Yeah, the Game Boy cart RP2040, like the original version is done with a SAMD51, but it had reliability issues and I suspect that's because the DMA and the SAMD51 is not super reliable. So the PIO is actually perfect for that because the PIO can buffer and make sure that it's really timing specific. So I'm very hopeful that an RP2040 Game Boy cart will actually like be solid. So that'll be good. And hi, JP. Glad you're watching. Thank you for getting the title set up. I appreciate that. My wife just texted me, we're planning what to have for dinner this weekend. So I thumbsed up it. Okay, and you can add VGA out to the cart. No, I don't want to do that. So, oh, I guess I should say if folks didn't notice, let me go to the desktop and shrink this down. I did the Tom's Hardware kind of last minute podcast. So if you just look at Abrams articles, you'll see this article here from Abram. This is actually a result of a discussion I had on the podcast. It's about the work that I want to do and those of you who watched it know. So here's the podcast recording. You can find it on YouTube as Tom's Hardware as well. But this little right up he did was about the idea of making circuit by the run bare metal on a Raspberry Pi. Oh no, Johnny says I was in the zone earlier today but then the VPN started acting up couldn't work at all. Yeah, that's a bummer. So the nice thing about working in open sources, I don't have to worry about any of that which has been great. So that's one thing and then I I'll sneak peek. It doesn't officially become public until tomorrow but Johnny pointed the link to it. If I can snag it out of the discord. So I was also on this podcast a few weeks ago called Simple Electronics. Thanks to Johnny for the recommendation. And I'll put that in the in the YouTube. It officially comes out tomorrow. Although it doesn't say unlisted so maybe it's there. But if you want to listen to a podcast with me and I forget the host's name. The host is great. Did a really good job. He is a mechanic by training but still very very much knows their stuff. So it was really cool and that's coming. Okay, I actually do have, let me scroll latest again. Hi David. Thanks for joining. Hi, Johnny. And hi, Mr. Certainly as well. Okay, I have more mailbag. So I, my partner Becca wanted this thing to go in our house which is a sensor to go around the house that I can, I'll put a timecode here for you. She wanted a sensor that we could place in different parts of the house to track temperature and humidity and light levels. She's been doing a lot of indoor plants in the house and wanted a sensor. So I came up with this idea. I had seen this, I had seen this case before but it's a, it's a Hammond case. It's a USB case. So in here I have my paper prototype so to speak. And I guess I could show it versus a feather. So there's the feather. It's like slightly larger than a feather but it's super not that tall. So a feather doesn't work very well in terms of fitting stuff in there. So here's my paper prototype. So I made, I made a board that has a micro mod connector on it. So I don't know, it's kind of hard to see but there's a micro mod footprint here. So micro mod goes on one side. And then what I did is I decided I wanted to, I still wanted pluggable sensors on top of this. And I've been thinking a lot about how to make low profile pluggable sensors. And the way that I came up with, I was originally going to use this SFP connector. SFP. It's probably on my digikey. Let's, let's look at my digikey favorites here. I think I favorited it. Small form factor pluggable connector. Yeah, low profile too. So my frustration with Stemma is that they're pretty large and chunky. Yes, SFP for, so there's these connectors. It's, it's based on this. This is actually not rated for it. It's a generic connector. It's 63 cents a piece but it's, it's a 20 pin connector but it's, so it would be reversible. So I was thinking about how to have like a just a sensor board like kind of like Stemma but, but smaller and, and yeah, just smaller. And I was looking at this and it's still pretty big. So in this case, you have like the PCB goes in the middle. So you only have like six millimeters above the PCB and then you have five millimeters below minus the thickness of the PCB itself. So there's not a lot of room for stuff in here. So what I actually settled on that I'm experimenting with, and I gave it away a little bit maybe, but I actually settled on doing FPC, which is a flexible printed circuit board. And the advantage of that is I'm looking through my favorites here. Oh, I didn't favor any of them. So I bought four different versions of it. And so what I got is I actually made some designs from Oshpark. So here's another bag of goodies. I just got this in the mail. So let me, they're very tiny. PapaRomeoMike asks, why not just use a feather with the 3D printed case? Well, I don't have a 3D printer is one. And two, I really like Hammond cases because I previously had a line of sensors that I made that was a 3D printed case, but the battery pack was separate. And it had some wires. And so one of the constraints I had was like no wires. So I really like this idea of a USB-A because all you do is you plug it into like a USB, like an AC to DC converter. So here's, this is the PCB for an SHTC3, temperature and humidity sensor. It's very basic. And you can see here that it's just like, I'm going to like lose it if I sneeze too much. But it's a 10 pin and then it's just got a decoupling cap because I decided to settle on just five volts for everything. Oh, I can link you to the case. Yeah. Apparently it's not in here. I need to favorite more stuff. But I remember what the, it's a 155.1 USB, I think. Am I right? Yes, I'm right. Yeah. So there's three different sizes, a one, two and a three. And I, this is actually the exact one that I have here. Yeah. So actually the way that I find it is not on Digikey. For cases like this, I really just go straight to Hammond, MFG. I think that's what their website is. So you could just go like small enclosures and plastic mini enclosures. And then you can see these miniature USB enclosures. It's one of those. Hi, unexpected maker. Yeah, we're on a different day today. We're looking at Hammond enclosures. I really like these ABS plastic mini enclosures, but they also are not tall enough to really fit a feather. This was like one I originally did, but it also has the challenge of like powering it. So I really like actually just using these. And so you could see the different sizes. And it's all the same depth, but I actually just went for the biggest one. Hi, cable tie. And Hugo, I didn't think, I don't think I said how do you actually, and Dexter. Yeah, so I have those, which I'm pretty excited about. I super speeded the board itself, but it got lost in the mail. It just popped up in Tennessee. So it must have gotten into a batch that needed to be resorted. So that one I did. That one's a design for temperature and humidity sensing. I also did a neopixel board here. So I think it's five, one, two, three, four, five neopixels. And so that would, that should be able to fit like, hopefully, kind of like that in there. And you'll be able to have like show it'll be able to show like a scale for a particular measurement, which will be cool. And then I think I have one more design. But the the main cool thing is that it's all flat flex. So it's like super thin. Oh yeah. So this is a, this is the last one I did. Oh, come on. And this is a Vemol 7700 or something. Vemols. Yeah, I think it's a Vemol 7700, which might actually be the temp and humidity sensor. So I got neopixels on one and I got two other sensors that will cover the light temperature and humidity that I want to start prototyping with. And then I have some of the kits from Sparkfun for doing the microbots. So I'm excited to put those together and see how well that the idea pans out. So yeah, that's my that's my mailbag. Anybody have questions or should we deep dive, get our scuba gear on? And I'll, I think it's usually what I do is I recap everything I'm working on. I think I'm actually just going to dive right into where I'm at. And then that will kind of coincide with explaining what I was doing earlier this week. Oh yeah. And I guess I can look at it. Papa Romeo Mike asks, will you be able to isolate the temp sensor from the electronics heat? I'm not too worried about, yeah, Johnny is saying that similar thing that says just be aware of temperature sensors and enclosures, they tend to be two to three degrees higher. Yeah, we're not, I don't think we're super worried about accuracy. And one thing I think we will plan on doing is it, we might drill holes in the enclosure to have more airflow, especially for humidity. So yeah, I'm not too worried about it. I'm not gonna like, like maybe, maybe the, we might get more heat from the AC to DC converter than, like it's an nRF, like an nRF is not going to use a lot, like produce a lot of heat. I don't think because they're, because they're power efficiency is so good. Okay, so let's talk about flash. So let's take a time code. Today's deep dive. So earlier on in the week, Lady Aida was working on producing these. And as she was doing the tester for it, she realized that the four megabyte wasn't working. That was her, that was her original plan is to put a four megabyte on it. The prototype I had had a two megabyte on it. But she couldn't get the four megabyte working at all. And then she switched to an eight megabyte. And the eight megabyte worked after she realized that turns out in CircuitPython we weren't using the, let's just talk about all this. So let me pull up the Pico SDK. I still like automatically go there. So the way that, and maybe the data sheets a good way to describe this too, I think the data sheet has a good section on the boot process. So for the RP2040, oh yeah, here we go, boot sequence. So let me try to make this a little bit bigger. All right, that's what we're going to go with. So several components of the RP2040 work together to get to a point where the processors are out of reset and able to run the boot ROM. The boot ROM is software that is built into the chip performing the processor controlled part of the boot sequence. We will refer to the steps before the processor is running as the hardware controlled boot sequence. So the hardware controlled boot sequences as follows. Powered as applied and the run pin is high. The on-chip voltage regulator waits until the supply is stable. And then the oscillator has started. The reset controller are all taking out a reset and the processors start to execute the boot ROM. That's all well and good. What does the boot ROM do? So the boot ROM is 16 kilobytes. Core zero runs everything and core one just goes automatically into low power state. This is the thing that provides UF2 and it also has a, yeah, so that provides the drive and it's got some built-in ROM stuff. Oh, look at that. A flow chart. Let's make the flow chart bigger. It's not a deep dive without a flow chart, right? Okay, so both cores enter boot ROM. If your core one, you sleep. If the rescue flag is, you clear it and you stop, watch dog. And then you delay for 100 microseconds and then read the chip select state. So this is why you hold boot ROM down when you start up to stay in the boot loader. So this is the logic that's doing that. It says if it's low, you act as a USB device, you start the crystal and you start the PLLs and do all the like USBs, like the RPi, RP2 boot stuff. If that's not the case, if boot select is not held down, it will be high because it's been pulled up. And that means you configure the SSI, which is the, what does it stand for? Serial, something interface. It's the thing that manages talking to the QSPY flash. And it connects it to the outside world in the pads. You load 256 bytes from the flash. You check some it. So it's actually 252 bytes plus I think four bytes of a check sum. And that's to make sure that you're not just loading garbage. If the check sum passes, then you enter the flash second stage, which is what we're about to talk about. Otherwise, if the check sum doesn't pass, but it's only been less than half a second, you just delay and you increment polarity and phase and delay and then try it again. So there are some retries here. And then if that doesn't work after the half second, then you just go into the normal like USB boot loader stuff. So that's, this is what the ROM code is. So this is code that is not going to change. Is anybody else having video issues? It looks like Randall is having audio no video all dark. See what folks say. Yep. This is certainly says here and Papa Romain say that they're good as well. So yeah, Randall try refreshing. You probably can't hear me, but I did reply to you on text as well. Awesome. Thank you folks. It's interesting to see who's who's fastest. See how thank you everyone. I didn't want to keep going if that was wasn't the case. So okay, so this diagram doesn't really have the car doesn't really cover what I want to talk about today, but it's this flash second stage. And let's see if they just have some more information about it. Watchdog boot flash second stage. So it says the flash second stage must configure the SSI and the external flash for the best possible execute in place performance. This includes interface with clock frequency instruction prefix and the continuation code for address data only modes. Until the SSI is correctly configured for the attached flash device is not possible to access flash via the execute in place address window. It cannot be reconfigured at all without first disabling. Therefore, the second stage must be copied from flash to SRAM by the boot room and executed in SRAM. This is the only job of the second stage. All of the chip setup PLLs voltage regulator can be performed by platform initialization code executed over the interface. So that's what we're talking about today. Good. Randall had a refresh fixed it. So thank you everybody to help help being debug stuff. Here's the checksum things doesn't really matter. This stuff doesn't matter either. And so basically what the problem is is that almost all of the code is stored off the chip, right? It's stored on the separate spy flash. So the question is, is like, how do you figure out what flash it is and how do you talk to it? And so this is this is a common problem. The IMX RT has it as well, along with the ESP will have this problem as well because those are all execute in place sorts of systems. And they all, I believe, have this process of like, there's some very basic, very hopefully well tested boot room code burned into the chip itself that does that like first initial bring up. And so you have this process of like figuring out, I guess we talked about this a little bit last week, didn't we? Picking up where we left off. So getting this right means that your code will run. If it doesn't work, like you could get into some very weird state. So what have I done this week? So let me just talk briefly about that before I pick up where I left off. There are, I guess I can show you the second stage. So the way that the Pico SDK handles it is they have this boot stage two, and then they have, let's see, one, two, three, four options in terms of flash initialization. And this generic O three H is actually the one I thought we were using, but it turned out we're not using. And this is why the eight megabyte didn't work with circuit Python. She got it working with the Pico SDK for the test, but it didn't work in circuit Python until I looked at it earlier this week. And so what we did in circuit Python to make it work before beta three is we actually turn everything but the Pico onto this version, which is the generic flash read. So what it, it's a very short bit of assembly code that is disabling the SSI, setting the clock rate, and then setting it all up to be the most basic settings. Beta says four byte flash. So the, the flash is connected over quad spy usually. So that means that like for every clock, you're reading four bits back. But yeah, four megabyte is what I was talking about to how big the chip is. So the production version actually has eight megabyte. So the flash was having problems. So if you look closely here, there's this command read, and that's what the zero three is. That's the standard command for reading. And it's so standard that that's the command that is used to actually load that 256 bytes off in the first place. And that's common for the IMXRT as well is that they load a chunk very slowly, hopefully reliably off the flash that includes settings and then reconfigures to have the faster settings. Okay, so we have this problem. And I showed this off last week of we have flash and configurations in a bunch of places. Oh, you mean four byte address. So the, the RP 2040 cannot do execute in place over greater than 16 megabyte versions. Um, so basically 16 megabytes is the limit. And I think that's pretty common in terms of like IMX and IMX and ESP as well, I think that I'm not positive. So what I was talking about doing is doing this Tommel Tommel thing. And I did it. So if you go to Adafruit comm slash nvm.tommel Tommel, well, you'll find now is that I broke it. It's, it's failing for some reason. But there are, there's M RAM, which is magnetic RAM, which is pretty neat. It's non-volatile RAM. And the reason that we have support for this is it's useful in space because the, the memory doesn't corrupt in the same way or is as often in space as regular nor flash does. Um, so somebody added M RAM support for the satellites that run circuit python, which is very cool. Um, but if we go to flash, now we have this, uh, listing. And you can see here, there's this flash.tommel that says for supports fast read. So everything under this, uh, subtree will, will have this value as well. And then if I just click like giga device, and I want to use like, this is the four megabyte. So we can see the total size is this, the capacity is that and right status register split is true, um, for this particular version. And if we just go back and look at the eight, I'm actually curious. So right status register is also split and capacity has a different value. So, uh, those look pretty similar. And then we also have this giga device.tommel, which is all the settings that are shared. So like the manufacturer ideas the same, the memory type comes back as the same, the max clock speeds the same, blah, blah, blah. So that is pretty neat. Now, what I really want is, I want to be able to say, like, give me all the settings for a particular thing. So let me show my terminal. And I did actually just update this. David G says, are there boards where I can remove the flash and replace by SRAM, just like we add flash to the QDPI or SRAM QDPI? So you wouldn't want to use SRAM because SRAM is, um, is volatile. So you wouldn't have any, like you'd only be able to store your code for the period that like you powered it. Um, but I would look at the, look at the, um, look at the settings for the SSI and you probably can. This is the place you would need to change it. Um, MRAM is pretty cool, but it is kind of like $20 a chip or something. But MRAM is cool because there's no erase. You just write directly and you can read immediately, I think, as well. Um, okay. So I'm just going to source a different virtual environment here. And then I can do pip install cascade Toml. So this is the other tool that I did. Yeah, you could use MRAM. Um, but you have to get this stage two stuff set up right, which is what we're talking about. So there's another repo here that is, um, get out of Adafruit cascade Toml. I just fixed it. There was a bug in this this morning, but what I can do now is I can do, um, cascade Toml. That's kind of small, isn't it? It's a bit bigger. So it's cascade Toml filter. And then you say, this is the skew I want to filter on you enter. And what it does is it, it squishes all those together into one kind of resulting Toml file. And you, I like these comments. I'm using this library called Toml kit, which allows you to round trip Toml. And we talked about this last week as well, like how nice it is to be able to programmatically, um, like refactor things. So having a library that can take in a file and produce the file identically again is really nice. Um, so we can see that this is all the data for this path. Um, here's the data we inferred from the path itself. So we know it's flash. This is the manufacturer and this is the skew. And that's coming out from this, uh, parse pattern here for the Toml file. And then from the top level, we see that it supports fast read. And from the giga device Toml, we see that all of these things are the case. And these are things that are uniform across all giga device flash that we have in here, at least. And then lastly, we see that these are the things that are from, from the skew specific version. Um, so that's really nice. So now what I want to do is I want to take this in and I want to produce stage two. Um, basically I want to, I want to, for anything in this database, I put it in quotes because it's like not really a database, but a lot of the operations you do on it kind of are. Um, but it's meant to be both human, human, readable, modifiable and machine readable and modifiable. Um, and I think this like Toml style is kind of the sweet spot for that. So, um, that's the challenge. The challenge is connecting, uh, this Toml structure, sorry, I'm going to, I want to, a window you can't see. Um, so connect this Toml structure to produce a stage two, um, that actually, uh, will start up the particular flash that it's doing. Now I did have a challenge issued to me by Lady Eda actually, which is what if we came up with a stage two that could handle all the chips in here? Uh, all the variations of it. So that is something I might try. And, um, let me pull up my editor, which I don't even have open yet. I restarted my computer before the stream. So I'm a little out of, uh, zone. Like I don't have anything set up. So here's my editor. And the first thing I wanted to do actually, what I wanted to try is, so here's the assembly, here's the assembly for, um, doing the very basic, very generic initialization. And there's a couple of things here is that there is actually this include, which is including assembly inside of it, which is kind of weird. And then, uh, the assembly that's included is this chunk. And if I look again, there is also a more complicated version, which is this, like the, the one that's used most often, I think is this one, because this is the chip that I think is on the, is on the Pico. So this is kind of the one that is, uh, it's most complicated, but it's also, um, the one that's actually being used. I haven't looked over it completely. It takes some, it takes some time to grok what it is. So one thing I decided to do is I wondered whether I could get away with not doing assembly. So it's easier for me to read C code than it is assembly. Like C is the original high level language, right? Like maybe not the original, but like at some point C was a high level language, because people were doing assembly before that. Um, and so I kind of wanted to see if I couldn't do the same thing. Cause I feel like I have a lot of experience with understanding how C gets translated to assembly. And so, uh, what I was working on earlier is actually translating. I started with just the basic stage two, uh, and I decided to make a stage two dot C. Luz says, I'm afraid of the person for whom it isn't easier to read C than assembly, C code than assembly. Yeah. I mean, when you're doing that though, you have even, you have caveats. So one of the, one of the caveats to think about is this has to be less than 252 bytes of code. It also has to be position independent because it's actually used in more than just the stage two. So stage two, it gets loaded, loaded in at a particular address, I believe that they do tell you, but, um, that code is actually also used when, um, doing any sort of other interactions with the flash, because if you want to do like a read the unique ID or erase or write, basically what you do is you turn all of the execute and place stuff off and then you do, um, and then you do whatever you need to do, and then you run this code again to get it back into execute and place mode. I used something called TAL, which is like C, but lower level. Yeah. So there is some trickiness there. So there's some challenges with this. So what I was doing earlier is I wasn't looking at this one. This is the complicated one. And we'll take a look at this, maybe and try to pick it apart. But I did manage to get a stage two dot C. So here's the equivalent of this. So here's this boot generic thing. And I don't have enough window to actually show you each one. But so this is setting a register off. It's setting the bottom rate. It's configuring configuring something. I see I can't even like I figured out what this is. Quarky says Matt Godbolt probably likes to read assembly overseas. No way you could have written compiler explorer otherwise. Well, I mean compiler explore compiler explorer is built upon the disassembler. So what I was doing is I have this stage two boot that I made. There is a bit of assembly in here. So what this is doing is it's taking the LR, which is the link return. That's what LR is, right? Basically, this is where you jump back to executing when a function finishes. So we save that we disable the SSI, we set the divisor like the bottom rate, we set this first control register, which includes the command and the number of address bits. And then we also set it to do a single 32 bit read. And then we re enable now. So this is the equivalent here of let's see, from here to here in the assembly. So one thing I like is that like it whereas assembly, you have to worry about like loading the value into the register and then setting another register based on that register. So there's like a little bit of indirection. There's a little bit of indirection that makes it harder to read, which in C code, you don't have you just have the assignment operator. And then so what this is is this chunk here is the the included bits, which I think I have open exit from boot two. So this is the popular r zero off the stack. If it's zero, then we vector into flash. So this is this is how this code can tell whether it came from the boot ROM or not. So if it came from the boot ROM, then we vector into flash and we do this stuff. Otherwise we return. So that's what this is bx r zero is jumping to where we run where the code like resumes from when you return vector into flash. What it's doing is, and I don't think this is very easy to read. I had to I had to look up this one in particular. So let me show let me show it from the the C side first. So it does still use assembly, but basically the position of the binary is that you have 256 bytes at the start, which is this number here. This hex number here is 256. So from the start of the flash, your actual arm kind of image starts 256 bytes in. So this is and what the thing at that position is called the vector table, which is like a standard layout of information that the arm CPU uses. In this case, it's a cortex M zero. So that's what we're talking about. But the vector table includes the stack pointer, the starting stack pointer, and then all of the different handlers. So reset handler, fault handler. And then at some point, it switches into like all your interrupt handlers. So when you make an interrupt, the pointer value of that interrupt goes into this vector table, which is used when an interrupt happens to figure out where to jump in the code to handle it. So vector table. And then there's this the CPU itself has this vtor, this vtor register, which is the base address of the vector table. So when the CPU starts up at zero, so the boot ramp boot ROM must be at zero, I think that's true. I'm sure it's configurable, but basically it's original originally vtor is set to where the boot ROM is. And then when we're handing off to other code, we we switch where it is. And so this is us shifting it to the address of the vector table. So we take this pointer and we cast it to just a regular number. And then what we do is the first entry in the table. Oh, this isn't right. I think this is a one. So it's a it's a table of 32 bit integers. The first one is the stack pointer. So this is the assembly to set the MSP, which is the main stack pointer, I think, to that value. And then next what we do is we do BX, which is a branch. And it's an unconditional branch. So it's a jump. And we do we jump to the second entry in the vector table, which is the reset handler. So I think this is right. So the next thing we're going to do is test this to see if if the code that we build with this actually still works. But let's just go over this. So so what is this? Why is the assembly doing this here? So here's our comparison. Here's our return. If we're not doing the special case coming from the boot ROM, we get the vector table offset, we store this is storing the address of the vector table register. This is a store instruction that's storing the vector table offset value into the address to the address of the vtor register. And then there's this which is a load something increment after something like that. So basically it's doing two things. It's I think it's doing two things. So it's loading the stack pointer. Yeah, that's what it should be doing is it's loading the stack pointer from r zero into or no. Yeah, so it's loading the stack pointer and it's loading the reset handler address. And then this is the thing that set the stack pointer and this is the thing to jump to r one. And there is like an increment that's happening here as well. So like, you'll see, like, yeah, there's an increment in there somewhere. I think I have it right. I think I've deduced what this code is doing. And maybe somebody can describe that better than I can. But I was like, this doesn't seem right to me. And then I realized, I looked up this instruction, it was like, Oh, it's doing an increment. So like that would mean that like, this r zero gets shifted by four, I think all in one go. So I think the stage two is right. But I haven't I had to take a call and come back to assembly. Yes. So the good news mark is that I am I think I've successfully converted this assembly to C. So here's the equivalent C. I mean, it's mostly C. There is some assembly in there as well. But it does compile. So I just want to test this and see if it works. So let's go here and we'll do make and clean. Johnny says it's load multiple increment after LDMIA drum roll. Well, I know it compiles. I compiled it earlier. But I'll just take one of these feathers. Let me put one away so I know which one I'm working with. Let's just use it with a brand new feather, shall we? Oh, so I never talked about. So the reason we had this point where LeMore was loading a circuit Python on the eight megabyte chip version, and it wasn't working for her. Now, I didn't have a bare eight megabyte chip here. So what I did is she's like, Oh, check these boards, these boards have the same chip. So I found a prototype pygamer advance, and it had an eight megabyte. So I, I hot aired it off there, and I put it on my feather prototype and it worked. And she was like, this doesn't make any sense. And the reason is that this chip had been initial, this flash chip had been initialized. There is this bit in the status register of flashes, usually, that say whether it should be a quad flash or not. And so she wasn't working because the initialization code for the quad enable bit was not working on the new chips. But if you use a chip that already had it enabled, it worked okay. So yeah. Yeah, the owl's name is Minerva. But yeah, Minerva should be our mascot for assembly stuff. Okay, so I'm going to plug it in and I'm going to hold boot down. Sorry, I don't have the overhead to go on, but take my word for it. So we should see, oh good, we got an hour. I can get some stuff done here. We should see it pop up. Maybe I didn't hold on to it long enough. There is that delay, isn't there? This circuit pi drive here is the drive for the, the timecode thing. So I'm just going to hold boot select again and hit reset. I think this cable should work. Really? Nothing. This is a new board. Maybe it's, it should work. Like that's a nice thing about a boot ROM is that there we go. Huh, I don't know why it didn't work that, that first time. Okay, so ports, Raspberry Pi, I don't know why I've gotten two tabs open here. Raspberry Pi build Feather RP2040 and firmware copy over. And it should work because this is the generic version. So it should work with the eight megabyte version just fine. And we should get a second circuit Python drive if my stage two is working. It's not popping up. So maybe it's not working. It looks right to me. Hmm, bummer. Well, what do I do now? I owe error. That doesn't look very happy. This is the, let's just, David says, will the next revision have less slash? No, I don't think so. It'll, it'll always be eight just because had to get it at the door of eight printfs. How do you debug something when like nothing is nothing else is going yet? The harder version of printf is actually like we could add blinks into it. Yeah, Hugo says you can always make things blink. It's true. Hmm. I cleaned it built. And it didn't look like it came up. So one thing I was doing is I was looking at the SWD. Yeah, I could do SWD as well. I don't have it on this board, but I could, I can move back to this other one. The SWD is kind of like not super convenient right now because I like using Jlink and Jlink doesn't have Wiimo says as long as it's not smoke signals. Yeah, that's pretty, pretty safe bet that it's not smoke signals. Oh, the other thing I was doing is I was looking at the the assembly that was resulting from everything. So this is what we're doing right now. We're getting so this is the the assembly output we're ending up with. I looked at it earlier and it looked right to me. But this is also of the elf. Hi, Jose. Ibrahim says SWD. Let's make sure that I just want to look at make sure that everything is working as expected. So let's just make sure that the padded and checksum version looks reasonable. Oh, yeah, just open it here. Raspberry Pi build. So what happens is that it gets compiled into an elf which converted into a bin, which then it gets converted into this file, which is then checksums. The last four bytes here are the checksum. And we can just compare here. So this is our debug. So 4671. So we are right at the start there. The one worry is if we happen to have and I basically want to just check the start in the end. So here's the 00100104. And then the e. Gareth says, where is the LDMI? I don't think I need it. So I'm letting I'm doing it differently. Yeah, we're doing it differently. Yeah, so I don't think we need the LDMI. And it looks like I just got pinged by Lady Aida. So she wants to stop by again. So we're going to get interrupted by Lady Aida here again. She'll save this from our assembly. So I think this is right. I think this padded and checksum thing is right. And then we can actually check the the UF2. So there's octeta UF2. And then if we look in the UF2, there's going to be some metadata in front of it. But then this looks like the checksum here that we saw the BF79. So that looks all all okay. Hello. Hey, let me pop you out. There we go. We're deep deep in the weeds. Let me tell you. Oh, yeah, that's my man hasn't given time for like intermission. No, I was like, I just said you're going to save me from assembly code. Oh, cool. That's what I like to hear. So I'm trying to convert the the assembly for the stage two stuff to see so that we don't have to do assembly. Yeah, sure. I mean, like, I mean, up to you never. I thought like some funny tweet was like somebody was like, you know, could I have written this code and see instead of assembler? Yes. Would it probably have been faster and smaller? Also, yes. Yeah. Yeah. Yeah, you know, don't don't discount the compilers. Compilers are really good at this shit. Indeed. Yeah. Yeah, but I just tried it and it didn't work. And now I'm like, Oh, great. Oh, no, do you have a disassembler? Yeah, I disassembled it. I mean, it doesn't assemble to the same exact thing. But it looks okay to me. And I just checked that it's also in the like, like all it gets into the UF two, like I would expect as well. So I'm not exactly sure. But we'll figure it out. It's it's it's an endeavor. You know, I'm actually thinking, you know, and I don't have I mean, people who watch the Descalade 8 and know why we're doing this is because we're, you know, we we decided not to go with two megabytes of flash on the RP 2040. And the two megabytes of flash happened to work with the, you know, the same flash chip definition that the Pico had. Right. But we wanted more. So we were like, let's get a four megabyte flash. And like, foolishly, I was like, what could be that different, right? It's like the same flash family, it turns out like, it's totally different. And the four megabyte we have even got working, I did send you some, I don't know if you tried it. Yeah, I haven't tried it. I just do some four mag chips. I just showed the goodie bag that you sent. But I haven't done that yet. Yeah. And then we were like, well, that doesn't, you know, and as I was like writing the tester code, so, you know, it was working on the tester last weekend, so I can hold it up, maybe see if this, it's hard to see if you can see, but whatever. So, you know, you've got the the the teensy brain with the teensies removed because I don't know why, but I think I was using it or something. And then, you know, the tester body, the thing that actually does the testing and then the clamp that holds it down. And I did this thing where I was like, well, you know, because I just wanted to get these out fast, we don't do what we normally do, which is load a test program that tests all the hardware and the pins and everything, and then separately load circuit Python after, because it actually just takes a little bit longer, takes like another 10 seconds. And I was like, well, you know what, maybe we can just load one program and the program does the test and also does like a neopixel swirl. And so folks who don't know it's a test program are like, oh, look, it's like the demo, you know, it's like, it's color swirling. Great. That's my little hack. And so I was writing that code over the week on Sunday to get it working on the RP2040. So I was actually learning Pico SDK, which is actually really wonderful and it was super easy to get going. So I do recommend checking that out, but their default flash chip was again the one on the Pico, which is not generic. It's the Wynbond W25Q something, something. So, you know, what's funny is I was like, I was like, the format didn't work and I was actually not sure why. And I was like, oh, like scary, didn't even like boot. So I just like swapped out because the feather, you know, we have so much space. And you know, what's funny is when I first showed this to Evan, he's like, why are you using such a large flash chip? And I'm like, yeah, if you use like a really, if you put down a big package, you're free to be flexible, right? It's not going to focus, but you can look at the product page. But I have, it's wide or non-wide SOIC. Yeah, I noticed that because I put in, the aid I put on was wide as well. And I was like, perfect. It fits both. Ask me how I figured out not to just use the narrow one, right? Like, you make that mistake once and you're like, you use wide from then on, right? If you can fit it. Right, right. And so I swapped out the eight megabyte flash that we actually used for like the Matrix portal and the Pi portal. We have a, we use a lot. So I know it's a good flash chip. Right. And that one also didn't come up. And then I was like, okay. And then I was thinking about, you know, you, you told me like a long time ago, don't forget, like, it's kind of like that scene from like, you know, Star Wars where it's like, use of the force Luke, but it was like you floating in space and saying, don't forget the flash initialization assembler. And I was like, oh, that's right. I went in, I swapped it for the generic and it came up. And so, but the four megabyte still didn't. So the four megabyte, it wasn't even working with the generic definition. Yeah, which is very weird. I like that. So, you know, so that's why I wanted to go with eight. Basically like I had to make decision. I think longterm, I mean, Scott, you're going to hate this, but I think longterm we're probably going to go back to windbond. So some feathers will have GDs and some will have windbonds. Because the more they think about it, you know, if I can get windbond, I think longterm I'll be able to get windbonds for the same price. Like right now I just, I just have the stock and I wanted to get people these boards. I actually think, you know, people, I had this feeling that the pie folks are not going to be super conducive to changing the Pico SDK default to generic. I don't know. So I'm concerned that there's going to be a lot of people who get their boards and then they load the Pico SDK example or like somebody distributes a UF2 and they're like, it doesn't load, it doesn't load, your hardware is broken, right? Which is like, you know, it's just a lot of tech support. And that's why I like having this like tester also, because they can be like, look, load this UF2. Does it work? Great. Then it's for me. So longterm, I think I'm going to have to go to windbond just because I think like, I think in the longterm. Yeah. And it's not a technical decision. It's just totally an emotional decision, right? Which is like half my decisions are emotional. It's just an emotional thing of like, I just know that other people are going to be compiling Pico SDK projects and they're going to use the windbond definition, not the generic definition, distributing the UF2s. And then folks are going to say stuff like, oh, the Adafruit feather doesn't work. It's broken. When it's not, it's just, it doesn't use that same windbond flash definition. So I think I'm going to continue selling the ones we have now that whatever, what's the name of it again? Gigadivice? ProblemGDs. The Gigadivice is, and we'll have CircuitPath on for it. But I think, I think I will start sourcing windbond. And hopefully if it's within a couple of cents, I'm just going to swap over to windbond chips. Right. So background for folks is we actually did the reverse of this a few years ago with the Circuit Playground Express, I think it was for. And it's what really, we started with windbond. Yeah. Yeah. It's what led us to this, the system that we have today in CircuitPath on that's used for most of the, the external spy flash chips that we have where when, when we start up, we actually read some of the JDAC IDs, like the manufacturer and the capacity and things like that. And then we decide based on that what to do. So it's not, not unheard of to have to do this. Yeah. So yeah, that's, that's kind of, kind of where, where it came from. And, and now what I'm trying to do is I'm trying to factor it out even further. Yeah. So now, you know, having, can you still hear me just because I'm now screen sharing? Yeah, I just got a, I got to remove, change my window so folks can see your little. You want me to change the window size or? No, no, you're good. I just want, I scooched you over so folks can see your, your thumbnail. So yeah. Oh, hi. Oh, that's cool. She shows both. I know that. I don't know nearly as good as this board. So having, you know, done this and, you know, and then I had another realization, you know, there's like, you never know what you don't know until you realize you don't know it. Oh, yeah. So I was like, okay, well, look, you know, okay, we're going to have to go to four, eight megabytes for the itsy and the cutie pie as well. So then I was like, okay, let's go get source those chips. And then I realized that those chips aren't available in the two by three USON. And I don't know why I thought they were the max or the USON is two megabytes. And again, we don't want two megabytes. We want four eight. And so when I researched it, basically, you have to go from USON up to Exxon or W son. I don't know. It doesn't matter. It's made four by four and not two by three millimeters. So the chip has changed size. So if you look at this, this has, you know, this fairly large flash chip here, we'll turn off the back layer. So there's less going on. So this is the, yeah, I'll turn on the T docu. I like T docu, but it's always hard to find the dropdown. There you go. So you have the two buttons here. So I kind of shifted the buttons over and then the flash kind of just sort of slid in between right over here. So the flashes is a four by four flash. And there's also four by three flash, but I'm like 99% sure it's just narrower. So like it'll four by three or four by four would fit. And again, same thing as the wide or narrow SOIC pick, you know, fit the widest than you can. SOIC definitely would not fit. This is this is half the size of the SOIC. But I, you know, revise the itsy and basically I moved everything to 0402 that was not, that was basically a very small capacitor. A lot of these parts were 0603. I shrunk them down to 0402 and then shoved everything over. You can barely tell, but this moved over like, you know, 50 male or something. Right. And you had to redo all the traces as a result? I had to redo the right, no, but only the right hand, the left hand side. You can even see this as a little spaced out. Right. This is not, it's not as, it's tightly bound up as it could be. A few things, you saw there's a, you know, there's a via here that I removed because I ended up having to do, I kind of whatever. I changed a little bit of routing. The IO pins do not match the itsy pins at all anymore, like not even close, but that's okay. But I got to fit this large flash chip and I did the same thing for the cutie pie. I swapped it over for my USON to a WSON or Exon. So I can fit four or eight megabytes comfortably. Right. I don't know why I thought it was available in, so then I always get bit by these flash memory things. Yeah. No, just like flash memory, man. It's always just like, I don't know, just a problem, but I'm going to do revision anyway. I'm going to send out panels today. Okay. I also have to do the tester. Right. So I could also show. Do you, do you have an idea, somebody's asking which, which flash chip will be on the itsy? Is this going to be a last minute call? It's probably going to be the eight meg. I'm probably just going to settle on the eight because I think the pricing was not that different. The pricing jumps at 16, but I think two to four to eight, it's less than linear. And the cost of the RP2040 is low enough that I feel like we can kind of bump it up. It's also just one of those things. It's like, I feel like we're going to only stick more stuff in the firmware, especially folks who folks, especially for folks who are going to like turn these into like computers or like keyboards or I don't know. I think, I think that given that has a little bit of extra power and it uses the flash on chip, I don't know why not. So I'm going to, again, I can't, because I'm getting special pricing, I can't see what the pricing is, but hopefully the pricing I can get for the wind bonds are good enough to justify it. So that's the itsy and then the QDPI, same deal. I can open that up and show that off real, real fast. So that's what I did today was like, look, and this is actually, you know, it's interesting. This is why I don't release multiple boards of the same family at once, because there's always stuff like this that happens and you don't know what you don't know. Right. So you do the feather first and you, you figure out the case. I do the feather first. Then you do the other two. Like this four, by the way, I totally like bought a thousand of these four megabyte flash chips sight unseen because I was totally like, I was like, what could possibly go wrong? It's like everything could go wrong. Yeah. Garrett says, life is meaningless. Garrett says, I think this accidental bump in capacity will turn out to be a really good thing. Yeah. No, I think, I think it's good. And also I think like, you know, Pimer only put eight megabytes on there, like little teeny board and I think so every kind of everyone sort of going that direction, which is funny because the original dev kit for the RP 2040 was to 16 megabytes. Remember, like, you know, I got one of those like initial dev kits. And then I got a Pico. You got the dev kit. I always got a Pico. I got a dev kits. The dev kit actually did have a 16 megabyte because I think they're like, well, we have to test it with the max. Right. But I think it's a good, it's a good look. We did it from the Pi portal and the matrix portal and a couple of anything, basically anything where you do like AV stuff because basically what you have audio files and like images, it's mainly images that just like totally hog up the space so fast fonts and images take up space. Although we we moved to PCF. So this is the new, show the back is the back is kind of the most interesting thing. So you've got the turn on the so Stephen is asking, what is the price of the RP 2040 chips themselves? And I think the answer is we can't talk about it. We can't talk about it. You're going to have to wait till they announced that. Yeah. Yeah. You know what? Here's the thing. I didn't even I didn't even sign the NDA. I just like it's just not never never ask a lady her age or weight or how much she spends on RP 2040. I mean, it's important to note that though. Like I've I've I heard about the RP 2040 a month early as well as a lot of people did and it was all under friendly A and it didn't leak. So it works. It's look, they I will here's the thing. If the Pi Foundation want people to know, they would tell you. So it's very competitive though, right? I feel comfortable saying that because they've said that it's going to be a very, very competitive price. People who are smart can reverse engineer. What I usually say is the cost of goods for products versus the feather price versus other folks are 2040 boards and you can you can give yourself an upper lower bound, right? So maybe it's a good Python project experiment. I was going to say, I was shocked that the feather is $12. Like that's one of the cheapest feathers, I think, right? Like that's really good price. Yeah, it is. It is a very good price because the price for the RP 2040 is very competitive. So this is the the 2040 chip crystal area over here. You know, a bunch of capacitors. Again, I moved a lot of parts to 0402. I'd like to keep my capacitor to a 603, but I did. I made a deal with myself. The 10 microfarads are 805. The 1 microfarads are a 603. And then the 0.1s are 0402. Now on the Pico, they actually use, now, I don't judge people for their manufacturing ideas, but like JFC, they use 0201s here. I mean, was that really necessary? Like they have space, you know? Why do that? You look on the Pico, but it's like, why did they do that? So I really don't like going. I don't even like 0402s that much because you need special feeders for them. Oh, can you pop me back to the screen? Yeah, you need special feeders because they're double-pitched. Did not... Oh, because I don't have the screen in front. Yeah, I don't know. It clicked it back, but it's fine. Discord was being smart. It's like, you're not, you don't have the screen open. So yeah, so you got 0402 caps over here and oh, you don't see my... So I can see your cursor. It might be hard to see, but yeah, I want to... So I was talking about re-spinning my Game Boy cart. So this is you talking about what pieces I need to put along with the RP2040 on this cart. Don't pick USAN. No, you have plenty of space. I do. I see. The 0402s are only because, again, I really need to squish it down. So then, you know, this... I got rid of the lozenges. So there were these little power lozenges here. You know, I didn't want that useful, honestly, because they're broken out. This is Bill Binko's jumper. This is a jumper that connects the VBus, the USB power bus, to the 5V. So it removes the diode connection protection, but it means that you can backpower USB. So if you want to use it as a USB host, you could do so. Oh, I see. So it's a little, yeah, it's a little thingy-thingy-thingy revolver. And then here is this little fellow over here. This is the bad idea diode. Okay. So this diode is the bad idea, Scott, that I was talking about. So, you know, Pimerone on their board made it to the USB boot chip. The USB boot pan could be used as a button. So I did that. It's a bad idea, but, you know, we're not. So the USB boot line, right, this is the... on the switch, this is the switch here, pulls low, and that actually also goes into an input here. And it's diode protected here. So the CS line does not... I think I got it right. The CS line cannot pull it low, only the button can pull it low. So then with an internal pull-up, if I'm correct, I don't know, this pin should be an input, which is I think the D GPIO, like 23 or something, or 24. Oh, I also, when I think I did on the QT Pi, you like this. Yeah, you'll think you hate it, but I know what, you know, what do you do? Electronics are hard. Yeah. Well, you know, I can always move it, right? Yeah. So I also, I had a little bit of space I had, but from changing over to a 402s, I moved the RX pin, so it's in line with the SPI pins. Nice. So you have four continuous pins. So these four are contiguous. Right. Yeah, USB boot is 21. The TX pin is not, USB boot is 21? No, no, that's the dumb idea I had. That's how you read it. Okay, yeah. That's my bad idea. Not a dumb idea. I shouldn't say that. It's a bad idea, but whatever. I like, you know what, I'm actually into bad ideas. I think we should have more bad ideas in electronics. Right, so you're trying to protect this. I'm trying to figure out what the right circuitry is. Okay. Right, because like... So here's what I think. Okay, go ahead. Explain it to me. So like, Pimeroni doesn't release schematics, right? Which is, which is, they're prerogative. So, you know, they mentioned, oh, we had some circuitry for this button and I was like, oh, okay, like, you know, let me see what it is. And it's obviously like, the correct thing to use is an open drain or gate. Okay. If you had open drain or gate, I think, I think it worked out. I was like, ooh, that's like the most elegant way of doing it. So such a thing does not exist. So here's, here's how it works because this is a bit of a weird hack. So the Q-Spy CS pin is tied directly to the Flash CS. The Flash, which has a pull-up, this has a light pull-up, 10K, just to keep it deactivated when not in use. It's also directly connected to here. So this is a direct connection. So when this switch is open, there's a light pull-up on USB boot, right? But this pin, because it's this diode protected, only a low signal affects this output. If this is high, this diode is open. There's no connection. So when this is pulled high, that is, the button is not pressed. This does not affect the CS line at all. This one case floating, this is open. This diode, it's like, it's like gone. It's not even there. When this is pulled low, because the button is pressed, this node is low, and this node is low. So this CS pin is low because this 1K is much smaller than the 10K light pull-up. And so that is the USB boot signal because the CS pin is held low while power. So you hold it down and when you plug it in, it detects it. So now the third piece is, okay, well, the CS pin is toggling as well, right? Because it's being used on a day-to-day basis. So I think I got this right. On a second-by-second basis. So the CS pin, if the CS pin is high, because the chip select is not enabled, whatever, but it's in use, but it's not pulled high. Remember, it's driven high. Okay, yeah. It's driven high, not pulled high. This pin is high, and then this is high, right? So this is the natural, normally this would be high. If this is low, then this doesn't exist. So the only thing, because the diode is would be, it's not there, because there's no, doesn't pass current. If this side is low, it doesn't matter what the side is, it doesn't pass current. So the only situation that is weird is what if this is high, it's driven high, and this button is pressed on a normal, like the code is running. Right. Which is the case I'm worried about, yeah. Which is, by the way, the case normally. Normally, this diode is even here. It's connected directly. So I actually was like, you know, I was actually like, I should just try it. Like I ran my feather, and I actually just pressed the button while it was running, and nothing happens. Okay. Because this 1K is not strong enough to affect the directly driven GPIO pin. If you think about it right now, if you have a Pico, there's nothing stopping people from just pressing that USB boot button. Right. But they have, it doesn't crash. But the feather has that 1K resistor in there? They all do. This is part of the minimal schematic requirement. I see. Yeah. Does that, does it change with drive strength? It does, but they must be driving it strong enough that it can overcome this 1K. Which is not that much, right? Like 1K is only 3 milliamps. 3 volts through 1K, 3 milliamps. So it just needs a drive strength of 3 milliamps or higher to be able to drive this. Right. And basically sink the current through and then it doesn't, it ignores whatever's over here. This is, it can't, it's overpowered. Right. And I think that, look, I don't know, man, I think, right? It sounds right. I mean, you're much more the EE than I am, but. Is this the thing about like nodes? But I think this should be, you know, that the diode basically is what keeps the GPIO pin, right, which is connected here from affecting CS in any way, or the CS pin from affecting the GPIO pin. Like they kind of, it kind of separates them in a sense because this, this 1K, the only thing that's weird about this is there's this very light pull up, but the light pull up should, the light pull up isn't overpowered because when this is low, this diode doesn't exist. And when this is high, it's just helping the pull up even stronger in a sense. So I believe, I believe my analysis is correct, but I will say I got a C in 6011. So I don't know, you know. I mean, you'll try it and worst case, we rev, we rev it or something, right? Well, I just, I just delete this diode like that. Normally, you just don't place it. Yeah. No, no, it's, it's placed, but it's a, it's a jumper. Okay. It would be just a jumper, which I would, you know, in my final, I would actually just delete, delete it, or I could place a .22 ohm resistor here or something like to, to jump right. Bill is asking, will that impact how fast the CS pin rises and falls? It doesn't matter. No, it doesn't matter because again, this directly driven, the drive, the drive strength, they must be turning it on strong enough to overcome this. This 1K resistor is, is part of the, um, okay. Well, here's another thing. All right. Let's, let's, let's actually be totally honest here. So the CS pin doesn't toggle that much, right? If this is a Q spy clock, the CS line is pretty much like I could, right, which is why we bang it usually. Yes. It's usually a bit bang, but in even the Q spy driver, I had a strong feeling that they pull it down and then they keep it down. They probably don't even like, right? You don't need to change it. Why should you? You don't have to. You're, once you're in Q spy mode, like, you know, we looked at the sale traces while we were debugging and like I saw it happen, like it happened like twice. It doesn't toggle very often, right? Because you don't have to, you're not sharing the bus with another port. The Q spy bus is completely dedicated. The chip select is only there to kind of wake up the chip from the initial, like, you know, when you want to like start it up, if it's in a weird state on boot, the chip select kind of tells it like, okay, I'm, this is your first instruction. But once you start giving it the instructions, you don't have to keep doing the chip select line. It's, it's optional on a non shared bus. Right. Yeah, Bill, you're right. It's, it's, it's exclusive to that bus as well. It does look, I was, I was reading the data sheet for the SSI, which is the peripheral that does it. And it looks like the peripheral itself does have the ability to have multiple slave selects or chip selects on it. But the way that they've configured it and hooked it up, they only have one, only have one. Yeah, I mean, it's, that's not, you know, if you look at how that expressive, you know, they have internal external Q spy flash and external Q spy PS RAM. Right. And, you know, both of those are on the same Q spy bus with separate, separate selects. Yep. So I remember like, they're shared. Right. Because I was looking at like the, we're over and they expose the chip select pin and then they say, do not connect anything to this pin. Right. You know, so I just leave it blank, you know, whether or not I'm using the PS RAM, you want to leave it disconnected. Right. So I think, I think this little hack will let you use the button. So then. Awesome. So the question is, is that, you know, should I, we add this to the, it's too late for the feather, you know, I think I'll, I may web the feather. And if I do, I'll probably add this little diode because there's definitely space. Right. But I want to wait to get more feedback in case there's other things I have to fix. Yep. Makes sense. Which, which there may be, but I can add it to the itsy, maybe I'm going to try to see if I can make some space for it. Probably like diodes are kind of big. Yeah. Annoying. Yeah. The SOD123s or whatever. Yeah. Even the 123s are like, they're kind of chunky. So that's, that's it. So that's my, my, hopefully I distracted you. That's deep dive with more. Deep dive with Lady Aida. Oh my God. There's only 30 minutes. So it's quite a while, but that's okay. 30 minutes is a good. We got plenty of time. It's all good. Good distraction. I don't know. I don't know how I'm going to debug this anyway. Okay, cool. Well, maybe I helped flush your brain a little bit. But I mean, I'm basically, I'm almost on weekend too. So, you know, I'll just tackle it next week in the worst case, but I might poke at it some more. Do you have any idea, I know folks are excited for the feathers. Do you have any idea when the next batch will be in the store? We're going to fab the next batch on Friday, I think, all things being good. Yep. It'll be a couple hundred. We're still, we're still working on the yield. Okay. It is a 04, it is a, you know, not a 402. It's a 0.4 millimeter pitch QFN. And there was a bit of bridging. Okay. So the first batch had 20% failure. You could rework them, but like the rework takes time. We really prefer not to. It would be a wonderful day to pop right out of the oven, you know, pristine jewels of feather. So the next one we're going to try to really, we're doing another smaller round of a couple hundred. We didn't notify folks, but when we put the next batch in, I will, I'll try to drop in by Discord and do a little whoever's in the circuit Python. I'll be like, Hey, you know, here's feathers, you can sign up. And then we're going to get parts to make, you know, many, many thousands, but I do want to work out the yield issues first. Right. So there's no lack of chips or PCBs. It's a matter of process. So what are you going to experiment with to reduce the bridging? Good question. So the first thing I did is when I got the stencil, I got a gold plate stencil. I didn't know they had those. Yeah, they're, they're, it's very light. It's like a one atom thick, right? And the gold, the nano plate gold helps with the release to get more perfect little ovals of paste. Okay. The second thing we're going to do is we're going to try to use cold paste. Cold paste is a little less runny. That might help with the bridging. You know, we're already using gold and a gold on the pads. If that doesn't work, I might actually go back to the Pi Foundation and be like, yo, what do you, what do you guys suggest? What's your secret? Yeah, do you have any secrets? I know that they don't do the manufacturing, but they, this is, they're pretty involved in it though, I think. I know. I would have, I wish they'd done 0.5 millimeter pitch, but it's 0.4 is a little frustrating. But we will do it. I mean, like we handle 0.4 millimeter. And in fact, the matter is I don't have a choice matter here. So I will, I'll figure it out. Yeah. And that's, I think that's the argument for actually going to BGA when the pitch is wider is like people would, a wide pitch BGA, like a 0.8 millimeter pitch is, that's amazing, huge. So, right. Awesome. Well, that's super exciting. I think people are going to be very excited to get that. Thanks for stopping by and diving deep on the schematics side of things. We'll get this. I still have the challenge of making a stage two that works for a lot of different flashes. So we'll see what we can fit in the area in that space. Yeah. Now, you know, we might have to do one that's, that's giga device slash wind bond at the same time. But yeah, I'll have to take a look. I think you can fit it. Let's take a look at what the differences between those two are. But yeah, it'll be good. We'll be ready for all those RP 2040 boards that are coming. I know. Well, I'm going to send out these photos today, get the testers done, and then we'll see, we'll see more boards come out. But I'm glad that I, I learned, I learned things, always learning. All right. Thanks everybody. And thanks for having me. Don't forget, we'll have a desk lady data on Sunday. She'll probably be more of the same. Never end. It's very exciting. Thanks for dropping by. You're still on more. She can't hear me. I hung up on her. Awesome. Well, that was a treat. It's always good to see how everything is going. Obviously, like I'm more of a software person. It's 345. And my code still didn't come up. It looks, it looks just fine to me. David says, I don't understand everything, but I like it. Awesome. Okay. Let me add another time code for myself. I can add time codes after the fact as well. Google foob says, thanks for this cool info. Yeah. If it's cheap, I'll buy a DIY rework kit. I don't think, I don't think we would ever actually sell that. I saw the example or the suggestion in the Discord as well. I don't think we'd ever do that. I don't think we'd ever sell boards that needed rework because you never know how much rework they need. Because like, if it's, if it has a bridge, you can't test it, right? So like, it's, it's completely untested. And to rework stuff, it takes like, like soldering, and it takes soldering skills usually, like it's not always an, not always an easy thing to do. So I, like, I know that they have people at Adafruit that will rework things. So they'll just, they'll just get to yield up and it'll be, it'll be all good. Bill says, a bit scared by that build issue, we have custom designs that we use the RP2040, probably stick to the Kiti Pi or other cast-alated pads for a while. Yeah, well, that's the nice thing about open source is that hopefully, yeah, they run through the same testing after they rework it. Hopefully the, once that, like the Pi Foundation is really good about being public with their information as well. So I think if one more comes to them and says, like, hey, what's the best footprint for this, like, they'll publish that. So it's, you know, I think it's all within the realm of like, it's just early in, it'll get sorted out. People will, people generally will figure out how to like, get the landing pads right and the stencils right for optimal, optimal yield on these chips. Like if you're assembling it by hand, I'm not too worried about it actually, because the way that I would do it is I would, I would just hot air the center pad down and then just drag solder. So you just use flux and drag solder and I think I suspect it's fine. You don't need like bridging is the thing that you get with solder paste and, and reflow. You can of course bridge it with a, with an iron as well, but I think it's less likely to do, to like, not be able to undo it from, from what I've, my hand soldering skills. Yeah, I'd not heard of gold stencils though. Okay, so what are my, what are my options? So this is the first assembly instruction. I wonder what I could do. AT Maker said, Bill says out of curiosity, was there a benefit to the weird boot litter approach? Um, not sure what you mean. This is, so all of this, like, if you do execute in place, you have this challenge of like, how do I initialize the flash to be fast? You could leave it, you could always do the generic version in the boot loader and then change it in the user code, but then the user code has to be like, very deliberate about like, shut everything off, load it and ram and do that again. And the nice thing with having the boot loader do that is then that it's up to the boot loader to decide like, oh, something's wrong, I'm going to just go into the boot loader. Although obviously that it's possible to have things not work enough that, it's possible to have things work, not work enough that the boot loader doesn't start and it's somewhere in the middle of the, the flash code too, which is where I'm at, right? Like, I'm not getting circuit pie, but I'm also not getting the RP, RP to drive. So take another time code, although my time codes may be a smidge. Yeah, I think this runs a bit fast. So where is the ROM code? So the ROM code is is open source, which is nice. But in terms of the chip, it's actually like in the chip itself. I'm trying to think of the best way to show that. I think that if we look, usually the block diagram will have a block for, yeah. So here's like a block diagram of the chip. And if we look here, we can see that there's this XIP cache, which goes out to the QSPY, but then there's also this chunk of ROM. So it's like, the ROM is like built into the chip itself. And it's not always the case that the source code for the boot ROM is made open, but in this case, the Raspberry Pi foundation does, did actually publish it. I'm not exactly sure, the repo name, but it's, it's somewhere here. Pico boot ROM. So yeah, if you want to see the source, this is what, what's on there. It's true ROM, not EE problem. I believe so. So they don't tell you any ways of re-racing it. So I think it is. NWK confirms it's a metal layer ROM slash permanent. So yeah, it's actually baked into the like way the chip is etched. So it can't change it, which is why you, you hope and hope and hope that it's correct. Vita says it's always harder to bridge when you're trying to do it deliberately, such as I squared C address jumpers. Saltino points out you can use solder wick for, for bridges. Yeah, David says we don't even have to use x-ray or decap to get the boot ROM. Yeah. And you get the actual source too, rather than a disassembled version. Okay. So this doesn't work. You know what one thing we could do to debug is, I have it set up here. Let's do this. The way, so debugging flash chips is really handy. So I don't have the overhead here, but my cable is not long enough. So I'll just unplug it before I get it going. So salier and I have this, which is a, sorry, a clip. And this is an SOIC8 clip, which is super handy because flash chips are usually SOIC8, especially on the feather. So what I'm about to do is I'm going to plug this, you can see I have wires to the salier. I'm going to put this on the flash chip on my feather and we can look at what it's doing. So that's, we should be able to see how far we're getting, hopefully. And I can never remember, yeah, I think ground is on the side of the pin. So let's, I hadn't thought about, this is a way to debug a flash chip and I hadn't thought of it until now. What is this? Oh, this is the disassembly or the UF2 logic. NWK says the recent amp hour podcast interviewed the RP2040 chip designers and they explained why they didn't use on chip flash. It adds steps to the manufacturing process and more money. Waymo says, okay, so this is fun and about as deep of a dive as is possible. I, yeah, I agree with you. There was a question to Lady Aida during Ask an Engineer about like talking about failure and showing failure and somebody was like, well, Scott's streams always have him failing. So it's good. I think it, you know, it's one of those things you learn as being over time as an engineer. So I'm happy to, happy to show stuff. Hi, Emmett debugging by observing. Indeed. Okay. So I think I've actually, I have this all set up for it. So all I'm going to do is I'm going to hit start. That's a nice thing about this clip too is that like, I'm just going to hit the reset button and it recorded. Oh, thank you, Mr. Certainly. Mr. Certainly linked to the test clip. I was suggesting to Lady Aida that we stock this because it's just, I think they did previously as well, but it's just so handy for, for capture here. So this is cool, right? This is super handy. What we're talking about. And, okay, so we're triggering. Do I not have any of my, oh, I don't. Okay. Spy. So here's a trick. I never actually cancel. Let's go to, I don't usually actually know, like look at what pin is connected to what usually what I'll do is I'll look at the signal. Oh, that signal does not look good. That does not look complete. What is that? I wonder if it's not my, it's possible the clip's not sitting well. So this looks like data, right? Like, if this is the first 256 bytes, then this would be our instructions and then this is the checksum. But like, nothing happens after that. So maybe we are failing the checksum, but I just clipped it on and we're not seeing a clock. There's no clock signal here, which is very weird. I wonder if I put it on backwards or I just need to, so I'm just putting it on again. And I'm just going to do the same thing. These clips won't sit according to much. Where is my clock line? Like that's clearly a data line. This is an instruction. Did I pull something out or I can see pin one, check physical first. Yeah, I think I have the, well I just unplugged it so it's not connected now. I have a giga device. Okay, so here's the chip. I'm just going to look at the pin out here and make sure that I'm oriented correctly. So contents. Here we go. This is what I want. Okay, so we have this version. Chip select. Yeah, the ground is there. Maybe my clip is busted. I was just using it. And let's see. Chip select is one. Clock is six, which I have on yellow. Well, it is channeled. Let's try it again. I should really record less compared directly with a regular boot. Yeah, I could. Yellow doesn't change at all. I mean, there was just messing with it, so, or it's not sitting correctly like somebody said. I could do a power cycle as well. That might, maybe it's in a bad state. Let's try one more time and then I'll, I don't think so. I was just using it. I should, I should put more in my, like that yellow line doesn't change at all. Let's do this. I'm going to unplug it. Like it's possible. Like maybe I busted it. Nope. Oh no, I lost it. I saw it go by. Weird. All right, let me look. I have another one here I can try it on too. Flip it to test a different line. Yeah, my ground reference moves then though, which is kind of annoying. I'll try a different board. That's what I'll do. Like I know this, that one still didn't have it. Let's just try this other one that I was doing yesterday. It didn't look bent. There are like some components right there that makes it a little tough. Well, this is, this isn't exciting. Well, that's it working, but see yellow is still not, still don't have a clock. So this is, this is interesting because this is what happens when, when it initializes. Okay. So one thing I want to do is, as I'm doing this improvement of flash, I want to actually see here when the code's running, it's, it's having to go to the flash every feet, like 20 milliseconds or so. So there's a 16 kilobyte cache, right? And ideally what we would do is we wouldn't have to go outside that cache for like regular code. So, yeah, let me, it must be the, maybe, now it's running so we can see that. After I like said these clips are awesome. I'll take it even if this clip is not. Well, that's uneventful. Oh, you know what I can do? What? I'll just switch it. I'm greens doing something. Blue's not doing anything. So that's blue. Oh, weird. What did I just do? I just switched clock to, that looks right. Not very good though. Huh. Yeah, the salient might be. Bye, Keith. Yeah, I'm sorry. I'm over time. All right, let's wrap up. I'll maybe keep poking this. But that's a good, that's a good next step. So I think the next step is to see how far it gets. And we should be able to see like the execution of the, no, should we? I guess we're not running anything external to the flash, but we should see if it tries to, tries to start it up. Let me take a time, good. Well, thanks again for everyone, everyone for hanging out. I'm happy that a bunch of you got the notice that we're on Thursday. Next week will be on Friday. I'll be working all week. I'm taking the 3D weekend this weekend. So thank you all for hanging out. Thanks to Lady Aida again for dropping by and going into the deep dive of the design of the cutie pie and the itsy-bitsy. Keep an eye out. If you have any questions, or wait, yeah, if you have any questions, go to Discord, which is ADAFRU.IT slash discord. If you want to try the cascade toml stuff and take a look at the flash stuff, that would be awesome. But yeah, I'll, you know, I'm working towards supporting different flash chips on the RP2040. So hopefully we'll get a good, either a Stage 2 that can do a lot of different chips or we'll be able to switch Stage 2s depending on what we're going to use. Gareth says, is adding a new language UK English? I think we already did. I think WebLate has it. I saw that we're building it now. WebLate, Circuit Python, few project languages, English United Kingdom. Yeah, so we have it now. So if you want to contribute Circuit Python in English United Kingdom, check that out. You can do that. Thank you again, everyone. Please support me by supporting ADAFRU by going to ADAFRU.com. Keep an eye out for Feather RP2040s. Join the Discord if you want to see a link go by if they're out. Like I said, we only do the email when we have a lot in stock. Early on, we may not actually send the email. So, secret. Yeah, ran out of time for the clock. Thank you again, everyone. I'll talk with you all next week on Friday. I guess we'll give Spook some pets here too while we're at it. I think I need to get a lapel mic so you can hear him here in prayer. Anyway, thanks all.