Monday, 2020-11-09

*** tpb has joined #litex00:00
*** SpaceCoaster has quit IRC00:11
*** SpaceCoaster has joined #litex00:17
*** lf has quit IRC00:57
*** lf has joined #litex00:57
*** Degi has quit IRC02:27
*** Degi has joined #litex02:28
*** midnight has quit IRC03:38
*** midnight has joined #litex03:44
*** TMM has quit IRC04:08
*** TMM has joined #litex04:09
*** benh_ has joined #litex04:54
*** benh_ has quit IRC05:00
*** benh_ has joined #litex05:02
*** benh_ has quit IRC05:20
*** benh_ has joined #litex05:23
*** benh_ has quit IRC05:52
*** kgugala has quit IRC07:29
*** kgugala has joined #litex07:29
*** lambda has quit IRC10:19
*** lambda has joined #litex10:21
*** _whitelogger has quit IRC13:18
*** _whitelogger has joined #litex13:20
somlodaveshah: with external 12V power, plugging both ethernet and microSD cards into the trellisboard no longer causes it to glitch13:30
daveshahGreat, that does seem like it was a power problem then13:30
somloyeah, and there's a deterministic solution (use ext. 12V - and a fuse!) that doesn't involve playing usb cable lottery :D13:31
_florent_somlo: nice, just for info i'm looking at the LiteSDCard insert-init-eject issue13:35
somlo_florent_: thanks! I'll hold off on creating a github issue then, unless it turns out to be a longer term project (hopefully it's just a quick FSM tweak though :)13:41
_florent_somlo: the  insert-init-eject issue is probably more related to software13:47
somlo_florent_: the softer the better :D13:49
_florent_somlo: i'm able to reproduce (even without ejecting the card)13:59
_florent_somlo: it seems the "Switch driver strength" command is only accepted once: https://github.com/enjoy-digital/litex/blob/master/litex/soc/software/liblitesdcard/sdcard.c#L455-L45714:02
_florent_it's passing on the first sdcard_init, but failing on the next ones14:03
_florent_it's maybe not returning SD_OK because it's already configured correctly, i'm going to look at the spec14:07
*** CarlFK has quit IRC14:28
somlo_florent_: I just emailed you the sequence of commands being sent to the card by linux14:32
somlomost of that is generic (i.e. not specifically done by the litex_mmc.c driver)14:32
somloso the question is whether sending "switch strength" repeatedly should be accepted/ignored rather than allow the card to get "legitimately upset" about it?14:34
_florent_somlo: i just removed the driver strength configuration since that's only supported in 1.8V signaling in fact (which was previously supported)14:47
_florent_https://github.com/enjoy-digital/litex/commit/1d04b1dd83cf864d7f48cb4fe34e09a37412414c14:47
_florent_somlo: with this, consecutive sdcard_inits are working fine (with the BIOS)14:49
_florent_somlo: but there is probably still an issue (this time i think in the gateware) since i also reproduce the miss-alignment of data on the first reads14:53
keesjwhat is the bench in litesdcard https://github.com/enjoy-digital/litesdcard/tree/master/bench ?15:06
keesjI was serching for a python script to send sd commands (there used to be one)15:06
keesjit looks like .. pretty cool setup with sirgok/pulseview15:07
_florent_keesj: i'm indeed creating hardware benchs to ease development of the different cores15:13
_florent_https://usercontent.irccloud-cdn.com/file/NkmVAdYo/architecture.png15:13
_florent_that's the idea with LiteSDCard bench, but the Pulseview/sigrok capture part is not yet fully validated15:15
_florent_for now i've been mostly testing with an external analyzer on the Pmod connector, but the idea is to try to get rid of it and re-sample Pmod signals directly with the FPGA and stream it to the Host15:17
keesjbut.. is litesdcard the dut or the SDCARD? (I need to dump an eMMC and would fancy doing this with the fpga)16:57
somlo_florent_: the data returned by `sdcard_read 0` after `sdcard_init` is different from the very first time, once you start ejecting, reinserting, and re-running the `sdcard_init` + `sdcard_read 0` sequence. No more outright failure upon `sdcard_init`, that's true17:02
somlobut there's still something in the gateware that returns different results starting with the second time after eject+reinsert17:03
*** kgugala_ has joined #litex17:03
somlo(maybe that's what you meant by "mis-alignment of data on first read")?17:03
*** kgugala has quit IRC17:04
somloeither way, with the linux driver it still only works the first time the card is inserted (so whatever happens after *re*insertion is problematic still)17:05
*** kgugala has joined #litex17:13
*** kgugala_ has quit IRC17:16
*** kgugala_ has joined #litex17:20
*** kgugala has quit IRC17:22
_florent_keesj: LiteSDCard is the DUT yes, there is a logic analyzer probing it internally and the PMOD is also probed (to verify the PHY/Protocol)17:23
*** kgugala has joined #litex17:23
_florent_somlo: yes that's what i meant with mis-alignment, i'm looking at this17:24
*** kgugala_ has quit IRC17:25
somlo_florent_: got it, thanks (apologies for coming off dumber than usual, experiencing unusually high levels of multitasking over here :)17:26
*** kgugala_ has joined #litex17:31
*** kgugala has quit IRC17:33
*** kgugala has joined #litex17:44
*** kgugala_ has quit IRC17:46
*** CarlFK has joined #litex18:41
_florent_somlo: the misalignment seems to be causes by some garbage data we get from the SDCard at the end of the initialization. I added some logic to ensure we flush this garbage data before doing the DMA:18:59
_florent_https://github.com/enjoy-digital/litesdcard/commit/9e267a5a17e955326ec84059f8d94aa738b5c42218:59
_florent_this seems to be working on my setup and with the BIOS (insert, sdcard_init, sdcard_read 0, eject, etc... sequence)19:00
_florent_can you do a test?19:00
somlo_florent_: thanks, working on it!19:42
somlo_florent_: superficially, with the existing linux driver on nexys4ddr, it's still failing to re-initialize the sdcard upon reinsertion  -- still only works the first time the card is inserted20:35
somlobut I can confirm that from the bios perspective, initializing the card and reading any given block is repeatable and predictable, regardless of how many times we eject and reinsert/reinitialize the card20:40
somlosince my minimal gateware reproducer is now gone, I'll dig into the driver over the weekend and either figure out what it's doing wrong, or come up with another reproducer :)20:42
*** CarlFK has quit IRC22:27
*** CarlFK has joined #litex22:49
*** _whitelogger has quit IRC23:13
*** _whitelogger has joined #litex23:16

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!