Hi,
If 8 data byte payload size is used then four EmbeddedRAMx words represents single Message Buffer, as following for MB0
MB1 belongs to EmbeddedRAM4-7, and so on...
I have modified the CAN_MASTER_example to enable the RXFIFO. You can test it on the EVB.
The internal loopback is enabled so single board can be used. The MB8 is used to send a message upon button press and is received through RXFIFO.
Hope it helps.
Hi Petr,
I have another issue about flexcan on s32k144, can you help to resolve?
Hello,
I have gone through the Discussion,
I need help on the FleXCAN details are,
I'm working on S32K144 MCU for My TPMS Application, My requirement to use the CAN with Extended the ID Format,
For Startup, I have used the Non-SDK FlexCAN Example to test the CAN Communication(MCU CAN_TX Pin) transmission, But unfortunately, this example Not working on EVB.
I can't see ant Data format signal with a scope, I have tapped the MCU CAN_TX Line.
Testing example found the CookBook documents Number: AN5413
Note: My Project used Non-SDK.
Please help me with this issue.
Thanks,
Sakthivel K
Hello,
which version of S32DS you use? Did you try to open it in version 1.3?
I have just tested in 1.3 and it works correct on my side. Could you please try to import project once again, clean project at first and then compile?
Have you already installed Update1? If no, could you please try to install and test the project once again?
https://community.nxp.com/docs/DOC-333898
Regards,
Martin
Hi,
After update S32 DS V1.3, and change SDK path, it works. But I have another problem when I use interrupt mode.
It can enter RX interrupt function every time, but it only sends out data in the first time. From second time, no data is sent out.
Would you pls help check my attached example?
Also, Is there any example to guide me how to use RX FIFO? How can I know which MBx is stored, and how to do it?
Thanks a lot!
Hi Petr,
I also modified CAN examples to work in FIFO mode. It works, but I see unexpected data byte swapping/reversing in every 4 byte group on the receiving side in RX FIFO.
I send 8 bytes: 0,1,2,3,4,5,6,7.
In RX FIFO I see: 3,2,1,0,7,6,5,4.
Did you see anything like that with your code and board?
PS: I do not see that problem in normal mailbox mode (without FIFO).
My changes to the example project are very similar to yours, but I do not use loopback. I use another board to transmit instead.
Also noticed you have ".fd_enable = true" in SendCANData(), but maybe it is ignored by driver since module is not in FD mode.
Thanks,
Mikhail
Hi Mikhail,
The module itself does not do any byte swapping.
Seems the API itself does swapping. See how the receive buffer is filled from MBx or RXFIFO in functions FLEXCAN_HAL_ReadRxFifo() and FLEXCAN_HAL_GetMsgBuff().
Note the S32K144 is little endian device.
Here is a memory map when
uint8_t txBuffer[8] = {0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88};
is send with
SendCANData(TX_MAILBOX, TX_MSG_ID, &txBuffer[0], 8UL);
using the MB8
The debugger is stopped in FLEXCAN_DRV_IRQHandler, the RXFIFO is at address 0x40024080
I see no byte swap in RXFIFO. data from MB8 is received in the same order as it should.
The same memory window from S32DS
BR, Petr
Hi Petr,
You are right!
In FLEXCAN_HAL_GetMsgBuff() they use REV_BYTES_32() to convert the data to little endian, but in FLEXCAN_HAL_ReadRxFifo() they do not do swapping and therefore data ends up being reversed.
Thanks!
Mikhail