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

Debugging, NRF_LOG, Segger Embedded Studio Problems

I saw something in the list that might help but I have learned that if I go there I lose all the work I did to get here

I am having major problems with Segger Embedded Studio

  • NRF_LOG_x does not print either through the UART and putty OR RTT in SES [Manually set in the sdk_config.h file] since CMSIS Wizard is not present
  • The CMSIS Configuration Wizard is NOT present in my Tools.xml
  • Debug breakpoints are not hit unless it is in the main() part of main.c and when hit not in the code, only if a debug window to the left of the code
  • I can step line by line if I start and use F10/F11 from the start (do not use F5 and a break point) but never once I use F5 and a break point.

The only thing I can think of is that somehow the installation of SES got really corrupted or I am missing a major step. I have no idea how to fix.

Yet the code I have does partially run - it advertises, gets connected to, responds to service discovery, gets two characteristic descriptors enabled but then when I try and write from the client the write times out. I am not surprised that there are issues with the code as I have ported a SoftDevice only project from nRF51 and Keil.

But being unable to debug or even print to RTT (this is new for me) or via the UART and putty (the latter worked fine in the Keil project) is not helping.

Any help would be great. (Yes I have seen the debugging video and that's how I know my Tools.xml is corrupt).

Parents Reply Children
  • I do not have a link - but its on this site. Found it by doing google searches.

    I still have not been able to do a successful port. I have, however, been able to take my code directly and substitute it into an existing Segger example hts project after getting the logging parameter correct in the SDK_config.h file and the optimization parameters correct (not NONE). That is what I tried first and could not debug or print. After being able to debug and print it turned out that I did not manage to remove all the SDK components and some were getting run and competing with my own handling of events through the sd_ble_evt_get() function. The SDK was still running it's own handler. I still don't know how that was happening but I solved it by removing these two calls

    nrf_sdh_ble_enable(&ram_start);
    
    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ...)

    and just calling

    nrf_sdh_enable_request();
    
    nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
    
    sd_ble_enable(&ram_start);

    in the ble_stack_init() function. I still have not cleared up everything in my mind (not sure what these 'observers' are and what the nrf_sdh_senable_request() does). Now that I have something working as in the Keil s130 nrf51 case on the nrf52840 I can systematically remove stuff I think I don't need and make sure it still works.

    Would still like to be able to do the port, though. Would be nice to have a 'free' Segger project for my nrf51 instead of using the size-limited version. Project still fits though.

  • I still can't get rid of the extra LF in my NRF_LOG statements (using putty via a UART). Latest SDK 17.0.2.

    I have the FPRINTF on in SDK_config.h (I think if I did not the build would fail - didn't need it in SDK 12.3.0 using Keil).

    I have 

    • NRF_FPRINTF_ENABLED 1
    • NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0
    • NRF_LOG_BACKEND_UART_ENABLED 1
    • NRF_LOG_ENABLED 1

    When I copy the log output from putty to Notepad++ and display all characters I see two LF 

    My actual log statements are the same as in the Keil 12.3.0 project and look like this:

    NRF_LOG_DEBUG("Main start GHS\r\n");

Related