[root@cdwx /]# ./led_test
Unhandled fault: external abort on non-linefetch (0x018) at 0x76101040
Bus error
arm端执行程序出现以上错误,求指导。C程序在gsrd fpga工程中能正常使用,自己新建fpga工程测试错误。
这个地址是根据手册上映射的,就是很简单的地址映射在加上Qsys系统设置的地址偏移。
在设备树里可以打开心跳灯,硬盘灯,等,可设置的东西可多了
谢谢,解答,不过我只是就hps2fpga需要配置设备树吗?
以下是QSOPC添加的设备树:
led: gpio@0x100000080 {
compatible = "altr,pio-15.0", "altr,pio-1.0";
reg = <0x00000001 0x00000080 0x00000010>;
clocks = <&clk_50>;
altr,gpio-bank-width = <3>; /* embeddedsw.dts.params.altr,gpio-bank-width type NUMBER */
resetvalue = <0>; /* embeddedsw.dts.params.resetvalue type NUMBER */
#gpio-cells = <2>;
gpio-controller;
}; //end gpio@0x100000080 (led)
以下是手工添加的子设备树,没错的话,会在/sys/class/gpio 下找到相应的设备:led_fpga0,led_fpga1,led_fpga2
soc_leds: leds {
compatible = "gpio-leds"; /* appended from boardinfo */
led_fpga0: fpga0 {
label = "fpga_led0"; /* appended from boardinfo */
gpios = <&led 0 0>; /* appended from boardinfo */
}; //end fpga0 (led_fpga0)
led_fpga1: fpga1 {
label = "fpga_led1"; /* appended from boardinfo */
gpios = <&led 1 0>; /* appended from boardinfo */
}; //end fpga1 (led_fpga1)
led_fpga2: fpga2 {
label = "fpga_led2"; /* appended from boardinfo */
gpios = <&led 2 0>; /* appended from boardinfo */
}; //end fpga2 (led_fpga2)
}; //end leds (soc_leds) 本帖最后由 yupc123 于 2016-9-20 08:37 编辑