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

How do I redirect printf in ble_template_app?

So I'm trying to start off development of my project using the PCA10040 development board. I have downloaded the SDK16 and built a couple of examples no problem using SES. Now I have started using the ble_app_template  - which builds fine and seems just right to base development on.

Until I try to use the UART. I've searched & tried dozens of things, none of which work and often break the project. Often the Googled answer to a question is just "please look at the UART example" which doesn't help with modifying another example. After two days of trying to get this one simple thing working I've finally decided to ask here..

It looks like the printf redirect is the simplest option, but there isn't any option in the sdconfig.h which is incomplete.

So what do I need to do to turn off the debug logging and to output to the UART?

Thanks!

Parents
  • Hi,

    To enable retargeting of the STDIO functions, you need to include the source file into the project:

    nRF5_SDK_16.0.0_684aa2c\components\libraries\uart\retarget.c

    And enable it in your sdk_config.h file (add the lines yourself if they are not there):

    // <q> RETARGET_ENABLED  - retarget - Retargeting stdio functions
    
    #ifndef RETARGET_ENABLED
    #define RETARGET_ENABLED 1
    #endif

    This uses the app_uart library, so you need to include and initialize this as well, similar to how it is done in the UART peripheral example.

    Also, make sure that the UART backend is disabled for NRF_LOG module, otherwise, you may get errors when initializing logger (if you want to keep logging over RTT, etc.):

    // <e> NRF_LOG_BACKEND_UART_ENABLED - nrf_log_backend_uart - Log UART backend
    //==========================================================
    #ifndef NRF_LOG_BACKEND_UART_ENABLED
    #define NRF_LOG_BACKEND_UART_ENABLED 0
    #endif

    Best regards,
    Jørgen

  • First of all, you should use app_uart_fifo.c and not app_uart.c. The latter does not support sending/receiving multiple bytes. You also need to enable the module in your sdk_config.h file:

    // <e> APP_UART_ENABLED - app_uart - UART driver
    //==========================================================
    #ifndef APP_UART_ENABLED
    #define APP_UART_ENABLED 1
    #endif
    // <o> APP_UART_DRIVER_INSTANCE  - UART instance used
     
    // <0=> 0 
    
    #ifndef APP_UART_DRIVER_INSTANCE
    #define APP_UART_DRIVER_INSTANCE 0
    #endif
    
    // </e>

    Then you need to setup and initialize the app_uart library in your application before you can use printf():

    #include "app_uart.h"
    
    #define UART_TX_BUF_SIZE 256                         /**< UART TX buffer size. */
    #define UART_RX_BUF_SIZE 256                         /**< UART RX buffer size. */
    
    void uart_error_handle(app_uart_evt_t * p_event)
    {
        if (p_event->evt_type == APP_UART_COMMUNICATION_ERROR)
        {
            APP_ERROR_HANDLER(p_event->data.error_communication);
        }
        else if (p_event->evt_type == APP_UART_FIFO_ERROR)
        {
            APP_ERROR_HANDLER(p_event->data.error_code);
        }
    }
    
    static void uart_init(void)
    {
    	ret_code_t err_code;
    
        const app_uart_comm_params_t comm_params =
          {
              RX_PIN_NUMBER,
              TX_PIN_NUMBER,
              RTS_PIN_NUMBER,
              CTS_PIN_NUMBER,
              APP_UART_FLOW_CONTROL_DISABLED,
              false,
              NRF_UARTE_BAUDRATE_115200
          };
    
        APP_UART_FIFO_INIT(&comm_params,
                             UART_RX_BUF_SIZE,
                             UART_TX_BUF_SIZE,
                             uart_error_handle,
                             APP_IRQ_PRIORITY_LOWEST,
                             err_code);
    
        APP_ERROR_CHECK(err_code);
    }
    
    
    int main(void)
    {
    	...
    	
        uart_init();
        printf("\r\nUART initialized\r\n");
    
    	...
    }

    There may also be other libraries that need to be included (source file) and enabled (in sdk_config.h), for instance, app_fifo, nrf_drv_uart/nrfx_uart/nrfx_uarte, etc. You should then get undefined references when building.

  • Finally the project file

    <!DOCTYPE CrossStudio_Project_File>
    <solution Name="ble_app_template_pca10040_s132" target="8" version="2">
      <project Name="ble_app_template_pca10040_s132">
        <configuration
          Name="Common"
          arm_architecture="v7EM"
          arm_core_type="Cortex-M4"
          arm_endian="Little"
          arm_fp_abi="Hard"
          arm_fpu_type="FPv4-SP-D16"
          arm_linker_heap_size="8192"
          arm_linker_process_stack_size="0"
          arm_linker_stack_size="8192"
          arm_linker_treat_warnings_as_errors="No"
          arm_simulator_memory_simulation_parameter="RWX 00000000,00100000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
          arm_target_device_name="nRF52832_xxAA"
          arm_target_interface_type="SWD"
          c_preprocessor_definitions="APP_TIMER_V2;APP_TIMER_V2_RTC1_ENABLED;BOARD_PCA10040;CONFIG_GPIO_AS_PINRESET;FLOAT_ABI_HARD;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;NRF52;NRF52832_XXAA;NRF52_PAN_74;NRF_SD_BLE_API_VERSION=7;S132;SOFTDEVICE_PRESENT;"
          c_user_include_directories="../../../../../NRFSDK16/components/libraries/fifo;../../../../../NRFSDK16/components/libraries/uart;../../../config;../../../../../NRFSDK16/components;../../../../../NRFSDK16/components/ble/ble_advertising;../../../../../NRFSDK16/components/ble/ble_dtm;../../../../../NRFSDK16/components/ble/ble_racp;../../../../../NRFSDK16/components/ble/ble_services/ble_ancs_c;../../../../../NRFSDK16/components/ble/ble_services/ble_ans_c;../../../../../NRFSDK16/components/ble/ble_services/ble_bas;../../../../../NRFSDK16/components/ble/ble_services/ble_bas_c;../../../../../NRFSDK16/components/ble/ble_services/ble_cscs;../../../../../NRFSDK16/components/ble/ble_services/ble_cts_c;../../../../../NRFSDK16/components/ble/ble_services/ble_dfu;../../../../../NRFSDK16/components/ble/ble_services/ble_dis;../../../../../NRFSDK16/components/ble/ble_services/ble_gls;../../../../../NRFSDK16/components/ble/ble_services/ble_hids;../../../../../NRFSDK16/components/ble/ble_services/ble_hrs;../../../../../NRFSDK16/components/ble/ble_services/ble_hrs_c;../../../../../NRFSDK16/components/ble/ble_services/ble_hts;../../../../../NRFSDK16/components/ble/ble_services/ble_ias;../../../../../NRFSDK16/components/ble/ble_services/ble_ias_c;../../../../../NRFSDK16/components/ble/ble_services/ble_lbs;../../../../../NRFSDK16/components/ble/ble_services/ble_lbs_c;../../../../../NRFSDK16/components/ble/ble_services/ble_lls;../../../../../NRFSDK16/components/ble/ble_services/ble_nus;../../../../../NRFSDK16/components/ble/ble_services/ble_nus_c;../../../../../NRFSDK16/components/ble/ble_services/ble_rscs;../../../../../NRFSDK16/components/ble/ble_services/ble_rscs_c;../../../../../NRFSDK16/components/ble/ble_services/ble_tps;../../../../../NRFSDK16/components/ble/common;../../../../../NRFSDK16/components/ble/nrf_ble_gatt;../../../../../NRFSDK16/components/ble/nrf_ble_qwr;../../../../../NRFSDK16/components/ble/peer_manager;../../../../../NRFSDK16/components/boards;../../../../../NRFSDK16/components/libraries/atomic;../../../../../NRFSDK16/components/libraries/atomic_fifo;../../../../../NRFSDK16/components/libraries/atomic_flags;../../../../../NRFSDK16/components/libraries/balloc;../../../../../NRFSDK16/components/libraries/bootloader/ble_dfu;../../../../../NRFSDK16/components/libraries/bsp;../../../../../NRFSDK16/components/libraries/button;../../../../../NRFSDK16/components/libraries/cli;../../../../../NRFSDK16/components/libraries/crc16;../../../../../NRFSDK16/components/libraries/crc32;../../../../../NRFSDK16/components/libraries/crypto;../../../../../NRFSDK16/components/libraries/csense;../../../../../NRFSDK16/components/libraries/csense_drv;../../../../../NRFSDK16/components/libraries/delay;../../../../../NRFSDK16/components/libraries/ecc;../../../../../NRFSDK16/components/libraries/experimental_section_vars;../../../../../NRFSDK16/components/libraries/experimental_task_manager;../../../../../NRFSDK16/components/libraries/fds;../../../../../NRFSDK16/components/libraries/fstorage;../../../../../NRFSDK16/components/libraries/gfx;../../../../../NRFSDK16/components/libraries/gpiote;../../../../../NRFSDK16/components/libraries/hardfault;../../../../../NRFSDK16/components/libraries/hci;../../../../../NRFSDK16/components/libraries/led_softblink;../../../../../NRFSDK16/components/libraries/log;../../../../../NRFSDK16/components/libraries/log/src;../../../../../NRFSDK16/components/libraries/low_power_pwm;../../../../../NRFSDK16/components/libraries/mem_manager;../../../../../NRFSDK16/components/libraries/memobj;../../../../../NRFSDK16/components/libraries/mpu;../../../../../NRFSDK16/components/libraries/mutex;../../../../../NRFSDK16/components/libraries/pwm;../../../../../NRFSDK16/components/libraries/pwr_mgmt;../../../../../NRFSDK16/components/libraries/queue;../../../../../NRFSDK16/components/libraries/ringbuf;../../../../../NRFSDK16/components/libraries/scheduler;../../../../../NRFSDK16/components/libraries/sdcard;../../../../../NRFSDK16/components/libraries/sensorsim;../../../../../NRFSDK16/components/libraries/slip;../../../../../NRFSDK16/components/libraries/sortlist;../../../../../NRFSDK16/components/libraries/spi_mngr;../../../../../NRFSDK16/components/libraries/stack_guard;../../../../../NRFSDK16/components/libraries/strerror;../../../../../NRFSDK16/components/libraries/svc;../../../../../NRFSDK16/components/libraries/timer;../../../../../NRFSDK16/components/libraries/twi_mngr;../../../../../NRFSDK16/components/libraries/twi_sensor;../../../../../NRFSDK16/components/libraries/usbd;../../../../../NRFSDK16/components/libraries/usbd/class/audio;../../../../../NRFSDK16/components/libraries/usbd/class/cdc;../../../../../NRFSDK16/components/libraries/usbd/class/cdc/acm;../../../../../NRFSDK16/components/libraries/usbd/class/hid;../../../../../NRFSDK16/components/libraries/usbd/class/hid/generic;../../../../../NRFSDK16/components/libraries/usbd/class/hid/kbd;../../../../../NRFSDK16/components/libraries/usbd/class/hid/mouse;../../../../../NRFSDK16/components/libraries/usbd/class/msc;../../../../../NRFSDK16/components/libraries/util;../../../../../NRFSDK16/components/nfc/ndef/conn_hand_parser;../../../../../NRFSDK16/components/nfc/ndef/conn_hand_parser/ac_rec_parser;../../../../../NRFSDK16/components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser;../../../../../NRFSDK16/components/nfc/ndef/conn_hand_parser/le_oob_rec_parser;../../../../../NRFSDK16/components/nfc/ndef/connection_handover/ac_rec;../../../../../NRFSDK16/components/nfc/ndef/connection_handover/ble_oob_advdata;../../../../../NRFSDK16/components/nfc/ndef/connection_handover/ble_pair_lib;../../../../../NRFSDK16/components/nfc/ndef/connection_handover/ble_pair_msg;../../../../../NRFSDK16/components/nfc/ndef/connection_handover/common;../../../../../NRFSDK16/components/nfc/ndef/connection_handover/ep_oob_rec;../../../../../NRFSDK16/components/nfc/ndef/connection_handover/hs_rec;../../../../../NRFSDK16/components/nfc/ndef/connection_handover/le_oob_rec;../../../../../NRFSDK16/components/nfc/ndef/generic/message;../../../../../NRFSDK16/components/nfc/ndef/generic/record;../../../../../NRFSDK16/components/nfc/ndef/launchapp;../../../../../NRFSDK16/components/nfc/ndef/parser/message;../../../../../NRFSDK16/components/nfc/ndef/parser/record;../../../../../NRFSDK16/components/nfc/ndef/text;../../../../../NRFSDK16/components/nfc/ndef/uri;../../../../../NRFSDK16/components/nfc/platform;../../../../../NRFSDK16/components/nfc/t2t_lib;../../../../../NRFSDK16/components/nfc/t2t_parser;../../../../../NRFSDK16/components/nfc/t4t_lib;../../../../../NRFSDK16/components/nfc/t4t_parser/apdu;../../../../../NRFSDK16/components/nfc/t4t_parser/cc_file;../../../../../NRFSDK16/components/nfc/t4t_parser/hl_detection_procedure;../../../../../NRFSDK16/components/nfc/t4t_parser/tlv;../../../../../NRFSDK16/components/softdevice/common;../../../../../NRFSDK16/components/softdevice/s132/headers;../../../../../NRFSDK16/components/softdevice/s132/headers/nrf52;../../../../../NRFSDK16/components/toolchain/cmsis/include;../../../../../NRFSDK16/external/fprintf;../../../../../NRFSDK16/external/segger_rtt;../../../../../NRFSDK16/external/utf_converter;../../../../../NRFSDK16/integration/nrfx;../../../../../NRFSDK16/integration/nrfx/legacy;../../../../../NRFSDK16/modules/nrfx;../../../../../NRFSDK16/modules/nrfx/drivers/include;../../../../../NRFSDK16/modules/nrfx/hal;../../../../../NRFSDK16/modules/nrfx/mdk;../config;"
          debug_additional_load_file="../../../../../NRFSDK16/components/softdevice/s132/hex/s132_nrf52_7.0.1_softdevice.hex"
          debug_register_definition_file="../../../../../NRFSDK16/modules/nrfx/mdk/nrf52.svd"
          debug_start_from_entry_point_symbol="No"
          debug_target_connection="J-Link"
          gcc_debugging_level="Level 3"
          gcc_entry_point="Reset_Handler"
          linker_output_format="hex"
          linker_printf_fmt_level="long"
          linker_printf_width_precision_supported="Yes"
          linker_scanf_fmt_level="long"
          linker_section_placement_file="flash_placement.xml"
          linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x80000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x10000;FLASH_START=0x26000;FLASH_SIZE=0x5a000;RAM_START=0x20002250;RAM_SIZE=0xddb0"
          linker_section_placements_segments="FLASH RX 0x0 0x80000;RAM RWX 0x20000000 0x10000"
          macros="CMSIS_CONFIG_TOOL=../../../../../NRFSDK16/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar"
          project_directory=""
          project_type="Executable" />
        <folder Name="Segger Startup Files">
          <file file_name="$(StudioDir)/source/thumb_crt0.s" />
        </folder>
        <folder Name="nRF_Log">
          <file file_name="../../../../../NRFSDK16/components/libraries/log/src/nrf_log_backend_rtt.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/log/src/nrf_log_backend_serial.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/log/src/nrf_log_backend_uart.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/log/src/nrf_log_default_backends.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/log/src/nrf_log_frontend.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/log/src/nrf_log_str_formatter.c" />
        </folder>
        <folder Name="nRF_Libraries">
          <file file_name="../../../../../NRFSDK16/components/libraries/button/app_button.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/util/app_error.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/util/app_error_handler_gcc.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/util/app_error_weak.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/scheduler/app_scheduler.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/timer/app_timer2.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/util/app_util_platform.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/crc16/crc16.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/timer/drv_rtc.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/fds/fds.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/hardfault/hardfault_implementation.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/util/nrf_assert.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/atomic_fifo/nrf_atfifo.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/atomic_flags/nrf_atflags.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/atomic/nrf_atomic.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/balloc/nrf_balloc.c" />
          <file file_name="../../../../../NRFSDK16/external/fprintf/nrf_fprintf.c" />
          <file file_name="../../../../../NRFSDK16/external/fprintf/nrf_fprintf_format.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/fstorage/nrf_fstorage.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/fstorage/nrf_fstorage_sd.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/memobj/nrf_memobj.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/ringbuf/nrf_ringbuf.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/experimental_section_vars/nrf_section_iter.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/sortlist/nrf_sortlist.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/strerror/nrf_strerror.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/sensorsim/sensorsim.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/uart/retarget.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/uart/app_uart_fifo.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/fifo/app_fifo.c" />
        </folder>
        <folder Name="None">
          <file file_name="../../../../../NRFSDK16/modules/nrfx/mdk/ses_startup_nrf52.s" />
          <file file_name="../../../../../NRFSDK16/modules/nrfx/mdk/ses_startup_nrf_common.s" />
          <file file_name="../../../../../NRFSDK16/modules/nrfx/mdk/system_nrf52.c" />
        </folder>
        <folder Name="Board Definition">
          <file file_name="../../../../../NRFSDK16/components/boards/boards.c" />
        </folder>
        <folder Name="nRF_Drivers">
          <file file_name="../../../../../NRFSDK16/integration/nrfx/legacy/nrf_drv_clock.c" />
          <file file_name="../../../../../NRFSDK16/integration/nrfx/legacy/nrf_drv_uart.c" />
          <file file_name="../../../../../NRFSDK16/modules/nrfx/soc/nrfx_atomic.c" />
          <file file_name="../../../../../NRFSDK16/modules/nrfx/drivers/src/nrfx_clock.c" />
          <file file_name="../../../../../NRFSDK16/modules/nrfx/drivers/src/nrfx_gpiote.c" />
          <file file_name="../../../../../NRFSDK16/modules/nrfx/drivers/src/prs/nrfx_prs.c" />
          <file file_name="../../../../../NRFSDK16/modules/nrfx/drivers/src/nrfx_uart.c" />
          <file file_name="../../../../../NRFSDK16/modules/nrfx/drivers/src/nrfx_uarte.c" />
        </folder>
        <folder Name="Board Support">
          <file file_name="../../../../../NRFSDK16/components/libraries/bsp/bsp.c" />
          <file file_name="../../../../../NRFSDK16/components/libraries/bsp/bsp_btn_ble.c" />
        </folder>
        <folder Name="Application">
          <file file_name="../../../main.c" />
          <file file_name="../config/sdk_config.h" />
        </folder>
        <folder Name="nRF_Segger_RTT">
          <file file_name="../../../../../NRFSDK16/external/segger_rtt/SEGGER_RTT.c" />
          <file file_name="../../../../../NRFSDK16/external/segger_rtt/SEGGER_RTT_Syscalls_SES.c" />
          <file file_name="../../../../../NRFSDK16/external/segger_rtt/SEGGER_RTT_printf.c" />
        </folder>
        <folder Name="nRF_BLE">
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/auth_status_tracker.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/common/ble_advdata.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/ble_advertising/ble_advertising.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/common/ble_conn_params.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/common/ble_conn_state.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/common/ble_srv_common.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/gatt_cache_manager.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/gatts_cache_manager.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/id_manager.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/nrf_ble_gatt/nrf_ble_gatt.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/nrf_ble_qwr/nrf_ble_qwr.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/peer_data_storage.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/peer_database.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/peer_id.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/peer_manager.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/peer_manager_handler.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/pm_buffer.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/security_dispatcher.c" />
          <file file_name="../../../../../NRFSDK16/components/ble/peer_manager/security_manager.c" />
        </folder>
        <folder Name="UTF8/UTF16 converter">
          <file file_name="../../../../../NRFSDK16/external/utf_converter/utf.c" />
        </folder>
        <folder Name="nRF_SoftDevice">
          <file file_name="../../../../../NRFSDK16/components/softdevice/common/nrf_sdh.c" />
          <file file_name="../../../../../NRFSDK16/components/softdevice/common/nrf_sdh_ble.c" />
          <file file_name="../../../../../NRFSDK16/components/softdevice/common/nrf_sdh_soc.c" />
        </folder>
      </project>
      <configuration
        Name="Release"
        c_preprocessor_definitions="NDEBUG"
        gcc_optimization_level="Optimize For Size" />
      <configuration
        Name="Debug"
        c_preprocessor_definitions="DEBUG; DEBUG_NRF"
        gcc_optimization_level="None" />
    </solution>
    
    

  • Ok, I will have a look. For next time, you can zip the project folder and upload it as a file to the answer by clicking "Insert->Insert image/video/file".

  • It looks to me like this is only a problem when the application is flashed to the board the second time, is this also the case when you test it?

    I tried erasing the chip using 'nrfjprog -e', and when I then flash from SES, the extra "H" is not printed. If I download from SES a second time without erasing, one extra "H" is printed. Maybe the programming process restarts the chip, starting the old application once before the flash is erased but the UART peripheral is only able to write a single char before the flash is erased. I also do not see this extra "H" when pressing the reset button on the DK.

    Which SES and J-Link versions are you using?

  • Yes I get the same. Oddly I still see the delay between "He" and "llo World" when I press reset. I do have programs which monitor COM ports but the delay is too short to measure, but I would guess it is maybe 100-200ms which is huge.

    I've tried some of the other examples before now which use UART logging but I haven't seen that effect.

    Version info:

    SEGGER Embedded Studio for ARM
    Release 4.12 Build 2018112601.37855
    Windows x64

    >nrfjprog -v
    nrfjprog version: 9.8.1
    JLinkARM.dll version: 6.44d

    Nick

  • I see that the delay is caused by ble_stack_init. If I move the printf() calls after this, the entire line is printed at once. I suspect this to be the startup-time for the low-frequency crystal oscillator (LFXO), which is typically 0.25 s.

Reply Children
No Data
Related