For transmitting messages in MB0 we have,
CAN0->RAMn[ 0*MSG_BUF_SIZE + 0] = 0x0C400000 | 8 <<CAN_WMBn_CS_DLC_SHIFT;
What all are the changes i supposed to make it to send messages in MB1 and MB2 instead of MB0?
- be sure written MBs are enabled, check MCR[MAXMB]
- if Abort is enabled (MCR[AEN] asserted) then you should clear MB flag in IFLAG1 to be able to update MB
- if the CAN FD is enabled and different payload is used, MSG_BUF_SIZE should be set accordingly. For default payload of 8bytes MSG_BUF_SIZE = 4
Anyway you can check the MB memory if it is written.