2021-04-05 05:30 AM
Hello,
I am working with the CAN peripheral on the STM8AF5288.
When I was using the standard peripheral library (delivered by STM) I found a fault in the code. It is about the STSW-STM8069 with version 2.3.1. (https://www.st.com/en/embedded-software/stsw-stm8069.html)
The fault is in line 880 of the file stm8s_can.c.
The assert_param will validate the uint8_t variable if it is <= to DLC_MAX.
DLC_MAX is a value of 0x08. So the values 0, 1, 2, 3, 4, 5, 6, 7 and 8 are valid.
The 8 must not be valid because it will return _Data[8] and that is out of range of the array __IO uint8_t _Data[8] = {0} from line 46.
Hopefully this fault will be adjusted in a new version release.
Kind regards,
Birdo
2021-04-07 12:18 AM
I'm afraid ST will not fix anything for the STM8 line anymore. It look as if they have abandoned it.