Dialog Semiconductor customer support - CONSOLE https://support.dialog-semiconductor.com/resource-keywords/console en sdk 5 ble example project console printing using the UART problem https://support.dialog-semiconductor.com/sdk-5-ble-example-project-console-printing-using-uart-problem

hi dialog:
1、open my keil project.(DA1458x_SDK_5.0.2.1\DA1458x_SDK\5.0.2.1\projects\target_apps\template\empty_peripheral_template)
2、open the following file:
\\da1458x_config_basic.h
Modify the following lines:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define CFG_PRINTF
#ifdef CFG_PRINTF
#define CFG_PRINTF_UART2
#endif
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
3、open the following file:
\\user_periph_setup.h
Modify the following lines:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifdef CFG_PRINTF_UART2
#define GPIO_UART2_TX_PORT GPIO_PORT_0
#define GPIO_UART2_TX_PIN GPIO_PIN_4

#define GPIO_UART2_RX_PORT GPIO_PORT_0
#define GPIO_UART2_RX_PIN GPIO_PIN_5
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
4、Open file :
@file arch_main.c
static inline void schedule_while_ble_on(void)
{
// BLE clock is enabled
while (ble_is_powered()) {

// BLE event end is set. conditional RF calibration can run.
uint8_t ble_evt_end_set = ke_event_get(KE_EVENT_BLE_EVT_END);

//execute messages and events
rwip_schedule();

//
if (ble_evt_end_set)
{
uint32_t sleep_duration = 0;
rcx20_read_freq ();

//if you have enough time run a temperature calibration of the radio
if (lld_sleep_check(&sleep_duration, 4)) //6 slots -> 3.750 ms
// check time and temperature to run radio calibrations.
conditionally_run_radio_cals();
}
/////////////////////////////////////////////////////////////////////////////////////////
#ifndef CFG_PRINTF//My Modify
//grant control to the application, try to go to sleep
//if the applciation returns GOTO_SLEEP
if (!app_asynch_trm())
break;
#endif //CFG_PRINTF //My Modify
/////////////////////////////////////////////////////////////////////////////////////////
//SDKIMPROVEMENTS Needs testing!! We can add the following condition and move
// it out of the loop
// we may consider putting it in before the app_asynch_trm
//if (GetBits16(CLK_CTRL_REG, RUNNING_AT_XTAL16M))

// execute the printf process
arch_printf_process();
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//add test
#if test_console_printf
arch_printf("test") ;
#endif // test_console_printf
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
}

Keywords: 
Device: 
Fri, 16 Oct 2015 06:52:29 +0000 libra_13179 2119 at https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/sdk-5-ble-example-project-console-printing-using-uart-problem#comments