Forum Discussion
Altera_Forum
Honored Contributor
11 years agoSystem console is not capable of being hosted on Nios II. System console can use the Nios II core to access memory but if you are already writing Nios II code to access the slave I wouldn't bother overcomplicating things by throwing system console into the mix.
The IO macros are all you need to access the slave. For example lets say I want to write the values of 0 to 9 to the 4th 32-bit location in the slave I would do something like this: # include "io.h" # include "system.h" void main() { int i; for(i=0;i<10;i++) { IOWR_32DIRECT(SLAVE_BASE, 4*(3), i); } } The 4* is to make sure my offsets are 4-byte aligned since it's a 32-bit write macro, and the (3) is because I'm accessing the 3rd 32-bit offset into the slave. SLAVE_BASE is defined in system.h (it'll have the name of whatever your component is called)