2020-08-21 02:53 AM
Hello.
I found a bug in STM32CubeMX software which is briefly described above in the title.
After setting "Output Mode", auto-calculated "Slot Active Final Value" is set to "0x00030000".
This value is not valid and cannot be changed using the CubeMX software.
So, you should modify the "Slot Active Final Value" by opening .ioc file in text editor or modify SlotInit.SlotActive value in the generated C source code.
I found this bug affects many (presumably all) devices such as F446 and F767, and can be reproduced in many CubeMX versions including 6.0.0.
2020-10-19 09:18 AM
Hi @peterleif
Thanks for the feedback, could you please explain why this value ("Slot Active Final Value" ="0x00030000") is not valid .
Best regards,
Nesrine
2020-10-19 08:20 PM
Hi @Nesrine.JLASSI , thank you for your reply.
"Slot Active Final Value" is output to hsai.SlotInit.SlotActive, and it is used to set the SLOTEN[15:0] bits in the Slot register (SAI_ASLOTR / SAI_BSLOTR) in HAL_SAI_Init function.
stm32f7xx_hal_sai.c
hsai->Instance->SLOTR|= hsai->SlotInit.FirstBitOffset | hsai->SlotInit.SlotSize
| (hsai->SlotInit.SlotActive << 16) | ((hsai->SlotInit.SlotNumber - 1) << 8);
In the above code, lower 16 bits of hsai->SlotInit.SlotActive are copied to the value of SAI_xSLOTR[31:16] bits (which corresponds to SLOTEN[15:0]).
In the case I described in the post, the number of slots is 2 and both the slots must be activated ("Use Slot 0 and 1 only"), so SLOTEN[15:0] should be 0x0003.
However, CubeMX is setting the value to 0x00030000 and no slot is activated.
Best regards,
peterleif
2020-10-20 03:40 AM
Hello @peterleif
Thanks for your post. I have raised your feedback internally to be reviewed and treated accordingly to the priority. We will give you an update as soon as possible.
Thanks for your contribution.
Best regards,
Nesrine