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

Wrong initialization value in static variables

Hi,

I'm developing a node based on the nRF52840-QIAA rev. B.

I'm using Eclipse Neon and GCC-toolchain for coding. Softdevice is S140 5.0.0.2 alpha and SDK is V14.2.

For Debugging I'm using an PCA10056 (nRF52840 PDK).

I'm always running into Error as soon as i try to interact with the softdevice. For example when calling nrf_sdh_enable_request().

While Debugging I've noticed that static variables like m_nrf_sdh_enabled (which is of type bool) don't seem to get initialized correctly.

Instead of "false", the value is an integer value. Depending on the configurations in sdk_config.h or the settings in the linker script for RAM start adress, this value changes.

Is this a Problem with the settings in linker script or what could it be?

Note: I'm using the default linkerscript provided in the examples library from ble_peripheral/ble_app_template 

Thanks for your help and advises!

Dominic

Parents Reply Children
  • Thank you for your fast answer!

    I tried Splitting the linker script in two parts, like in an old one that already worked and the initalisation works now fine.

    The bss-sections are getting erased and the Reset_Handler is called as it should. 

    Values of the static variables are now as they should be.

    Problem with enabling the Softdevice stil exists, but I think this should be questioned in an other thread, as it has nothing to do with static variables...

    Thank you for your Support! 

    I'll mark your answer as solution.

    Best regards, 

    Dominic

Related