AnsweredAssumed Answered

     The question about adding the FlexCan module to the S32 project of the Dual motor control Demo board

Question asked by Eden Li on Jul 1, 2017
Latest reply on Jul 4, 2017 by dumitru-daniel.popa

Hi Gusy,

I wanna add the FlexCan to the S32 project of the Dual motor control Demo board,but there are some question in the progress,

Now,i describe the process of adding the FlexCan module:

1#,I built two files named FlexCan.h and FlexCan.c

FlexCan.c:

*******************************************************************************
*
* This file includes initial setting function of MPC5643L FlexCan peripheral module.
*
******************************************************************************/
#include "MPC5643L_qs.h"
#include "flexCan.h"

/******************************************************************************
* FlexCan functions
*****************************************************************************/
volatile FLEXCAN_tag *pFlexCan_0;
volatile FLEXCAN_tag *pFlexCan_1;

FlexCan.h:

*******************************************************************************
*
* This file includes initial setting and MACRO definitions of MPC5643L FlexCan
* peripheral module.
*
******************************************************************************/
#ifndef _FlexCan_H_
#define _FlexCan_H_
/******************************************************************************
* Global FlexCan variables definition
******************************************************************************/
// Pointer to FlexCan structure
extern volatile FLEXCAN_tag *pFlexCan_0;
extern volatile FLEXCAN_tag *pFlexCan_1;

/******************************************************************************
* FlexCan MACRO definitions
******************************************************************************/

/******************************************************************************
* FlexCan registers bit definition
******************************************************************************/

/******************************************************************************
* Exported functions
*******************************************************************************/
extern void Delay(void);
extern void InitFlexCAN_0(void);
extern void InitFlexCAN_1(void);


#endif /* _FlexCan_H_ */

2#,

add the header file to the MPC5643L_periph.h shown as below:

*******************************************************************************
*
* Detailed Description of the file.
*
******************************************************************************/
#include "siul.h"
#include "flexpwm.h"
#include "ctu.h"
#include "adc.h"
#include "eTimer.h"
#include "pit.h"
#include "dspi.h"
#include "flexCan.h"

3#,I built two files named MPC5643L_FlexCan_LLD.h and MPC5643L_FlexCan_LLD.c

MPC5643L_FlexCan_LLD.h:

*******************************************************************************
*
* This file includes initial setting and MACRO definitions of MPC5643L FlexCan
* peripheral module.
*
******************************************************************************/

#ifndef _MPC5643L_FlexCan_LLD_H_
#define _MPC5643L_FlexCan_LLD_H_

#ifdef __cplusplus
extern "C" {
#endif

#define FlexCan0_BASE 0xFFFC0000
#define FlexCan1_BASE 0xFFEC4000

/*******************************/

 

#ifdef __cplusplus
}
#endif

#endif /* _MPC5643L_FlexCan_LLD_H_ */

MPC5643L_FlexCan_LLD.c:

*******************************************************************************
*
* This file includes initial setting functions of MPC5643L FlexCan module.
*
******************************************************************************/
#include "MPC5643L_qs.h"
#include "MPC5643L_FlexCan_LLD.h"

/******************************************************************************
* FlexCan functions
*****************************************************************************/

4#,add the header file the MPC5643L_FlexCan_LLD.h to  MPC5643L_LLD.h shown as below:

*******************************************************************************
*
* Detailed Description of the file.
*
******************************************************************************/
#include "MPC5643L_ADC_LLD.h"
#include "MPC5643L_CTU_LLD.h"
#include "MPC5643L_DSPI_LLD.h"
#include "MPC5643L_ETIMER_LLD.h"
#include "MPC5643L_FlexPWM_LLD.h"
#include "MPC5643L_PIT_LLD.h"
#include "MPC5643L_SIUL_LLD.h"
#include <MPC5643L_FlexCan_LLD.h>

 

 

But there are some error popup,shown as below:

The tip seems said that  undefined the initFlexCan_0,but i clearly define the function in the  flexCan.h and  flexCan.c

 

I don't konw how to deal with it,The attachment is the S32 project.

Original Attachment has been moved to: Test_2.zip

Outcomes