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

RTT logs broken in SDK14.2 with GCC

Hi all,

Just noticed the RTT logs are broken with GCC in SDK14.2 while they work fine in SDK14.1

I found the cause is the definition of the macros:

    /*
 * For GCC sections are sorted in the group by the linker. For IAR and KEIL it is assumed that linker will sort
 * dynamic and const section in the same order (but in different locations). Proper message formatting
 * is based on that assumption.
 */
#if defined(__GNUC__)
#define NRF_LOG_DYNAMIC_SECTION_NAME(_module_name) CONCAT_2(log_dynamic_data_,_module_name)
#define NRF_LOG_CONST_SECTION_NAME(_module_name) CONCAT_2(log_const_data_,_module_name)
#else
#define NRF_LOG_DYNAMIC_SECTION_NAME(_module_name) log_dynamic_data
#define NRF_LOG_CONST_SECTION_NAME(_module_name)   log_const_data
#endif

The macro responsible for the bug is NRF_LOG_CONST_SECTION_NAME, it completely breaks the logs and even the connection to the RTT viewer.

Parents
  • Hi,

    Linker declarations for the logger module (section variables) was changed in SDK 14.2.0, and I assume it may be related to the following bug fix (from SDK 14.2.0 release notes):

    • Fixed invalid module names in logger output when LTO was used in the GCC compiler.

    Because of this you need to update your linker script if you have migrated from an older SDK version.

Reply
  • Hi,

    Linker declarations for the logger module (section variables) was changed in SDK 14.2.0, and I assume it may be related to the following bug fix (from SDK 14.2.0 release notes):

    • Fixed invalid module names in logger output when LTO was used in the GCC compiler.

    Because of this you need to update your linker script if you have migrated from an older SDK version.

Children
Related