This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Expert,
I try to understand Message RAM Configuration in MCAN. Also, try to understand the setting from example code.
please help clarify few questions below.
from example, mcan_message_rx_tcan114x_LP_MSPM0G3507_nortos_ticlang
1. why TX buffer start address is 148? Filter starts from 0 and filter needs memory from 0-147?
2. follow previous question. Why i increase 1 "Number of Dedicated Transmit Buffers", end address increases 6( 6 32bit)? But the element size is 64 bytes.
3. Same question as above. If I increase\ decrease 1 from Number of RX FIFO0 Elements, End Address will increase\ decrease. but But the element size is 8 byte data field(2 32bits). As I know, it should be 2(R0+R1)+2(data field)=4,right?
4. from the code, start address is divided by 4. From TRM, it should be 32bits address. Why?
HW_WR_FIELD32(&mcan->MCANSS.MCAN.MCAN_RXF0C, MCAN_RXF0C_F0SA,
(msgRAMConfigParams->rxFIFO0startAddr >> 2U));
BR,
frank
Hi,
1. why TX buffer start address is 148? Filter starts from 0 and filter needs memory from 0-147?
The standard filter takes 4 address and extended filter takes 8 address. It is just a demo to use 148 for the TX buffer here. You can modified it.
2. follow previous question. Why i increase 1 "Number of Dedicated Transmit Buffers", end address increases 6( 6 32bit)? But the element size is 64 bytes.
I do not think this end address is related to the element size. Please check 20.4.19.1 Message RAM Configuration in TRM for more details. Same for question 3 and 4.
https://www.ti.com/lit/ug/slau846a/slau846a.pdf
Best regards,
Cash Hao
Cash,
for 1, you mean that I can set TX MSG RAM address to 8 due to filter only use 2*4 = 8.
for 2, from trm, address increases with each section. So, end address should be relative element size, right?
BR,
frank
Hi,
For 1, Yes, you can do that. For current version sysconfig, the information shows on the Sysconfig of the filter end address is not correct. This will be fixed in the coming version.
For 2, I look into how does the end address get calculate.
txBufEndAddr = txStartAddr + (txBufNum+txFIFOSize)*6;
In the equation, Number of Dedicated Transmit Buffers is txBufNum, and No of TX FIFO Elements is txFIFOSize. It is not relative to element size.
Best regards,
Cash Hao
cash,
Can you show me where I can find the equation below and 6 stands for?
txBufEndAddr = txStartAddr + (txBufNum+txFIFOSize)*6;
BR,
Frank
You can find it in <MSPM0_SDK>/source/ti/driverlib/.meta/MCAN.js.
Best regards,
Cash Hao
Cash,
Can you explain why it's 6
txBufEndAddr = txStartAddr + (txBufNum+txFIFOSize)*6;
BR,
frank
Hi Frank,
I do not know why it is 6. However, I do not think you need to concern about how it gets calculated. You just need to avoid overlapping the address based on the end address result given by the sysconfig.
Best regards,
Cash Hao