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

S130 UART problem

Hi all,

I was trying to use the S130 Softdevice but the uart peripheral doesn't work properly... I am trying to send three bytes, but only one appears. Flow Control doesn't actually make any difference... I have tried it with a PCA10001 board as well as a custom board with the same result.

If I use S110 the same code (different makefile) works as it should, also if I implement it by hand on the S130 it also works...

I have attached my source code that doesn't work:

main:

int main(void) {

uart_init();

while (1)
{
	app_uart_put('a');
	app_uart_put(0x00);
	app_uart_put('t');
	
	nrf_gpio_pin_toggle(LED_RED);
	nrf_delay_ms(100);
}

}

uart_init:

    static void uart_init(void)
{
    uint32_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_ENABLED,
        false,
        UART_BAUDRATE_BAUDRATE_Baud115200
    };
    APP_UART_FIFO_INIT( &comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
					   uart_event_handle,
                       APP_IRQ_PRIORITY_LOW,
                       err_code);
    APP_ERROR_CHECK(err_code);
}

Also if I don't want to use an event handler (NULL instead if uart_event_handle), the code doesn't run... The only way to get it to work is if I set some delays (of some hundred of ms) between the different app_uart_put(). The only char from the code above I get is the 'a'.

Thanks for your help,

Diogo

Parents Reply Children
No Data
Related