issues with memory pool

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
golb
Posts: 8
Joined: Mon Nov 21, 2016 9:11 pm

issues with memory pool

Post by golb »

hello I am trying to configure a memory pool in chibios,

however I keep getting this error every time I try to build the project:
Description Resource Path Location Type
unknown type name 'MemoryPool' main.c /Proyecto_Micro line 17 C/C++ Problem

this is the section of my code where the error is popping up:

Code: Select all

typedef struct {
  adcsample_t Sample[ADC_NUM_CHAN*ADC_BUFFER_DEPTH];
} ADC_Conversion;

MemoryPool Conv_pool;

ADC_Conversion Conv_Sample[MB_BUFFER_SIZE];


I know from reading other forums that I am supposed to align my structure to the stack, however that too was giving me an error...
I am clueless on how to do this properly, could someone pls help me figure this out.
Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: issues with memory pool

Post by Marco »

Hi,

What version of ChibiOS are you using? In 16.1.5 the type for a memory pool is memory_pool_t, not MemoryPool. I think MemoryPool was renamed to memory_pool_t when moving from version 2.6.x to 3.0.x.

Marco
golb
Posts: 8
Joined: Mon Nov 21, 2016 9:11 pm

Re: issues with memory pool

Post by golb »

while looking through the .h on my projects I found: "chmempools.h" and found out that it is indeed as you just pointed out, some function names have also changed..

I fixed the code, and I'm going to try it out now.

thank you very much.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: issues with memory pool

Post by Giovanni »

Hi,

Some migration notes from 2.6.x are in this article:

http://www.chibios.org/dokuwiki/doku.ph ... rom_2_to_3

Giovanni
golb
Posts: 8
Joined: Mon Nov 21, 2016 9:11 pm

Re: issues with memory pool

Post by golb »

Thank you for you help yesterday guys.

I was wondering if there was a function that allowed me to know the amount of free objects in the pool...
I've been trying to check this using sizeof, but thinking about it more deeply, it wouldnt really give me any useful information regarding the amount of
free objects in the pool.

thanks in advance for you help.
Post Reply