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

MicroC/OS-II + VIC?

Altera_Forum
Honored Contributor II
1,662 Views

Is the Altera VIC compatable with MicroC/OS-II? I added the VIC to the standard SOPC design and then attempted to build (using the command line tools) the hello_ucosii example. The BSP compiles, links, and creates the libucosii_bsp.a library file, but when the application (hello_ucosii.c) tries to link, I get several "undefined reference to `alt_ic_isr_register'" errors from the linker. 

 

I downloaded and built the files from AN-595 and they built without error, but the BSP is built with '--type=hal' instead of 'ucosii'. After comparing the directories, I verifired that the UCOSII bsp is not including the VIC related source files that the AN-595 does. Do the tools not support creating a BSP that uses both the VIC and MicroC/OS? Has anyone done this? 

 

Thanks!
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
571 Views

Problem still occurs, unresolved references in sys/alt_irq.h when using VIC + µCos II.

0 Kudos
Altera_Forum
Honored Contributor II
571 Views

Sorry to reopen this topic after such a long time, but as I didn't find any pointer to this problem anywhere, this should be the right spot to add my 2 cents. 

 

I just had a similar problem. 

My problem was, that I added a driver to the BSP with a custom *_sw.tcl file, and afterwards I got "undefined reference to `alt_ic_isr_register'". 

 

The resolution to this is stated in the Nios2 Software Developer's Handbook Chapter 8 (Exception Handling): 

 

--- Quote Start ---  

A driver can publish its interrupt API support by way of a software property. The driver’s <driver name>_sw.tcl file uses the set_sw_property command to set supported_interrupt_apis to either legacy_interrupt_api, 

enhanced_interrupt_api, or both. 

Drivers supporting the enhanced API always publish that support. If supported_interrupt_apis is undefined, the SBT assumes that the driver only 

supports the legacy API. 

Starting in 9.1, all Altera device drivers support both APIs. These drivers can be used in a BSP along with legacy drivers. The SBT determines whether the legacy API is required, and implements it only if it is required. If there are no drivers requiring the legacy API, the BSP implements the enhanced API. 

A driver can be written to support only the enhanced API. However, you cannot combine such a driver with legacy drivers. 

--- Quote End ---  

So if one of the drivers does not work with the Enhanced API, it will be disabled, leading to this problem. 

 

Maybe Altera considers it good style to surround every alt_ic_isr_register() with 

# ifdef NIOS2_EIC_PRESENT alt_ic_isr_register()# else alt_isr_register()# endif I have seen code, though, that maps alt_ic_isr_register() to alt_isr_register(), but I have no clue when this comes active. 

 

But my components in question did support the enhanced API (or better, it does not use interrupts at all, for the moment), so I added  

set_sw_property supported_interrupt_apis enhanced_interrupt_api  

to the _sw.tcl, and alt_ic_isr_register() was there again.
0 Kudos
Reply