s32k freemaster over can

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

s32k freemaster over can

1,188 Views
fengba_360
Contributor III

Dear NXP engineers, happy Chinese new year! I have a question regarding the use of FreeMaster. When using CAN communication, I would like to change the communication ID to use extended frames. What modifications or changes are needed in the FreeMaster low-level driver configuration for this purpose?

freemaster-1.pngfreemaster-2.png

0 Kudos
Reply
1 Reply

1,164 Views
iulian_stan
NXP Employee
NXP Employee

Hi @fengba_360,

Unfortunately, FreeMASTER Driver for S32K1 is outdated and does not support Extended CAN IDs.

However, it was implemented in later versions targeting new NPIs (ex: S32M2) which should work out of the box with S32K1. The drawback is that, in S32DS, FreeMASTER Driver for S32M2 cannot be attached to a S32K1 project, meaning you would need to do the integration manually.

It can be done by following the steps bellow:
1. Download FreeMASTER Driver 3.0 for S32M2
Capture.PNG

2. When you get to Flexera page, select FreeMASTER Driver source code
Capture2.PNG

3. Unarchive the content of the downloaded zip file.
4. Replace the content of the FreeMASTER folder from your project with the content of the src folder from the archive
Capture3.PNG

5. Next you will need to make some adjustments in your project config. These are described in Release_Notes.pdf (ch 5.2. Using FreeMASTER Standalone Library)
6. Replace your freemaster_cfg.h with src/template/freemaster_cfg.h.
The template is configured for UART communication by default, so you will need to update the communication interface as follows:

// Remove UART config
// #define FMSTR_TRANSPORT         FMSTR_SERIAL            // Use serial // transport layer
// #define FMSTR_SERIAL_DRV        FMSTR_SERIAL_S32_LPUART // Use serial driver for LPUART
// Add FlexCAN config
#define FMSTR_TRANSPORT         FMSTR_CAN                // Use serial transport layer
#define FMSTR_CAN_DRV           FMSTR_CAN_S32_FLEXCAN    // Use serial driver for FLEXCAN

/* Select RX and TX FlexCAN Message buffers */
#define FMSTR_FLEXCAN_TXMB      0
#define FMSTR_FLEXCAN_RXMB      1

/* Specify CAN command & response IDs */
#define FMSTR_CAN_CMDID 0x800007AAU
#define FMSTR_CAN_RESPID 0x800007AAU

If the most significative bit of FMSTR_CAN_CMDID  and FMSTR_CAN_RESPID is set to 1 as in the example above, FreeMASTER will use extended IDs. In this particular case, the desktop application should use Command ID 7AA with checked Extended ID.

Hope it helps

 

0 Kudos
Reply