Project

General

Profile

FPGA programming

Added by Davide Vaccaro over 5 years ago

Hi everyone,

I'm having troubles programming the FPGA from HPS in the Linux environment. In particular, after I scp my rbf file to my sd card and disable the bridges, I try to program the FPGA issuing the dd if =file.rbf of=/dev/fpga0 bs=1M command. When I do so, the system freezes and the following screen appears:

INFO: rcu_sched self-detected stall on CPU { 0} (t=2100 jiffies g=193 c=192 q=23)
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.16.0-g2067793 #1
[<8001864c>] (unwind_backtrace) from [<800132c0>] (show_stack+0x20/0x24)
[<800132c0>] (show_stack) from [<804fd5c8>] (dump_stack+0x8c/0x9c)
[<804fd5c8>] (dump_stack) from [<80076664>] (rcu_check_callbacks+0x470/0x908)
[<80076664>] (rcu_check_callbacks) from [<80033ab4>] (update_process_times+0x50/0x70)
[<80033ab4>] (update_process_times) from [<80082324>] (tick_sched_timer+0x80/0x23c)
[<80082324>] (tick_sched_timer) from [<80049970>] (_run_hrtimer+0x90/0x1bc)
[<80049970>] (
_run_hrtimer) from [<8004a3f8>] (hrtimer_interrupt+0x140/0x310)
[<8004a3f8>] (hrtimer_interrupt) from [<80016e3c>] (twd_handler+0x44/0x54)
[<80016e3c>] (twd_handler) from [<8006eedc>] (handle_percpu_devid_irq+0x90/0x124)
[<8006eedc>] (handle_percpu_devid_irq) from [<8006ac60>] (generic_handle_irq+0x3c/0x4c)
[<8006ac60>] (generic_handle_irq) from [<8000fbd8>] (handle_IRQ+0x50/0xa0)
[<8000fbd8>] (handle_IRQ) from [<80008644>] (gic_handle_irq+0x3c/0x6c)
[<80008644>] (gic_handle_irq) from [<80013ec0>] (_irq_svc+0x40/0x50)
Exception stack(0x8075de30 to 0x8075de78)
de20: 00000001 ffffab8f 00000000 00000000
de40: 8075ab30 0000001d 00000282 fee00100 80504ef4 8079fd70 00000000 8075dedc
de60: 807a2d40 8075de78 807a2d40 8002b734 200f0113 ffffffff
[<80013ec0>] (
_irq_svc) from [<8002b734>] (_do_softirq+0xe0/0x318)
[<8002b734>] (
_do_softirq) from [<8002bc0c>] (irq_exit+0x88/0xc0)
[<8002bc0c>] (irq_exit) from [<8000fbdc>] (handle_IRQ+0x54/0xa0)
[<8000fbdc>] (handle_IRQ) from [<80008644>] (gic_handle_irq+0x3c/0x6c)
[<80008644>] (gic_handle_irq) from [<80013ec0>] (_irq_svc+0x40/0x50)
Exception stack(0x8075df38 to 0x8075df80)
df20: bf7d0440 00000000
df40: 000285f8 00000000 8075c000 ffffffff 807a0324 8076446c 80504ef4 8079fb7a
df60: 00000000 8075df8c 8075df90 8075df80 8000ff50 8000ff54 600f0013 ffffffff
[<80013ec0>] (
_irq_svc) from [<8000ff54>] (arch_cpu_idle+0x3c/0x40)
[<8000ff54>] (arch_cpu_idle) from [<80062308>] (cpu_startup_entry+0x124/0x1ec)
[<80062308>] (cpu_startup_entry) from [<804f9420>] (rest_init+0x84/0x88)
[<804f9420>] (rest_init) from [<806f9c5c>] (start_kernel+0x394/0x3a0)

Can someone enlighten me about this matter?

Best,
Davide


Replies (2)

RE: FPGA programming - Added by Zachary Miller over 5 years ago

Hi Davide,

If your FPGA is based on the one from the support site (in particular, if it includes PIO cores), you'll need to rebuild the kernel with the GPIO driver as a module instead of built in.

You can follow the instructions at Linux Kernel, and in menuconfig change Device Drivers -> GPIO Support -> Altera GPIO to M for module. Then copy the uImage and socfpga_mitysom5csx_devkit.dtb to the 5CSx and replace the old ones in /boot, copy the modules into the 5CSx's /lib/modules folder, and reboot.

Unload the gpio driver if it's already loaded (you can check with lsmod):

rmmod gpio-altera

Then you should be able to follow the same procedure you tried before to program the FPGA. You can then reload the GPIO driver:

modprobe gpio-altera

RE: FPGA programming - Added by Davide Vaccaro over 5 years ago

Dear Zachary,

that worked perfectly, thank you so much!

Best,

Davide

    (1-2/2)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)