Page 1 of 1

Wrong OTG1 FIFO size

Posted: Sun Nov 03, 2013 9:04 pm
by daemon
Hello!

In STM32F4 reference manual we read that OTG_FS FIFO size is 1.25 kBytes which is 320 bytes.
But in stm32_otg.h we see:

Code: Select all

/**
 * @brief   OTG_FS FIFO memory size in words.
 */
#define STM32_OTG1_FIFO_MEM_SIZE        384

(chibios-2.6.1)

which is: 384 * 4 / 1024 = 1.5 kBytes.
The question is: WHY?

Incorrect memory allocation could result in an unpredictable behavior, isn't it?

Re: Wrong OTG1 FIFO size

Posted: Sun Nov 03, 2013 9:14 pm
by Giovanni
Hi,

You are correct, it is a bug. It does not have impact because the constant is only used to check the upper limit and none of the demo uses all the available memory.

Thanks for finding, I will open a ticket about this one.

Giovanni

Re: Wrong OTG1 FIFO size

Posted: Sun Nov 03, 2013 9:25 pm
by Giovanni
Fixed as bug #437.

Giovanni

Re: Wrong OTG1 FIFO size

Posted: Sun Nov 03, 2013 9:26 pm
by daemon
The demo is not used, right. But my program does! :D
OK, Giovanni, thanks for confirmation.