Hello,
we are using a S32K358 with RTD 4.0.0 and EB tresos for configuration.
we are using Freemaster over UART without problem.
Now we want to use Freemaster over CAN.
The step I try with the option FMSTR_POLL_DRIVEN and FMSTR_DEBUG_TX.
The FLEXCAN1 clock is enable using EB tresos config , DIO are configure using EB Tresos.
I also configure the CAN controller with EB TResos.(250 Kb)
but I can't see the Debug frame on CAN
I'm not sure I have configure the CAN properly, we also use the FLEXCAN 0 for other purpose.
I disable CanRxFifo
Do someone have a example of CAN configuration ?
Sophie
FREEMASTER S32K3
Solved! Go to Solution.
If my understanding is correct, EB Hardware are used by the RTD API to send/receive CAN messages, if so - they won't be used by FreeMASTER calls, but to avoid confusion I would remove them.
On the FreeMASTER configuration side (freemaster_cfg.h) select the CAN transport and set message buffer IDs:
// Select communication interface
#define FMSTR_TRANSPORT FMSTR_CAN // Use can transport layer
#define FMSTR_CAN_DRV FMSTR_CAN_S32_FLEXCAN // Use can driver for FLEXCAN
/* Select RX and TX FlexCAN Message buffers */
#define FMSTR_FLEXCAN_TXMB 0
#define FMSTR_FLEXCAN_RXMB 1
Additionally, you need to set CAN base addres before calling FMSTR_Init
either via FMSTR_CanSetBaseAddress function call
/* Set FreeMASTER can base address */
FMSTR_CanSetBaseAddress((FMSTR_ADDR)0x40304000);
/* Initialize FreeMASTER */
FMSTR_Init();
or via macro definition in the same configuration header file:
#define FMSTR_CAN_BASE 0x40304000
How do I need to configure
/* Select RX and TX FlexCAN Message buffers */
#define FMSTR_FLEXCAN_TXMB 1
#define FMSTR_FLEXCAN_RXMB 0
with EB tresos Hardware object configure as :
Sophie
Hi Sophie,
You do not need to configure the RX and TX buffers in EB. Only basic CAN driver configuration is required.
FreeMASTER will set messages IDs for RX (FMSTR_CAN_CMDID) and TX (FMSTR_CAN_RESPID) into the message buffers corresponding to those macros - FMSTR_FLEXCAN_RXMB and FMSTR_FLEXCAN_TXMB respectively.
Btw, are you able to send & receive standard messages (non FreeMASTER) ? As far as I know some S32K358 boards come with a secure CAN transceiver that requires additional configuration.
Iulian
If my understanding is correct, EB Hardware are used by the RTD API to send/receive CAN messages, if so - they won't be used by FreeMASTER calls, but to avoid confusion I would remove them.
On the FreeMASTER configuration side (freemaster_cfg.h) select the CAN transport and set message buffer IDs:
// Select communication interface
#define FMSTR_TRANSPORT FMSTR_CAN // Use can transport layer
#define FMSTR_CAN_DRV FMSTR_CAN_S32_FLEXCAN // Use can driver for FLEXCAN
/* Select RX and TX FlexCAN Message buffers */
#define FMSTR_FLEXCAN_TXMB 0
#define FMSTR_FLEXCAN_RXMB 1
Additionally, you need to set CAN base addres before calling FMSTR_Init
either via FMSTR_CanSetBaseAddress function call
/* Set FreeMASTER can base address */
FMSTR_CanSetBaseAddress((FMSTR_ADDR)0x40304000);
/* Initialize FreeMASTER */
FMSTR_Init();
or via macro definition in the same configuration header file:
#define FMSTR_CAN_BASE 0x40304000