sdk 5 ble example project console printing using the UART problem

3 posts / 0 new
Last post
libra_13179
Offline
Last seen:4 years 8 months ago
Joined:2015-06-16 04:43
sdk 5 ble example project console printing using the 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 ();

/ /如果你有足够的时间跑calibr温度ation 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:
MT_dialog
Offline
Last seen:2 months 6 days ago
Staff
Joined:2015-06-08 11:34
Hi libra_13179,

Hi libra_13179,

Check this post in order to use the uarthttp://support.dialog-semiconductor.com/sdk-5-uart

Thanks MT_dialog

libra_13179
Offline
Last seen:4 years 8 months ago
Joined:2015-06-16 04:43
Hi MT_dialog

Hi MT_dialog
Thank you for your reply.I found the key:
@void periph_init(void)add arch_printf("test\r\n");
And debug stop by
void wrap_platform_reset(uint32_t error)
{
ASSERT_WARNING(error==RESET_AFTER_SPOTA_UPDATE); //do not break in case of a SPOTA reset
platform_reset_func(error);
}

Topic locked