Hello.
I am currently learning the flexcan example inside the SDK with FRDM-KW36 boards.
The version of MCUX I am using is 'MCUXpresso IDE v11.8.1_1197' and the SDK version is 'SDK_2.x_FRDM-KW36_2.2.12'.
I'm using the 'flexcan_interrupt_transfer' example included in that version of the SDK.
Let me explain what I'm curious about. First of all, it seems like the example is an example that utilizes CAN FD communication, but is there no example of basic CAN communication other than CAN FD?
Is it possible to modify the example code to use basic CAN instead of CAN FD?
I'm wondering how to change it if there is a way.
Second, I would like to transmit data input from outside through CAN communication.
For example, I know there is a 'Low Power Bluetooth Temperature Sensor/Collector' example in the KW36 SDK. Applying this, I want to communicate the temperature data collected from the Collector device with another FRDM-KW36 board via CAN communication.
To do that, I think I need to assign the collected temperature data to the CAN communication data packet, but I'm curious about how to do that.
To implement the communication I'm talking about, where/how do I change the data allocated to the CAN Tx Buffer (maybe txXfer?) in the 'flexcan_interrupt_transfer' example?
I am currently lacking in relevant knowledge and experience, so please understand that I have many questions and that they are complicated.
However, since this question is very important to me, I look forward to your kind and detailed answer.
Thank you.
Best regards
SeokJin
Hello,
Thank you for contacting NXP support.
Answering your first question:
According to the Reference Manual the FDEN (Field 11) register of the Module Configuration Register (MCR) is used to enable the CAN FD operation, it is also mentioned that if this is enable then the FlexCAN is able to receive and transmit messages in both CAN FD and CAN 2.0 formats.
So in order to disable the CAN FD receive and transmit capabilities the FDEN register value should be 0 instead of 1.
But in the SDK example that you are currently using inside the flexcan_interrupt _transfer.c in the definition section you can find #define USE_CANFD (1) that for purposes of the example this value is equal to 1, but if you change this value to 0 you will disable the CAN FD functionality in the example including the following:
In resume you will remove from the application the CAN FD capabilities.
Second Question:
Regarding this question I understand that you are willing also to use the BLE (Bluetooth Low Power) in your example based on the Temperature Sensor/ Collector example, this means that the information you collect you are also available to share the collected information through CAN to another device.
This is possible in fact, but in this case you will need to take the Bluetooth data and (that has a different format than CAN) and process this data in order to be able to send this as a CAN message.
Highly recommend to give a look into the documentation located on the SDK-> docs->wireless->Bluetooth.
Please let me know if there is anything else where I can help you.