This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Define BOARD_CUSTOM not working in SDK12 with GCC

I can't seem to add custom pin definitions to my own board in SDK12. I use the BOARD_CUSTOM define and copied my PCA10040 header file to one call custom_board.h and my pin assignments do not change. The only warnings I get are from bad paths to the config folder which is new since moving to SDK12.image description

Parents
  • If you are using gcc and the makefile, the definition for the board is set inside the makefile and not using a #define in a header

    The SDK is slightly misleading, as it applies to all build platforms e.g. Keil and IAR as well as gcc, and each of them will have a different way to add the define.

    If you add

    #define BOARD_CUSTOM  
    

    To a header that is included by the whole project, this will cause a problem, as the define for the PCA board will still be defined in the makefile.

    the

    -DXXX
    

    flag for the gcc compiler (preprocessor) is the same as

    #define XXX
    

    So, you need to change the lines in the makefile which have

    -DBOARD_PCA10040
    

    to

    -DBOARD_CUSTOM
    

    This occurs in 2 places, once for the CFLAGS and once for the ASMFLAGS

  • Hi Chris,

    I agree to your discussion that the documentation should not have mentioned #define as different compilers override these defines in the file in different ways given in the build settings. I will ask the team to remove #define and say that "you should make sure that only BOARD_CUSTOM" is defined in your build target OR your header file and no conflicting flags are set either in build target or in the header files". Does this sound ok?

Reply
  • Hi Chris,

    I agree to your discussion that the documentation should not have mentioned #define as different compilers override these defines in the file in different ways given in the build settings. I will ask the team to remove #define and say that "you should make sure that only BOARD_CUSTOM" is defined in your build target OR your header file and no conflicting flags are set either in build target or in the header files". Does this sound ok?

Children
No Data
Related