Search found 8 matches

by Methanbombe
Wed Mar 30, 2016 7:39 pm
Forum: ChibiOS/RT
Topic: Mailbox - How to pass a pointer correct
Replies: 11
Views: 2432

Re: Mailbox - How to pass a pointer correct

FUUUUUUUUUCK

I AM THE BIGGEST POSSIBLE MORON ON THE EARTH :'(

the problem was that I defined the OutputMessage struct below the Pool_Buffer, and gcc didn't know the size of the struct...

Moved it 5 lines up and now it's working :/

Thanks for your help anyways :)

Methanbombe
by Methanbombe
Wed Mar 30, 2016 6:45 pm
Forum: ChibiOS/RT
Topic: Mailbox - How to pass a pointer correct
Replies: 11
Views: 2432

Re: Mailbox - How to pass a pointer correct

What you receive from chMbxFetch() is the pointer to your structure so you need to declare: OutputMessage *current; Yes I have already changed it to a Pointer. Pool_Buffer contains 128 "pointers to OutputMessage" (sizeof each of the 128 things is the size of the pointer). But in the chPoo...
by Methanbombe
Wed Mar 30, 2016 6:28 pm
Forum: ChibiOS/RT
Topic: Mailbox - How to pass a pointer correct
Replies: 11
Views: 2432

Re: Mailbox - How to pass a pointer correct

Could this be the problem: OutputMessage* Pool_Buffer[OUTPUT_BUFFER_LEN] __attribute__((aligned(sizeof(stkalign_t)))); Because I only have an array of Pointers to OutputMessages? But when I try: OutputMessage Pool_Buffer[OUTPUT_BUFFER_LEN] __attribute__((aligned(sizeof(stkalign_t)))); which should b...
by Methanbombe
Wed Mar 30, 2016 6:07 pm
Forum: ChibiOS/RT
Topic: Mailbox - How to pass a pointer correct
Replies: 11
Views: 2432

Re: Mailbox - How to pass a pointer correct

BTW your pool code looks a bit fishy to me: Pool_Buffer contains 128 "pointers to OutputMessage" (sizeof each of the 128 things is the size of the pointer). But in the chPoolObjectInit call you declare that each item in the pool has sizeof(OutputMessage) I know that the code is not aesthe...
by Methanbombe
Wed Mar 30, 2016 4:59 pm
Forum: ChibiOS/RT
Topic: Mailbox - How to pass a pointer correct
Replies: 11
Views: 2432

Re: Mailbox - How to pass a pointer correct

The second parameter to chMBFetch should a pointer to the thing you want to receive. You want to receive a pointer. Correct, the message parameter must be a pointer. It is guaranteed that msg_t is large enough to contain a pointer. Giovanni Yes but my actual problem is, that the pointer, when I rec...
by Methanbombe
Wed Mar 30, 2016 12:06 pm
Forum: ChibiOS/RT
Topic: Mailbox - How to pass a pointer correct
Replies: 11
Views: 2432

Re: Mailbox - How to pass a pointer correct

Also here is the code, if it helps.
by Methanbombe
Wed Mar 30, 2016 11:50 am
Forum: ChibiOS/RT
Topic: Mailbox - How to pass a pointer correct
Replies: 11
Views: 2432

Mailbox - How to pass a pointer correct

Hello again, Still having trouble with my own incompetence. So I want to pass data from one thread to another. There for I have declared a Mailbox and initialized it. /* * Initialize Mailbox */ mailbox_t Output_Queue; msg_t Output_buf[128]; chMBObjectInit(&(Output_Queue), Output_buf, 128); The d...
by Methanbombe
Sat Mar 26, 2016 9:46 pm
Forum: ChibiOS/HAL
Topic: Serial over USB - chnWrite Topic is solved
Replies: 1
Views: 937

Serial over USB - chnWrite Topic is solved

Hello, This is my first post on this Forum and i'm not that experienced with MC-Programming, so please be gentle. My setup is: - STM32F4 Discovery - ChibiStudio with Kernel Version 3.1.3 I am trying to implement a Virtual Com Port via Serial over USB, so I can log what's happening on my board. So fa...

Go to advanced search