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:
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
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
我发现the UART2 of the DSPS can not work,why?
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