John Kearney
|
RE: mmap_device_io not functioning
|
John Kearney
02/14/2019 5:35 AM
post119517
|
RE: mmap_device_io not functioning
If mmap_device_io wasn't working you would be getting a core file, and be unable to read the value.
This is more likely being caused by the chipset being locked, in some way, or that being a read only register or some
such.
If it wasn't mapped correctly for write access you would expect to see a SIGSEGV ACCERR.
Cheers
John
________________________________________
From: mike scott [community-noreply@qnx.com]
Sent: Thursday, February 14, 2019 04:02
To: ostech-core_os
Subject: mmap_device_io not functioning
Hi QNX,
qnx sdp 6.6,
BSP_ti-am335x-beaglebone_br-660_be-660_SVN797070_JBN574.zip
beaglebone black Rev. C
I am not able to modify register value through mmap_device_io, which always readback as the pre-setted value defined in
BSP.
#include <errno.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/mman.h>
#include <hw/inout.h>
#include <arm/am335x.h>
#include <sys/iofunc.h>
#include <sys/dispatch.h>
#define conf_mcasp0_aclkx 0x0990
int main(int argc, char *argv[])
{
uintptr_t mode_base;
ThreadCtl(_NTO_TCTL_IO, 0);
mode_base = mmap_device_io(0x2000, AM335X_CTRL_BASE);
out32(mode_base + conf_mcasp0_aclkx, 0x37);
sleep(2);
printf("conf_mcasp0_aclkx = %x\n", in32(mode_base + conf_mcasp0_aclkx));
munmap_device_io(mode_base, 0x2000);
return 1;
}
program outputs: "conf_mcasp0_aclkx = 23"
which is exactly that conf_mcasp0_aclkx was initialized in init_pinmux.c as 0x23. I would like to change it to 0x37.
Please help, thanks in advance
Mike
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post119515
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
|
|
|