Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Variable "sec_mode" is used uninitialized at this location in the sourcecode

With IAR (EWARM) 8.50.9 the UART project in the SDK compiles fine.

After upgrading to IAR (EWARM) 9.10.1 or 9.10.2 I get compiler error:

 Error[Go029]: Variable "sec_mode" is used uninitialized at this location in the sourcecode. D:\2\IAR\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_uart\main.c 156 

Any help on what the problem is?

Parents
  • Karl,

    Thanks for the reply, but this sounds like a bug in the UART example code?

    I do not understand why earlier versions of IAR compiled OK, and past 9.xx shows the error, but it sounds a fix in the code is needed?

    Regards

  • Karl,

    Correct, No changes. I use the example directly from the nRF5 SDK.

    I tried to compile with Optimization set to High, and then None, with the same result.

    The IAR error is a compiler issue, but the uninitialized Variable "sec_mode" could be fixed on the code side, (Nordic side)

    Regards 

  • Renix said:
    Correct, No changes. I use the example directly from the nRF5 SDK.

    Thank you for clarifying.

    Renix said:
    The IAR error is a compiler issue, but the uninitialized Variable "sec_mode" could be fixed on the code side, (Nordic side)

    Which compiler and compiler version if this IAR version using, and what did it use before?
    The sec_mode variable is actually populated by  the BLE_GAP_CONN_SEC_MODE_SET_OPEN macro, so I do not know why the IAR compiler suddenly complains about this. Does the changelog between the two versions mention any changes to the compiler, if so, which?

    Best regards,
    Karl

Reply
  • Renix said:
    Correct, No changes. I use the example directly from the nRF5 SDK.

    Thank you for clarifying.

    Renix said:
    The IAR error is a compiler issue, but the uninitialized Variable "sec_mode" could be fixed on the code side, (Nordic side)

    Which compiler and compiler version if this IAR version using, and what did it use before?
    The sec_mode variable is actually populated by  the BLE_GAP_CONN_SEC_MODE_SET_OPEN macro, so I do not know why the IAR compiler suddenly complains about this. Does the changelog between the two versions mention any changes to the compiler, if so, which?

    Best regards,
    Karl

Children
No Data
Related