I am stuck. I tried to use mmap to map memory and access such from the userspace. I started getting segmentation faults with g++ compiler. I need to use classes, and I am trying to gain access to the outter memory with the use of mmap.
To try out developed code, I tried to compile devmem2.c with g++.
I end up with a different pointer than with devmem2.c compiled with gcc. I get the result directly from mmap, and the result is different:
silverbeast devmem2 # ./devmem2_native_gcc_c_no_opt_no_volatile 0xfffff600
Memory mapped at address 0xb7f20000.
Value at address 0xFFFFF600 (0xb7f21800): 0x0
silverbeast devmem2 # ./devmem2_native_gpp_cpp_no_opt_no_volatile 0xfffff600
Memory mapped at address 0xb7f92000.
Value at address 0xFFFFF600 (0xb7f93800): 0x0
Please help. I already tried volatile and casting my pointers to unsigned long. Right now I am confused.
This forum is for users of Microchip MPUs and who are interested in using Linux OS.
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests