Hello,
I'm using the FlexRay controller in the TMS570LS3137ZWT. I am able to coldstart with but even though I think I have configured the receive buffer correctly I can't seem to receive any data.
Here's how I configure the rx buffer:
while (frayREG->IBCR_UN.IBCR_ST.ibsyh_B1 == 1U); //wait while busy while (frayREG->IBCR_UN.IBCR_ST.ibsys_B1 == 1U); //wait while busy //clearing the WRHSx register frayREG->WRHS1_UN.WRHS1_UL = 0x0; frayREG->WRHS2_UN.WRHS2_UL = 0x0; frayREG->WRHS3_UN.WRHS3_UL = 0x0; frayREG->WRHS1_UN.WRHS1_ST.fid_B11 = 8; frayREG->WRHS1_UN.WRHS1_ST.cyc_B7 = 1; frayREG->WRHS1_UN.WRHS1_ST.cha_B1 = 1; frayREG->WRHS1_UN.WRHS1_ST.chb_B1 = 1; frayREG->WRHS1_UN.WRHS1_ST.mbi_B1 = 0U; // buffer interrupt not enabled frayREG->WRHS1_UN.WRHS1_ST.cfg_B1 = 0U; //set as receive buffer frayREG->WRHS2_UN.WRHS2_ST.pl_B7 = 16; //payload is 32 bytes that means 16 half-words frayREG->WRHS3_UN.WRHS3_ST.dp_B11 = 16; //free space in the message ram (words 0-7 are headers, 8-15 is the transmit buffer) frayREG->IBCM_UN.IBCM_ST.lhsh_B1 = 1U; //request only header transfer frayREG->IBCM_UN.IBCM_ST.ldsh_B1 = 0U; //no data transferred while (frayREG->IBCR_UN.IBCR_ST.ibsyh_B1 == 1U); //wait while busy frayREG->IBCR_UN.IBCR_ST.ibrh_B7 = 1; //set to 1 because buffer 0 is the coldstart transmit buffer
I don't enable interrupts but poll for new data instead like this:
if ((frayREG->NDAT1_UN.NDAT1_UL>> 1) & 1U) { ... }
But the new data flag in the NDAT1 register is never set.
Here's a data capture from an oscilloscope just to show that it really coldstarts:
I would be grateful for any suggestions about what am I missing.
Martin