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

Peer manager leading to hard fault with -Os flag with GCC 5

FormerMember
FormerMember

HI all,

We've recently moved to SDK 11.0 and it certainly has not been a painless migration, especially when using GCC.

Setup: GCC 5.2.1 on Linux Mint with nrf51 xxAA on a custom board

So, When using the peer manager, I'm not able to run with -Os flag with GCC, it gets into hard fault somewhere. Its fine with O1 or O2. I'm guessing some memory isn't allocated in an aligned manner. Please help me solve this as we prefer using Os as its lighter on the OTA update.

I had a similar problem where the following statement caused hard fault

if (p_page_addr[FDS_PAGE_TAG_WORD_0] != FDS_PAGE_TAG_MAGIC)

which is line number 183 in fds.c. This got resolved when I copied that this part of linker script from another post in Devzone

SECTIONS
{
  .fs_data :
  {
    . = ALIGN(4);
    PROVIDE(__start_fs_data = .);
    KEEP(*(.fs_data))
    PROVIDE(__stop_fs_data = .);
    . = ALIGN(4);
     __data_end__ = .;
  } > RAM
} INSERT AFTER .data;

Also things like the linker script being faulty in the SoftDevice section of the SDK makes ,me feel that again GCC is being treated as a second class citizen. There is not enough testing and verification with GCC before releasing the SDK.

Thanks!

Parents
  • Hi,

    I have no problems building and running the ble_app_proximity example of SDK 11 when using -Os optimisation. It uses peer manager. Do you get the same or similar issues when trying with the ble_app_proximity example?

    There has been some linker script problems but these should have been fixed from SDK 11. The linker scripts still must be patched when migrating from previous versions, though.

    Regards, Terje

Reply
  • Hi,

    I have no problems building and running the ble_app_proximity example of SDK 11 when using -Os optimisation. It uses peer manager. Do you get the same or similar issues when trying with the ble_app_proximity example?

    There has been some linker script problems but these should have been fixed from SDK 11. The linker scripts still must be patched when migrating from previous versions, though.

    Regards, Terje

Children
No Data
Related