Read onchip memory from NIOS II

Hi…

Onchip memory is shared with NIOS II, when i execute…

printf(IORD(base_addr,0x00);

it returns jibrish “unknown character” :: I think it is able to read that memory location but not able to decode it in HEX…

how to read onchip memory through NIOS II and display in hex values ?

on reading onchip memory with IORD instruction,
IORD ( BASE_ADDRESS, 0X00);

It returns same value. even if there is different value present in the address…

It’s a printf formatting/“variable type” issue.

printf() doesn’t natively understand anything other than quoted strings…i.e.: printf(“Hello, World!”);

You’d need to use one of %x, %i…for the details of how to do that you can use Google as well as I. :wink:

Cheers!

Brendan

1 Like

Thank you for the reply… But what if i want to store it in a integer type variable…?