Hi,
I am programming EPIT1 registers 20D_0000 to 20D_0010 using memtools in the Linux OS on my imx6 board. After programming them, I want to access the value of the counter at run-time using C code.
Currently, I have created a memory pointer that gets the entire memory block from 20DXXXX address and then compares if some specific count value has been reached.
The error that I am getting is:
ERROR: Unhandled fault: external abort on non-linefetch (0x1818)
My doubt is that the way of declaring the memory pointer (using page_mask and page_size) must be wrong? What is the correct way of accessing EPIT registers using C pointers? What is the general calculations done in allocating a memory block to the pointer via mmap?
Best,
Abhijeet
Hi,
I have enabled EPIT registers, and written a C application code, that creates a memory pointer and accesses control and count register. Currently, the issue I am facing is of interrupt handling.
Studying your patch on epit.c, there are some RAM write functions and irq calls. Since, epit.c is in the kernel level, I will have to modify the kernel. Is there a way to implement the RAM write functions and irq calls, into an application code, that can be cross-compiled into an exe.
Best,
Abhijeet
Hi Abhijeet
linux uses mmu and one can look at memtool example function map_address()
memtool.c\memtool\test - imx-test - i.MX Driver Test Application Software
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
I am already using memtools to access the EPIT registers, I run the memtools script from my C file exe, so everytime I run the exe, the registers are set, and the downcounter starts.
I am unable to get access to the OCIF or the interrupt of the EPIT Timer through the C code.
Best,
Abhijeet