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++
12590 Discussions

NIOS II HAL Device Driver example files couldn't build

Altera_Forum
Honored Contributor II
1,878 Views

Hey guys, 

 

Have you tried the NIOS II HAL Device Driver example on altera website which goes with application note 459?  

 

I simply followed the application note AN459 to build a NIOS II HAL device driver, but in step 15 on page 6 of AN459 the NIOS II command shell threw out error messages and couldn't build successfully.  

 

The error messages include "Interrupt not connected for sysclk_timer", "undefined reference to `__alt_invalid`" and "undefined reference to `alt_irq_register`". I also attached a screenshot of the command shell in this post. 

 

Any suggestion is appreciated. Thanks very much.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
571 Views

Forgot to mention that the files I was using was downloaded directly from http://www.altera.com/support/examples/download/an459-design-files.zip, and I didn't make any change to the files.

0 Kudos
Altera_Forum
Honored Contributor II
571 Views

All of the "alt_" files are in the HAL as far as I understand it. I know from my own recent frustrations that the "undefined reference" errors can result from using the "small C library" option in the BSP. 

 

The sysclk_timer thing I have no idea? Is that is a clock then the error makes no sense. If the component does something else, then maybe you need to specify the interrupt in Qsys/SOPC builder.
0 Kudos
Altera_Forum
Honored Contributor II
571 Views

Now I found "Interrupt not connected for sysclk_timer" was the first error of all. But in Qsys the example file did connect the irq port of sysclk_timer to irq_input of another component called Vectored Interrupt Controller. And the tutorial didn't mention any change to that.... 

 

Can anyone provide a working version of device driver? ...
0 Kudos
Altera_Forum
Honored Contributor II
571 Views

What version of the tools are you using? In 10.1 the vector interrupt controller caused BSP problems when it was used in Qsys. The document says you need version 11.0 SP1 or higher which I'm guessing is the first version with the fix. In a nutshell the association of the interrupt number was not being propagated into the system.h file correctly causing the driver to think it was disconnected even though it was really connected.

0 Kudos
Altera_Forum
Honored Contributor II
571 Views

 

--- Quote Start ---  

What version of the tools are you using? In 10.1 the vector interrupt controller caused BSP problems when it was used in Qsys. The document says you need version 11.0 SP1 or higher which I'm guessing is the first version with the fix. In a nutshell the association of the interrupt number was not being propagated into the system.h file correctly causing the driver to think it was disconnected even though it was really connected. 

--- Quote End ---  

 

BadOmen, you are a genius !!! Thanks very very much!
0 Kudos
Reply