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

  • Thank you for all your help Roger! Your work around helped me. BUT I just tested "#define BOARD_CUSTOM" in Keil 5.2 and it doesn't work. Problems like this are very frustrating to engineers like myself that assume things work as documented....

Reply Children
No Data
Related