Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi oceanx,
I think that looks basically fine. However, what you might have problems with is the data cache (if you have one installed in your system) - the write might be stored there instead of written to main memory. I suggest you check the IOWR and IORD macros which are provided in HAL to bypass the cache: Nios2 Documentation states that the 'volatile' keyword does not do the job because of a the cache machanism used in Nios2 (I believe it is called write-back cache). <Nios II kit path>/components/altera_nios2/HAL/inc/io.h Cheers, -pkumpula