Page 2 of 2
Re: ChibiOS/RT and external RAM
Posted: Sat May 04, 2013 7:45 pm
by Giovanni
My bad, it should be:
static MemoryHeap ext_heap
chHeapInit(&ext_heap, (void*)0x60000000, 10240);
See testheap.c
Giovanni
Re: ChibiOS/RT and external RAM
Posted: Sat May 04, 2013 7:57 pm
by Tectu
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:
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
Re: ChibiOS/RT and external RAM
Posted: Sat May 04, 2013 8:08 pm
by Giovanni
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
Re: ChibiOS/RT and external RAM
Posted: Sat May 04, 2013 8:45 pm
by Tectu
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
Re: ChibiOS/RT and external RAM
Posted: Sat May 04, 2013 8:55 pm
by Tectu
Okay, I got it finally working. Thanks for your help Giovanni and sorry for my very stupid mistake ^^
~ Tectu