wuxx / icesugar

iCESugar FPGA Board (base on iCE40UP5k)
350 stars 96 forks source link

Demo: uart_tx not working #45

Closed piso77 closed 7 months ago

piso77 commented 2 years ago

I tried both the prebuilt binary and to rebuild it myself - no output on the usb-c serial:

@cdone:1 @reset @cdone:0 @prog [0x00000000] @prog [0x00010000] @start @cdone:1

and if i connect the micro usb to my pc, no new serial devices appear (i'm using Linux, so no /dev/ttyUSB* show up) so i can't connect there.

How is one supposed to run this demo?

piso77 commented 2 years ago

Ok, after a bit of tinkering i realized what is wrong:

the microusb is not used at all, instead one is supposed to plug a PmodUSBUART (see Digilent website) into PMOD1, after that, and after opening a serial connection on ttyUSB0 @ 9600, i got the output.

But then i tried uart_echo, and i found this:

src/common/io.pcf: ... set_io RX 4 # IOB_8A set_io TX 6 # IOB_13B ...

but if you look at the schematics in schematic/iCESugar-v1.5.pdf, these two signals are on two different rows - after a bit more looking, they are routed through J5 to UART3_RX and UART3_TX and these go into the STM32 PB11/PB10 - so, where are we supposed to see the serial output? ttyACM0 perhaps?

If i connect cu/minicom to ttyACM0, when i type i see the rgb led chaning color from green to red (and viceversa), but i don't get any char echo back.

A bit more documentation would greatly help...

LHLaurini commented 1 year ago

You need to set the correct baud rate. Connect the board through USB, then use screen /dev/ttyACM0 115200. I guess you can also use picocom -b 115200 /dev/ttyACM0.

wil-low commented 1 year ago

I got my UART working through USB-C with both jumpers on J5 in horizontal direction, and using /dev/ttyACM0 via minicom or Arduino IDE, with matching baud rate.