-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_prompt.txt
More file actions
26 lines (19 loc) · 2.76 KB
/
Copy pathinit_prompt.txt
File metadata and controls
26 lines (19 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
This repo contains everything needed to boot nommu Linux on a NEORV32 RISC-V soft-core FPGA, built entirely from source. Read CLAUDE.md first — it has the full build flow and known pitfalls.
Before starting: clean any leftover build artifacts from previous attempts. Delete linux-6.6.83/ (extracted kernel source), output/* (but keep the directory), quartus/db/ quartus/incremental_db/ quartus/output_files/, sw/stage2_loader/build/ sw/stage2_loader/*.bin, sw/initramfs/init sw/initramfs/gen_init_cpio sw/initramfs/*.cpio.gz — if they exist.
Your task: build every component from source and boot Linux on the FPGA, following these steps:
1. Build openFPGALoader from source (tools/openFPGALoader/) — the system-installed version does NOT support our FPGA chip (EP4CE6)
2. Build the FPGA bitstream with Quartus (quartus/)
3. Build the stage2 xmodem loader (sw/stage2_loader/, `make exe`) — output is neorv32_exe.bin (NOT main.bin), must fit in 8 KB
4. Extract linux-6.6.83.tar.xz, apply kernel/neorv32_nommu.patch, inject board/neorv32_uart.c via board/inject_driver.sh
5. Build the initramfs (sw/initramfs/) — needs gen_init_cpio compiled from kernel source
6. Fix CONFIG_INITRAMFS_SOURCE path in defconfig, then build the kernel
7. Compile the device tree (board/neorv32_ax301.dts)
8. Program the FPGA and run host/boot_linux.py to boot Linux
All build outputs go into output/. The expected end result is a Linux shell prompt:
nommu#
Critical warnings (read CLAUDE.md for details):
- COMPILER MATTERS: The kernel MUST be built with xPack riscv-none-elf-gcc 14.2.0. Do NOT use Buildroot's riscv32-buildroot-linux-gnu-gcc 12.4.0 for the kernel — it produces a binary that hangs in free_initmem() on NEORV32 despite identical source/patches/config. This is a confirmed GCC code generation issue. The Buildroot toolchain is ONLY for building the initramfs /init binary.
- Two different toolchains are needed: bare-metal riscv-none-elf- for kernel/stage2, Buildroot Linux riscv32-buildroot-linux-gnu- for initramfs init. The init binary MUST be static-PIE (built with -fpie), which only the Linux toolchain supports. If init is not PIE, the kernel hangs silently after "Run /init".
- CONFIG_RISCV_ISA_V, CONFIG_FPU, and CONFIG_RISCV_ISA_FALLBACK must all stay disabled (defconfig has them off). FPU=y causes kernel hang after free_initmem (NEORV32 has no FPU). After `make defconfig`, verify: `grep -E 'RISCV_ISA_V|FPU|ISA_FALLBACK' .config` — all should be "is not set". The resulting kernel Image should be ~1.51 MB; if significantly larger, unwanted features snuck in.
- CONFIG_INITRAMFS_SOURCE in defconfig has a stale path — fix with sed before building kernel.
The board is already connected (USB-Blaster + PL2303 UART at /dev/ttyUSB0). If SDRAM fails intermittently, just power-cycle the board.