*** tpb has joined #tomu | 00:00 | |
scientes | xobs, ^ | 05:56 |
---|---|---|
*** tcal has quit IRC | 09:23 | |
*** craigo has quit IRC | 12:00 | |
*** coderobe has quit IRC | 12:42 | |
*** coderobe has joined #tomu | 12:43 | |
*** emeb has joined #tomu | 14:04 | |
xobs | I'm not sure what it could be. selinux? | 14:42 |
*** alexhw has quit IRC | 14:43 | |
scientes | gregkh in #kernelnewbies wasn't sure either | 14:45 |
scientes | the error is when it asks it to change modes | 14:45 |
scientes | but there are also errors when i do lsusb -v | 14:46 |
scientes | time outs | 14:46 |
scientes | but no kernel messages for those time out | 14:46 |
xobs | Wait, so once you load `blink-extended` onto that Fomu, it will never work again on that machine? | 14:47 |
scientes | it works on another machine however | 14:47 |
scientes | while the blink-extended program is running | 14:47 |
scientes | but yes | 14:47 |
scientes | i managed to upgrade the bootloader on another laptop | 14:48 |
xobs | But if you plug it into your Thinkpad you can't see it anymore when you do `lsusb`. | 14:48 |
scientes | I can | 14:48 |
scientes | I can see it | 14:48 |
scientes | but lsusb *-v* has timeouts on certain requests | 14:48 |
scientes | lsusb works fine | 14:48 |
xobs | That's interesting. Because loading a program such as `blink-extended` shouldn't affect `foboot` at all. | 14:49 |
scientes | the program is running right now | 14:49 |
scientes | so its a problem with the reset? | 14:50 |
scientes | cause it blinks the whole time I am trying to program it | 14:50 |
scientes | is it suppose to stop blinking when it is reset? | 14:50 |
xobs | What color is it blinking? | 14:50 |
scientes | green i believe | 14:51 |
xobs | Where are you getting `blink-extended` from? | 14:51 |
xobs | Is it from https://github.com/im-tomu/fomu-workshop/tree/master/verilog/blink-expanded? | 14:51 |
tpb | Title: fomu-workshop/verilog/blink-expanded at master · im-tomu/fomu-workshop · GitHub (at github.com) | 14:51 |
scientes | yes | 14:52 |
scientes | I just ran make and then dfu-util -D | 14:52 |
scientes | I am not good with colors, I can take a video | 14:52 |
xobs | Interesting. There appears to be a critical piece of information that's missing from the README files. | 14:53 |
xobs | The USB core is in the FPGA gateware itself. Foboot is actually a CPU + USB + ROM. When you load your own Verilog code, such as the blink example, it reconfigures the FPGA to be whatever program you loaded. | 14:54 |
scientes | https://imgur.com/a/nbYKN46 | 14:54 |
tpb | Title: Imgur: The magic of the Internet (at imgur.com) | 14:54 |
xobs | Since you didn't load a USB core, it isn't a USB device anymore. | 14:54 |
scientes | xobs, yeah I got that from the docs, but I thought there is a special reset | 14:55 |
scientes | that reloads into the bootloader | 14:55 |
scientes | the riscv example docs kinda say that | 14:55 |
xobs | There is -- you can hit `SB_WARMBOOT` from your Verilog code. | 14:56 |
scientes | then how the hell does the other laptop do it? | 14:56 |
xobs | But the question is how to trigger that. | 14:56 |
xobs | Since it's not a USB device anymore. | 14:56 |
scientes | bit the other laptop worked???? | 14:56 |
scientes | usually you have a boot sequence that can be interupted on these type of things | 14:57 |
scientes | and you just reset and then do your thing | 14:57 |
scientes | and the cheap way to do it is to have it boot off the host | 14:57 |
scientes | like the sheevaplug had tftpboot | 14:57 |
xobs | That works if you're using the CPU that's part of Foboot. But since you're in Verilog land, you must first invent the universe. | 14:58 |
scientes | but again, why did it work in the laptop? | 14:59 |
scientes | the other laptop | 14:59 |
scientes | Oh I see, that is why other FPGA boards have USB serial chips | 14:59 |
xobs | I think it may be a bug. | 14:59 |
scientes | while this one is kinda funky to just have that part of the FPGAs duties | 14:59 |
xobs | These pins should be floating, not `0`: | 14:59 |
xobs | https://github.com/im-tomu/fomu-workshop/blob/master/verilog/blink-expanded/blink.v#L73-L74 | 14:59 |
tpb | Title: fomu-workshop/blink.v at master · im-tomu/fomu-workshop · GitHub (at github.com) | 14:59 |
xobs | They're kinda breaking spec as-is. | 15:00 |
xobs | So perhaps your other laptop didn't interpret that as a disconnect. Or maybe the Thinkpad did. | 15:00 |
scientes | so what it should do is to reset when there is a usb change mode command | 15:00 |
xobs | They should be 1'z not 1'0. | 15:00 |
scientes | hmm verilog land is like way less mature than even C-land | 15:01 |
xobs | scientes: That requires you to implement USB in Verilog, or port Valentyusb to Verilog to support that. Doable, but it's a lot of baggage to bring in. | 15:02 |
*** alexhw has joined #tomu | 15:02 | |
scientes | is usb that gross? | 15:02 |
xobs | It's like saying it's easy to display a JPEG file from a console, all you need to do is start a Wayland server. | 15:03 |
scientes | yeah I get it | 15:03 |
scientes | yeah that makes sense actually, I imagine how hard it would be to recieve a ethernet packet | 15:03 |
scientes | only serial is easy to implement | 15:03 |
xobs | USB on Fomu is made particularly icky by the fact that it's split into two clock domains to meet timing, and the fact that it's 4x oversampled. Clock sync is hard. | 15:03 |
scientes | so that is why TinyFPGA has a FT2232 chip | 15:04 |
scientes | or whatever that common usb serial chip is called | 15:04 |
scientes | it makes it way easier on the fpga | 15:05 |
xobs | Yeah, that's why a lot of those boards use external serial devices, and program the SPI flash using auxiliary GPIOs. | 15:05 |
scientes | so what does doing "1'z" do? | 15:05 |
scientes | oh z is a floating point literal | 15:05 |
xobs | On the flipside, it means Fomu can be many things, which is why Circuitpython lets us be things like a keyboard/mouse/uart/disk. | 15:05 |
scientes | but z floating point is the same as a 0 integer | 15:05 |
scientes | *zero floating point | 15:06 |
xobs | `z` means "Hi-Z" | 15:06 |
xobs | Boolean values in Verilog have at least four values I'm aware of (VHDL bools have 9 possible values -- welcome to hardware). | 15:07 |
scientes | this definitely makes it trickier to do toolchain dev. which is what I was interested in | 15:07 |
scientes | oh wow, I have lots to learn | 15:07 |
scientes | in SQL bools are a tristate | 15:07 |
xobs | `0`, `1`, `x`, and `z`. 0 and 1 you know, `x` means unknown, and `z` means hi-impedance. Which if you're used to normal GPIOs can sometimes be thought of as "input". | 15:08 |
xobs | Right now that line is setting USB to drive 0 onto the D+/D- pins. What it should be doing is setting it to `z`, which means "don't drive anything, just let it float". | 15:09 |
scientes | unknown would be "undefined" in llvm then? | 15:09 |
scientes | ahhhhh | 15:09 |
scientes | so gregkh knew exactly what was happening :) | 15:10 |
xobs | I see "unknown" mostly in simulations. | 15:10 |
xobs | Ah, `X` can also mean "Don't care". | 15:12 |
scientes | yeah now i understand what "high-impedence" means | 15:12 |
scientes | it means it isn't grounded to anything | 15:12 |
scientes | in any way | 15:12 |
scientes | so it doesn't look like a wire | 15:13 |
xobs | For example, you can make an address decoder that looks for `8b101xxxxx`, and will match `8'10100000', `8'10100001', and so on. | 15:13 |
scientes | so why does the bootloader show up in lsusb? | 15:17 |
scientes | I am still confused about what is happening | 15:17 |
scientes | Bus 001 Device 080: ID 1209:5bf0 Generic Fomu PVT running DFU Bootloader v2.0.3 | 15:17 |
scientes | where is that string? | 15:17 |
xobs | The bootloader has a CPU + USB + ROM, and the CPU configures the USB core to work with Linux. | 15:19 |
xobs | Rather, to work with your machine. | 15:19 |
scientes | before loading the program | 15:19 |
scientes | damn, that must happen *fast* | 15:19 |
scientes | cause it starts blinking immediately | 15:19 |
xobs | Here's the reference manual for the USB core (and the whole CPU) that Foboot runs on, and that gets used when you load a RISC-V program (as opposed to a Verilog program): https://rm.fomu.im/usb.html | 15:19 |
tpb | Title: USB Fomu Bootloader documentation (at rm.fomu.im) | 15:19 |
xobs | I want to say 150ms, but I feel it's faster than that. 40ms? I'd have to consult the ICE40 reference manual. | 15:20 |
scientes | so the problem is that it sees it as a usb device | 15:21 |
scientes | and if it didn't it just resets it? | 15:21 |
scientes | *if it does not see it as a usb device | 15:21 |
scientes | wow, this is actually quite liberating | 15:27 |
scientes | like i could get this https://store.digilentinc.com/pmod-can-can-2-0b-controller-with-integrated-transceiver/ | 15:27 |
tpb | Title: Pmod CAN: CAN 2.0B Controller with Integrated Transceiver - Digilent (at store.digilentinc.com) | 15:27 |
scientes | and write a proper AF_CAN driver for linux | 15:27 |
scientes | this is way better than AVR-8 can because you can just *be* the cpu is you want | 15:28 |
scientes | I had a can device one that was one of those microcontrolers and avr-8, but then the linux driver was serial+nodejs!!!!! | 15:30 |
xobs | Very zen. Be the CAN. | 15:30 |
*** xkapastel has joined #tomu | 15:39 | |
scientes | so dfu-util should have a pre-reset mode | 15:53 |
scientes | to knock it into the bootloader | 15:53 |
*** CarlFK has joined #tomu | 15:57 | |
*** ssb has quit IRC | 17:18 | |
*** ssb has joined #tomu | 17:26 | |
*** craigo has joined #tomu | 19:04 | |
*** xkapastel has quit IRC | 20:19 | |
*** Joel__ has quit IRC | 20:51 | |
*** Joel__ has joined #tomu | 20:53 | |
*** xkapastel has joined #tomu | 21:34 | |
*** coderobe has quit IRC | 23:12 | |
*** coderobe has joined #tomu | 23:13 |
Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!