Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
866 Views

PIO base address constant, defined on design

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 I
54 Views

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

 

Cheers, 

Alex
Altera_Forum
Honored Contributor I
54 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.

Altera_Forum
Honored Contributor I
54 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
Altera_Forum
Honored Contributor I
54 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.
Reply