10-30-2019 06:06 AM
Hello all,
I have seen other posts about accessing RAM through mmap(). Unfortunately those other post have not helped yet, which is why I am hoping for your help to access physical addresses within Linux through mmap()-calls. I am using the Ultrazed-EG from Avnet with a 4.19.0 Linux Kernel and Debian, and I am currently debugging both kernel module and user space application.
In the driver I am using kmalloc to get a memory area. using the following functions I am trying to map this area directly to userspace:
pfn = ( virt_to_phys( virt_addr_from_kmalloc ) >> PAGE_SHIFT ); remap_pfn_range(vma, vma->vm_start, pfn, vma->vm_end - vma->vm_start, vma->vm_page_prot)
But unfortunately this memory area always stays random and using a bare-metal program I have validated that the PL is working correctly. Does anyone have experience with this or a similar issue?
I would add further code, screenshots, etc. if required.
Furthermore I am using the write functions to write from userspace to kernel, and using iowrite32/ioread32 to write from kernel to PL which seems to work. I dont have that much experience with Embedded Linux which is why I would appreciate all tips I can get.
Best regards,
Bjorn Hoevding
10-30-2019 10:05 AM
Can you try the following in petalinux
petalinux-config -c kernel
10-31-2019 01:20 AM
Hello @stephenm,
by default this was enabled within PetaLinux Tools.
I have disabled [ ] Filter access to /dev/mem but still the output image is random.
Do you have another idea?
Regards
03-03-2020 12:58 PM