A Patch For FlexCAN RX FIFO ID table structure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

A Patch For FlexCAN RX FIFO ID table structure

A Patch For FlexCAN RX FIFO ID table structure

There was a macro definition issue in the flexcan driver of ksdk 2.0, the macros of RX_FIFO_STD_MASK_TYPE_B/C were defined based on maco FLEXCAN_ID_STD(id), for example:

#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH(id, rtr, ide) \
(((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \
(FLEXCAN_ID_STD(id) << 16)) /**< Standard Rx FIFO Mask helper macro Type B upper part helper macro. */

but FLEXCAN_ID_STD(id) is defined for flexCAN Message Buffer structure, so FLEXCAN_ID_STD(id)  is a value of "id" left-shifted by 18,  according to the spec.

169566_169566.pngpastedImage_1.png

while for RX FIFO ID table structure, the spec of Type B/C is different.

169567_169567.pngpastedImage_2.png

169568_169568.pngpastedImage_3.png

so we should use the value of id directly to define the type B and type C Rx Frame Identifier. For example,

#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH(id, rtr, ide) \
(((uint32_t)((uint32_t)(rtr) << 31) | (uint32_t)((uint32_t)(ide) << 30)) | \
((id & 0x7FF) << 19)) /**< Standard Rx FIFO Mask helper macro Type B upper part helper macro. */

 

This patch doesn't affect FlexCAN operation related with message buffers , neither with RX FIFO A type ID table.

 

Please kindly refer to the attachment for details.

 

Sorry for the inconvenience that has caused.

 

-Kan

Labels (1)
Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-1104136%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EA%20Patch%20For%20FlexCAN%20RX%20FIFO%20ID%20table%20structure%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1104136%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThere%20was%20a%20macro%20definition%20issue%20in%20the%20flexcan%20driver%20of%20ksdk%202.0%2C%20the%20macros%20of%20RX_FIFO_STD_MASK_TYPE_B%2FC%20were%20defined%20based%20on%20maco%20FLEXCAN_ID_STD(id)%2C%20for%20example%3A%3C%2FP%3E%3CP%3E%23define%20FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH(id%2C%20rtr%2C%20ide)%20%5C%20%3CBR%20%2F%3E%20(((uint32_t)((uint32_t)(rtr)%20%26lt%3B%26lt%3B%2031)%20%7C%20(uint32_t)((uint32_t)(ide)%20%26lt%3B%26lt%3B%2030))%20%7C%20%5C%20%3CBR%20%2F%3E%20(FLEXCAN_ID_STD(id)%20%26lt%3B%26lt%3B%2016))%20%2F**%26lt%3B%20Standard%20Rx%20FIFO%20Mask%20helper%20macro%20Type%20B%20upper%20part%20helper%20macro.%20*%2F%3C%2FP%3E%3CP%3Ebut%20FLEXCAN_ID_STD(id)%20is%20defined%20for%20flexCAN%20Message%20Buffer%20structure%2C%20so%20FLEXCAN_ID_STD(id)%26nbsp%3B%20is%20a%20value%20of%20%22id%22%20left-shifted%20by%2018%2C%26nbsp%3B%20according%20to%20the%20spec.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22169566_169566.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22169566_169566.png%22%20style%3D%22width%3A%20658px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117422iD77EC09DAE437D1D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22169566_169566.png%22%20alt%3D%22169566_169566.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_1.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_1.png%22%20style%3D%22width%3A%20658px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F23358i764EC2F3E8E1690B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_1.png%22%20alt%3D%22pastedImage_1.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ewhile%20for%20RX%20FIFO%20ID%20table%20structure%2C%20the%20spec%20of%20Type%20B%2FC%20is%20different.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22169567_169567.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22169567_169567.png%22%20style%3D%22width%3A%20662px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117423iE498BBC590A6888D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22169567_169567.png%22%20alt%3D%22169567_169567.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_2.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_2.png%22%20style%3D%22width%3A%20662px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F8866i678CD7FC41FF56EE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_2.png%22%20alt%3D%22pastedImage_2.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22169568_169568.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22169568_169568.png%22%20style%3D%22width%3A%20646px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117424iBA2B2F40D58F606A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22169568_169568.png%22%20alt%3D%22169568_169568.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_3.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_3.png%22%20style%3D%22width%3A%20646px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F8903i30B5FFADA998DC0C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_3.png%22%20alt%3D%22pastedImage_3.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Eso%20we%20should%20use%20the%20value%20of%20id%20directly%20to%20define%20the%20type%20B%20and%20type%20C%20Rx%20Frame%20Identifier.%20For%20example%2C%3C%2FP%3E%3CP%3E%23define%20FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH(id%2C%20rtr%2C%20ide)%20%5C%20%3CBR%20%2F%3E%20(((uint32_t)((uint32_t)(rtr)%20%26lt%3B%26lt%3B%2031)%20%7C%20(uint32_t)((uint32_t)(ide)%20%26lt%3B%26lt%3B%2030))%20%7C%20%5C%20%3CBR%20%2F%3E%20((id%20%26amp%3B%200x7FF)%20%26lt%3B%26lt%3B%2019))%20%2F**%26lt%3B%20Standard%20Rx%20FIFO%20Mask%20helper%20macro%20Type%20B%20upper%20part%20helper%20macro.%20*%2F%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20patch%20doesn't%20affect%20FlexCAN%20operation%20related%20with%20message%20buffers%20%2C%20neither%20with%20RX%20FIFO%20A%20type%20ID%20table.%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20kindly%20refer%20to%20the%20attachment%20for%20details.%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%20for%20the%20inconvenience%20that%20has%20caused.%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-Kan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1104136%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EGeneral%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
No ratings
Version history
Last update:
‎11-15-2016 07:10 PM
Updated by: