⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
alan.a
Offline
Last seen:2 years 5 months ago
Joined:2018-10-31 07:50
UART Issue

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

Device:
PM_Dialog
Offline
Last seen:12 hours 14 min ago
Staff
Joined:2018-02-08 11:03
Hi alan.a,

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