AnsweredAssumed Answered

Using Ceedling with SDK2.3.0

Question asked by Andy Berger on Aug 8, 2018
Latest reply on Aug 9, 2018 by Kerry Zhou

I am trying to incorporate Ceedling as a unit-testing tool for my K64 project. I am struggling to get the source code to compile with gcc when trying to execute tests with Ceedling.

 

Specifically, I am trying to test a module that makes use of many of the fsl drivers (fsl_pit, fsl_dac, fsl_ftm, etc.). When compiling the driver headers, I get errors regarding many of the custom typedefs and macros that are defined in "MK64F12.h". I am #include-ing the processor header ("MK64F12.h") in my test_module.c source code, so these typedefs and macros should be defined (and they work fine when I compile the code from MCUXpresso).

 

As a concrete example, here is the first error that I run into when compiling the test_myModule.c from Ceedling:

In file included from drivers/fsl_common.h:173,
from drivers/fsl_pit.h:37,
from src/myModule.c:5:
drivers/fsl_clock.h:341:25: warning: implicit declaration of function 'SIM_SOPT2_USBSRC' [-Wimplicit-function-declaration]
kCLOCK_UsbSrcPll0 = SIM_SOPT2_USBSRC(1U) | SIM_SOPT2_PLLFLLSEL(1U), /*!< Use PLL0. */
^~~~~~~~~~~~~~~~
drivers/fsl_clock.h:341:48: warning: implicit declaration of function 'SIM_SOPT2_PLLFLLSEL' [-Wimplicit-function-declaration]
kCLOCK_UsbSrcPll0 = SIM_SOPT2_USBSRC(1U) | SIM_SOPT2_PLLFLLSEL(1U), /*!< Use PLL0. */
^~~~~~~~~~~~~~~~~~~
drivers/fsl_clock.h:341:5: error: enumerator value for 'kCLOCK_UsbSrcPll0' is not an integer constant
kCLOCK_UsbSrcPll0 = SIM_SOPT2_USBSRC(1U) | SIM_SOPT2_PLLFLLSEL(1U), /*!< Use PLL0. */

SIM_SOPT2_USBSRC and SIM_SOPT2_PLLFLLSEL are both #define'd in "MK64F12.h", so I don't understand what's happening here.

 

Thanks for your help.

Outcomes