cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 config CAN Filters

Posted on July 26, 2016 at 14:35

Hello there,

For a while now I am trying to configure the CAN filter system to work properly in STM32F4 I have managed to make the system work the way that I have 2 mask filters. Depending on which the CAN ID message is received through FIFO0 or FIFO1. So it seems to be working properly. But not quite... In the HAL CAN RX interrupt routine the filter hit is checked (FMI part from CAN_RDTxR register). Even though messages come to the proper FIFO, the FMI part is always 0. I started playing with the filter ID configuration and FMI started to change, but still it didnt reflect my configured filter number at any point. This is my configuration code:

/**
* @brief Configures the Can receiving filter.
* Filter should cover the lower part of upper 16 bit mask and filter.
* @param canData: Pointer to a can conf struct, preconfigured.
* @return HAL_OK if all ok.
*/
HAL_StatusTypeDef can_ConfigRxFilter(canData_t* canData)
{
assert_param(canData);
assert_param(canData->canHandle);
HAL_StatusTypeDef retVal = HAL_OK;
CAN_FilterConfTypeDef sFilterConfig;
// First config unicast filter
sFilterConfig.FilterNumber = canData->objectId;
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
// TML CAN
uint32_t EXID = canData->canAxisId << 
13
;
uint32_t 
STID
= 
EXID
& 0x7FF;
uint32_t 
EXMASK
= 
0xFF
<< 13;
uint32_t 
STMASK
= 
EXMASK
& 0x7FF;
sFilterConfig.FilterIdHigh = (uint16_t)(((STID << 5) & 0xFFE0) | ((EXID >> 13) & 0x001F));
sFilterConfig.FilterIdLow = (uint16_t)(((EXID << 
3
) & 0xFFF8));
sFilterConfig.FilterMaskIdHigh = (uint16_t)(((STMASK << 5) & 0xFFE0) | ((EXMASK >> 13) & 0x001F));
sFilterConfig.FilterMaskIdLow = (uint16_t)(((EXMASK << 
3
) & 0xFFF8));
sFilterConfig.FilterFIFOAssignment
= 
canData
->canRxFifo;
sFilterConfig.FilterActivation = ENABLE;
sFilterConfig.BankNumber = 0;
retVal += HAL_CAN_ConfigFilter(canData->canHandle, &sFilterConfig);
assert_param(!retVal);
return retVal;
}

This function is run twice. Once for canData->objectId = 0 (received message should have FMI = 0) and once for canData->objectId = 1 (FMI should be 1). Maybe it has something to do with the BankNumber, this is not very clear for me. I would appreciate all help regarding the configuration.
23 REPLIES 23
Posted on July 27, 2016 at 09:29

Do you know where I can find the 3rd party IP documentation? I cant seem to find it by simply googling, are you sure its available? I am starting to wonder either this isnt a case for ST support, as this mechanism seems not to be working correctly, or at least its very badly documented. Are you able to commit a ticket? For me the service is down:

/content/my_st_com/en/support/online-support.html

EDIT: I have hyperlinked the link. Could you check now?

I have to say i tried configuring those filters and fifo's expirementally and I really cant find any logical pattern.

Posted on July 27, 2016 at 10:42

Define available, the vendor may have terms and conditions to providing you support/documentation. I don't expect it to be free or openly accessible.

I don't use the support ticket system, I have an FAE, and I can't cut-n-paste links on mobile devices, you'll have to inline the cite properly.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 27, 2016 at 17:34

Submission choking with

One or more fields are invalid.

'Submitted by' has an invalid selection. Please select a valid value to complete this transition.

Will push to moderation

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 27, 2016 at 17:47

Attaching screen shot here as I can't do that in the moderation dialog.

________________

Attachments :

ticketsubfail002.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0n5&d=%2Fa%2F0X0000000bdh%2FGmH.Qu6bsGtbulytn9_iZHdTHZ80xZRvIfkfE3MovVY&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 27, 2016 at 19:35

Thank you very much.

Kersten HEINS
Associate III
Posted on July 28, 2016 at 10:59

our Online Support system is heavily in use and works fine - usually. I just double-checked with an external test account. But for sure I am very interested to understand how to reproduce mentioned problem and below mentioned error message. Can you please provide more info. That would help.

Thank you,

Kersten.

Posted on July 28, 2016 at 14:10

Im not sure either I can give you any more info, you would have to tell me what to check exacly. All I do is click ''Submit Request'' on this site :

/content/my_st_com/en/support/online-support.html

Then I am getting redirected to page looking like this:

https://www.dropbox.com/s/rwa09gv4cdrw666/Zrzut%20ekranu%202016-07-28%png?dl=0

Address of this page is:

/idp/login?wa=wsignin1.0&wreply=https://my.st.com/tmtrack/tmtrack.dll?ProjectPage%26Template%3Dsubmit%26ProjectId%3D9%26TableId%3D1011%26TransitionId%3D0%26CopyTableId%3D0%26CopyRecordId%3D0%26PostTransitionId%3D0%26forceshell&wctx=2023:-1404596035&wct=2016-07-28T12:08:302Z&wtrealm=uri:org:eclipse:alf:sso:relyingparty:anonymous:anonymous:anonymous&gsid=88e45cace19944dcb3b2dd6b0ac49eeb&xid=4badcf7f-5789-4208-a15b-ebb01ebb75c3&catalog=http://eun1p2-fe.stp-prod.st.com:8180/tmtrack/tmtrack.dll?AnonymousUse%26template%3dssocatalog.jsvar

Please let me know either you need more info.
Posted on July 28, 2016 at 15:42

I was using Chrome on a Windows PC, I was logged into the forum/myST, and went to the online support link provided earlier.

I got to the ticket input, completed that, and when I tried to submit it would keep failing on a field it doesn't show, and that I can't change. Screen shot attached to prior post. Earlier attempts had rejected codes and customer data, and fields appear/disappear in some managed but non-obvious ways.

You'd want to review the server side logs to understand why it rejected the submission, the metric you want to focus on is the number of abandoned/rejected submissions, rather than the ones that are successful.

There really needs to be a ''submit with flaws'' option, so instead of getting stuck in a ''Computer Says No'' loop, someone familiar with the tools, and more visibility, can fix the ticket.

My general experience with the assorted ST online portals is pretty grim, at times it tries to be far too clever and fails at basic functionality/usability.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 02, 2016 at 10:08

Hi, any news regarding this issue?

Posted on August 02, 2016 at 17:35

Well zero from my side, I've had no interaction from ST staff. You'd perhaps want to cultivate a relationship with your local ST Sales and FAEs.

I have submitted a ticket this morning, cutting and pasting content from the original attempt into a new/fresh window on FireFox, seemed to go through.

TECH021772

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..