今天编写程序,qsys添加外部组件SRAM后,无法创建NIOS II工程,有如下错误:
“Error:Failed to execute: ./create-this-app --cpu-name cpu --no-make
SEVERE: CPU "cpu" exception memory "sram" has no matching memory region.
WARNING: Tcl script "bsp-set-defaults.tcl " error: CPU "cpu" exception memory "sram" has no matching memory region.
SEVERE: [Error] altera_hal_linkerx_generator: Required linker section mappings do not exist: "[.entry, .exceptions, .rodata, .rwdata, .text, .bss, .heap, .stack]"
SEVERE: [Error] altera_hal_linkerx_generator: Required linker section mappings do not exist: "[.entry, .exceptions, .rodata, .rwdata, .text, .bss, .heap, .stack]"
SEVERE: nios2-bsp-create-settings failed.
nios2-bsp: nios2-bsp-create-settings failed
nios2-bsp hal . E:/..../NIOS_CPU.sopcinfo --cpu-name cpu failed”
解析:
感觉应该是有个可以设置的选项来告诉Qsys系统,当前的自定义组件是一个Memory Device,SOPC中有isMemoryDevice复选框可以设置,但是Qsys中拿掉了。自定义组件生成的tcl应该可以设置;另外我在系统生中的sopcinfo文件中将组件的Avalon_Slave_0这部分的isMemoryDevice属性设置为1,是可以成功建立工程的。
解决方法:
一、打开自定义组件的SRAM脚本**_hw.tcl,
找到 set_interface_assignment avalon_slave_0 embeddedsw.configuration.isMemoryDevice 0
改为 set_interface_assignment avalon_slave_0 embeddedsw.configuration.isMemoryDevice 1
二、打开生成的.sopcinfo文件,其中有
<name>embeddedsw.configuration.isMemoryDevice</name>
<value>0</value>
改为
<name>embeddedsw.configuration.isMemoryDevice</name>
<value>1</value>
然后再创建nios 2工程,成功创建。