Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
891 Views

How to integrate my own hardware drivers to Nios II project?

I designed my own component interfaced to avalon-MM. The location is: ...\proj\ip\... I also integrated it using sopc builder New Component function and directed the ip search path to ...\proj\ip\... directory. I wrote the driver functions component_regs.h, component.h, component.c, and put them into ...\proj\ip\Inc, ...\proj\ip\HAL\Inc, ...\proj\ip\HAL\Src. Then I wrote my test project using Nios II BSP. When built, an error appearred: 

"Can't find the component.h". I want to know where or how to direct the software to find the driver files for any project ?
0 Kudos
2 Replies
Highlighted
Valued Contributor III
5 Views

You need a <component>_sw.tcl script file. 

 

Place it in the same directory as the SOPC Builder generated <component>_hw.tcl file 

 

Some of the information in this file is used to specify the c/c++ source files and the include files. It also specifies such things as whether the component is auto initialized at boot-up (you have to write the code in your driver to do that), the minimum compatability versions, etc. 

 

When generating a bsp, if you don't have this file for your component, it doesn't know where to look. Thus, your code will not be compiled into the bsp package. 

 

Either find one already on your computer and modify it, or search for more help on Altera's website regarding writing HAL drivers.
0 Kudos
Highlighted
Valued Contributor III
5 Views

I found one already and modified it as the nios ii software development handbook description. It seems working. Thanks for your reply.

0 Kudos