Hii....
i just implemented UART in ble_app_barebone example as per uart_sync example but the transmission (using function uart2_write)works fine. in case of reception its not work(using function uart2_read). can you help me why uart not received data's?
i just Reserve the gpio's(p0.4 and p0.5) after it configure and enable uart clock. and transmit some data(works fine) after that recive some data but not receive data its not trigger the callback uart2_read_completion_cb.
Gpio reserved:-
RESERVE_GPIO( UART2_TX, GPIO_PORT_0, GPIO_PIN_4, PID_UART2_TX);
RESERVE_GPIO( UART2_RX, GPIO_PORT_0, GPIO_PIN_5, PID_UART2_RX);
Configure gpio:-
GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_4, OUTPUT, PID_UART2_TX, false);
GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_5, INPUT, PID_UART2_RX, false);
clock enable:-
SetBits16(CLK_PER_REG, UART2_ENABLE, 1); // enable clock for UART 2
uart2_init(UART_BAUDRATE_115K2, UART_CHARFORMAT_8);
after that:-
uart2_write((uint8_t *)"test for data\n\r", strlen("test for data\n\r"), uart2_write_completion_cb); // works fine
uart2_read(rxbuf, 1, uart2_read_completion_cb); // not trigger uart2_read_completion_cb
Hi alan.a,
Could you please clarify if you are using any of the sleep modes? If yes, the most possible reason why you cannot receive data through UART I because of the UART block is powered of in sleep mode. This means that the device will not receive any data since it is sleep mode. I would suggest you to run your code in active mode (without any sleep configuration) and try to send data to the DA14580. Also, it would be very helpful to probe UART signals.
Thanks, PM_Dialog