不需要打开/关闭外部微控制器,我就能成功地在微控制器和手机之间来回发送数据。然而,我认为当我在运行时重新配置引脚时,它会导致数据在接收时丢失,有时会导致DA14580在某处挂起。发生看门狗复位(如果启用了监管机构,和手机与蓝牙设备不再禁用广告如果监管机构)< / p > < p >启动,在“set_pads_function”别针将GPIO输出低电压的别针,以防止任何外部微控制器。
当我用手机连接设备时,我禁用了睡眠模式。
在函数“user_sps_server_data_rx_ind_handler”中,我启动一个定时器来处理我的应用程序进程。
The first time the timer callback occurs, I configure the pins to turn on my external microcontroller and set up my UART pins. TX, RX, CTS, and RTS. (I have HW flow control defined)
After a couple seconds, for testing purposes, I disable the timer in case it is causing any problems. Then, I send the outgoing command to the external microcontroller. I can see that the external microcontroller has received and processed the command correctly.
The external microcontroller then sends 3000+ bytes to the DA14580 in 240 byte chunks.
At this point, I can see that all of the bytes have been sent over UART on a scope. The DA14580 will respond either one of two ways:
1. The device is disconnected from the DSPS mobile app and is stuck in some state.
2. If the device doesn't get stuck. I can look at the amount of bytes received from the DSPS mobile app, there will be ~1940 bytes in the last receive file.
If I initially set up the pins as UART and have the microcontroller "on", the DA14580 is able to handle the 240 byte chunks without HW flow control enabled. The DA14580 is also able to handle the 240 byte chunks with flow control enabled without setting the RTS pin during a transmission.
There are a couple things I suspect could be causing the problem:
Is there anything I need to do when I reconfigure the pins from GPIO to UART during runtime?
Is there anything I need to do with the SPS scheduler when I am reconfiguring the pins that could be causing me to not be able to process all 3000+ bytes?
Anything helps, thank you for your time