cancel
Showing results for 
Search instead for 
Did you mean: 

HSE Clock for CAN

Aashritha_Vuda
Associate II

Tested CAN on STM32h723ZGT6 using internal clock i.e., HSI ,which is working fine. When I tried to test it using external clock i.e., HSE with same configuration I am unable to get data on BUS-Analyzer. When I try to transmit the data, the data is able to store in the RAM and even transmit handler is hit. But unable to get data on BUS.

I am using crystal oscillator with 12MHz frequency, baudrate 500k, clock frequency to CAN is 8MHz and all the remaining configurations are as seen in the image below.

 

 

Thank you and best Regards,

Aashritha V.

 

Capture.PNG

6 REPLIES 6
SofLit
ST Employee

Hello,

Need to check again your bitrate when you switched from HSI to HSE.

PS: it's not recommended to use HSI for CAN communication.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

LED, SPI are working with external clock. There is only issue with CAN. 

HSE is ON in the driver generated even then I am getting issue in transmission. I am able to transmit but unable to get on BUS.

Capture1.PNG

1- Please use </> button to paste the code instead of sharing screen shots. See this link.

2- Sorry I didn't understand, are you using CubeMx to generate the configuration or are you coding the config yourself? if the second case, I suggest you to generate the code with CubeMx, test it, if it's OK, you can inspire from the register configuration from the HAL.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

I generated the code using cubeMX and I even generated separate builds for both internal and external clocks with same configurations as above and same baudrate 500k, it's working fine with internal clock but not external clock.

Thank you,
Aashritha V.

Could you please share your ioc file?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.
SofLit
ST Employee

Another question regarding this statement:


@Aashritha_Vuda wrote:

Tested CAN on STM32h723ZGT6 using internal clock i.e., HSI ,which is working fine. When I tried to test it using external clock i.e., HSE with same configuration I am unable to get data on BUS-Analyzer. When I try to transmit the data, the data is able to store in the RAM and even transmit handler is hit. But unable to get data on BUS.


What do you mean by Bus analyzer? a CAN analyzer (CAN to USB converter)? did you establish a complete CAN bus with CAN_H and CAN_L that connect two nodes?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.