Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4829

C/C++ • Re: Allocate memory for DMA on Raspberry Pi 5

$
0
0
yes my error mmap seems to work. program terminated at memset with bus error.

Code:

int main(){    // int size = 315392;    void *p = mapmem(0xc1800000, PAGE_SIZE);    printf("p:%p\n", p);    printf("Alloc: %6d bytes;  %p \n",PAGE_SIZE, p);    memset(p, 0x00, PAGE_SIZE);    return 0;}
Output

Code:

# ./mmapApp base=0xc1800000, mem=0x7fb0e5a000p:0x7fb0e5a000Alloc:  16384 bytes;  0x7fb0e5a000 Bus error

Statistics: Posted by drLaplace — Tue Nov 19, 2024 9:23 am



Viewing all articles
Browse latest Browse all 4829

Trending Articles