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

Nios Eclipse Problem IORD e IOWR

Altera_Forum
Honored Contributor II
1,767 Views

I have an error message from Eclipse when i build my project: 

 

"Undefined reference to 'IORD'" 

"Undefined reference to 'IOWR'" 

 

I used many times this functions to build the comunication between my component and software but this time something goes wrong 

I used the standard include entry of the Blank Project: 

# include <stdio.h># include "system.h"# include "my_component_regs.h" 

 

so where is the problem?
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
792 Views

IORD and IOWR are declared in "io.h" 

 

Usually you don't have to specifically include it, because it's included by other Altera headers. For example, "altera_avalon_performance_counter.h" will include this for you. 

 

If you're using IOWR and IORD directly, then you should include the io.h header in your main function. Let the# ifdef pragmas take care of removing subsequent includes.
0 Kudos
Altera_Forum
Honored Contributor II
792 Views

thanks for your replay. 

if i use io.h all works but i used many times the stdio.h without any problems.
0 Kudos
Altera_Forum
Honored Contributor II
792 Views

Hi, 

 

Anyone knows about the IOWR function declaration/definition? 

 

I need to know how the IDE drivers the data to pins of my component in SoPC. 

For example, if I have a LED_PIO with widht 8 bits, I just write IOWR (LED_PIO_BASE, 0, DATA) and I think the DATA will be sent to pins. But, if I have a component as DM9000A Ethernet controller, with 38 pins, where some are data and some are control, how I can set the correct pins to write a word?
0 Kudos
Altera_Forum
Honored Contributor II
792 Views

I'm not familiar with that IP core, so you'll have to carefully read the documentation for specifics. The pins are mapped in your top level HDL or schematic file to your Ethernet hardware. I think what you are trying to ask, though, is "how do I write to the Ethernet controller?" IORD and IOWR are probably not what you want. These are very basic low level Nios instructions. You should instead use whatever driver comes with the controller. The documentation will tell you what header file to include and how to setup and control the ethernet controller.

0 Kudos
Altera_Forum
Honored Contributor II
792 Views

I read all documentation that came with it and the controller has a set of steps to initialize, including access through index and data port registers. There is no problem with this, because I can access by using IORD and IOWR. The point is that I need to a hardware-reset, so I should write '0' to the reset pin and no data pins and I don't know how write in this pin especially. Indeed, I don't know how access a specific pin.

0 Kudos
Altera_Forum
Honored Contributor II
792 Views

Please don't multipost your question, once is enough. 

If the IP core can let the user directly control the reset pin (it usually doesn't) then it should be written in the documentation. (the IP core's documentation, not the chip datasheet). 

If not another option could be to control that pin directly through a PIO component instead of connecting it to the core.
0 Kudos
Reply