Comments (4)
There isn't one yet.
One option might be to adapt dummyusb
to provide a simple Tx/Rx interface.
from fomu-workshop.
I wanted to ping this ancient thread with the same question as initially proposed:
Is there an example of bare metal firmware for the pre-built LiteX/VexRISC core that demonstrates using the UART to communicate with the host?
I don't think there's an out-of-the-box example of that available.
There's a number of sub-questions there - details that I am not quite sure of...
There's already a Micropython port, and that can definitely communicate over USB-serial - so I looked there first.
As far as I can tell ... that requires running the TinyUSB lib to provide a USB-CDC, and then the actual UART driver for micropy is in @mithro 's fork of Micropython, here:
https://github.com/mithro/micropython/blob/7a4245d24b1f185d6a7a1a863349e148a2c74c5a/litex/uart.c
But then I am not sure where uart_rxtx_write
actually gets implemented.
And it's a bit unclear how that code works or what it is doing.
For that solution - is it ultimately going through TinyUSB?
Unclear if any UART that LiteX might add is actually being used, or if it is just a character stream with CDC transport.
I should/will try copying that driver in the micropy port, rolling it into an otherwise empty firmware derived from riscv-blink
example, do some stdio redirection, and get the minimum working example that I am looking for.
Although, per everything above, I wanted to check if this would be expected to work, or if I am misunderstanding a component.
Beyond that, there seems to be some related discussion here:
#421
but they might be chasing a different kind of solution.
Given that people are therein proposing a gateware implementation of USB-CDC, would it potentially be possible to roll a bitstream that required zero C-code level support, and just followed the standard RISC-V low-level code of hitting a couple of UART registers to pend/send characters (e.g. here), and then the gateware would invisibly get it to the host? That would be a pretty wonderful solution. Outside of my skillset to implement, sadly.
from fomu-workshop.
It's ultimately going through TinyUSB, yes.
If you want USB-CDC without TinyUSB, you have two options:
- Implement it yourself using eptri. This hardware block is documented at https://rm.fomu.im/usb.html and is what TinyUSB uses.
- Implement it as a replacement hardware block. There was an implementation someone did as part of a C64 implementation which you could adapt: https://github.com/jamesacraig/6502-on-fomu/blob/master/fomu_usb_cdc.py
from fomu-workshop.
@xobs Ah, ok, great. I will try roll a minimum working example of the blink bare metal example incorporating the CDC config and driver taken from the micropython port. That should only be a matter of software, without having to tweak anything else.
I think that other thread was also proposing a similar solution, of a driverless hardware block. Beyond my abilities for now, but that'll be next steps.
from fomu-workshop.
Related Issues (20)
- Add chisel example to documentation and tests
- litex_boards bump is blocked. Local LiteX scripts probably need update. HOT 5
- vhdl/blink/blink.json missing HOT 7
- https://workshop.fomu.im/en/latest/migen.html out of date?
- USB-to-UART core desirable HOT 13
- More permissive license for .pcf files HOT 2
- investigate macosx ci failures HOT 1
- investigate docs ci failure HOT 1
- investigate tinyusb failure HOT 7
- consider exposing SB_LEDDA_IP to verilog and litex samples HOT 3
- consider adding SB_RGBA_DRV PWM verilog examples HOT 4
- consider mentioning simulation tooling in hdl section
- VHDL examples don't build with fomu-toolchain HOT 7
- The RISC-V Zig Example is failing on macOS HOT 2
- Add an XLS demo to the workshop
- Foboot v2.0.3 check should come after driver/udev
- doc build: python 3.7 is not installable HOT 1
- doc build error: 'Sphinx' object has no attribute 'add_stylesheet' HOT 1
- Readthedocs broken
- Current builds of docs result in blank page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fomu-workshop.