2016-11-24 03:52 AM
Hi,
i have a little problem on Can program.If you call HAL_CAN_Init and after HAL_CAN_Deinit, when you call again HAL_CAN_Init, the function ''HAL_CAN_Init'' return always Timeout on CAN1.Its a bug ?And i found this bug on file * @file stm32f1xx_hal_can.c * @author MCD Application Team * @version V1.0.4 * @date 29-April-2016on function HAL_StatusTypeDef HAL_CAN_Transmit_IT(CAN_HandleTypeDef* hcan)if you enter in this function, and you have CAN_TXSTATUS_NOMAILBOX, when you exit from, you will have the state of your can LOCKED.Is missing the part with else{ unlock// return error// and other }Sorry for my english2016-11-29 08:36 AM
Hi macro,
I think It's related to a lock/unlock mechanism issue in the Cube library like this
. This process is under review and a rework will be implemented. Meanwhile,the best approach would be simply removing the call to the lock and unlock in these two drivers as no critical section lock is really required for these drivers.
-Hannibal-
2016-11-29 09:12 AM
Ok,
for lock i have already correct the parts and now work all, but about Init, Deinit and Init ? Where is the problem ?I not find the error....