I wpuld like to write to hardware registers on OMAP3530 in Linux userspace. Please, find below code. Mmap returns error:
Memory map failed. error -1
mmap: Pe
The documentation for mmap() says (emphasis mine):
The
mmap()function shall fail if:EACCES
The fildes argument is not open for read, regardless of the protection specified, or fildes is not open for write and
PROT_WRITEwas specified for aMAP_SHAREDtype mapping.
Since you specify PROT_WRITE, the file should be open for write. Your code only opens it for read.