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

UART not work in ble_app_beacon

Hello i use the example ble_app_beacon_s130_pca10028, i'll try to add UART functions, but they not work anybody has this problem, please help me!!

int main(void) { uint32_t err_code; // Initialize. APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);

err_code = bsp_init(BSP_INIT_LED, APP_TIMER_TICKS(100, APP_TIMER_PRESCALER), NULL);
APP_ERROR_CHECK(err_code);
	uart_init();
ble_stack_init();
advertising_init();
	printf("Starting...");
advertising_start();
	
	
// Enter main loop.
for (;;)
{
    power_manage();
}

}

Best Regards

Nelson

Parents
  • Hi Nelson, generally, from what I've seen, people usually retarget printf over UART, or use Segger RTT for logging. However, regarding the fact that its hanging, my guess is that somewhere in your project its linking to retarget.c. For instance, in my IAR project, under the nRF_Libraries group, retarget.c is linked. If I remove that file, navigate to General Options-->Library Configuration you should see an option for semihosting. If you want printf to log through IAR IO console, click Semihosted for stdout/stderr. You should now be able to see your stdout over the View-->Terminal IO window.

    Let me know how you make out!

Reply
  • Hi Nelson, generally, from what I've seen, people usually retarget printf over UART, or use Segger RTT for logging. However, regarding the fact that its hanging, my guess is that somewhere in your project its linking to retarget.c. For instance, in my IAR project, under the nRF_Libraries group, retarget.c is linked. If I remove that file, navigate to General Options-->Library Configuration you should see an option for semihosting. If you want printf to log through IAR IO console, click Semihosted for stdout/stderr. You should now be able to see your stdout over the View-->Terminal IO window.

    Let me know how you make out!

Children
No Data
Related