Learn MoreFAQsTutorials

2 posts / 0 new
Last post
Jasu
Offline
Last seen:1 year 10 months ago
加入:2019-01-23 10:26
UART&SPI

I need to use UART serial moiter and ble at a time time ,is it possible? if it is possible what are the pin configuratin need to change?

Device:
PM_Dialog
Offline
Last seen:10 hours 15 min ago
工作人员
加入:2018-02-08 11:03
嗨Jasu,

嗨Jasu,

You could use the arch_printf() API in order to print into the serial monitor.

  1. #define CFG_PRINTF in the da1458x_config_basic.h
  2. Change the uart ports of the fw and assign the UART_TX port/pin to P04 and UART_RX port/pin to P05 (make sure that the configuration that you have changed is under the HW_CONFIG_PRO_DK and that this the board declared in the HW_CONFIG definition).

#elif HW_CONFIG_PRO_DK

#定义UART2_TX_GPIO_PORTGPIO_PORT_0

#define UART2_TX_GPIO_PIN GPIO_PIN_4

#define UART2_RX_GPIO_PORT GPIO_PORT_0

#define UART2_RX_GPIO_PIN GPIO_PIN_5

If you have one other of our DKs or if you are working on a custom board, please modify the definitions above with the appropriate GPIOs

  1. Include the arch_console.h file into user_barebone.c
  2. Invoke arch_printf() into your application
  3. Change the baud rate of the terminal into 115200.

Also, you could have a look at the UART2 asynchronous example of SDK which demonstrates how to use the UART2 driver.

Thanks, PM_Dialog