Demo project uart baudrate error

⚠️
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.
3 posts / 0 new
Last post
guxiang
Offline
Last seen:6天9小时前
加入:2017-05-12 04:18
Demo project uart baudrate error

Hi dialog,
We used a basic develop kit and "freertos_retarget" project to do the test . In "freertos_retarget" project , DA14681 will send a byte "0x23" via uart port periodically . But the byte I received is "0xE3" in PC console software. The project default baudrate is 115200 . When I lower the baudrate to 38400 , I can receive the correct byte "0x23" . But in "pxp_reporter" , 14681 can send byte correctly even baudrate configured with 115200. why?

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
工作人员
加入:2015-06-08 11:34
Hi guixiang,

Hi guixiang,

I ve tested what you 've mentioned on a basic kit, and using the freertos_retarget i ve added a printf("23"); right under the printf("#"); i could properly receive a "23" on the terminal. Perhaps you 've done something else in order to see what you are mentioning ? Also be aware that because the basic kit uses the UART emulation of the jlink and because of an issue in the jlink driver (the issue is commented in most of the demo projects in the periph_init() function for more details) you will have to add the following line in order for the device to start printing properly.

hw_gpio_configure_pin(HW_GPIO_PORT_2, HW_GPIO_PIN_3, HW_GPIO_MODE_OUTPUT, HW_GPIO_FUNC_GPIO, 1);

This is something that the proximity reporter project implements but the freertos project doesn't.

Thanks MT_dialog

guxiang
Offline
Last seen:6天9小时前
加入:2017-05-12 04:18
Hi , MT

Hi , MT
Thank you, the UART RX pin need to pull up indeed . Now it work well after cofigured the rx pin as internal pull up :
hw_gpio_set_pin_function(HW_GPIO_PORT_2, HW_GPIO_PIN_3, HW_GPIO_MODE_INPUT_PULLUP , HW_GPIO_FUNC_UART2_RX);