Monday, 2017-10-16

*** tpb has joined #timvideos00:00
*** CarlFK has joined #timvideos00:08
*** ChanServ sets mode: +v CarlFK00:08
*** felix_u16 has quit IRC01:57
jimmo@mithro would it be possible to use a different IP for qemu vs hardware02:10
jimmoit's annoying switching between them02:10
*** whatnick has left #timvideos03:37
shorneIt looks like I need to rebuild my kernel (host pc) I didnt compile in the ftdi usb driver04:15
shorneJust recently I started running development kernels again :)04:15
shorneMight as well dog food what I am working on04:15
mithrojimmo: I was pondering that too04:32
mithrojimmo: Qemu uses the *exact* same firmware that will run on the FPGA soft-cpu and the IP address is hardcoded into the BIOS04:33
mithrojimmo: So changing the IP address would mean the firmware + BIOS needs to be recompiled...04:33
jimmoi don't mind rebuilding the firmware when switching between hardware and qemu04:33
jimmobut reconfiguring my network is annoying04:33
mithrojimmo: Rebuilding the firmware isn't the problem - it's more the fact the firmware is no longer identical....04:34
mithrojimmo: I have 3 potential ideas04:34
mithrojimmo: (a) Binary patch the IP address as part of the mkimage.py process :-P (this is horrible, let's not do this :-P)04:35
mithrojimmo: (b) Set up the QEmu network in "bridged" mode, so that the real and virtual networks are connected (hence to your computer it looks identical)04:35
mithrojimmo: (c) Set up both interfaces with the same IP address and see if it just works?04:35
mithrojimmo: I think I reproduced the Linux not booting here...04:36
mithrojimmo: But it was late last night before I went to bed and I've forgotten where I actually got to...04:36
mithroI have lots of horrible ideas :-P04:40
jimmoi like (a) best04:41
jimmoalso i found the USB ethernet adaptor and that makes things a lot better04:41
mithrojimmo: Yeah - I actually have a USB3.0 ethernet adapter with USB hub, just plug everything from the FPGA into that...04:42
jimmoi don't understand why the firmware has to be identical?04:43
mithrojimmo: It doesn't /have/ to be identical but it is strongly preferable (and how things are currently set up). The idea is that Qemu should be emulation the exact hardware -- IE you should be able to run stuff targeted at real hardware. Any difference in the software always opens up the question "was it the change in the software which is making things not work" type question.04:47
jimmoi think (a) is probably good for now can investigate (b) later04:50
jimmoi'm not sure (c) can work because we bind atftpd to an IP04:51
mithrojimmo: Yes, but you can set the same IP address on two interfaces IIRC05:13
mithrojimmo: Actually Linux has a "feature" where it responds to all it's IP addresses on every interface (that most people sensible turn off)05:14
jimmook will test later05:14
jimmohow did you imagine booting the arty is going to work at LCA?05:15
jimmonot everyone will have a way to ethernet05:15
mithrojimmo: I plan to bring some extra ethernet USB dongle things05:48
*** Ishan_Bansal has quit IRC06:25
*** mithro has quit IRC06:26
*** CARAM___ has quit IRC06:26
*** CARAM___ has joined #timvideos06:28
*** mithro has joined #timvideos06:28
*** ChanServ sets mode: +o mithro06:28
mithrojimmo: Did I share https://github.com/timvideos/HDMI2USB-litex-firmware/blob/master/doc/notes.md#setting-up-the-environment with you?06:34
tpbTitle: HDMI2USB-litex-firmware/notes.md at master · timvideos/HDMI2USB-litex-firmware · GitHub (at github.com)06:34
jimmo@mithro i've seen it yet06:53
jimmo@mithro any updates since last night? i.e. what should i try next to get qemu or hardware booting linux?06:53
jimmos/yet/yes/06:53
mithrojimmo: Give me a moment, currently closing tabs and windows to get into a state were I can shutdown this machine...06:54
mithrojimmo: So you have tftp boot working with the HDMI2USB bare metal firmware?06:56
mithrojimmo: Okay - I have Linux booting here...06:58
mithrojimmo: Shall I send you my linux image to see if that is the problem?06:59
mithrojimmo: https://drive.google.com/file/d/0B5VlNZ_Rvdw6aDUtazVJa1FJX0E/view?usp=sharing07:00
tpbTitle: firmware.fbi - Google Drive (at drive.google.com)07:00
jimmo@mithro does the gateware-load include the bios?07:07
jimmothe bios is in blockram right?07:07
jimmo$ git submodule update07:09
jimmoerror: Server does not allow request for unadvertised object bf8d8819824bcdf83c75fd7e855b82940bcc92c507:09
jimmoFetched in submodule path 'third_party/litex', but it did not contain bf8d8819824bcdf83c75fd7e855b82940bcc92c5. Direct fetching of that commit failed.07:09
mithroYes for the arty07:14
mithrojimmo: pull first?07:14
jimmopull what? (i thought i did)07:14
mithrojimmo: Try again?07:16
jimmotry what again?07:16
mithrojimmo: fetching...07:17
jimmofetching which repo?07:17
mithrojimmo: The top level07:17
jimmoi was confused because you didn't add any commits to HDMI2USB07:21
jimmoyou pushed litex07:22
jimmoso what i actually wanted was `git submodule update`07:22
mithrojimmo: Well - it commit was already available on the enjoy-digital repo, I just pushed the same thing to mine as well07:22
jimmopython -m litex.soc.tools.mkmscimg -f firmware.bin -o firmware.fbi07:24
jimmoFileNotFoundError: [Errno 2] No such file or directory: '/opt/Xilinx/Vivado/Vivado'07:24
jimmo(running make gateware)07:24
mithroHrm - that is my patch to litex07:25
mithroPushing a fix (I think...)07:27
mithrojimmo: Pushed - give that a go?07:30
mithroI'm running over to dinner, be back shortly but will be packing up my work machine....07:31
jimmoseems to be working07:32
mithrojimmo: Cool, I'm just eating my dinner now07:42
mithrojimmo: Any luck with my Linux file?07:44
mithroCI works for Vivado kinda! -> https://travis-ci.org/mithro/HDMI2USB-litex-firmware/jobs/28843043107:45
jimmo@mithro i'm figuring out what to do with an fbi file07:48
jimmois that for qemu or for tftp ?07:48
mithroput it in build/arty_net_or1k/software/linux/07:49
jimmohaha yes i got that far07:50
jimmobut what uses it?07:50
mithroOh07:51
jimmotfpt generation seems to use firmware.bin07:51
jimmoand the fbi file is also generated from firmware.bin07:51
jimmoso i think what i actually need is your firmware.bin file07:51
mithroUploading now07:52
jimmobut i think i have a bigger issue with qemu -- it seems to start downloading boot.bin then times out07:53
jimmowhereas on real hardware i have no issues witht he actual downloading07:53
mithrohttps://drive.google.com/file/d/0B5VlNZ_Rvdw6M1MtQVc5ODdMb0E/view?usp=sharing07:54
tpbTitle: firmware.bin - Google Drive (at drive.google.com)07:54
jimmohttps://www.irccloud.com/pastebin/ihN6yorT/07:54
tpbTitle: Snippet | IRCCloud (at www.irccloud.com)07:54
mithroHow did you setup the network device?07:59
jimmoon hardware, with your firmware.bin07:59
jimmohttps://www.irccloud.com/pastebin/sCEdlMC6/07:59
tpbTitle: Snippet | IRCCloud (at www.irccloud.com)07:59
mithrojimmo: Hrm.....08:00
jimmohttps://www.irccloud.com/pastebin/6DiBReTl/08:00
tpbTitle: Snippet | IRCCloud (at www.irccloud.com)08:00
jimmocan you send me your gateware image?08:02
mithrojimmo: Can you give me a couple more of the lines above the "Booting from network" ?08:03
jimmofor hardware or for qemu?08:03
mithrojimmo: Both08:03
jimmook for qemu:08:04
jimmohttps://www.irccloud.com/pastebin/gy9KKrsF/08:04
tpbTitle: Snippet | IRCCloud (at www.irccloud.com)08:04
jimmoand for hardware:08:04
jimmohttps://www.irccloud.com/pastebin/9oLcFmsU/08:04
tpbTitle: Snippet | IRCCloud (at www.irccloud.com)08:04
mithrojimmo: Okay, I'm seeing the netboot timeout failure under qemu here too...08:05
mithrohttps://www.irccloud.com/pastebin/APABOZaq/08:06
tpbTitle: Snippet | IRCCloud (at www.irccloud.com)08:06
mithrojimmo: That is what you see right?08:06
jimmoyep08:07
jimmowireshark shows that it fails at about the moment where the host sends qemu an ARP08:07
jimmoand then the device never acks the final tftp packet08:08
jimmoit successfully replies to the ARP though08:09
mithroProbably a bug in either the code or qemu emulation?08:12
jimmobut didn't this used to work?08:12
mithrojimmo: Not sure - it's hard to remember exactly what use to work08:13
mithrojimmo: We started by using gdb to load the kernel and then booting from the virtual spi08:14
jimmoi thought the SPI wasn't supported on the arty?08:15
jimmowhere does the bios code live?08:15
mithrojimmo: Yeah - This was the opsis... The arty only started working like 3-4 days ago08:15
mithrojimmo: https://github.com/enjoy-digital/litex/tree/master/litex/soc/software/bios08:16
tpbTitle: litex/litex/soc/software/bios at master · enjoy-digital/litex · GitHub (at github.com)08:16
mithrojimmo: https://github.com/enjoy-digital/litex/tree/master/litex/soc/software/libnet08:16
tpbTitle: litex/litex/soc/software/libnet at master · enjoy-digital/litex · GitHub (at github.com)08:16
mithroUploading gateware now...08:17
mithrojimmo: https://drive.google.com/file/d/0B5VlNZ_Rvdw6N0kyM2NjM2xIZTA/view?usp=sharing08:19
tpbTitle: build-arty_net_or1k.tar.gz - Google Drive (at drive.google.com)08:19
mithroGive that a go?08:20
mithroOkay, I'm shutting down this computer - will be around on my other computer but won't be able to build / test things at the moment08:24
*** Ishan_Bansal has joined #timvideos08:26
jimmo@mithro same thing08:32
jimmoit tftps but stops at Executing booted program at 0x4000000008:33
jimmooh!08:35
jimmoactually i typoed08:35
jimmoit boots!08:35
jimmoalso works with my linux firmware image08:39
jimmoso there's something different in either: your gateware or your bios08:39
mithrojimmo: Hrm....08:40
mithroI can't check now as the computer is off...08:40
mithrojimmo: What is your third_party/litex revision at?08:46
mithrojimmo: Oh, I bet it's not or1k-linux any more?08:47
jimmono08:47
jimmoremember we were talking about submodules before08:47
jimmomy litex is commit e07bd71b16932a504b7435a96901a3b0eb5a99cd (HEAD, origin/better-error)08:48
mithrojimmo: Yeah, try going into that directory and changing it to or1k-linux and then "make clean; make gateware"08:50
mithrosorry, I forgot about that....08:50
mithrojimmo: Any luck with that?09:23
jimmo@mithro, that worked09:32
jimmoso now i'm confused09:32
jimmowhat was different compared to last night?09:32
jimmoit still doesn't boot to userspace, but at least linux boots09:33
mithroI'm guessing you somehow accidentally got off the or1k-linux litex branch09:33
jimmoi was definitely on that branch last night09:34
mithrojimmo: Hrm.... dunno then...09:34
mithrojimmo: Anyway, I should finish up the change which means that can be fully merged....09:35
jimmostill fails on qemu though09:35
mithroCan you see if the Opsis version works?09:37
jimmoqemu netboot?09:39
jimmoso that would be TARGET=net PLATFORM=opsis09:43
jimmohow do i make qemu netboot?09:43
jimmo(on the opsis it boots from flash by default)09:44
jimmoi commented out the args to qemu that configured the spiflash09:46
jimmosame problem - the firmware never acks the last tftp data packet09:47
jimmo@mithro it's very strange10:04
jimmoi added some debugging to the bios10:04
jimmowireshart shows the final packet in full10:04
jimmobut the bios only sees the first 10 bytes of it10:04
jimmoand same for the next 5 retries10:04
*** shorne has quit IRC10:58
jimmo@mithro update!11:17
jimmoby padding the boot.bin a bit, it boots!11:17
jimmo(in qemu that is)11:21
mithrojimmo: that is weird...11:22
mithroWonder if qemu or bios bug?11:22
jimmoor HDL bug11:24
jimmoargh nevermind11:24
jimmoduh11:24
jimmoyeah i guess i can start tracing qemu11:24
mithroI've finally finished packing everything at work, now need to pack stuff at home...11:28
mithrojimmo: So, we have a bunch of things that were highlighted from you and shorne getting set up11:32
mithrojimmo: Need to fix up the conda stuff11:32
mithrojimmo: need to add udev rules for the arty...11:32
mithrojimmo: So, since we know the Arty works and the MimasV2 has yet to work, I think we just choose the arty?11:36
jimmoi think the speed of programming the arty is a major plus11:37
jimmothere's a VGA pmod right?11:38
mithrojimmo: Yes11:39
mithrojimmo: And HDMI pmods11:39
jimmowhy were you ever considering NOT the arty?11:39
jimmohow much more expensive is it?11:39
jimmo49 vs 9911:40
jimmohrmm11:40
jimmoi think vivado is a major plus   (given that ISE segfaults for me now)11:41
jimmo(actually it's the X libraries that it can't find...but anyway)11:42
mithrojimmo: The big thing is the lack of SD Card -- but if someone gets the network driver working, I guess we could use nfsroot :-P12:01
mithrojimmo: Plus I was hoping to get a MimasV2 which had a bigger FPGA on it12:01
jimmothere's an Arty S7100 (out of stock)     !!12:02
jimmoA7-100 i mean12:02
mithrojimmo: Lol, they still haven't fixed that12:02
mithrojimmo: Its suppose to not be announced yet...12:02
jimmohaha12:17
jimmono luck figuring out this tftp problem12:17
jimmoqemu's pcap doesn't show the issue either12:17
jimmo@mithro who knows the most about litex + qemu ? joel or florent?12:24
mithroI probably know the most sadly12:24
mithroGuy called key2 did the ethernet driver12:25
*** tsglove has joined #timvideos12:27
mithroshorne knows a lot about or1k qemu12:27
*** shorne has joined #timvideos12:48
jimmo@mithro @shorne i'm seeing a qemu bug where the bios sees a length 512 less than the correct amount12:57
jimmohttps://www.irccloud.com/pastebin/xsrucWFT/12:58
tpbTitle: Snippet | IRCCloud (at www.irccloud.com)12:58
jimmoso for most packets this doesn't matter because microudp only cares that it's longer than the ip+udp header, then uses the length inside that12:59
jimmobut it just so happens that the last chunk of firmware bin for me ends up in an ethernet frame that is 522 bytes, which results in rxlen=522-512=10 which it drops on the floor13:00
mithrojimmo: You probably understand this code better then I do now :-P13:03
mithrointeresting13:05
mithrohttps://github.com/uwcms/vivado-git13:05
tpbTitle: GitHub - uwcms/vivado-git: Support scripts for integrating complex Vivado design projects with git vcs (at github.com)13:05
shorneI am trying to learn the basic of this firmware / litex / migen etc13:12
shorneI just want to see what happens running or1k and the native firmware13:12
shorneI did 'make gateware' and 'make gateware-load'13:13
shorneand it loaded onto the arty board via usb13:13
shornenow what?13:13
shorneDo i need to connect to the board via the ethernet cable?13:13
mithroshorne: "make firmware-connect" to connect to the gateware13:14
shorneoh... actually I got serial output "Unable to download boot.bin over TFTP"13:14
mithroshorne: generally I do a "make tftp && make gateware-load && make firmware-connect"13:14
mithroshorne: Yeah, you want to connect the ethernet and configure the device as 192.168.100.100 - then "make tftpd_start"13:15
shorneok, let me try13:15
*** shorne has quit IRC13:20
*** shorne has joined #timvideos13:22
jimmo@mithro aaaaaaaaaaaaarrrrrrrrrrggggggggggggggggggggggggggggggggghhhhhhhhhhhhhhhhhhhhhh13:25
jimmolook very closely at that snippet from liteeth.c13:25
jimmo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!13:27
shornejimmo: should it be >>13:33
jimmoyou are correct13:33
shornehaha13:33
jimmoi was put off by the "off by 512" looking for some bit error which I should have realized was actually just "trucate to single byte"13:34
jimmo@mithro PR incoming13:35
*** tvCommitBot has joined #timvideos13:37
tvCommitBot[qemu-litex] jimmo opened pull request #22: Fix >> instead of << to pull bytes out of ethernet frame size. (master...fix-frame-size) https://git.io/vdDBu13:37
*** tvCommitBot has left #timvideos13:37
jimmo@shorne were you able to get the netboot to work?13:38
shornejimmo: I am almost there13:39
shorneno aftpd on fedora so converted Makefil to plane tftpd13:39
jimmoah13:40
jimmodo you have ifconfig? i had to fix the script to use ip addr too13:40
shornealso I dont want to configure my host to .100 so I am updating platform/.../net.py13:40
shorneto my ip address13:40
jimmoah you're using hardware, not qemeu13:40
shorneyeah, hardware now13:41
shorneI think it would be nice to have the IPs configurable13:42
jimmocan you add a second address to your host rather than changing that?13:42
jimmobut yeah - 192.168.100.100 seems to be configured in a couple of places13:42
shorneyeah, I could add a second address in ipconfig13:42
shorne'ifconfig'13:43
shornehmm, after all that netboot doesnt work13:46
shorneI can see the request for boot.bin come in (via tcpdump)13:46
shornelets see...13:46
jimmowhat's the last line?13:50
jimmo"Executing booted program at 0x40000000" ?13:50
jimmoor does it fail to load boot.bin ?13:50
shorneits "Unable to download boot.bin over TFTP"13:51
shornebut it looks like something wrong with my tftp server13:52
jimmobinary vs ascii?13:52
shornethe problem seems to by my server is not responding to the tftp requests at all13:55
jimmoah13:55
jimmocan you build atftpd from source?13:55
jimmoit was quite useful having its logging to stderr while i wa salso running qemu in hte same terminal while i was getting qemu tftp to work13:56
jimmobut bedtime for me13:56
jimmo@mithro what time's your flight tomorrow? see you online in a few days -- good luck!!!!!!!!!!13:57
mithrojimmo: Merged your pull request14:00
*** tvCommitBot has joined #timvideos14:00
tvCommitBot[qemu-litex] mithro closed pull request #22: Fix >> instead of << to pull bytes out of ethernet frame size. (master...fix-frame-size) https://git.io/vdDBu14:00
*** tvCommitBot has left #timvideos14:00
mithroFlight is at 10:50 AEDT14:00
CarlFKshorne: for debugging your tftp server, there is: apt install tftp ...14:02
CarlFKcarl@twist:~$ tftp 192.168.1.414:02
CarlFKtftp> get pxelinux.cfg/default14:02
CarlFKReceived 272 bytes in 0.0 seconds14:02
shornejimmo: yes, thats what I am doing building atftp from source14:07
mithroshorne: Any luck?14:21
shornehard time finding atftp14:21
shorneI found some but they dont compile14:22
shornetrying to extract debians source14:22
shorneso annoying14:22
mithrogah :-/14:22
CarlFK[m]shorne: what os do you need to build for?14:31
shorneok, it builds14:31
shorneI am the odd one out running Fedora14:32
mithroshorne: Jimmo is using arch14:38
shorneahhh, firewall14:40
mithroshorne: Should write down that to check14:41
shorneyeah, I should have known... maybe too late14:42
shornebut now it booted to 'H2U 00:00:18>'14:42
shorneon arty14:43
mithroshorne: Via tftp?14:43
shorneyes, compiled tftp14:44
shorneI mean atftp14:44
mithroYou should be able to telnet to the arty14:44
shorneyes, I did telnet14:44
shorneit works14:44
mithro\o/14:44
mithroso you should be able to do a "export FIRMWARE=linux"14:45
mithrothen put your Linux kernel in build/arty_net_or1k/software/linux/firmware.bin14:45
shornebut now... a question for you, it seems arty doesnt have any video/hdmi/usb is there any useful support for it?14:45
shorneyeah, I can do linux next.  I just wanted to learn the basics of this HDMI2USB firmware/gateware stuff14:46
mithroshorne: For the HDMI2USB project?14:46
shornemithro: yeah, well will arty be able to do video streaming?14:47
mithroThe arty isn't hugely useful for the HDMI2USB because of the lack of video input/output14:47
mithroBut you can get pmods which add video stuff14:47
shorneI see a bunch of headers, not sure if they are able to support video14:47
shorneI see14:47
mithroBut for the miniconf we'll just be concentrating on Linux & Networking probably14:48
mithroYou can do things like control the LEDs in theory - they are RGB14:48
shorneright, so 'net' target14:48
mithroshorne: Yeah - most other boards also have a video target14:49
mithroand boards we use in "production" have a hdmi2usb target14:49
mithrobrb14:49
*** rohitksingh has joined #timvideos14:49
shorneok, I think I need to head for bed14:53
shornethe FTP does work find with tftpd14:54
shornesudo in.tftpd --verbose --listen --user $(shell whoami) -s $(TFTPD_DIR) &14:54
shorneI put this under `tftpd_start`14:54
mithroOkay14:55
mithroshorne: Did you get qemu working with tftp?14:55
shorneI didnt try qemu with tftp14:56
mithroshorne: That would be good to try sometime14:56
mithroshorne: Would also be good if you could look at were the kernel is locking up14:57
shorneok, ill try either qemu tftp boot or linux kernel boot tomorrow or next day14:58
shornecurrently when in run ./scripts/build-qemu.sh it will boot all of the way to H2U14:58
shorneits not using tftp then?14:58
shorneI am reading that script... it looks like it loads everything into a emulated flash... but if I enabled something it will try tftp15:01
mithroshorne: I assume it's because it fails at tftpboot it goes onto looking at flash....15:01
mithroif you are building the net target it should automatically build net support for qemu15:01
shorneoh, I see15:03
shorneok, ill try that again15:03
shorneI am getting to understand this whole thing a bit better15:04
shornemigen > misoc > litex > hdmi2usb-litex-firmware15:04
shornelots of layers15:04
shorneok, time for bed15:05
mithroshorne: Great!15:05
*** rohitksingh has quit IRC16:15
mithroSo my luggage is like 85% FPGA boards :-P18:23
mithroFor everyones info - I'm heading to the US in about 5 hours, so will be offline for the next 20ish hours.18:27
cr1901_modernHave fuuun!18:31
CarlFKmithro: have a safe flight21:30

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!