Send CAN RTR flag on iMX6

I tested to send RTR flag on CAN bus but I could n’t send RTR flag.
I modified your sample some, and recorded the test screen.

sample : vs_project

I used under code to send RTR Message.
what is wrong?    = 123;
memcpy(, data, sizeof(data));
canBuf.dataLen = 8;
canBuf.canMsgFlags = CanMsgFlags_RTR;

if (Can_Write(hCan, &canBuf))
    printf("\nCAN Transmit: Frame ID = 0x%x Remote/Data Frame = %s\nData:",, (canBuf.canMsgFlags & CanMsgFlags_RTR  ? "REMOTE" :  "DATA"));
    // display Transmit data
    for (i = 0; i < 8; i++)
        printf(" %d",[i]);
    printf("CAN Transmit error\r\n");

At the moment CanMsgFlags doesn’t seem to work (we need to investigate it a bit better), but using the “RtrFormat” parameter should work.
before CAN_Write
should force packets to be sent as RTR until you configure “RtrFormat” back to “data”.