Other Parts Discussed in Thread: TMDSCNCD263, TCA6416, , SYSCONFIG
Tool/software:
Hi!
I am trying to run TI’s canfd_external_read_write.c example found here:
I have a TMDSCNCD263 control card dev kit set up per the description in the example to a Windows computer running PCAN VIEW.
I am importing the `canfd_external_read_write_am263x-cc_r5fss0-0_nortos_ti-arm-clang` to my CCS Version 20.1.1 (20.1.1.466), compiling and running the code with the debugger available.
I am having 2 issues.
1)
I have found I'm required to comment out L97 `mcanEnableTransceiver()`, for the program to run. https://github.com/TexasInstruments/mcupsdk-core/blob/next/examples/drivers/mcan/canfd_external_read_write/canfd_external_read_write.c#L97
If I do not, I receive the error `Cortex_R5_0: ASSERT: 0.181s: ../canfd_transceiver.c:SetupI2CTransfer:103: SystemP_SUCCESS == status failed !!!` on the terminal.
Is this okay to comment out? Why is this happening?
2)
After commenting out canfd_external_read_write.c L97 `mcanEnableTransceiver()`.
When I run the code, I can confirm that the TX is working as my PCAN VIEW shows incoming CAN FD messages. If I send multiple messages from PCAN VIEW with a CAN ID of 0x0, the program receives the messages without issue. Through the debug tool, I see a interrupt status of `MCAN_INTR_SRC_DEDICATED_RX_BUFF_MSG` and `CANFD_receiveBufferInterrupt` is called. https://github.com/TexasInstruments/mcupsdk-core/blob/next/source/drivers/mcan/v0/canfd.c#L319
However, when I send a message with CAN ID that is not 0x0, I see an interrupt status of `MCAN_INTR_SRC_RX_FIFO0_NEW_MSG` and `CANFD_processFIFOElements` is called. This works successfully for the first non-0 CAN ID message. However the second non-0 CAN ID message receives causes a hard fault.
ptrCanMsgObj = ptrCanFdObj->rxMapping[fifoStatus.getIdx]; has getIdx return 1, ptrCanMsgObj is given a value of 0 as rxMapping[1] is still NULL, and dereferencing ptrCanMsgObj causes a crash. https://github.com/TexasInstruments/mcupsdk-core/blob/next/source/drivers/mcan/v0/canfd.c#L198
How can I configure / setup the CAN FIFO differently so it can successfully receive multiple can messages from any extended CAN ID? (I still want 64B canfd messages). I tried playing around with configuration settings to make things specific for supporting CAN FD - FIFO without success.
Thank you!