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
  • FormerMember
    0 FormerMember

    Thanks for the quick reply RK. I think where we are differing is what our expectations are from Nordic. A Free tool doesn't mean that it should be kind of untested and dependent on the community to iron out the bugs, especially when a company like Nordic say that they support GCC. I can do the debugging to figure out what is happening and do less "guessing", especially if I've to work with a pre-release SDK. But I don't expect to do hours of debugging when moving to a new "stable" SDK. I am using the code from 11.0.0_89a8197 which I think is the latest.

    So if anyone is able to use peer manager in SDK 11.0.0 with Os optimization with GCC, please let me know.

Reply
  • FormerMember
    0 FormerMember

    Thanks for the quick reply RK. I think where we are differing is what our expectations are from Nordic. A Free tool doesn't mean that it should be kind of untested and dependent on the community to iron out the bugs, especially when a company like Nordic say that they support GCC. I can do the debugging to figure out what is happening and do less "guessing", especially if I've to work with a pre-release SDK. But I don't expect to do hours of debugging when moving to a new "stable" SDK. I am using the code from 11.0.0_89a8197 which I think is the latest.

    So if anyone is able to use peer manager in SDK 11.0.0 with Os optimization with GCC, please let me know.

Children
No Data
Related