Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

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

Altera_Forum
Honored Contributor II
1,132 Views

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
Altera_Forum
Honored Contributor II
246 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
Altera_Forum
Honored Contributor II
246 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
Reply