Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


CAN Filter Setup for F091

I’m using HAL functions for STM32F091CC.
When CAN Filter is disabled, all the messages are received,
When CAN Filter is setup and enabled, only the global addressed message is received.

It works fine for STMF103CB.

Here is the function to setup the CAN filter for F091CC.

HAL_StatusTypeDef MX_CAN_Config(void)
{
CAN_FilterConfTypeDef sFilterConfig;

/* Configure the CAN Filter 0 for FIFO 0 with node id=0x02 */
sFilterConfig.FilterNumber = 0;
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
sFilterConfig.FilterIdHigh = (uint32_t)0x02 & 0x3F80;
sFilterConfig.FilterIdLow = 0;
sFilterConfig.FilterMaskIdHigh = 0x3F80;
sFilterConfig.FilterMaskIdLow = 0;
sFilterConfig.FilterFIFOAssignment = CAN_FIFO0;
sFilterConfig.FilterActivation = ENABLE;
sFilterConfig.BankNumber = 1;

if(HAL_CAN_ConfigFilter(&hcan, &sFilterConfig) != HAL_OK)
{
return HAL_ERROR;
}
/* Configure the CAN Filter 1 FIFO 0 for global id */
sFilterConfig.FilterNumber = 1;
sFilterConfig.FilterIdHigh = 0;
sFilterConfig.FilterFIFOAssignment = CAN_FIFO0;

if(HAL_CAN_ConfigFilter(&hcan, &sFilterConfig) != HAL_OK)
{
return HAL_ERROR;
}

// set buffer pointers
hcan.pTxMsg = &TxMessage;
hcan.pRxMsg = &RxMessage;
/* Configure Transmission process */
hcan.pTxMsg->RTR = CAN_RTR_DATA;
hcan.pTxMsg->IDE = CAN_ID_EXT;
hcan.pTxMsg->DLC = 0;
// enable can rx with interruptions
HAL_CAN_Receive_IT(&hcan, CAN_FIFO0);
HAL_CAN_Receive_IT(&hcan, CAN_FIFO1);

return HAL_OK;
}