2017-04-10 07:02 AM
Hi,
I am testing CAN interface on STM32F769i-Eval board.
Checked the default CAN_Loopback loopback example from the following path
STM32Cube_FW_F7_V1.6.0\Projects\STM32F769I_EVAL\Examples\CAN\CAN_LoopbackData is transmitting and receiving properly when confirmed through LED.
Other than LED confirmation,I tried to capture the CAN packets from the connector CN26.But I am not able to find CAN packets coming out from the CN26 connector.Also,Checked the default CAN_Networking example from the following path
STM32Cube_FW_F7_V1.6.0\Projects\STM32F769I_EVAL\Examples\CAN\CAN_Networkingi feel like the frame may not be getting transmitted.
Am using kvaser tool and application for seeing messages on PC and i could see errorframe messages.I am able to see the CAN packets with other device using the kvaser tool and application.So I believe Kvaser Tool and PC application is working fine in my test environment.
Is there any additional configuration is required in evk to get the CAN packets in CN26 connector?
Test Environment:
EVK(CN26)------->Kvaser Tool-------->PC(CAN packet Sniffing Application)Thanks and Regards
Rizwan Syed2017-04-10 09:15 PM
Hello,
The EVAL board is so crowded that there is no unused GPIO pin available for the can interface, so none has been configured in the loopback example.
You must configure one of the CAN_TX pin as alternate function to see its signal.
Be aware that whichever pin you choose, it is physically connected to something else, and this may impact your test.
You may have to disconnect one pin from its original function.
CubeMx may help you select the best pin for your test.
I recommend to open CubeMx > New Project > Board selector > your eval board
unfold your CAN interface and hover the red configuration with your mouse. You will see what is conflicting with the mode you want to use.
Or even better, you could try it on the nucleo-F767zi or the STM32F769I-DISCOVERY, if you own one, they have CAN pin available.
2017-04-11 01:30 AM
Hi Max,
Thanks for your reply.
PA12 is configured as CAN_TX and PA11 is configured as CAN_RX.
We verified in schematics of evaluation baord, PA12 and PA11 are connected CAN_TX and CAN_RX respectively to CN26 connector.
In stmf7xx_hal_msp.c file , the following code is configured
/* CAN1 TX GPIO pin configuration */
GPIO_InitStruct.Pin = CANx_TX_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;GPIO_InitStruct.Speed = GPIO_SPEED_FAST;GPIO_InitStruct.Pull = GPIO_PULLUP;GPIO_InitStruct.Alternate = CANx_TX_AF;HAL_GPIO_Init(CANx_TX_GPIO_PORT, &GPIO_InitStruct);
/* CAN1 RX GPIO pin configuration */
GPIO_InitStruct.Pin = CANx_RX_PIN;GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;GPIO_InitStruct.Speed = GPIO_SPEED_FAST;GPIO_InitStruct.Pull = GPIO_PULLUP;GPIO_InitStruct.Alternate = CANx_RX_AF;HAL_GPIO_Init(CANx_TX_GPIO_PORT, &GPIO_InitStruct);
Thanks and Regards
Rizwan Syed
2017-04-11 01:36 AM
Hi Max,
I got a confusion here.
Is there any concern to use STM32F769I evaluation board to do the CAN test?
I feel CAN1 signals are coming out through CN26 connector in evaluation board.
Please correct me if I am wrong.
2017-04-11 05:00 AM
No there is no problem.
Just make sure JP14 is fitted and you are not using the USB_FS interface at the same time.
They are sharing the same pins
2017-04-17 02:24 AM
Hi Max,
I am testing CAN interface on STM32F769i-Eval board.
I have created a CAN Application and i can able to receive CANpackets on the PC Application in Loopback mode.
Moreover in Loopback mode, I am unable to receive CANpackets from PC to board.
Unable to receive messages in Normal mode.How can i make transmit and receive working with Normal Mode.
Am using kvaser tool and application for seeing messages on PC.
Thanks and Regards
Rizwan Syed
2017-04-17 04:46 AM
How is JP14 on your board?
2017-04-18 03:01 AM
Hi Max,
Thanks for your reply.
Now Transmit and receive is working but when i transmit the data from PC to board only that moment, board receives the data and again board transmits the data to PC.
Otherwise data transfer does not happen.I need continuous transfer of data, so m,y code is in while(1) loop.
My understanding is, Timeout is not happening in HAL_CAN_Receive() function.
Please suggest how to proceed
Thanks and Regards
Rizwan Syed