Errors Running Buildroot Linux Image on KCU105

Hello! I am a student doing research on RISC-V cores on FPGAs. I have been trying run Linux using the NOEL-V core on a Xilinx KCU105 board using the instructions in the quick start guide from here so I can run some benchmark tests. I have been able to run the sample Linux images given, but when I try to make an image using the default configuration for the buildroot distribution from this page and then run that image on the board I get an error like so:

[    1.960538] Kernel panic - not syncing: junk at the end of compressed archive
[    2.011503] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.7.19 #1
[    2.054332] Call Trace:
[    2.074184] [<ffffffe00020335c>] walk_stackframe+0x0/0x110
[    2.113435] [<ffffffe000203678>] show_stack+0x3c/0x50
[    2.151287] [<ffffffe0005566e4>] dump_stack+0x90/0xbc
[    2.191814] [<ffffffe00020b4dc>] panic+0x138/0x30c
[    2.226429] [<ffffffe000003d4c>] populate_rootfs+0x40/0xe0
[    2.266896] [<ffffffe0002000ec>] do_one_initcall+0x44/0x154
[    2.311445] [<ffffffe000002090>] kernel_init_freeable+0x1ac/0x24c
[    2.360143] [<ffffffe000a95ee8>] kernel_init+0x1c/0x150
[    2.400844] [<ffffffe0002018cc>] ret_from_exception+0x0/0x10
[    2.444366] SMP: stopping secondary CPUs
[    2.475562] ---[ end Kernel panic - not syncing: junk at the end of compressed archive ]---

If anyone has any ideas of why this is happening or how to fix it that would be much appreciated.

Where are you loading the image from? I don’t recognize this error per se, but it just going by the text of the error it seems that the medium is not clean.

I’m using Vivado to program the EX2 example core onto the KCU105 and then I am using grmon3 to load the image onto the board from my computer.

Are you loading the image into RAM or Flash ROM?

From what I’m reading in the documentation, grmon loads the image into RAM

If you are loading the fw_payload.elf file it could be that it was not generated correctly. Try running make opensbi-rebuild and see if that helps.

I tried building it that way but it came up with the same error when I tried to run it.

Can you post exactly what you have done (commands; output only if relevant)?

Yeah, sorry for taking so long. I pretty much just follow the instructions in section 7 of the quick-start guide on the NOEL-XCKU site.

cd noel-buildroot
make clean
make noel64_defconfig
make opensbit-rebuild

[A bunch of output]....

cd ../noel-xcku-20210208
vivado -mode tcl -notrace -source doprog.tcl
(Vivado output)
****** Vivado v2018.1 (64-bit)
  **** SW Build 2188600 on Wed Apr  4 18:39:19 MDT 2018
  **** IP Build 2185939 on Wed Apr  4 20:55:05 MDT 2018
    ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.

source doprog.tcl -notrace
Vivado% doprog EX2
-------------------------------------------------------
Programming the FPGA with NOELV configuration EX2
-------------------------------------------------------
INFO: [Labtools 27-2285] Connecting to hw_server url TCP:localhost:3121
INFO: [Labtools 27-2222] Launching hw_server...
INFO: [Labtools 27-2221] Launch Output:

****** Xilinx hw_server v2018.1
  **** Build date : Apr  4 2018-18:56:09
    ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.


INFO: [Labtoolstcl 44-466] Opening hw_target localhost:3121/xilinx_tcf/Digilent/210308957392
INFO: [Labtools 27-1434] Device xcku040 (JTAG device index = 0) is programmed with a design that has no supported debug core(s) in it.
WARNING: [Labtools 27-3361] The debug hub core was not detected.
Resolution: 
1. Make sure the clock connected to the debug hub (dbg_hub) core is a free running clock and is active.
2. Make sure the BSCAN_SWITCH_USER_MASK device property in Vivado Hardware Manager reflects the user scan chain setting in the design and refresh the device.  To determine the user scan chain setting in the design, open the implemented design and use 'get_property C_USER_SCAN_CHAIN [get_debug_cores dbg_hub]'.
For more details on setting the scan chain property, consult the Vivado Debug and Programming User Guide (UG908).
INFO: [Labtools 27-3164] End of startup status: HIGH
program_hw_devices: Time (s): cpu = 00:00:09 ; elapsed = 00:00:09 . Memory (MB): peak = 1710.844 ; gain = 1.000 ; free physical = 128 ; free virtual = 2708
INFO: [Labtools 27-1434] Device xcku040 (JTAG device index = 0) is programmed with a design that has no supported debug core(s) in it.
WARNING: [Labtools 27-3361] The debug hub core was not detected.
Resolution: 
1. Make sure the clock connected to the debug hub (dbg_hub) core is a free running clock and is active.
2. Make sure the BSCAN_SWITCH_USER_MASK device property in Vivado Hardware Manager reflects the user scan chain setting in the design and refresh the device.  To determine the user scan chain setting in the design, open the implemented design and use 'get_property C_USER_SCAN_CHAIN [get_debug_cores dbg_hub]'.
For more details on setting the scan chain property, consult the Vivado Debug and Programming User Guide (UG908).
****** Webtalk v2018.1 (64-bit)
  **** SW Build 2188600 on Wed Apr  4 18:39:19 MDT 2018
  **** IP Build 2185939 on Wed Apr  4 20:55:05 MDT 2018
    ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.


cd ..
grmon -digilent -u -nb
GRMON debug monitor v3.2.12.1 64-bit eval version
  
  Copyright (C) 2021 Cobham Gaisler - All rights reserved.
  For latest updates, go to http://www.gaisler.com/
  Comments or bug-reports to support@gaisler.com
  
  This eval version will expire on 20/11/2021

JTAG chain (1): xcku040 
  Device ID:           0x287
  GRLIB build version: 4261
  Detected frequency:  100.0 MHz
  
  Component                            Vendor
  NOEL-V RISC-V Processor              Cobham Gaisler
  GR Ethernet MAC                      Cobham Gaisler
  AHB-to-AHB Bridge                    Cobham Gaisler
  AHB Debug UART                       Cobham Gaisler
  JTAG Debug Link                      Cobham Gaisler
  EDCL master interface                Cobham Gaisler
  L2-Cache Controller                  Cobham Gaisler
  Generic AHB ROM                      Cobham Gaisler
  Xilinx MIG Controller                Cobham Gaisler
  AHB/APB Bridge                       Cobham Gaisler
  RISC-V CLINT                         Cobham Gaisler
  RISC-V PLIC                          Cobham Gaisler
  RISC-V Debug Module                  Cobham Gaisler
  AHB/APB Bridge                       Cobham Gaisler
  AHB-to-AHB Bridge                    Cobham Gaisler
  AMBA Trace Buffer                    Cobham Gaisler
  Version and Revision Register        Cobham Gaisler
  AHB Status Register                  Cobham Gaisler
  General Purpose I/O port             Cobham Gaisler
  Modular Timer Unit                   Cobham Gaisler
  Generic UART                         Cobham Gaisler
  
  Use command 'info sys' to print a detailed report of attached cores

grmon3> dtb noel-xcku-dts_dtb/noel-xcku-ex2.dtb
  DTB will be loaded to the stack
  
grmon3> load noel-buildroot/output/images/fw_payload.elf
                 0 .text             82.0kB /  82.0kB   [===============>] 100%
             15000 .rodata            4.3kB /   4.3kB   [===============>] 100%
             17000 .data              1.1kB /   1.1kB   [===============>] 100%
             17498 .htif               16B              [===============>] 100%
            200000 .payload          18.4MB /  18.4MB   [===============>] 100%
  Total size: 18.51MB (510.81kbit/s)
  Entry point 0x00000000
  Image /home/garrett/Downloads/NOEL-V/noel-buildroot/output/images/fw_payload.elf loaded

grmon3> run

OpenSBI v0.8
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name       : noel-xcku-ex2
Platform Features   : timer,mfdeleg
Platform HART Count : 1
Boot HART ID        : 0
Boot HART ISA       : rv64imafdsu
BOOT HART Features  : pmp,scounteren,mcounteren
BOOT HART PMP Count : 16
Firmware Base       : 0x0
Firmware Size       : 116 KB
Runtime SBI Version : 0.2

MIDELEG : 0x0000000000000222
MEDELEG : 0x000000000000b109
PMP0    : 0x0000000000000000-0x000000000001ffff (A)
PMP1    : 0x0000000000000000-0x00000001ffffffff (A,R,W,X)
[    0.000000] OF: fdt: Ignoring memory range 0x0 - 0x200000
[    0.000000] Linux version 5.7.19 (garrett@garrett) (gcc version 9.3.0 (Buildroot 2020.08), GNU ld (GNU Binutils) 2.33.1) #1 SMP Mon Jun 21 10:40:31 MDT 2021
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000000200000-0x000000003fffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000200000-0x000000003fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000200000-0x000000003fffffff]
[    0.000000] software IO TLB: mapped [mem 0x3b1fc000-0x3f1fc000] (64MB)
[    0.000000] SBI specification v0.2 detected
[    0.000000] SBI implementation ID=0x1 Version=0x8
[    0.000000] SBI v0.2 TIME extension detected
[    0.000000] SBI v0.2 IPI extension detected
[    0.000000] SBI v0.2 RFENCE extension detected
[    0.000000] SBI v0.2 HSM extension detected
[    0.000000] riscv: ISA extensions adfim
[    0.000000] riscv: ELF capabilities adfim
[    0.000000] percpu: Embedded 17 pages/cpu s31912 r8192 d29528 u69632
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 258055
[    0.000000] Kernel command line: earlycon=sbi console=ttyGR0,115200
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 945456K/1046528K available (10689K kernel code, 3895K rwdata, 4096K rodata, 279K init, 318K bss, 101072K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]       fixmap : 0xffffffcefee00000 - 0xffffffceff000000   (2048 kB)
[    0.000000]       pci io : 0xffffffceff000000 - 0xffffffcf00000000   (  16 MB)
[    0.000000]      vmemmap : 0xffffffcf00000000 - 0xffffffcfffffffff   (4095 MB)
[    0.000000]      vmalloc : 0xffffffd000000000 - 0xffffffdfffffffff   (65535 MB)
[    0.000000]       lowmem : 0xffffffe000000000 - 0xffffffe03fe00000   (1022 MB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: 	RCU debug extended QS entry/exit.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[    0.000000] plic: mapped 31 interrupts with 1 handlers for 4 contexts.
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
[    0.000062] sched_clock: 64 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
[    0.048826] Console: colour dummy device 80x25
[    0.072686] Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=200000)
[    0.140437] pid_max: default: 32768 minimum: 301
[    0.171851] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.215120] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.280986] rcu: Hierarchical SRCU implementation.
[    0.312462] smp: Bringing up secondary CPUs ...
[    0.337518] smp: Brought up 1 node, 1 CPU
[    0.367567] devtmpfs: initialized
[    0.391323] random: get_random_u32 called from bucket_table_alloc.isra.0+0x74/0x1e4 with crng_init=0
[    0.449195] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.506062] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.552261] NET: Registered protocol family 16
[    0.726232] vgaarb: loaded
[    0.742881] SCSI subsystem initialized
[    0.770667] usbcore: registered new interface driver usbfs
[    0.802021] usbcore: registered new interface driver hub
[    0.835383] usbcore: registered new device driver usb
[    0.876079] clocksource: Switched to clocksource riscv_clocksource
[    0.997851] NET: Registered protocol family 2
[    1.029858] tcp_listen_portaddr_hash hash table entries: 512 (order: 2, 20480 bytes, linear)
[    1.076882] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    1.124727] TCP bind hash table entries: 8192 (order: 6, 262144 bytes, linear)
[    1.173987] TCP: Hash tables configured (established 8192 bind 8192)
[    1.215170] UDP hash table entries: 512 (order: 3, 49152 bytes, linear)
[    1.252577] UDP-Lite hash table entries: 512 (order: 3, 49152 bytes, linear)
[    1.298410] NET: Registered protocol family 1
[    1.333080] RPC: Registered named UNIX socket transport module.
[    1.364547] RPC: Registered udp transport module.
[    1.396355] RPC: Registered tcp transport module.
[    1.430302] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.471269] PCI: CLS 0 bytes, default 64
[    1.497599] Kernel panic - not syncing: junk at the end of compressed archive
[    1.541274] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.7.19 #1
[    1.574380] Call Trace:
[    1.588746] [<ffffffe00020335c>] walk_stackframe+0x0/0x110
[    1.622440] [<ffffffe000203678>] show_stack+0x3c/0x50
[    1.650581] [<ffffffe0005566e4>] dump_stack+0x90/0xbc
[    1.679894] [<ffffffe00020b4dc>] panic+0x138/0x30c
[    1.707639] [<ffffffe000003d4c>] populate_rootfs+0x40/0xe0
[    1.746236] [<ffffffe0002000ec>] do_one_initcall+0x44/0x154
[    1.781029] [<ffffffe000002090>] kernel_init_freeable+0x1ac/0x24c
[    1.817904] [<ffffffe000a95ee8>] kernel_init+0x1c/0x150
[    1.849947] [<ffffffe0002018cc>] ret_from_exception+0x0/0x10
[    1.885050] ---[ end Kernel panic - not syncing: junk at the end of compressed archive ]---

Then it just sits there until I interrupt it.

I assume you tried their suggestion?

The dependency handling for the OpenSBI package is not working correctly. If the image does not start or does not include recent changes to the configuration, try deleting the output/build/opensbi-* directory and rebuild the image.

In any case: the first obvious difference I see between the output you posted and the quick start guide is that you have an entry point at 0x0. This could mean the image got put at the wrong address… I’m not familiar with NOEL so maybe someone more knowledgeable can make a more meaningful comment.

1 Like

I hadn’t seen that suggestion, where is it from? Regardless, I tried it but ran into the same error.

Good catch, the different entry point might be the problem.

I’m not sure exactly what I did previously when I said I deleted OpenSBI, but recently tried it again from scratch and that worked. Thanks!

Cool, glad you got it working!

The quoted remark was from the quick start guide page 26, near the bottom. That’s where also quoted the entry point value from. Did it change now to a different value?

Ah I see it now, I don’t know how I read over that part.

I tried changing the entry point value at some point which didn’t fix it and when I got it working it still had entry point 0x0.

Thanks for all the help!

Hi,
I’m investigating Noelv core on an ARTY-A7-100T board with the guide from here. The DTB files can be downloaded from here. I met a similar issue when the Buildroot Linux was run on the board.

I follow the instruction to build the Linux image.

> cd noel-buildroot
> make noel64__defconfig
> make
> ....[outputs]...

then an error occurs as follows:

>>>  Executing post-image script board/gaisler/noel/post-image.sh
make[1]: *** No rule to make target 'opensbi-rebuild' . Stop.
make: *** [Makefile:836: target--post-image] Error 2

So I delete the output/build/opensbi-* directory and rebuild the image following the instruction.

The dependency handling for the OpenSBI package is not working correctly. If the image does not start or does not include recent changes to the configuration, try deleting the output/build/opensbi-* directory and rebuild the image.

Load the Linux image with grmon jtag debug link.

> grmon -digilent
> 
>   GRMON debug monitor v3.3.2 64-bit eval version
>   
>   Copyright (C) 2022 Cobham Gaisler - All rights reserved.
>   For latest updates, go to https://www.gaisler.com/
>   Comments or bug-reports to support@gaisler.com
>   
>   This eval version will expire on 22/06/2023
> 
> JTAG chain (1): xc7a100t 
>   Device ID:           0x330
>   GRLIB build version: 4280
>   Detected frequency:  40.0 MHz
> 
>   Component                            Vendor
>   NOEL-V RISC-V Processor              Cobham Gaisler
>   GR Ethernet MAC                      Cobham Gaisler
>   AHB-to-AHB Bridge                    Cobham Gaisler
>   L2-Cache Controller                  Cobham Gaisler
>   AHB Debug UART                       Cobham Gaisler
>   JTAG Debug Link                      Cobham Gaisler
>   EDCL master interface                Cobham Gaisler
>   JTAG Debug Link                      Cobham Gaisler
>   Generic AHB ROM                      Cobham Gaisler
>   AHB/APB Bridge                       Cobham Gaisler
>   RISC-V CLINT                         Cobham Gaisler
>   RISC-V PLIC                          Cobham Gaisler
>   Xilinx MIG Controller                Cobham Gaisler
>   RISC-V Debug Module                  Cobham Gaisler
>   AHB/APB Bridge                       Cobham Gaisler
>   AHB-to-AHB Bridge                    Cobham Gaisler
>   AMBA Trace Buffer                    Cobham Gaisler
>   Version and Revision Register        Cobham Gaisler
>   AHB Status Register                  Cobham Gaisler
>   General Purpose I/O port             Cobham Gaisler
>   Modular Timer Unit                   Cobham Gaisler
>   Generic UART                         Cobham Gaisler
> 
>   Use command 'info sys' to print a detailed report of attached cores
> 
> grmon3> load fw_payload.elf
>                  0 .text             82.0kB /  82.0kB   [===============>] 100%
>              15000 .rodata            4.3kB /   4.3kB   [===============>] 100%
>              17000 .data              1.1kB /   1.1kB   [===============>] 100%
>              17498 .htif               16B              [===============>] 100%
>             200000 .payload          16.9MB /  16.9MB   [===============>] 100%
>   Total size: 16.97MB (630.23kbit/s)
>   Entry point 0x00000000
>   Image /home/ciaociao/Downloads/Noelv_tools/Linux/noel-buildroot-2021.02-2.1/noel-buildroot/output/images/fw_payload.elf loaded
> 
> grmon3> dtb MC64-SC.dtb
>   DTB will be loaded to the stack
> 
> grmon3> forward enable uart0
>   I/O forwarding to uart0 enabled
> 
> grmon3> run
> 
> OpenSBI v0.8
>    ____                    _____ ____ _____
>   / __ \                  / ____|  _ \_   _|
>  | |  | |_ __   ___ _ __ | (___ | |_) || |
>  | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
>  | |__| | |_) |  __/ | | |____) | |_) || |_
>   \____/| .__/ \___|_| |_|_____/|____/_____|
>         | |
>         |_|
> Platform Name       : noel-min64-sc
> Platform Features   : timer,mfdeleg
> Platform HART Count : 1
> Boot HART ID        : 0
> Boot HART ISA       : rv64imafdcu
> BOOT HART Features  : pmp,scounteren,mcounteren
> BOOT HART PMP Count : 16
> Firmware Base       : 0x0
> Firmware Size       : 116 KB
> Runtime SBI Version : 0.2
> 
> PMP0    : 0x0000000000000000-0x000000000001ffff (A)
> PMP1    : 0x0000000000000000-0x00000001ffffffff (A,R,W,X)

the program gets stuck from there until I interrupt it.