_florent_ changed the topic of #litex to: LiteX FPGA SoC builder and Cores / Github : https://github.com/enjoy-digital, https://github.com/litex-hub / Logs: https://libera.irclog.whitequark.org/litex
tpb has quit [Remote host closed the connection]
tpb has joined #litex
cr1901_ is now known as cr1901
xobs[m] has joined #litex
<xobs[m]> Hi cr1901 , I hear you had questions about Valentyusb.
cr1901 has quit [Ping timeout: 240 seconds]
cr1901_ has joined #litex
cr1901_ has quit [Ping timeout: 240 seconds]
cr1901 has joined #litex
bl0x has quit [Ping timeout: 252 seconds]
bl0x has joined #litex
Degi_ has joined #litex
Degi has quit [Ping timeout: 256 seconds]
Degi_ is now known as Degi
cr1901_ has joined #litex
cr1901 has quit [Read error: Connection reset by peer]
cr1901_ is now known as cr1901
<cr1901> Hi xobs[m], I'm here now for a little bit, lemme see if I can find the relevant IRC msg to link
<cr1901> xobs[m]: So while I'm looking, I'll give some context
<cr1901> Recently I designed a litex SoC for orangecrab optimized to take advantage of it's feather functionality
<cr1901> I'm using the Betrusted I2C core and valentyusb: https://github.com/cr1901/orangecrab-feather/tree/main/deps
<xobs[m]> Alright, it's been a while but I can try to answer any questions.
<cr1901> xobs[m]: I don't think it's a difficult question, just I'm not sure where I should "tack on" the functionality I need
<cr1901> The problem w/ my SoC as-is is that the UART TX will block until a host opens the USB port
<cr1901> There is a solution for non-USB UARTs in LiteX: https://libera.irclog.whitequark.org/litex/2022-03-06#1646587326-1646588438;
<tpb> Title: #litex on 2022-03-06 — irc logs at whitequark.org (at libera.irclog.whitequark.org)
<cr1901> Aaand I'm looking for the follow-up msg and can't seem to find it
<xobs[m]> Are you referring to a `UARTCrossover` implementation? Or is there a new version where it shows up as an actual serial device now?
<cr1901> In today's LiteX, valentyusb is an actual UART that the SoC can talk to
<cr1901> https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart.py#L281-L298 This is the code to add an automatic TX flusher. It doesn't work for ValentyUSB because ValentyUSB doesn't actually have a stream endpoint w/ the correct name.
<cr1901> I was looking for an error message in the IRC logs, but I can't seem to find it. Give me a minute to duplicate
<cr1901> My question is: "How difficult would it be to modify valentyusb to support auto tx flush?"
<cr1901> xobs[m]: Whoops, sorry for not mentioning you :P ^
<xobs[m]> I'm not sure right now, I'll need to think. I think what you want is for it to drop data if it hasn't been read in a while, correct?
<cr1901> yes, because if it doesn't the SoC program will busy wait sending the BIOS banner and status messages until I connect a terminal
<cr1901> While I have to connect a USB cable, waiting for me to open a terminal for the main SoC program to run is not necessarily what I want (SD card boot, for instance)
<cr1901> xobs[m]: Take your time, btw. This isn't/wasn't urgent, and I wasn't actually expecting this quick a turnaround time :D
<cr1901> Just something to send off async and awai- *pulled off the stage by a hook*
<cr1901> Yea, this is the error I recall seeing... add_auto_tx_flush would need to be added on the valentyusb side, and I'm not sure how to go about doing it
<xobs[m]> I actually have to go soon as well. But wouldn't it be possible to wrap the `tx_fifo` inside a `ResetInserter()` and add a timer to reset it if `tx_fifo.valid` is 1 for a very long time: https://github.com/litex-hub/valentyusb/blob/912d8e6dc72d45e092e608ffcaabfeaaa6d4580f/valentyusb/usbcore/cpu/cdc_eptri.py#L148-L161
<xobs[m]> Yeah, that's how I'd do it. Place the `tx_fifo` inside a `ResetInserter()` similarly to how the address field is in one, then reset the whole tx fifo when it is Valid for too long. https://github.com/litex-hub/valentyusb/blob/master/valentyusb/usbcore/cpu/eptri.py#L225-L234
cr1901__ has joined #litex
<cr1901__> xobs[m]: Wifi is going to hell rn.
<cr1901__> Anyways, I didn't think of that. That's a reasonable idea and I'll look into trying it
<cr1901__> I'll send a PR if it works- no need to be compat w/ litex's add_auto_tx_flush
cr1901 has quit [Ping timeout: 240 seconds]
cr1901 has joined #litex
<xobs[m]> I think it's possible to still be compatible, and I'm curious to see how well it works.
cr1901__ has quit [Ping timeout: 240 seconds]
<cr1901> the litex version drains the TX fifo one entry at a time, every interval, after timeout has occurred (without any activity from the PHY)
<cr1901> your solution sounds like "when timeout has passed, drain the fifo all at once"
<cr1901> That being said, I see that tx_fifo in CdcUsb is similar to the litex UARTs, so when I get the chance I'll play w/ it
<cr1901> Thanks for the hint
<cr1901> xobs[m]: It's midnight here, and while my sleep schedule hasn't been great the past few days, I've also lacked the b/w for most FPGA type stuff :P
<cr1901> Otherwise I would do it tonight
AndrewD has joined #litex
<AndrewD> @mithro: thanks for the spreadsheet link
<AndrewD> I'm intrigued by renode, I've thought about using it but was concerned that it may be another rabbit hole that takes quite a bit of time to get up to speed with. The high level introductory information available makes it look almost too easy to get started with demos, but it only gets useful when you dive into the less trivial stuff.
cr1901_ has joined #litex
cr1901 has quit [Killed (NickServ (GHOST command used by cr1901_))]
cr1901_ is now known as cr1901
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #litex
AndrewD has quit [Ping timeout: 256 seconds]
sebo has joined #litex
sebo_ has joined #litex
C-Man has quit [Ping timeout: 240 seconds]
sebo_ has quit [Remote host closed the connection]
sebo_ has joined #litex
sebo has quit [Ping timeout: 240 seconds]
sebo_ has quit [Ping timeout: 240 seconds]
sebo has joined #litex
sebo_ has joined #litex
sebo has quit [Remote host closed the connection]
sebo has joined #litex
sebo has quit [Ping timeout: 240 seconds]
sebo_ has quit [Ping timeout: 256 seconds]
sebo has joined #litex
sebo_ has joined #litex
sebo has quit []
sebo_ has quit [Ping timeout: 256 seconds]
lexano_ has joined #litex
lexano has quit [Ping timeout: 240 seconds]
rektide has quit [Ping timeout: 250 seconds]
rektide has joined #litex
nats` has quit [Ping timeout: 250 seconds]
nats` has joined #litex
C-Man has joined #litex
Coldberg has joined #litex
C-Man has quit [Ping timeout: 260 seconds]
ilia__s has quit [Ping timeout: 245 seconds]
ilia__s has joined #litex
sebo has joined #litex
sebo has quit [Ping timeout: 240 seconds]
ilia__s has quit [Read error: Connection reset by peer]
ilia__s6 has joined #litex