Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


STM32F779I - Eval board CAN Communication

Hi All,
Currently I am working with STM32F779I - Eval Board for one of our projects. I am using the BSP and Drivers provided by STM and using STM32 Workbench as development platform. As the part of bringing-up the CAN module and validate the CAN driver for our requirements I have used the example taken from ‘STM32Cube_FW_F7_V1.8.0/Projects/STM32F769I_EVAL/Examples/CAN_Networking’. I have built the code and flashed into Eval board and I used Vector CAN tool VN1600 for testing the same. Here CAN message transmission is working as expected but reception is not happening though it is configured for all message ID’s. I have used the below configuration from the example.

/*##-1- Configure the CAN peripheral #######################################*/
CanHandle.Instance = CANx;
CanHandle.pTxMsg = &TxMessage;
CanHandle.pRxMsg = &RxMessage;

CanHandle.Init.TTCM = DISABLE;
CanHandle.Init.ABOM = DISABLE;
CanHandle.Init.AWUM = DISABLE;
CanHandle.Init.NART = DISABLE;
CanHandle.Init.RFLM = DISABLE;
CanHandle.Init.TXFP = DISABLE;
CanHandle.Init.Mode = CAN_MODE_NORMAL;
CanHandle.Init.SJW = CAN_SJW_1TQ;
CanHandle.Init.BS1 = CAN_BS1_6TQ;
CanHandle.Init.BS2 = CAN_BS2_7TQ;
CanHandle.Init.Prescaler = 4;

if(HAL_CAN_Init(&CanHandle) != HAL_OK)
{
/* Initialization Error */
Error_Handler();
}

/*##-2- Configure the CAN Filter ###########################################*/
sFilterConfig.FilterNumber = 0;
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
sFilterConfig.FilterIdHigh = 0x0000;
sFilterConfig.FilterIdLow = 0x0000;
sFilterConfig.FilterMaskIdHigh = 0x0000;
sFilterConfig.FilterMaskIdLow = 0x0000;
sFilterConfig.FilterFIFOAssignment = 0;
sFilterConfig.FilterActivation = ENABLE;
sFilterConfig.BankNumber = 14;

if(HAL_CAN_ConfigFilter(&CanHandle, &sFilterConfig) != HAL_OK)
{
/* Filter configuration Error */
Error_Handler();
}

/*##-3- Start the Transmission process #####################################*/
CanHandle.pTxMsg->StdId = 0x123;
CanHandle.pTxMsg->RTR = CAN_RTR_DATA;
CanHandle.pTxMsg->IDE = CAN_ID_STD;
CanHandle.pTxMsg->DLC = 8;

I have used the below API for CAN Reception. Configuration also done in MSPiInit();

/*##-2- Start the Reception process and enable reception interrupt #########*/
if (HAL_CAN_Receive_IT(&CanHandle, CAN_FIFO0) != HAL_OK)
{
/* Reception Error */
Error_Handler();
}

Also I have taken care the Jumper settings for the evaluation board mentioned as per the STM32F77XX user manual.
1. JP19 - 1-2 fitted ( High speed mode)
2. JP18 - Fitted ( CAN termination resistor)
3. JP14 - Fitted (PA11 connected with CAN Rx signal)

Can anyone help me to identifying the issue and sort out the problem. Please feel ask for more clarification.

Thanks

Vipin Das B

Hi All,

I just need to add few more observations which may help you all to give some clue to identify our actual issue.

As I mentioned above we are using Vactor’s CAN VN1600 tool and when we send a CAN frame from Tool to STM32 board I am getting ‘Not Acknowledge Error’ in Tool side. Similarly when we debugged the bxCAN error status register(ESR), Receive Error Count value is getting increased and CRC error bit is ‘1’.

Thanks

Vipin Das B


 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs