trabucayre / litexOnColorlightLab004

basic example of litex on colorLight 5A-75B based on fpga_101/lab004
29 stars 12 forks source link

trellis fails #2

Closed FFY00 closed 3 years ago

FFY00 commented 4 years ago

Hi, trellis is failing here. Do you have any idea what is wrong?

ERROR: Cell 'serial_rx$tr_io' cannot be bound to bel 'X72/Y35/PIOC' since it is already bound to cell 'user_btn_n$tr_io'

Log: https://paste.xinu.at/gbppT/

trabucayre commented 4 years ago

Hi, Yes I know the issue. A serial resource is already defined using led and button pins. Modifications on my code are done. Rest to check before pushing this update. Thanks to report this issue (and force me to hurry)

FFY00 commented 4 years ago

Thank you!

trabucayre commented 4 years ago

Done! Happy to have your feedback. Thanks again

FFY00 commented 4 years ago

Thank you :grin:.

I am now running into other issue

$ ./base.py --load --cable ft232
INFO:SoC:        __   _ __      _  __  
INFO:SoC:       / /  (_) /____ | |/_/  
INFO:SoC:      / /__/ / __/ -_)>  <    
INFO:SoC:     /____/_/\__/\__/_/|_|  
INFO:SoC:  Build your hardware, easily!
INFO:SoC:--------------------------------------------------------------------------------
INFO:SoC:Creating SoC... (2020-07-09 18:26:51)
INFO:SoC:--------------------------------------------------------------------------------
INFO:SoC:FPGA device : LFE5U-25F-6BG256C.
INFO:SoC:System clock: 25.00MHz.
INFO:SoCBusHandler:Creating Bus Handler...
INFO:SoCBusHandler:32-bit wishbone Bus, 4.0GiB Address Space.
INFO:SoCBusHandler:Adding reserved Bus Regions...
INFO:SoCBusHandler:Bus Handler created.
INFO:SoCCSRHandler:Creating CSR Handler...
INFO:SoCCSRHandler:8-bit CSR Bus, 32-bit Aligned, 16.0KiB Address Space, 2048B Paging (Up to 32 Locations).
INFO:SoCCSRHandler:Adding reserved CSRs...
INFO:SoCCSRHandler:CSR Handler created.
INFO:SoCIRQHandler:Creating IRQ Handler...
INFO:SoCIRQHandler:IRQ Handler (up to 32 Locations).
INFO:SoCIRQHandler:Adding reserved IRQs...
INFO:SoCIRQHandler:IRQ Handler created.
INFO:SoC:--------------------------------------------------------------------------------
INFO:SoC:Initial SoC:
INFO:SoC:--------------------------------------------------------------------------------
INFO:SoC:32-bit wishbone Bus, 4.0GiB Address Space.
INFO:SoC:8-bit CSR Bus, 32-bit Aligned, 16.0KiB Address Space, 2048B Paging (Up to 32 Locations).
INFO:SoC:IRQ Handler (up to 32 Locations).
INFO:SoC:--------------------------------------------------------------------------------
INFO:SoCCSRHandler:ctrl CSR allocated at Location 0.
INFO:SoCBusHandler:io0 Region added at Origin: 0x80000000, Size: 0x80000000, Mode: RW, Cached: False Linker: False.
INFO:SoCBusHandler:cpu_bus0 added as Bus Master.
INFO:SoCBusHandler:cpu_bus1 added as Bus Master.
INFO:SoCCSRHandler:cpu CSR allocated at Location 1.
INFO:SoCBusHandler:rom Region added at Origin: 0x00000000, Size: 0x00008000, Mode: R, Cached: True Linker: False.
INFO:SoCBusHandler:rom added as Bus Slave.
INFO:SoC:RAM rom added Origin: 0x00000000, Size: 0x00008000, Mode: R, Cached: True Linker: False.
INFO:SoCBusHandler:sram Region added at Origin: 0x01000000, Size: 0x00002000, Mode: RW, Cached: True Linker: False.
INFO:SoCBusHandler:sram added as Bus Slave.
INFO:SoC:RAM sram added Origin: 0x01000000, Size: 0x00002000, Mode: RW, Cached: True Linker: False.
INFO:SoCBusHandler:main_ram Region added at Origin: 0x40000000, Size: 0x00004000, Mode: RW, Cached: True Linker: False.
INFO:SoCBusHandler:main_ram added as Bus Slave.
INFO:SoC:RAM main_ram added Origin: 0x40000000, Size: 0x00004000, Mode: RW, Cached: True Linker: False.
INFO:SoCCSRHandler:identifier_mem CSR allocated at Location 2.
INFO:SoCCSRHandler:uart_phy CSR allocated at Location 3.
INFO:SoCCSRHandler:uart CSR allocated at Location 4.
INFO:SoCIRQHandler:uart IRQ allocated at Location 0.
INFO:SoCCSRHandler:timer0 CSR allocated at Location 5.
INFO:SoCIRQHandler:timer0 IRQ allocated at Location 1.
INFO:SoCBusHandler:csr Region added at Origin: 0x82000000, Size: 0x00010000, Mode: RW, Cached: False Linker: False.
INFO:SoCBusHandler:csr added as Bus Slave.
INFO:SoCCSRHandler:bridge added as CSR Master.
INFO:SoCCSRHandler:leds CSR allocated at Location 6.
INFO:SoC:--------------------------------------------------------------------------------
INFO:SoC:Finalized SoC:
INFO:SoC:--------------------------------------------------------------------------------
INFO:SoC:32-bit wishbone Bus, 4.0GiB Address Space.
IO Regions: (1)
io0                 : Origin: 0x80000000, Size: 0x80000000, Mode: RW, Cached: False Linker: False
Bus Regions: (4)
rom                 : Origin: 0x00000000, Size: 0x00008000, Mode: R, Cached: True Linker: False
sram                : Origin: 0x01000000, Size: 0x00002000, Mode: RW, Cached: True Linker: False
main_ram            : Origin: 0x40000000, Size: 0x00004000, Mode: RW, Cached: True Linker: False
csr                 : Origin: 0x82000000, Size: 0x00010000, Mode: RW, Cached: False Linker: False
Bus Masters: (2)
- cpu_bus0
- cpu_bus1
Bus Slaves: (4)
- rom
- sram
- main_ram
- csr
INFO:SoC:8-bit CSR Bus, 32-bit Aligned, 16.0KiB Address Space, 2048B Paging (Up to 32 Locations).
CSR Locations: (7)
- ctrl           : 0
- cpu            : 1
- identifier_mem : 2
- uart_phy       : 3
- uart           : 4
- timer0         : 5
- leds           : 6
INFO:SoC:IRQ Handler (up to 32 Locations).
IRQ Locations: (2)
- uart   : 0
- timer0 : 1
INFO:SoC:--------------------------------------------------------------------------------
INFO:SoCBusHandler:Interconnect: InterconnectShared (2 <-> 4).
make: Entering directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/libcompiler_rt'
make: Nothing to be done for 'all'.
make: Leaving directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/libcompiler_rt'
make: Entering directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/libbase'
 CC       exception.o
 CC       system.o
 CC       id.o
 CC       uart.o
 CC       time.o
 CC       spiflash.o
 CC       i2c.o
 CC       memtest.o
 AR       libbase.a
 AR       libbase-nofloat.a
make: Leaving directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/libbase'
make: Entering directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/liblitedram'
 CC       sdram.o
 AR       liblitedram.a
make: Leaving directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/liblitedram'
make: Entering directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/libliteeth'
 CC       udp.o
 CC       mdio.o
 AR       libliteeth.a
make: Leaving directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/libliteeth'
make: Entering directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/liblitespi'
 CC       spiflash.o
 AR       liblitespi.a
make: Leaving directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/liblitespi'
make: Entering directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/liblitesdcard'
 CC       sdcard.o
 CC       spisdcard.o
 AR       liblitesdcard.a
make: Leaving directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/liblitesdcard'
make: Entering directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/bios'
 CC       isr.o
 CC       boot.o
 CC       cmd_bios.o
 CC       cmd_mem.o
 CC       cmd_boot.o
 CC       cmd_i2c.o
 CC       cmd_spiflash.o
 CC       cmd_litedram.o
 CC       cmd_liteeth.o
 CC       cmd_litesdcard.o
 CC       main.o
 LD       bios.elf
chmod -x bios.elf
 OBJCOPY  bios.bin
chmod -x bios.bin
python3 -m litex.soc.software.mkmscimg bios.bin --little
python3 -m litex.soc.software.memusage bios.elf /home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/bios/../include/generated/regions.ld riscv64-elf

ROM usage: 20.64KiB     (64.49%)
RAM usage: 1.64KiB  (20.51%)

make: Leaving directory '/home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/software/bios'
Error: fail to open /home/anubis/git/litexOnColorlightLab004/build/colorlight_5a_75b/gateware/colorlight_5a_75b.bit
ft232

Am I doing something wrong?

And for the firmware

$ make
 CC       main.o
 CC       firmware.elf
riscv64-elf-gcc: error: ../build//software/libbase/crt0-ctr.o: No such file or directory
make: *** [Makefile:18: firmware.elf] Error 1

I fixed it by renaming crt0-ctr.o to crt0.o.

trabucayre commented 4 years ago

For the first issue (missing .bit file) have you using ./base.py --build first?

The second I need to investigate. Theorically everything is up to date on my computer...

FFY00 commented 4 years ago

Ah, :man_facepalming:. I just did ./base.py, I thought --build was implicit.

Which component is the error coming from? I can check my versions.

trabucayre commented 4 years ago

Ok. My fault. Some residual litex version in .local. I've pushed a fix.

FFY00 commented 4 years ago

I can confirm it now works, thanks!

Although I have not quite managed to make it work yet :confused:. Perhaps you could give me an hint. lxterm gets stuck.

$ lxterm /dev/ttyUSB0 --kernel firmware.bin
[LXTERM] Starting....

I have my serial adapter connected to the two most right pins of the J1 header.

http://imgur.com/a/WeDwK61

FFY00 commented 4 years ago

After flashing, pin 1 is high, which seems correct.

trabucayre commented 4 years ago

Three (maybe) stupid questions: 1/ By default this board has some 74HC245T buffers in output direction, have you changed this. In the picture it seems not. 2/ Ftdi RX -> ECP5 TX and Ftdi TX -> ECP5 RX 3/ your jtag adapter consume a ttyUSBx, are you sure to use ttyUSBx corresponding to your serial adapter?

FFY00 commented 4 years ago

Yes, stupid indeed. I totally forgot the buffer is output only. Sorry!

trabucayre commented 4 years ago

My fault (or that of the board), I wish to use button and led so the only two pins without buffer are reserved for another usage.

Tell me if the demo is working for you.

FFY00 commented 4 years ago

No no, I was aware of this, I just forgot. It's my fault.

What I ended up doing was replacing U17, as it's more isolated and I am not that used to SMD soldering, and changing the pins to J4.13, J4.15. It did not work for some reason. J4.13 is set high, but lxterm does not work.

diff --git a/base.py b/base.py
index 20aa5e3..633cd3e 100755
--- a/base.py
+++ b/base.py
@@ -21,8 +21,8 @@ from ios import Led

 _serial = [
     ("serialJ1", 0,
-        Subsignal("tx", Pins("j1:0")), # J1.1
-        Subsignal("rx", Pins("j1:1")), # J1.2
+        Subsignal("tx", Pins("j4:12")), # J4.13
+        Subsignal("rx", Pins("j4:14")), # J4.15
         IOStandard("LVCMOS33")
     ),
 ]

colorlight-u17-replacement

trabucayre commented 4 years ago

Seems good. Have you crossed RX and TX ? Are you sure for your /dev/ttyUSB ? maybe you use /dev/ttyUSBx corresponding to JTAG cable ? According to chubby75 these pins are used for all connectors, maybe a problem at this level. Last idea: lxterm display nothing when it is loaded, try to push enter key or writing serialboot followed by ? Really strange and difficult to reproduce :(

trabucayre commented 4 years ago

Hi, I've tried again with a docker (to have a clean system), changed configuration to use same pins as you. The demo is working... I have no idea why it's not working for you...

FFY00 commented 4 years ago

Okay, I will give a try again next week. I am not home so I don't have access to the board right now.

FFY00 commented 3 years ago

Hey, I have finally come back to this and I did manage to get it working, thank you! I am not sure what was going on previously.

trabucayre commented 3 years ago

Great! Thank!