⚠️
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.
11 posts / 0 new
Last post
phanquocuong1520022
Offline
Last seen:1 year 10 months ago
加入:2019-04-11 02:47
Connect betwen DA14580 and STM32F4 via UART

Hello,

STM32F4 <----- UART -----> DA14580 <----- BLE(DSPS)----> Android

I want to connect between DA14580 and STM32F4 via UART. Let DA14580 read data from STM32F4
Then, from STM32F4 can send data to the phone.
How to transmit data from DA and STM32F4 by UART?
帮我。

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

Hi phanquocuong1520022,

Thanks for posting your question on our Bluetooth LE forums. Could you please clarify if you are using any of our development boards or you are using a custom board based on DA14580 device? Firstly, you should connect correctly the UART between DA14580 and STM32F4. The DSPS reference application code is by default using the following GPIOs for the UART configuration:

  • TX: P0_4
  • RX: P0_5
  • RTS: P0_3
  • CTS: P0_2

您可以在user_periph_setup.h中找到UART配置。因此,您必须将STM32F4连接到该GPIOS。如果您希望拥有其他UART引脚,则必须修改User_Periph_setup.h。DSP提供了软件(XON / XOFF)和硬件(RTS / CTS)流控制方案,分别由user_periph_setup.h配置文件中的cfg_uart_sw_flow_ctrl和cfg_uart_hw_flow_ctrl定义选择。UART波特率的选择是通过将UART_SPS_BAUDRATE定义中的UART_SPS.H头文件中的值设置为所需的波特率来完成。可用的波特率115200,57600,38400,19200,9600.中央和外围设备都可以在活动模式下运行或延长睡眠,请检查app_default_sleep_mode在user_config.h中。如果使用扩展睡眠模式,则必须使用符合者的硬件或软件流控制。否则设备不会醒来。由于您在DA1458P和STM32F4之间正确建立了UART连接,因此您可以通过UART发送数据,并且DSP将通过空气传输它们。关于Android应用程序,您应该下载DSPS Android应用程序。 The Android application can be found in Google’s ‘Play Store’ and easily installed from there as any other android application. To find the application, user can search for ‘DSPS Dialog’. For more information, I would suggest you to read theUM-B-038 : User Manual for Dialog Serial Port Profileuser manual.

Thanks, PM_Dialog

phanquocuong1520022
Offline
Last seen:1 year 10 months ago
加入:2019-04-11 02:47
Thanks for the help of the

Thanks for the help of the system.
让我问我如何检查STM32之间的数据传输与持续的DA,STM32F4发送到手机的数据?

My connection:
PC <--- USB ---> STM32F4 <--- UART - > DA < - DSP - > Android
Connect my uart:
TX: P0_4 <---> RX: PA3 (STM32)
RX: P0_5 <---> TX: PA2 (STM32)
RTS:P0_3 <---> CTS:PA1(STM32)
CTS: P0_2 <---> RTS: PA0 (STM32)
And I send it with tools: hercules
but does not display data transfer between STM32 and Android.

Unlike what I have successfully connected: DA with Android
Thanks and please help me !!

CYibin
Offline
Last seen:5 months 4 weeks ago
工作人员
加入:2017-12-14 02:48
Hi,

Hi,

I think the reference design named Codeless would meet your requirement. All you have to do are just to burn the codeless firmware into your 580 and send your data to it via UART AT command. Click below link for more information:

//www.wsdof.com/products/smartbondtm-codeless-commands

Br

CYibin

phanquocuong1520022
Offline
Last seen:1 year 10 months ago
加入:2019-04-11 02:47
Can you help me with the

你能帮助我的CTROL流量吗?
I can't send data between DA and STM32F4 because of CTS / RTS.

PM_Dialog
Offline
Last seen:11 hours 10 min ago
工作人员
加入:2018-02-08 11:03
Hi phanquocuong1520022,

Hi phanquocuong1520022,

You are using the DSPS reference design, aren’t you? Or you are using the CodeLess as CYibin had suggested you? Which is your issue regarding the flow control? Could you please probe the UART lines? If you don’t have connected the STM32F4 with the DA14580, can you send/receive data? I would suggest you to connect a serial monitor instead of STM32F4 and thy to send /receive data to a DSPS mobile application.

Thanks, PM_Dialog

phanquocuong1520022
Offline
Last seen:1 year 10 months ago
加入:2019-04-11 02:47
connect.

connect.
PC <---> DA14580 <--DSPS-> Android
I successfully transmitted data between Android and hercules (PC) with the DSPS App.
Thanks, Cuong

PM_Dialog
Offline
Last seen:11 hours 10 min ago
工作人员
加入:2018-02-08 11:03
Hi phanquocuong1520022,

Hi phanquocuong1520022,

That’s good! So, when you have connected the STM32F4 with the DA14580, can you please probe the UART lines? Could you please make sure that you are using the correct baud rate from both sides?

Thanks, PM_Dialog

phanquocuong1520022
Offline
Last seen:1 year 10 months ago
加入:2019-04-11 02:47
Hi Dialog.

Hi Dialog.
1. I checked Baurate of STM32 = 115200 just like the DSPS example of the Dialog provided. But do not transmit receive data.
2.我没有更改代码,并保持DSP示例的配置(DSPS SPS_DIVICE KEIL5)
and set the PIN pin on STM32F4.
I need Code Flow Ctrol (CTS / RTS) Software for STM32F4 instead of using Hard_Flow_Ctrol code is available.
3. PC <---usb--> STM32F4 <--- uart--> DA14580 <- dsps -> Android
Do I need to connect DA14580 to PC?
Or just connect as the above diagram?

Attachment:
phanquocuong1520022
Offline
Last seen:1 year 10 months ago
加入:2019-04-11 02:47
Hi Dialog,

Hi Dialog,

when connecting DA14580 and STM32F4
In the DSPS example there are 2 choices
1. sps_device
2.sps_host
Which option should I use 1 or 2?
Thanks,cuong

PM_Dialog
Offline
Last seen:11 hours 10 min ago
工作人员
加入:2018-02-08 11:03
Hi phanquocuong1520022,

Hi phanquocuong1520022,

您应该使用SPS_DEVICE项目。您能否在DA14580和STM32F4之间共享UART连接?如果是以下情况,请澄清一下吗?

[STM] RX:PA2 <----> [580] TX:P0_4

[STM] ΤX: PA3 < ---- > [580] RX: P0_5

[STM] CTS: PA1 < ---- > [580] RTS: P0_3

[STM] RTS: PA0 < ---- > [580] CTS: P0_2

Did you probe the UART lines in order to check if the STM is successfully transmitting data to DA14580?

Thanks, PM_Dialog