*** tpb has joined #timvideos | 00:00 | |
* mithro forgets how to put the analyzer in a different clock domain... | 00:00 | |
*** samsagaz has quit IRC | 00:11 | |
*** samsagaz has joined #timvideos | 00:14 | |
mithro | be back later... | 00:16 |
---|---|---|
mithro | tannewt: one thing that might be worth trying, getting your tinyusb to compile and link inside the buildenv even if there is no USB device to drive yet | 00:28 |
mithro | xobs: Have you used litescope recently? | 01:46 |
mithro | Hrm, I can't seem to figure out why litescope doesn't seem to be seeing these values change... | 01:55 |
tannewt | mithro, ya I can look into it. does the build env have more than a compiler in it? | 02:05 |
mithro | You mean does it have a libc? | 02:06 |
tannewt | my linux box is still very flaky so I may end up giving up and working to get the ice40 tools going on mac | 02:06 |
cr1901_modern | mithro: Presumably you remembered ClockDomainsRenamer by now :P? | 02:06 |
mithro | tannewt: Linux VM on your Mac maybe? | 02:07 |
mithro | cr1901_modern: yes, I was trying to figure out the args before | 02:07 |
tannewt | mithro: I'm wondering what it provides exactly. It'd be nice to keep the deps to a minimum | 02:07 |
tannewt | mac can run most linuxy things natively just fine | 02:08 |
mithro | tannewt: by default there is a pretty minimal C stuff | 02:08 |
mithro | There is also a newlib option | 02:08 |
cr1901_modern | I imagine you can build a gcc cross compiler on Mac just fine | 02:09 |
tannewt | right, I'm just thinking I'll need the lm32 toolchain | 02:09 |
cr1901_modern | tannewt: lm32 is probably one of the easiest toolchains to cross-compile | 02:09 |
cr1901_modern | Follow step #4 here: https://github.com/m-labs/misoc | 02:10 |
tpb | Title: GitHub - m-labs/misoc: A high performance and small footprint system-on-chip based on Migen (at github.com) | 02:10 |
tannewt | kk, will follow that if I give up on linux | 02:10 |
tannewt | currently running top and tailing dmesg to see if I can spot the problem | 02:11 |
tannewt | definitely have unhappy usb | 02:11 |
mithro | I mean, it would be good if the setup supported Mac, but it's a pretty big yac shave... | 02:11 |
tannewt | ya, totally. that's why if I can reduce it to needing a gcc toolchain and icestorm I'd be happy | 02:13 |
mithro | I think I have scoping of the USB working.... https://usercontent.irccloud-cdn.com/file/HY0ECppW/Screenshot%20from%202018-11-17%2019-31-04.png | 03:38 |
xobs | Ooh, awesome! | 03:39 |
mithro | The NAK would be coming from the FPGA, right? | 03:44 |
xobs | No, looks like either a lower level signaling problem, or an invalid device configuration struct. | 03:48 |
mithro | xobs: Hrm? | 04:42 |
CarlFK | mithro: any idea what color wires I should use for the 2 usb datalines? | 04:43 |
mithro | CarlFK: It's defined somewhere... | 05:14 |
mithro | CarlFK: https://turbofuture.com/computers/Color-Coded-Wire-inside-the-USB | 05:15 |
tpb | Title: What Each Colored Wire Inside a USB Cord Means | TurboFuture (at turbofuture.com) | 05:15 |
CarlFK | mithro: I've been clicking around https://usb.org/document-library/usb-20-specification-released-april-27-2000 | 05:15 |
CarlFK | you have better click foo | 05:15 |
mithro | Red color indicates the positive wire with 5 volts of DC power. | 05:15 |
mithro | Black has always been the ground wire in almost all electronic devices. | 05:15 |
mithro | White is the data as a "positive" wire, while | 05:15 |
mithro | Green is also for the data , but as the negative wire. | 05:15 |
mithro | Well, this is frustrating, it seems to work with icecube2 but not nextpnr | 05:28 |
CarlFK | mithro: good. this random cable pulled from a desktop case is perfect: | 05:28 |
* CarlFK[m] uploaded an image: 20181117_232130.jpg (360KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/zUQwovpRqzdDNFktcubeHOBP > | 05:28 | |
mithro | Yay, I got it to ACK! | 05:46 |
*** rohitksingh has joined #timvideos | 05:51 | |
tannewt | mithro: awesome! | 05:53 |
tannewt | mithro what core are you using? | 05:54 |
mithro | tannewt: tinyfpga's | 05:55 |
tannewt | ah, I mean cpu | 05:55 |
tannewt | tinyusb example code is here: https://github.com/hathach/tinyusb/tree/develop/examples/device/device_composite/src | 05:56 |
tpb | Title: tinyusb/examples/device/device_composite/src at develop · hathach/tinyusb · GitHub (at github.com) | 05:56 |
tannewt | no makefile yet though, only the segger ide stuff | 05:56 |
tannewt | how is data moved to and from the usb peripheral? direct ram access or dma? | 05:57 |
*** rohitksingh has quit IRC | 06:01 | |
mithro | tannewt: That doesn't work yet | 06:05 |
mithro | tannewt: Still working the level below that | 06:05 |
tannewt | kk | 06:17 |
*** rohitksingh has joined #timvideos | 06:40 | |
mithro | tannewt: How good if your USB data payload decoding? | 06:56 |
tannewt | try me :-) | 06:56 |
mithro | Any idea what [0x80, 0x06, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00] says? | 06:56 |
tannewt | setup packet | 06:56 |
tannewt | I think its get descriptor 1 | 06:57 |
tannewt | length 0x0040 | 06:57 |
tannewt | ya, the 0x80 is on ctrl IN I think | 06:58 |
xobs | mithro: what could be happening is that the PHY/MAC is incorrectly decoding that packet as something that it doesn't know about. | 06:58 |
xobs | You're supposed to NAK any setup packets that you don't recognize. | 06:58 |
xobs | So apologies, it's likely the device that's NAKing. | 06:59 |
mithro | xobs: yes, but it is nacking / acking -- that is all I was trying to get out of that | 06:59 |
mithro | xobs: IE the device was responding to the input in some way | 06:59 |
mithro | tannewt: So what does a set address usb packet look like? | 07:00 |
tannewt | I see that on linux sometimes before the set address packet | 07:00 |
xobs | Oh! Yes. You should be able to have it respond with a valid descriptor header now. | 07:00 |
tannewt | I can grab a capture for you shortly | 07:01 |
xobs | mithro: byte 0 of the SETUP is 0, and byte 1 is 5 (for SET_ADDRESS) | 07:02 |
xobs | You send a zero-length DATA packet when you get that. | 07:03 |
mithro | data0 [00 05 0C 00 00 00 00 00] | 07:03 |
xobs | Yes, that's saying to set the address to 0xc | 07:04 |
xobs | The state machine for my bitbanged USB stack is at https://github.com/xobs/grainuum/blob/master/grainuum-state.c, and this is in grainuum_state_process_setup() | 07:04 |
mithro | tannewt: Any idea why its occurring before the set address packet? | 07:07 |
tannewt | its a Linux thing | 07:08 |
tannewt | I'm on my mac but will grab a sequence with a linux box | 07:08 |
tannewt | https://usercontent.irccloud-cdn.com/file/Qm8nzFom/Screen%20Shot%202018-11-17%20at%2011.04.37%20PM.png | 07:11 |
*** rohitksingh has quit IRC | 07:16 | |
*** sb0__ has quit IRC | 07:24 | |
tannewt | with my mac https://usercontent.irccloud-cdn.com/file/kARJoBMv/Screen%20Shot%202018-11-17%20at%2011.06.18%20PM.png | 07:27 |
tannewt | I have a BIOS prompt! | 07:42 |
tannewt | and now I have repl! | 07:44 |
CarlFK | yay! | 07:56 |
tannewt | I got a kick out of the pause while it thought about "1+1" :-) | 07:57 |
*** fischerm has quit IRC | 08:00 | |
*** fischerm has joined #timvideos | 08:00 | |
CarlFK | try something hard, like 1+1.0 | 08:00 |
tannewt | heh | 08:01 |
tannewt | seems simila | 08:01 |
tannewt | r | 08:01 |
CarlFK | now I am pondering what implements floating point math: the python vm or the cpu or what? | 08:04 |
xobs | CarlFK: usually it's the libc that does that. | 08:05 |
tannewt | the cpu if its available | 08:11 |
*** rohitksingh has joined #timvideos | 08:18 | |
tannewt | is python actually run by migen? I'm wondering if we should use Python docstrings for documentation | 08:18 |
*** rohitksingh has quit IRC | 08:26 | |
*** rohitksingh has joined #timvideos | 08:58 | |
*** rohitksingh has quit IRC | 08:59 | |
*** rohitksingh has joined #timvideos | 09:01 | |
mithro | tannewt: Yes you should use Python doc strings | 09:23 |
tannewt | But we can’t read back the attribute strings | 09:28 |
tannewt | I want a data sheet :-) | 09:29 |
tannewt | I’ll sleep on how to structure it so we can document it. :-) | 09:30 |
xobs | tannewt: I've been trying to figure out how to get migen to generate datasheets, too. | 09:32 |
tannewt | Nice! What have you explored? | 09:33 |
tannewt | I think class level attributes have doc strings associated with them | 09:34 |
xobs | Not much right now. I was planning something more generic, something that could generate reference manuals from SVD files. Then have migen generate SVD files. | 09:34 |
tannewt | That would be cool too! | 09:35 |
tannewt | what would we need to do that besides register level docs? | 09:37 |
xobs | I'd like something that renders the register maps. Those pictures are so very very useful. | 09:39 |
xobs | I think it might be possible to render them as HTML, though. | 09:39 |
tannewt | got an example? | 09:40 |
xobs | I wonder if this works... | 09:42 |
* xobs uploaded an image: image.png (412KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/gUOrdsgXnjbnrXnhBuJjUnFt > | 09:42 | |
tannewt | ya, cool | 09:42 |
tannewt | I think we have all of that info except the description | 09:43 |
xobs | All of that information is present in an svd file, too. So it's possible to e.g. go from svd to C header files, or to rust accessors. What we don't yet have is something to generate the pdf, because by-and-large those PDFs come from the chip vendors and they're all done by hand in Word. | 09:45 |
tannewt | ya, migen just outputs a csv at the moment | 09:47 |
xobs | And a header file that you can use in C code. | 09:48 |
tannewt | ah, I haven't seen that yet | 09:49 |
xobs | I added a patch that lets you #include "csr.h", and use it when debugging C drivers on the host. | 09:50 |
mithro | Have you seen wavedrom? | 09:50 |
mithro | Well, I now have a test bench which replicates the hardware behaviour | 09:51 |
xobs | mithro: cool! | 09:51 |
mithro | And can make it respond with nak or ack | 09:51 |
mithro | And I can see were the data out of the packet should be shoved | 09:52 |
mithro | So, I think I'm going to head home to bed | 09:52 |
mithro | xobs: wavedrom already has a sphinx plugin too... | 09:52 |
xobs | congratulations. sleep well. | 09:52 |
tannewt | bedtime for me too. night! | 09:56 |
xobs | goodnight! | 09:56 |
mithro | https://usercontent.irccloud-cdn.com/file/MWfLCUZO/image.png | 09:57 |
xobs | fancy. This all with a UP5K? | 09:57 |
mithro | xobs: That is all simulation | 09:59 |
xobs | Ooh, also fancy. | 10:00 |
mithro | xobs: But it matched the behaviour I was getting on the tinyfpga bx | 10:00 |
mithro | xobs: https://github.com/mithro/valentyusb/blob/master/valentyusb/test_usbcore.py#L1681-L1692 | 10:03 |
tpb | Title: valentyusb/test_usbcore.py at master · mithro/valentyusb · GitHub (at github.com) | 10:03 |
*** rohitksingh has quit IRC | 10:23 | |
*** rohitksingh has joined #timvideos | 12:27 | |
* xobs uploaded an image: tomu-fpga-evt1-front.jpg (319KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/kGNgwyFPxGtqCtBhsosrJbHW > | 12:35 | |
*** rohitksingh has quit IRC | 12:39 | |
*** rohitksingh has joined #timvideos | 12:41 | |
*** rohitksingh has quit IRC | 12:54 | |
*** rohitksingh has joined #timvideos | 12:56 | |
*** rohitksingh has quit IRC | 13:19 | |
*** rohitksingh has joined #timvideos | 13:34 | |
*** rohitksingh has quit IRC | 13:44 | |
*** rohitksingh has joined #timvideos | 13:59 | |
*** rohitksingh has quit IRC | 14:02 | |
*** lexano has quit IRC | 16:01 | |
*** Kripton has quit IRC | 16:27 | |
*** Kripton has joined #timvideos | 16:28 | |
*** rohitksingh has joined #timvideos | 16:56 | |
*** rohitksingh has quit IRC | 18:07 | |
*** rohitksingh has joined #timvideos | 18:17 | |
*** springermac has quit IRC | 19:46 | |
*** springermac has joined #timvideos | 19:46 | |
*** rohitksingh has quit IRC | 20:04 | |
mithro | xobs: is U10 the RGB led? | 20:16 |
mithro | xobs: still think you'll regret not having more user controlled LEDs :-P | 20:17 |
mithro | tannewt: just about to head into the office to continue the USB stuff | 20:18 |
mithro | tannewt: you know what would be super handy, if someone added USB packet decoding to sigrok... Hint hint | 20:40 |
*** TheAssassin has quit IRC | 20:42 | |
mithro | tannewt: if ya really good, figure out a way to use Wireshark decoders in sigrok :-P | 20:43 |
mithro | The J and K symbols in the USB keep making me think it's joking | 20:57 |
tannewt | mithro: https://github.com/adafruit/beaglecap | 20:59 |
tpb | Title: GitHub - adafruit/beaglecap: Capture from a Beagle 12 into Wireshark (at github.com) | 20:59 |
tannewt | that can take usb packets and wrap them into what wireshark is used to | 21:00 |
mithro | tannewt: apparently sigrok already has some of this feature according to #sigrok | 21:02 |
mithro | tannewt: I try to use free or cheap tools as much as possible :-P | 21:02 |
tannewt | I'm happy to expand that parsing as well | 21:07 |
mithro | 'sigrok-cli -P usb_request --show' suggests that there's -B pcap, 'git grep pcap' in sigrok-dumps points to usb/setup/README | 21:08 |
mithro | https://sigrok.org/gitweb/?p=sigrok-dumps.git;a=blob;f=usb/setup/README;h=ae0e1f71cadc898d471197ff8df1f4790fe54c73;hb=HEAD#l60 | 21:09 |
tpb | Title: sigrok.org Git - sigrok-dumps.git/blob - usb/setup/README (at sigrok.org) | 21:09 |
*** techman83 has quit IRC | 22:06 | |
*** techman83 has joined #timvideos | 22:07 | |
*** ChanServ sets mode: +v techman83 | 22:07 | |
mithro | So, I don't quite understand how big the DATA0 packets should be? | 23:08 |
mithro | For full speed endpoints, the maximum bulk packet size is either 8, 16, 32 or 64 bytes long. | 23:10 |
Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!