AnsweredAssumed Answered

STM32F0 CAN with STM32Cube HAL

Question asked by mamonov.sergey on Feb 2, 2015
Latest reply on Feb 4, 2015 by mamonov.sergey
Help me, please.
I've got STM32F042K6T6.

I generated project for IAR with STM32Cube. I need use CAN-BUS in my device but i can't, cause it doesn't work.

I have CAN transmission in Infinite loop with 100ms delay. First 3 transmissions return timeout error ( /* Check End of transmission flag */ while(!(__HAL_CAN_TRANSMIT_STATUS(hcan, transmitmailbox)))). And then i haven't anymore mailboxes and HAL_CAN_Transmit returns HAL_CAN_STATE_ERROR. I have tested all CAN modes: CAN_MODE_NORMAL, CAN_MODE_LOOPBACK etc. I have got CAN driver SN65HVD233DR.

I attach a main.c file to the message.

And i see nothing on CAN_TX pin with oscilloscope - only 3.2 Volt.

What i'm doing wrong? Help me please!