Forum Discussion
Altera_Forum
Honored Contributor
14 years agoif you use uClinux no-mmu .......
use a program like that to test you acess.....#include <stdio.h>
# define BUFFER_MEMORY 0x10000000# define IORD(address, offset) (*(volatile unsigned *)(((address)| 0x80000000)+4*(offset)))
# define IOWR(address, offset, value) (*(volatile unsigned *)(((address)|0x80000000)+4*(offset)))=(value)
int main()
{
int op;
int valor;
int temp;
while (1) {
printf("\n\n\nDIGITE A OPCAO\n");
printf("1 - ESCREVER\n");
printf("2 - LER\n");
scanf("%d",&op);
if (op == 1) {
printf("DIGITE O VALOR\n");
scanf("%x", &valor);
printf("ESCREVENDO %x\n", valor);
IOWR(BUFFER_MEMORY, 2, valor);
//IOWR(0x00041040, 0, valor);
}
else if (op == 2) {
printf("LENDO\n");
temp=IORD(BUFFER_MEMORY, 0X2);
printf("temp = %x\n", temp);
}
else {
printf("OPCAO INVALIDA\n\n");
}
}
return 0;
} good luck Franz Wagner