MPSOC(ZCU104) BRAM实现PL与PS数据互联 mmap(/dev/men) 访问失败
int g_fd_mmw_data = open(/dev/mem, O_RDWR);
volatile unsigned int *mapped_base = NULL;
mapped_base = (volatile unsigned int *)mmap(NULL, 0x1000, PROT_READ | PROT_WRITE, MAP_SHARED,
g_fd_mmw_data, (__off_t)0x0080000000);
printf("Mem address %p.\n", mapped_base);
printf("ddr address %p.\n", (unsigned int *)((unsigned int)mapped_base + 12));
*((volatile unsigned int *) ((unsigned int)mapped_base + 12)) = 0;
root@zcu104_test:/mnt/app# ./NSRX_APP_V1.0.0.elf
Mem address 0x7f9ec95000.
ddr address 0x9ec9500c.
[ 280.181419] NSRX_APP_V1.0.0[2187]: unhandled level 1 translation fault (11) at 0x9ec9500c, esr 0x92000045, in NSRX_APP_V1.0.0.elf[400000+1d000]
[ 280.198676] CPU: 1 PID: 2187 Comm: NSRX_APP_V1.0.0 Not tainted 4.14.0 #1
[ 280.205342] Hardware name: ZynqMP ZCU104 RevC (DT)
[ 280.210113] task: ffffffc06bf3f180 task.stack: ffffff800be58000
[ 280.216019] PC is at 0x415fd8
[ 280.218960] LR is at 0x415fcc
[ 280.221917] pc : [<0000000000415fd8>] lr : [<0000000000415fcc>] pstate: 60000000
[ 280.229296] sp : 0000007ffe579ec0
[ 280.232593] x29: 0000007ffe579ec0 x28: 0000000000000000
[ 280.237887] x27: 0000000000000000 x26: 0000000000000000
[ 280.243183] x25: 0000000000000000 x24: 0000000000000000
[ 280.248477] x23: 0000000000000000 x22: 0000000000000000
[ 280.253777] x21: 0000000000401e50 x20: 0000000000000000
[ 280.259068] x19: 0000000000418ad8 x18: 0000007ffe579da8
[ 280.264363] x17: 0000007f9ea8b6a8 x16: 000000000042d268
[ 280.269658] x15: 0000000000000010 x14: 0000000000000001
[ 280.274952] x13: 0000000000000000 x12: 0000000000000000