ChibiOS/RT and external RAM

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

User avatar
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

Post by Giovanni »

My bad, it should be:

static MemoryHeap ext_heap
chHeapInit(&ext_heap, (void*)0x60000000, 10240);

See testheap.c

Giovanni
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: ChibiOS/RT and external RAM

Post 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
User avatar
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

Post 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
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: ChibiOS/RT and external RAM

Post 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
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: ChibiOS/RT and external RAM

Post by Tectu »

Okay, I got it finally working. Thanks for your help Giovanni and sorry for my very stupid mistake ^^


~ Tectu
Post Reply