2026-06-03 12:03 AM
Hardware connection
CAN Configuration
CAN_HandleTypeDef hcan1;
/* CAN1 init function */
void MX_CAN1_Init(void)
{
/* USER CODE BEGIN CAN1_Init 0 */
/* USER CODE END CAN1_Init 0 */
/* USER CODE BEGIN CAN1_Init 1 */
/* USER CODE END CAN1_Init 1 */
hcan1.Instance = CAN1;
hcan1.Init.Prescaler = 8;
hcan1.Init.Mode = CAN_MODE_NORMAL;
hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;
hcan1.Init.TimeSeg1 = CAN_BS1_6TQ;
hcan1.Init.TimeSeg2 = CAN_BS2_3TQ;
hcan1.Init.TimeTriggeredMode = DISABLE;
hcan1.Init.AutoBusOff = DISABLE;
hcan1.Init.AutoWakeUp = ENABLE;
hcan1.Init.AutoRetransmission = DISABLE;
hcan1.Init.ReceiveFifoLocked = DISABLE;
hcan1.Init.TransmitFifoPriority = DISABLE;
if (HAL_CAN_Init(&hcan1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN CAN1_Init 2 */
CAN_FilterTypeDef canfilterconfig;
canfilterconfig.FilterBank = 0;
canfilterconfig.FilterMode = CAN_FILTERMODE_IDMASK;
canfilterconfig.FilterScale = CAN_FILTERSCALE_32BIT;
canfilterconfig.FilterIdHigh = 0x0000;
canfilterconfig.FilterIdLow = 0x0000;
canfilterconfig.FilterMaskIdHigh = 0x0000;
canfilterconfig.FilterMaskIdLow = 0x0000;
canfilterconfig.FilterFIFOAssignment = CAN_RX_FIFO0;
canfilterconfig.FilterActivation = CAN_FILTER_ENABLE;
canfilterconfig.SlaveStartFilterBank = 14;
if (HAL_CAN_ConfigFilter(&hcan1, &canfilterconfig) != HAL_OK)
{
Error_Handler();
}
/* USER CODE END CAN1_Init 2 */
}Notification is also enabled.
if (HAL_CAN_ActivateNotification(&hcan1, CAN_IT_RX_FIFO0_MSG_PENDING) != HAL_OK)
{
Error_Handler();
}Callback function
CAN_RxHeaderTypeDef gRxHeader;
uint8_t gRxData[8];
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)
{
printf("Hi from CB\r\n");
if (HAL_CAN_GetRxMessage(&hcan1, CAN_RX_FIFO0, &gRxHeader, gRxData) == HAL_OK){
printf("ID: 0x%03lX DLC: %lu Data:", gRxHeader.StdId, gRxHeader.DLC);
for (uint8_t i = 0; i < gRxHeader.DLC; i++){
printf(" %02X", gRxData[i]);
}
printf("\r\n");
}
}What Works
What Doesn't Work
I have tried changing the filter configuration still that didn't worked.
2026-06-03 1:40 AM
Hello @nikhilkrn and welcome to the ST community,
First thing to check is your hardware: the wiring: especially the bad contacts.
Second issue:
@nikhilkrn wrote:
- Node A: STM32F423RHTx, TCAN1462-Q1 transceiver, HSI→PLL→80MHz SYSCLK, 40MHz APB1, PA11/PA12
You should avoid using HSI for CAN communication in Normal mode. Use a crystal or you can face comm issues. Please refer to these articles:
CAN reception issues: Reasons and general troubleshooting
Using CAN (bxCAN) in Normal mode with STM32 microcontrollers (Part 1)
Using CAN (bxCAN) in Normal mode with STM32 microcontrollers (Part 2)
Hope that helps.
2026-06-03 3:36 AM
Hi @mƎALLEm ,
Thanks for the response. I've since switched to HSE (25 MHz crystal on PH0/PH1 with PLL: M=12, N=96, P=2 → SYSCLK=100 MHz, APB1=50 MHz, CAN Prescaler=10) — no more HSI.
After all fixes, both nodes confirmed at exactly 500 kbps. STM32 → Arduino works reliably. Register-level checks on the STM32 side show:
I have a doubt that if Transmission works then it shouldn't be hardware issue?
I have checked the articles as well still facing the same issue.
2026-06-03 3:45 AM
1- Please share your complete project
2- What are the power supply voltage levels of the TCAN1462-Q1 transceiver: VCC and VIO?
2026-06-03 4:41 AM
2026-06-03 4:43 AM
@nikhilkrn wrote:
Hi,
I have attached the project file.
Thank you for the sharing but you didn't answer my second question.
2026-06-03 4:50 AM
Hi,
VIO: 3V3
VCC: 5V
It's a custom board with stm32f423RHT6 mcu. I have tried with other transiver as well separately but still issue is same.
let me know if you need any more information.
Thanks!!
2026-06-03 4:51 AM
+
You are still pointing to HSI as clock source:
Even though the clock config in the main configures HSE as clock source for PLL:
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 12;
RCC_OscInitStruct.PLL.PLLN = 96;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
So there is a mismatch between the ioc file and main. You need to regenerate the code with HSE selected as source clock in the ioc file and retest.
2026-06-03 4:52 AM
Assuming you don't have a protocol analyser something similiar, have you tried a lower bitrate ?
2026-06-03 5:00 AM - edited 2026-06-03 5:04 AM
+
There is a mismatch in the filter config in tha attached project:
canfilterconfig.FilterBank = 0;
canfilterconfig.FilterMode = CAN_FILTERMODE_IDMASK;
canfilterconfig.FilterScale = CAN_FILTERSCALE_32BIT;
canfilterconfig.FilterIdHigh = 0x0F6<<5;
canfilterconfig.FilterIdLow = 0x0000;
canfilterconfig.FilterMaskIdHigh = 0x0F6<<5;
canfilterconfig.FilterMaskIdLow = 0x0000;
canfilterconfig.FilterFIFOAssignment = CAN_RX_FIFO0;
canfilterconfig.FilterActivation = CAN_FILTER_ENABLE;
canfilterconfig.SlaveStartFilterBank = 14;
And what you have shared in the first post:
canfilterconfig.FilterBank = 0;
canfilterconfig.FilterMode = CAN_FILTERMODE_IDMASK;
canfilterconfig.FilterScale = CAN_FILTERSCALE_32BIT;
canfilterconfig.FilterIdHigh = 0x0000;
canfilterconfig.FilterIdLow = 0x0000;
canfilterconfig.FilterMaskIdHigh = 0x0000;
canfilterconfig.FilterMaskIdLow = 0x0000;
canfilterconfig.FilterFIFOAssignment = CAN_RX_FIFO0;
canfilterconfig.FilterActivation = CAN_FILTER_ENABLE;
canfilterconfig.SlaveStartFilterBank = 14;
So please restore the first filters config:
canfilterconfig.FilterMode = CAN_FILTERMODE_IDMASK;
canfilterconfig.FilterScale = CAN_FILTERSCALE_32BIT;
canfilterconfig.FilterIdHigh = 0x0000;
canfilterconfig.FilterIdLow = 0x0000;
canfilterconfig.FilterMaskIdHigh = 0x0000;
canfilterconfig.FilterMaskIdLow = 0x0000;
Please don't post many configuration for the same issue. So it muddies the waters.
So what I suggest is to provide a complete project on which you did the final test with:
and
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.