*** tpb has joined #tomu | 00:00 | |
*** futarisIRCcloud has joined #tomu | 00:31 | |
mithro | xobs: It looks like the applet has a bunch of addresses to start from | 00:32 |
---|---|---|
mithro | xobs: https://docs.google.com/spreadsheets/d/1GpODSOEyMLW0n-oLtM2OK5VHUZfGAMkQ0Hzdnw_t2y4/edit?pli=1#gid=0 | 00:34 |
tpb | Title: Google Sheets - create and edit spreadsheets online, for free. (at docs.google.com) | 00:34 |
futarisIRCcloud | xobs: So can I flash the hacker boards using foboot and bit-banged SPI now? | 00:36 |
xobs | futarisIRCcloud: nearly there. I have managed to erase and program exactly 256 bytes. It gets stuck after that, so today I'll try and finish it up. | 00:38 |
xobs | Then I need to get rebooting working. | 00:38 |
xobs | mithro: the SB_WARMBOOT block has two bits. Maybe there's a header that needs to get stuck on the front of the Foboot Bitstream. | 00:40 |
mithro | xobs: That is correct | 00:40 |
mithro | xobs: See the second sheet | 00:40 |
xobs | Does it scan all of spi looking for the correct image? | 00:45 |
xobs | Or do these four configuration words go at the start of the first image? | 00:46 |
*** im-tomu has left #tomu | 00:46 | |
*** im-tomu has joined #tomu | 00:46 | |
mithro | xobs: These go at address 0 | 00:47 |
xobs | Does each get a sync word? | 00:48 |
mithro | xobs: As far as I can see | 00:49 |
mithro | xobs: The "applet" is 128 bytes long, with 32bytes per offset thingy | 00:50 |
xobs | That clears things up a bit, thanks. I wonder why they're so large. No crc16? | 00:54 |
mithro | https://github.com/cliffordwolf/icestorm/blob/master/icemulti/icemulti.cc#L125-L158 | 00:54 |
tpb | Title: icestorm/icemulti.cc at master · cliffordwolf/icestorm · GitHub (at github.com) | 00:54 |
xobs | I see how these could interact with the FPGA Bitstream state machine. | 00:54 |
mithro | xobs: I think it's because the header thingy only fits in 17 bytes, and 32 bytes is the next 2^n offset? | 00:57 |
mithro | xobs: What flash device are you using? | 01:02 |
xobs | mithro: there are a few, I'd need to go check. I actually need to update Foboot to work with the dvt flash. | 01:03 |
xobs | I mean, it works right now as-is, but it doesn't identify the capacity correctly, and there might be some quirks. | 01:04 |
mithro | xobs: I'm pondering about write protect | 01:10 |
mithro | The device can be software protected against erroneous or malicious program or erase operations by utilizing the NonVolatile Protection feature of the device. Non-Volatile Protection can be enabled or disabled by using the Write Status Register command to change the value of the Protection (CMP, SEC, TB, BP2, BP1, BP0) bits in the Status Register. | 01:11 |
mithro | xobs: I'm trying to figure out what the spiflash layout should look like... | 01:27 |
mithro | xobs: Interestingly, the bitstream is 102kbytes, so in a 128kbytes region you could have the FPGA+bitstream + 28kbytes of program.... | 01:38 |
xobs | That was my thought. We could actually use the bootloader CPU to run user programs. | 01:42 |
xobs | Makes it easier to pass data back and forth between the bootloader and RISC-V programs, if necessary. | 01:42 |
mithro | xobs: So I was thinking if you get 28kbyte of program per 128kbyte region with bitstream, if we did "failsafe bootloader + embedded foboot, bigger bootloader, riscv cpu + embedded bios" we could fit in the first 256kbyte of flash and have ~56kbytes of flash for the bigger bootloader | 01:57 |
futarisIRCcloud | Sounds reasonable | 02:00 |
mithro | xobs: then we can write protect the first 256kbytes of the flash | 02:01 |
xobs | The two SPI flash stuff options I picked both have similar registers for that, though I'm still trying to understand how the MX25R1635FZUIH0 works. | 02:06 |
xobs | They look different, but that's fine that's just a special case for updating Foboot, and it can be worked out in a Fomu version of Booster. | 02:09 |
mithro | Booster? | 02:10 |
xobs | mithro: "booster" is the program that you stick a new version of Toboot onto the end of to update Tomu. Kinda like a booster rocket. | 02:11 |
xobs | https://github.com/im-tomu/tomu-bootloader/tree/master/booster | 02:11 |
tpb | Title: tomu-bootloader/booster at master · im-tomu/tomu-bootloader · GitHub (at github.com) | 02:11 |
mithro | xobs: The question is how big a UF2 bootloader is going to be | 02:24 |
xobs | mithro: that is the question. | 02:24 |
xobs | I've run out of space, which makes it difficult to add debugging. | 02:24 |
xobs | So I'm getting the debugger working instead. | 02:25 |
mithro | xobs: for foboot? | 02:25 |
xobs | I don't think UF2 will be much larger. I'd guess UF2 would be maybe twice as large. | 02:25 |
xobs | Yeah, for the DFU mode. DFU should be the failsafe mode. | 02:25 |
mithro | xobs: your running foboot inside the bitstream right? | 02:26 |
xobs | Yes, Foboot is within the bitstream. | 02:27 |
xobs | However, with the full UF2 bootloader, I think it should be outside of the bitstream, which should free up enough BRAM to use epfifo with more than just the one endpoint. | 02:27 |
mithro | xobs: Should also figure out how big micropython is.... | 02:31 |
futarisIRCcloud | You'll need a few endpoints for USB Mass Storage, for UF2... | 02:32 |
futarisIRCcloud | Has anyone hooked up a vexriscv simulator to a litex bridge? | 02:34 |
mithro | futarisIRCcloud: The renode was doing something like that | 02:34 |
xobs | futarisIRCcloud: I've done an awful lot of the reverse. | 02:37 |
*** jayvee` is now known as jayvee | 02:39 | |
xobs | Whyyyyyy. I hook up the debugger and everything just works. | 02:41 |
mithro | What are you trying to debug? | 02:44 |
xobs | mithro: Foboot's DFU mode. It was getting into a state where it stopped responding, and my assumption was that it was spinning waiting for SPI flash. | 02:45 |
xobs | But today it's mostly working. | 02:45 |
xobs | Oh well, it's nice to have a debugger at least. | 02:45 |
xobs | Unfortunately I have the debugger working using the UART, which is only on EVT boards. | 02:47 |
xobs | Now I'm playing the try-to-get-it-to-meet-timing game | 03:32 |
xobs | It is not a fun game. | 03:32 |
mithro | xobs: Didn't you do some work on the epmem interface? | 03:53 |
xobs | mithro: I did some, but I stopped work on it in favour of getting something up and running. | 03:54 |
mithro | xobs: That should only increase the LC count while keeping the mem count the same | 03:54 |
xobs | I have something working, and the system is validated, so now I can pick it up again. Once I have free time, of course. | 03:54 |
mithro | I had an interesting idea about how to do fast interrupts on riscv on ice40 | 04:06 |
xobs | Oh? | 04:06 |
mithro | s/fast interrupts/fast context switches/ | 04:07 |
mithro | As we use a register file, we actually have a whole bunch of spare space fo have copies of the registers | 04:07 |
xobs | Banked/windowed registers? | 04:08 |
mithro | so it would be pretty simple to "save" the registers by just having an offset into the register file | 04:08 |
xobs | It's an interesting idea. And would save a lot of time for context switches. | 04:09 |
mithro | xobs: It would in fact just end up being mapped to the top bits of address.... | 04:09 |
mithro | xobs: I was thinking that you might keep the bottom 16 constant and the top 16 are banked, as frequently you still need to access the registers which have arguments and stuff? | 04:10 |
mithro | and there is already the RISC-V mode were you only have 16 registers -- embedded mode | 04:10 |
xobs | Yeah, embedded mode might be nice to have for performance reasons. | 04:11 |
futarisIRCcloud | mithro: https://www.sifive.com/blog/all-aboard-part-7-entering-and-exiting-the-linux-kernel-on-risc-v | 04:11 |
xobs | Though the banked idea does get around the issue nicely. | 04:11 |
mithro | The RISC-V calling convention passes arguments in registers when possible. Up to eight integer registers, a0–a7 | 04:14 |
xobs | And that's $x10-$x17 | 04:15 |
futarisIRCcloud | $x10? | 04:16 |
xobs | Logical register $a0 is physical register $x10. Like how logical register $zero is physical register $x0, and logical register $sp is physical register $x2. | 04:17 |
mithro | https://gist.github.com/mithro/3eb3089873a670ce2030c07555febe84 | 04:20 |
tpb | Title: riscv-calling-convention.md · GitHub (at gist.github.com) | 04:20 |
*** rohitksingh_work has joined #tomu | 04:31 | |
*** ewen has joined #tomu | 05:54 | |
ewen | For those playing along at home, https://github.com/im-tomu/fomu-tests/pull/6 contains my draft attempt at making the Fomu blink example buildable for Fomu Hacker boards too. (Still works on EVT2/EVT3; builds for FOMU_REV=hacker, but I don't have a hacker board to test with). | 06:14 |
tpb | Title: WIP: Support EVT and non-EVT Fomu boards by ewenmcneill · Pull Request #6 · im-tomu/fomu-tests · GitHub (at github.com) | 06:14 |
*** awe00 has joined #tomu | 07:38 | |
futarisIRCcloud | Check out @zephray_wenting’s Tweet: https://twitter.com/zephray_wenting/status/1110384453048774658?s=09 | 07:45 |
*** awe00 has quit IRC | 08:59 | |
xobs | thanks for the changes, ewen! | 09:12 |
xobs | Wow, programming is so much easier when you have a debugger. Even better when you have *hardware breakpoints*. | 09:12 |
xobs | (Which, let me tell you, makes debugging ROM code so luxurious.) | 09:13 |
ewen | xobs: Debuggers and breakpoints are defintely very useful for certain types of bugs :-) | 09:13 |
*** AmosSam has left #tomu | 09:14 | |
ewen | xobs: Re changes, you're welcome. I learned a bunch getting it compiling. I'd suggest reviewing and ideally testing on a hacker board before merging. | 09:14 |
xobs | I don't actually have any hacker boards wired up. I'll do that once I get DFU working. | 09:15 |
ewen | Cool, thanks. Good luck with DFU. (I'm off to bed now, BTW.) | 09:19 |
xobs | Goodnight! | 09:19 |
*** AmosSam has joined #tomu | 09:20 | |
xobs | I'm 90% of the way there with DFU. The issue I'm struggling with right now is that the FIFO has up to 64 elements, but it'll add on a CRC16 if there's space. | 09:20 |
*** ewen has quit IRC | 09:23 | |
*** awe00 has joined #tomu | 10:38 | |
*** AmosSam has left #tomu | 10:57 | |
*** AmosSam has joined #tomu | 10:57 | |
*** rohitksingh_work has quit IRC | 11:27 | |
*** rohitksingh_work has joined #tomu | 11:28 | |
*** futarisIRCcloud has quit IRC | 13:10 | |
*** rohitksingh_work has quit IRC | 13:27 | |
*** jas4711 has quit IRC | 14:18 | |
*** awe00 has quit IRC | 14:36 | |
*** im-tomu has left #tomu | 14:40 | |
*** im-tomu has joined #tomu | 14:42 | |
*** awe00 has joined #tomu | 14:45 | |
*** jas4711 has joined #tomu | 14:52 | |
*** AmosSam has left #tomu | 15:07 | |
*** rohitksingh has joined #tomu | 15:08 | |
*** AmosSam has joined #tomu | 15:19 | |
*** AmosSam has left #tomu | 15:36 | |
*** rohitksingh has quit IRC | 15:41 | |
*** AmosSam has joined #tomu | 15:44 | |
*** rohitksingh has joined #tomu | 15:54 | |
*** rohitksingh has quit IRC | 16:06 | |
*** rohitksingh has joined #tomu | 16:21 | |
*** rohitksingh has quit IRC | 16:33 | |
*** rohitksingh has joined #tomu | 16:59 | |
*** awe00 has quit IRC | 17:53 | |
*** rohitksingh has quit IRC | 17:56 | |
*** awe00 has joined #tomu | 18:03 | |
*** awe00 has quit IRC | 18:11 | |
*** awe00 has joined #tomu | 19:46 | |
*** awe00 has quit IRC | 21:41 |
Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!