Using Ceedling with SDK2.3.0

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

Using Ceedling with SDK2.3.0

1,143 Views
aberger
Contributor V

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.

Labels (1)
0 Kudos
1 Reply

876 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Andy,

   I am not familiar with the ceedling, and never use it before.

  But, about the SIM_SOPT2_USBSRC and SIM_SOPT2_PLLFLLSEL  error, actually, from IAR, MDK, MCUXPresso IDE, you also can find it is defined in the MK64F12.h.

  So, the code should not have the problem, I think it should still in the ceedling side, maybe you can contact with ceedling engineer, let them help you whether you have lost some configuration in that tool. From the nxp side, we highly recommend you to use the official recommended IDE:IAR , MDK, MCUXPresso IDE.

Wish it helps you!

Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos