AnsweredAssumed Answered

[Bug] STM32CubeMX, SAI->xSLOTR, SLOTEN not shifted

Question asked by Vinci on Jan 20, 2016
Latest reply on Jan 21, 2016 by Vinci
After spending an entire morning figuring out why my SAI configuration isn't working anymore I guess I found a new bug concerning the configuration of the SLOTR register inside HAL_SAI_Init.

Prior to 1.2.0
hsai->Instance->SLOTR|=  hsai->SlotInit.FirstBitOffset |  hsai->SlotInit.SlotSize
                        | (hsai->SlotInit.SlotActive << 16) | ((hsai->SlotInit.SlotNumber - 1) <<  8);


1.2.0
hsai->Instance->SLOTR|=  hsai->SlotInit.FirstBitOffset |  hsai->SlotInit.SlotSize
                        | hsai->SlotInit.SlotActive | ((hsai->SlotInit.SlotNumber - 1) <<  8);          


The missing shift at the SlotActive parameter causes the SLOTEN value to be set to a wrong value. Maybe the shift was left out intentinally but the CubeMX tool still produces the same output for the old and the current library version.


/edit
This was like the 5th bug I reported within 6 months. You guys should put up some kind of reward system for reporting stuff and send me a coffee cup or something. :D

Outcomes