Wrong OTG1 FIFO size

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

Moderator: RoccoMarco

Post Reply
daemon
Posts: 35
Joined: Tue Oct 09, 2012 1:53 pm

Wrong OTG1 FIFO size

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Wrong OTG1 FIFO size

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Wrong OTG1 FIFO size

Post by Giovanni »

Fixed as bug #437.

Giovanni
daemon
Posts: 35
Joined: Tue Oct 09, 2012 1:53 pm

Re: Wrong OTG1 FIFO size

Post by daemon »

The demo is not used, right. But my program does! :D
OK, Giovanni, thanks for confirmation.
Post Reply