Closed ghost closed 4 years ago
Ok, I think I might be doing something silly. If I run this code it works on Intel but not on the ARM:
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <stdint.h>
#include <string.h>
int main() {
int fd = open("/dev/xtrx0", O_RDWR);
uintptr_t* p1 = (uintptr_t*)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
uintptr_t* p2 = (uintptr_t*)malloc(4096);
printf("p1=%p, p2=%p\n", p1, p2);
memcpy(p2, p1, 4096);
free(p2);
munmap(p1, 4096);
close(fd);
return 0;
}
Intel output:
root@connor-Latitude-E6540:/home/connor# ./test
p1=0x7f4574cca000, p2=0x5587a75ec260
dmesg:
[77147.214163] xtrx: call: REGION=1 VMA=000000004993e82b vma->vm_pgoff=0
[77147.214179] xtrx: VMA open, virt 7f2c449dd000, phys 0
[77147.214659] xtrx: VMA close.
ARM output:
root@bionic-newport:~# ./test
p1=0xffff93991000, p2=0xaaab03985260
Bus error
dmesg:
[ 9953.508406] xtrx: call: REGION=1 VMA=ffff800066026300 vma->vm_pgoff=0
[ 9953.508413] xtrx: VMA open, virt ffff93991000, phys 0
[ 9953.508571] Synchronous External Abort: synchronous external abort (0x92000210) at 0x0000ffff93991000
[ 9953.518038] xtrx: VMA close.
Oh, using the latest code works :)
Hi,
I'm trying to use an XTRX Pro on a Gateworks GW6200 SBC. Any help would be super appreciated.
I have stripped the test_xtrx code down to this. The same error happens with the original test_xtrx, it's just more noisy.
This is what I get when running it on the GW6200:
This is what I get when I run the same code on an i7 laptop:
This is how I compiled the driver: