公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JQ
Level 1
Level 1
Distributor - Future(GC)
10 replies posted 5 comments on blog First comment on blog

我使用filter接收报文放入rxbuff,可以接受ID0x1234568, 如果接收ID 0x1234569 MCU会死机,配置如下,请问哪里配错了

g_mcmcan.canNodeConfig.filterConfig.standardListSize = 1; //Standard Frame
g_mcmcan.canNodeConfig.filterConfig.extendedListSize = 16; //Extended Frame
g_mcmcan.canNodeConfig.filterConfig.messageIdLength = IfxCan_MessageIdLength_extended;

g_mcmcan.canNodeConfig.messageRAM.standardFilterListStartAddress = 0x0;
g_mcmcan.canNodeConfig.messageRAM.extendedFilterListStartAddress = 0x80;
g_mcmcan.canNodeConfig.messageRAM.rxFifo0StartAddress = 0x100;
g_mcmcan.canNodeConfig.messageRAM.rxFifo1StartAddress = 0x200;
g_mcmcan.canNodeConfig.messageRAM.rxBuffersStartAddress = 0x300;
g_mcmcan.canNodeConfig.messageRAM.txEventFifoStartAddress = 0x400;
g_mcmcan.canNodeConfig.messageRAM.txBuffersStartAddress = 0x440;
g_mcmcan.canNodeConfig.messageRAM.baseAddress = MODULE_CAN0_RAM;

g_mcmcan.canFilter.number = 7;
g_mcmcan.canFilter.elementConfiguration = IfxCan_FilterElementConfiguration_storeInRxBuffer;
g_mcmcan.canFilter.id1 = (uint32)0x1234568;
g_mcmcan.canFilter.rxBufferOffset = IfxCan_RxBufferId_7;
IfxCan_Can_setExtendedFilter(&g_mcmcan.can00Node, &g_mcmcan.canFilter);

g_mcmcan.canFilter.number = 8;
g_mcmcan.canFilter.elementConfiguration = IfxCan_FilterElementConfiguration_storeInRxBuffer;
g_mcmcan.canFilter.id1 = (uint32)0x1234569;
g_mcmcan.canFilter.rxBufferOffset = IfxCan_RxBufferId_8;
IfxCan_Can_setExtendedFilter(&g_mcmcan.can00Node, &g_mcmcan.canFilter);

0 点赞
8 回复数
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received
0 点赞
JQ
Level 1
Level 1
Distributor - Future(GC)
10 replies posted 5 comments on blog First comment on blog

Hi dw

          I set 64 ID messages and filtered them into 64 RXBUFFs. I found that buff0-buff7 and buff32 buff39 can receive them, but rxbuff8-buff31 and rxbuff40-buff63 cannot receive them. I used CAN0 NODE0 to test , whether node0 has 64 rxbuffs or whether node0-4 shares 64 rxbuffs, thanks.

0 点赞
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

1. Each node has its own FIFO0 and FIFO1. Both FIFO0 and FIFO1 can store up to 64 elements. You can find more details in the user manual, specifically in Chapter 40, Section 3.2.4.2 titled "Rx FIFOs." To configure these Rx FIFOs, you use registers RXF0Ci (where i ranges from 0 to 3) for RXF0 and RXF1Ci (where i ranges from 0 to 3) for RXF1.

2. The M_CAN system can use up to 64 dedicated Rx Buffers. You set the starting address for this section using RXBCi (where i ranges from 0 to 3) and RBSA. Each Rx Buffer needs to be configured with a Standard or Extended Message ID Filter Element.

3. You can utilize 64 buffers for all the nodes. See below code snippet:

 IfxCan_RxBufferId bufferId = IfxCan_RxBufferId_0;

 

0 点赞
JQ
Level 1
Level 1
Distributor - Future(GC)
10 replies posted 5 comments on blog First comment on blog

Is it Node0-4 sharing 64 dedicated Rx Buffers, or does Node0 have 64 dedicated Rx Buffers?

0 点赞
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Every node has a property called .rxBuffersStartAddress, which implies that there are 64 buffers allocated for each node. See this function: IfxCan_Node_getRxBufferElementAddress

0 点赞
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Below addresses should be modified to fit your need.

        .messageRAM                                  = {
            .baseAddress                    = (uint32)&MODULE_CAN0,
            .standardFilterListStartAddress = 0x0,
            .extendedFilterListStartAddress = 0x80,
            .rxFifo0StartAddress            = 0x100,
            .rxFifo1StartAddress            = 0x200,
            .rxBuffersStartAddress          = 0x300,
            .txEventFifoStartAddress        = 0x400,
            .txBuffersStartAddress          = 0x440
        }, 
0 点赞
JQ
Level 1
Level 1
Distributor - Future(GC)
10 replies posted 5 comments on blog First comment on blog

JQ_0-1701148624301.png

Hi DW:JQ_1-1701148672137.png

one node (128+128+1152+1152+1152+64+576)*4=4352*4=17408byte

four node=17408byte*4=69632byte

but I find RAM SIZE IN BYTE IS 32768,  How to calculate 32768 bytes for 4 nodes, thanks.

 

0 点赞
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Hello JQ, if the RAM is limited, it implies that we won't be able to accommodate all the elements. Suggest to adjust the size of RAM to fit the actual need.

0 点赞