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

keil v5 & NRF52832 For BLE mesh

Dear expert

     I have created a keil project according to the example of light_switch with Segger_Embedded_Studio IDE in nrf5SDKforMeshv310src, and when I build the main source, there are two errors and warnings as following:

the first error:   ..\..\mesh\core\include\hal.h(70): error: #29: expected an expression
#elif NRF52_SERIES

the second error:    ..\..\mesh\core\include\hal.h(119): error: #35: #error directive: "Unsupported hardware platform"
#error "Unsupported hardware platform"

the first warning:   ..\..\nrf5 sdk\components\libraries\util\app_util.h(211): warning: #47-D: incompatible redefinition of macro "STATIC_ASSERT_SIMPLE" (declared at line 206)
#define STATIC_ASSERT_SIMPLE(EXPR) extern char (*_do_assert(void)) [sizeof(char[1 - 2*!(EXPR)])]

the second warning:   ..\..\nrf5 sdk\components\libraries\util\app_util.h(212): warning: #47-D: incompatible redefinition of macro "STATIC_ASSERT_MSG" (declared at line 207)
#define STATIC_ASSERT_MSG(EXPR, MSG) extern char (*_do_assert(void)) [sizeof(char[1 - 2*!(EXPR)])]

Parents
  • So what have you done to find the cause(s) of those errors?

    As with any compiler messages, the thing to do is:

    1. Read the message - it tells you what the problem is
    2. Look at the corresponding source code - see how that message applies.
    3. Remember that one error early on will often lead to resulting errors later in the source file - so always address the earliest message first.

    This is basic 'C' programming stuff - nothing specific to Keil or Nordic.

    For example

    error: #35: #error directive: "Unsupported hardware platform"

    The compiler has reached a #error directive, giving the message, "Unsupported hardware platform".

    So look at that point in the source code to find out what condition(s) has allowed it to reach that point.

    It will probably be something like:

    #if defined SOME_PLATFORM
    
    // do stuff appropriate when  'SOME_PLATFORM' is defined
    
    #elif defined SOME_OTHER_PLATFORM
    
    // do stuff appropriate when  'SOME_OTHER_PLATFORM' is defined
    
    #else
    
    // This is an error condition:
    // *neither* 'SOME_PLATFORM' *nor* 'SOME_OTHER_PLATFORM' is defined,
    // but one or the other is *needed*
    
    #error "Unsupported hardware platform"
    
    #endif
    

Reply
  • So what have you done to find the cause(s) of those errors?

    As with any compiler messages, the thing to do is:

    1. Read the message - it tells you what the problem is
    2. Look at the corresponding source code - see how that message applies.
    3. Remember that one error early on will often lead to resulting errors later in the source file - so always address the earliest message first.

    This is basic 'C' programming stuff - nothing specific to Keil or Nordic.

    For example

    error: #35: #error directive: "Unsupported hardware platform"

    The compiler has reached a #error directive, giving the message, "Unsupported hardware platform".

    So look at that point in the source code to find out what condition(s) has allowed it to reach that point.

    It will probably be something like:

    #if defined SOME_PLATFORM
    
    // do stuff appropriate when  'SOME_PLATFORM' is defined
    
    #elif defined SOME_OTHER_PLATFORM
    
    // do stuff appropriate when  'SOME_OTHER_PLATFORM' is defined
    
    #else
    
    // This is an error condition:
    // *neither* 'SOME_PLATFORM' *nor* 'SOME_OTHER_PLATFORM' is defined,
    // but one or the other is *needed*
    
    #error "Unsupported hardware platform"
    
    #endif
    

Children
Related