Hi,
Recently I noticed that CAN_0_MB_tag MB[64] is not in MPC5748G.h revision 6.0.2.
Instead, I found CAN_0_RAMn_tag RAMn[384] there. Is there any plans to fix it? Or I need to access it by another way?
MPC5748G.h revision 6.0.2(S32DS PA 2.1)
MPC5748G.h revision 6.0.1(S32DS PA 2017.R1)
Solved! Go to Solution.
Hi,
header ver. 6.0.1 is not correct as defines just 64 MBs, it should be 96.
Second one from S32DS PA 2.1 should be OK but the usage is little bit different. Here it covers whole MB area, but per single words (384/4=96 MBs for default config). Access is using
#define MSG_BUF_SIZE 4 /* Msg Buffer Size. (CAN 2.0AB: 2 hdr + 2 data= 4 words) */
CAN0->RAMn[ 8*MSG_BUF_SIZE + 1] = /* MB8 word 1: ID */
CAN0->RAMn[ 8*MSG_BUF_SIZE + 2] = /* MB8 word 2: data word 0 */
CAN0->RAMn[ 8*MSG_BUF_SIZE + 3] = /* MB8 word 3: data word 1 */
CAN0->RAMn[ 8*MSG_BUF_SIZE + 0] = /* MB8 word 0: CS */
you can easily address MBs in case of different payload if CAN FD is used, because base address of the MB differs.
Previous header assume just 8 bytes payload.
BR, Petr
Hi,
header ver. 6.0.1 is not correct as defines just 64 MBs, it should be 96.
Second one from S32DS PA 2.1 should be OK but the usage is little bit different. Here it covers whole MB area, but per single words (384/4=96 MBs for default config). Access is using
#define MSG_BUF_SIZE 4 /* Msg Buffer Size. (CAN 2.0AB: 2 hdr + 2 data= 4 words) */
CAN0->RAMn[ 8*MSG_BUF_SIZE + 1] = /* MB8 word 1: ID */
CAN0->RAMn[ 8*MSG_BUF_SIZE + 2] = /* MB8 word 2: data word 0 */
CAN0->RAMn[ 8*MSG_BUF_SIZE + 3] = /* MB8 word 3: data word 1 */
CAN0->RAMn[ 8*MSG_BUF_SIZE + 0] = /* MB8 word 0: CS */
you can easily address MBs in case of different payload if CAN FD is used, because base address of the MB differs.
Previous header assume just 8 bytes payload.
BR, Petr
Oh I see! Thanks for your help!