My bad, it should be:
static MemoryHeap ext_heap
chHeapInit(&ext_heap, (void*)0x60000000, 10240);
See testheap.c
Giovanni
ChibiOS/RT and external RAM
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: ChibiOS/RT and external RAM
I'm really sorry that I have to keep this going... I compared your last post with the testheap.c and my own code. I don't see any differences there:
yours:
testheap.c:
mine:
Compiler error:
~ Tectu
yours:
Code: Select all
static MemoryHeap ext_heap
chHeapInit(&ext_heap, (void*)0x60000000, 10240);
testheap.c:
Code: Select all
static MemoryHeap test_heap;
chHeapInit(&test_heap, test.buffer, sizeof(union test_buffers));
mine:
Code: Select all
static MemoryHeap ext_heap;
chHeapInit(&ext_heap, (void*)0x60000000, 10240);
Compiler error:
Code: Select all
/home/tectu/projects/resources/chibios/os/kernel/include/chheap.h:82:9: note: expected 'struct MemoryHeap *' but argument is of type 'MemoryHeap'
~ Tectu
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: ChibiOS/RT and external RAM
I pasted that code into a demo and it compiles. Do the same, if it does compile then check your code for conflicts or preprocessor changing things in an non-obvious way.
Giovanni
Giovanni
Re: ChibiOS/RT and external RAM
Yeah it was kinda my bad... The error I listed was related to another line where I called chHeapAlloc(ext_heap, ...); instead of chHeapAlloc(&ext_heap, ....).
So the code compilers and so on, but currently I receive NULL pointers back from chHeapAlloc. Have you yet used external memory yourself, Giovanni? I am sure it's some wrong FSMC setup.
~ Tectu
So the code compilers and so on, but currently I receive NULL pointers back from chHeapAlloc. Have you yet used external memory yourself, Giovanni? I am sure it's some wrong FSMC setup.
~ Tectu
Re: ChibiOS/RT and external RAM
Okay, I got it finally working. Thanks for your help Giovanni and sorry for my very stupid mistake ^^
~ Tectu
~ Tectu