Part Number: AWR1642BOOST
Tool/software: Code Composer Studio
Hi,
In my own CCS Project, I'm trying to send a certain amount of data, 3584 bytes in total, over CAN-FD.
To transmit the data, I divide the total amount of data in 3584/64 = 56 CAN-FD frames of 64 bytes each, which are separately sent to the "CANFD_transmitData" driver function.
In other forum threads I have seen that when using CAN-FD, after having called "CANFD_transmitData" to send the 64 bytes of the first block, is needed a "Task_sleep(1)" to avoid the CANFD_EINUSE error at the successive API calls.
This slows considerably the effective CAN-FD throughput to 64bytes/1ms=512kbits/s.
I've tried to overcome this limit with two different strategies:
1. Using a TI-RTOS Timer with period in microseconds, I have been able to pause the task for less than 1 ms, but the received CAN-FD data are partial and corrupted, bad solution.
2. To have a more interrupt-controlled process, after the first "CANFD_transmitData" call, I have blocked the task until I receive a message of message TX completion by the MCANAppCallback with the CANFD_Reason "CANFD_Reason_TX_COMPLETION". After the first call, the successive API calls returns the CANFD_EINUSE. This have sense because the interrupt I have used is from the MCAN_TXBTO register, wich just says that the TX has occourred but it doesn't guarantee that I can make a new TX request.
The CANFD_EINUSE occours when the API detects TX pending messages in the TX buffer (the MCAN_TXBRP register). I'm probably wrong or missing something, but I suppose the transceiver to be available after a TX has occourred. Is there a way to know exactly when I can do a new TX request without finding the Transceiver in use? Or I just have to wait this 1 ms with Task_sleep(1)?
Thanks in advance,
Riccardo