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

PIO base address constant, defined on design

Altera_Forum
Honored Contributor II
1,406 Views

Hi, 

 

 

I have made some experiments on NIOS2 core with the Avalon PIO and it’s working fine. 

 

However, differently from some examples found on the Web, e.g iord(pio_0_base,0) - I had to manually paste the numerical base address of the pio_0 which was generated by Qsys. I had to do this way for the sake of Eclipse underlined this parameter warning that it was not recognized by compiler. Although I made a deep search on the content of all files of the design by Windows search tool, seeking some occurence of the partial word “PIO_0” assigned to something related to it current address “3030” ( actually, 0x0000_3030 ), could not find anything. 

 

Correct me if I’m wrong, but should I manually create my own assignments, or are there a better way ? 

I fear that after performing eventual updating on base addresses on Qsys this could change the value already defined 

 

#define PIO_0_BASE 0x00003030
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
594 Views

Do you have:#include "system.h"in your code? You certainly shouldn't have to hard code the addresses in. 

 

Cheers, 

Alex
0 Kudos
Altera_Forum
Honored Contributor II
594 Views

You should be able to look up your PIO_0_BASE in your system.h. I assume that you have generate/re-generate BSP based on the new sopcinfo file.

0 Kudos
Altera_Forum
Honored Contributor II
594 Views

 

--- Quote Start ---  

You should be able to look up your PIO_0_BASE in your system.h. I assume that you have generate/re-generate BSP based on the new sopcinfo file. 

--- Quote End ---  

 

 

In addition to regenerate the BSP, you probably need to select the Refresh and/or Rebuild Index commands
0 Kudos
Altera_Forum
Honored Contributor II
594 Views

Thank you all for the advices. 

 

I was not aware of the need to re-generate the BSP, and doing that now the PIO_0 base address 0x3030 is visible at the file "system.h". 

The only action that I have to do in order to take effect the changes, it was generating a new BSP project instead of the generate option.
0 Kudos
Reply