Jump to content
  • 0

How to work around missing switches used in existing bitstream?


aeon20

Question

I have RISC-V running (sort of) on a Nexys A7, I was able to get it booting by doing as kwilber suggested in the following thread 

make getrelease, and then make program-cfgmem, as explained in the guide https://www.lowrisc.org/docs/getting-started/?_ga=2.61717228.1512607184.1562590486-778246975.1562590486 that you linked to in the thread.

This makes the process pretty simplified, as it uses a precompiled Linux kernel and initial ramdisk as well as a precompiled FPGA bitstream which implements the RISC-V.

I turn it on, and I do get a display.

However, I'm prompted with the following on the VGA output immediately after some self test output:

"Hello LowRISC! Tue Aug 14 10:40:47 2018: Turn on SW0 for gdb loading, SW1 for SD-card loading, or SW2 for Ethernet loading."

I'm running this installed from the QSPI memory on the Nexys A7.

I've tried all the switches, but they don't seem to do anything, not after it has loaded, nor after a reset/power cycle of the device.

Since the tutorial appears to have been made for the Nexys A4, I'm wondering if this is the reason switches that aren't present on the A7 are referred to in this manner.

How can I get past this?

I understand that ideally I should modify the source of the bitstream and recompile it, taking into account the physical differences on the board layout between the Nexys 4 and A7.

However, this negates the whole point in using this quick start tutorial for me. I was wondering, is there a simple way to work around this, that I'm not aware of?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Hi @aeon20,

We unfortunately do not work with the RISC-V/lowRISC  material. The lowRISC material you linked is for the Nexys 4 DDR which is nearly identical to the Nexys A7.  I would contact the creators of the LowRISC material about this issue. 

best regards,

Jon

Link to comment
Share on other sites

Hello @aeon20

I replied to your PM but will also reply here so others can benefit.

I followed the getting started guide and used the "standalone installation" option. On my Nexys A7 100T, I made sure sw1 was on and the others were off. JP1 was set to QSPI and JP2 was set to USB. I attached a usb keyboard and vga monitor.

I initially left the sd card out so I could observe the behavior. The read from the sd failed as expected. The quickstart mentions that a reported bus width other than 4  bytes is an error.

0: 0
1: 1
2: 1
3: 1
800: 1e
801: 0
802: 0
803: 0
Selftest iteration 1, next buffer = 0, rx_start = 4000
Selftest matches=2/2, delay = 9
Selftest iteration 2, next buffer = 1, rx_start = 4800
Selftest matches=4/4, delay = 9
Selftest iteration 3, next buffer = 2, rx_start = 5000
Selftest matches=8/8, delay = 9
Selftest iteration 4, next buffer = 3, rx_start = 5800
Selftest matches=16/16, delay = 16
Selftest iteration 5, next buffer = 4, rx_start = 6000
Selftest matches=32/32, delay = 31
Selftest iteration 6, next buffer = 5, rx_start = 6800
Selftest matches=64/64, delay = 60
Selftest iteration 7, next buffer = 6, rx_start = 7000
Selftest matches=128/128, delay = 119
Selftest iteration 8, next buffer = 7, rx_start = 7800
Selftest matches=187/187, delay = 173
lowRISC boot program
=====================================
Hello LowRISC! Tue Aug 14 10:40:47 2018: Booting from FLASH because SW1 is high ..

u-boot based first stage boot loader
MMC:
mmc created at 86800248, host = 86800200
lowrisc_sd: 0
Device: lowrisc_sd
Manufacturer ID: 0
OEM: 0
Name: Bus Speed: 5000000
High Capacity: No
Capacity:
llu BytesBus Width: 1-bit

 

Next I inserted the sd and reset the board. The boot process went pretty much as described in the guide. It eventually left me at a login. I logged in as root and followed the firstboot procedure.

Debian GNU/Linux buster/sid lowrisc tty1
lowrisc login: root
Linux lowrisc 4.18.0-gc81ff0d #48 Thu Oct 18 16:00:24 BST 2018 riscv64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
[  258.760000] systemd-logind[1160]: New seat seat0.
This is the firstboot script. It will display only once
Set the superuser (root) password below
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Creating normal user lowrisc ...
Adding user `lowrisc' ...
Adding new group `lowrisc' (1000) ...
Adding new user `lowrisc' (1000) with group `lowrisc' ...
Creating home directory `/home/lowrisc' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for lowrisc
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:

 

If no switches are set you would see

lowRISC boot program
=====================================
Hello LowRISC! Tue Aug 14 10:40:47 2018: Turn on SW0 for gdb loading, SW1 for SD-card loading, or SW2 for Ethernet loading

if sw0 is set, the display clears and no other activity occurs, presumably it is waiting for debugging commands to come in via the uart.

If sw2 is set you would see (i do not have the ethernet port connected)

lowRISC boot program
=====================================
Hello LowRISC! Tue Aug 14 10:40:47 2018: Booting from Ethernet because SW2 is high ..
Max file size is 17146368 bytes
MAC = eee1:e2e3e4e0
MAC address = ee:e1:e2:e3:e4:e0.
eth0 MAC : EE:E1:E2:E3:E4:E0
Sending DHCP_DISCOVERY
Waiting for DHCP_OFFER

 

Link to comment
Share on other sites

8 hours ago, kwilber said:

Hello @aeon20

I replied to your PM but will also reply here so others can benefit.

I followed the getting started guide and used the "standalone installation" option. On my Nexys A7 100T, I made sure sw1 was on and the others were off. JP1 was set to QSPI and JP2 was set to USB. I attached a usb keyboard and vga monitor.

I initially left the sd card out so I could observe the behavior. The read from the sd failed as expected. The quickstart mentions that a reported bus width other than 4  bytes is an error.


0: 0
1: 1
2: 1
3: 1
800: 1e
801: 0
802: 0
803: 0
Selftest iteration 1, next buffer = 0, rx_start = 4000
Selftest matches=2/2, delay = 9
Selftest iteration 2, next buffer = 1, rx_start = 4800
Selftest matches=4/4, delay = 9
Selftest iteration 3, next buffer = 2, rx_start = 5000
Selftest matches=8/8, delay = 9
Selftest iteration 4, next buffer = 3, rx_start = 5800
Selftest matches=16/16, delay = 16
Selftest iteration 5, next buffer = 4, rx_start = 6000
Selftest matches=32/32, delay = 31
Selftest iteration 6, next buffer = 5, rx_start = 6800
Selftest matches=64/64, delay = 60
Selftest iteration 7, next buffer = 6, rx_start = 7000
Selftest matches=128/128, delay = 119
Selftest iteration 8, next buffer = 7, rx_start = 7800
Selftest matches=187/187, delay = 173
lowRISC boot program
=====================================
Hello LowRISC! Tue Aug 14 10:40:47 2018: Booting from FLASH because SW1 is high ..

u-boot based first stage boot loader
MMC:
mmc created at 86800248, host = 86800200
lowrisc_sd: 0
Device: lowrisc_sd
Manufacturer ID: 0
OEM: 0
Name: Bus Speed: 5000000
High Capacity: No
Capacity:
llu BytesBus Width: 1-bit

 

Next I inserted the sd and reset the board. The boot process went pretty much as described in the guide. It eventually left me at a login. I logged in as root and followed the firstboot procedure.


Debian GNU/Linux buster/sid lowrisc tty1
lowrisc login: root
Linux lowrisc 4.18.0-gc81ff0d #48 Thu Oct 18 16:00:24 BST 2018 riscv64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
[  258.760000] systemd-logind[1160]: New seat seat0.
This is the firstboot script. It will display only once
Set the superuser (root) password below
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Creating normal user lowrisc ...
Adding user `lowrisc' ...
Adding new group `lowrisc' (1000) ...
Adding new user `lowrisc' (1000) with group `lowrisc' ...
Creating home directory `/home/lowrisc' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for lowrisc
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:

 

So in order to actually boot, it requires an SD card?

Forgive my naive questions, but what does it use the SD card for? I might have guessed it is the only form of non-volatile storage it has, however, if it needed this to boot, shouldn't Linux throw an error? I'm assuming the kernel and initial ramdisk are all programmed to the QSPI, so I don't really see why it needs the SD card in order to boot in that sense.

Once I get an SD card to try with, do I need to do anything to it? Create a file system?

Link to comment
Share on other sites

The bit file in QSPI only implements the system hardware and a simple first stage bootloader. Very similar to how pc's have a bootloader in rom but load the actual operating system from disk. 

The SD card will hold the actual linux file system and is just like a disk drive in your pc.

There are 4 partitions on the card.

  • First, there is a FAT32 partition that has boot.bin. This is a more capable loader that knows about the structure of the sd card and can locate and read the linux kernel.
  • A second ext4 formatted partition holds the kernel. 
  • A third partition is for swap space.
  • A fourth ext4 partition is used for the rest of your file system.

The startup guide explains how to create the sd card. It begins at the section "READ THIS WARNING (!)" and ends at "Remote console installation".

Link to comment
Share on other sites

1 minute ago, kwilber said:

The bit file in QSPI only implements the system hardware and a simple first stage bootloader. Very similar to how pc's have a bootloader in rom but load the actual operating system from disk. 

The SD card will hold the actual linux file system and is just like a disk drive in your pc.

There are 4 partitions on the card.

  • First, there is a FAT32 partition that has boot.bin. This is a more capable loader that knows about the structure of the sd card and can locate and read the linux kernel.
  • A second ext4 formatted partition holds the kernel. 
  • A third partition is for swap space.
  • A fourth ext4 partition is used for the rest of your file system.

The startup guide explains how to create the sd card. It begins at the section "READ THIS WARNING (!)" and ends at "Remote console installation".

Much appreciated, thank you. Sorry for overlooking this. I thought it would throw an error if there was something wrong with the file system, such as the typical "kernel panic - not syncing", or similar to what I'd see on a normal Linux system if it can't access the root disk at all.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...