⚠️
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.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
5 posts / 0 new
Last post
Max44
Offline
Last seen:8 months 4 weeks ago
加入:2016-02-08 15:58
UART2 + UART1?

I have an application based on the ble_app_peripheral example. I want to use UART2 as configured in the example as the printf console for debug messages. I'd like to add UART1 to connect to another external device. It isn't clear how UART2 and UART1 can be configured to run together. Do I need a uart1.c driver in addition to uart2.c? Then how are the interface routines for uart1_read and uart1_write invoked and the callbacks for uart1_write_completion and uart1_read_completion set up?

谢谢你,马克斯

Device:
MT_dialog
Offline
Last seen:1 month 3 weeks ago
Staff
加入:2015-06-08 11:34
Hi Max44,

Hi Max44,

The UART2 is used usually from the SDK along with the arch_console api as a debug module that will make sure that the 580 is awake when the printing moment arrives. The drivers for both the UART interfaces are almost identical and can be used together as long as you properly configure the pins for each UART, the difference is that for the usage of UART2 the SDK uses an additional layer (arch_console) that as mentioned will store the printing messages in a list and when the device will pass through the app_asynch_trm() function will output all the messages stored in the list. The arch_console api is implemented in order to use only one UART module, but you can always use other UART directly via the dirvers. You can have a look at the DSPS application that uses the UART module and check how the functions that you mention operate.

Thanks MT_dialog

Max44
Offline
Last seen:8 months 4 weeks ago
加入:2016-02-08 15:58
Thanks MT.

Thanks MT.

I think the DSPS is a bit complicated to use as an easy to understand example of UART use, but I did take a look at it. I'm going to try to set up a simple example with both UARTs operating using modified code based on the SDK peripheral examples. If I can get that to work I should be able to do something similar in the ble_app_peripheral based application I'm working on. I'm currently using a UART to communicate with an external MCU managing some sensors, but I would also like to have the capability of having debug messages via the development kit virtual comm port. I've found this very useful in debugging and monitoring operation in sleep modes where the Keil debugger disconnects.

Regards, Max

zhaozhenhong
Offline
Last seen:1 year 5 months ago
加入:2019-07-12 04:10
我发现the UART2 of the DSPS

我发现the UART2 of the DSPS can not work,why?

PM_Dialog
Offline
Last seen:9 hours 15 min ago
Staff
加入:2018-02-08 11:03
Hi zhehanc,

Hi zhehanc,

You could find all the available schematic and PCB material for DA14580 in the “Schematics” section form our support website. Please follow the link below:

//www.wsdof.com/products/connectivity/bluetooth-low-energy/smartbond-da14580-and-da14583

Thanks, PM_Dialog