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

beacon cannot work with uart

I try to create a beacon which can receive dynamic UUID through UART and advertise with the received UUID.

Now I am working on the sample ble_app_uart, to replace the existed advertising codes with the beacon advertising code in ble_app_beacon.

But in practice, when I remove some code like below

APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false);
    uart_init();
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    gap_params_init();
    services_init();
    //advertising_init();
    //conn_params_init();
    
    printf("%s",start_string);

		//init_timer();
    
		//err_code = ble_advertising_start(BLE_ADV_MODE_FAST);

The program keep printing char 'ÿ', rather than print 'Start...'

How is it caused? And what should I do to implement my purpose?

Parents
  • I have solved the problem... The reason of problem is my program doing nothing after initiation. I change my code to this APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, 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();
    //buttons_leds_init(&erase_bonds);
    ble_stack_init();
    //gap_params_init();
    //services_init();
    //advertising_init();
    //conn_params_init();
    advertising_beacon_init();
    printf("%s",start_string);
    	advertising_start();
    

    Where advertising_beacon_init and advertising_start are same to initiation function in ble_app_beacon, both beacon advertising and uart work well.

    But I still hope someone can explain why program printed some strange things if it do nothing after initiation.

Reply
  • I have solved the problem... The reason of problem is my program doing nothing after initiation. I change my code to this APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, 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();
    //buttons_leds_init(&erase_bonds);
    ble_stack_init();
    //gap_params_init();
    //services_init();
    //advertising_init();
    //conn_params_init();
    advertising_beacon_init();
    printf("%s",start_string);
    	advertising_start();
    

    Where advertising_beacon_init and advertising_start are same to initiation function in ble_app_beacon, both beacon advertising and uart work well.

    But I still hope someone can explain why program printed some strange things if it do nothing after initiation.

Children
Related