dsps v5.150.2 device disconnects after

⚠️
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.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8 posts / 0 new
Last post
roinovi.
Offline
Last seen:3 years 9 months ago
加入:2015-11-04 18:11
dsps v5.150.2 device disconnects after

hello
我正在使用DA14580来通过UART从我的自定义板转移到手机上的应用程序
in order to test the device i am using the dsps app on an iphone:

custome board (mcu)<=>da14580(device)<=>ble---------ble<=>dsps app running on iphone(host)

当我试图在DA14580设备上运行v 3.150.2时,它可以正常工作 - >我看到了iPhone上运行的应用程序(DSP)上的数据
however when i tried to use the v 5.150.2 on the da14580 device, the device disconnects from the app only when the mcu starts sending data via uart
as seen in the pics attached.
如果MCU不通过UART发送数据,则只有当数据传输开始时,设备将连接到应用程序(主机),仅在第二个时断开连接
它可以是一个缓冲问题还是这样的东西?

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

I haven't encountered such an issue while operating with the DSPS, the fact that when the device starts sending data could be cause by an overflow of a buffer but if you use the flow control feature this should not occur. Check what exactly happens to the 580 when tha MCU starts sending data over the UART and the 580 disconnects, does the device resets ?

Thanks MT_dialog

roinovi.
Offline
Last seen:3 years 9 months ago
加入:2015-11-04 18:11
这是一个缓冲问题。

这是一个缓冲问题。
now its working fine except for the advertising stage meaning:
if the external mcusends data during the advertising phase, than the advertising drops after 1 sec.
however if the mcu doesnt send data during this phase(i physically disconnect the pin) then the da14580 is able to connect to the dsps app , and after the pairing i reconnect the tx pin(physically) from my mcu to the da14580 and i see the data on the dsps app.

my question is : i want to set inactive (GPIO_SetInactive(0,7)) the tx pin on the initialization of the device, and after the pairing phase set the pin active (GPIO_SetActive(0,7))

where in the code do i need to insert these 2 commands?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

I am not sure i understand the question since you have the port/pin 0_7 as a tx pin you wont be able to use it as a gpio set and un-set it with the GPIO_SetActive() command, what you can do is reconfigure the pin as a plain GPIO (PID_GPIO) and set the state of the pin that you would like. Now regarding where you can set the pin, you mention that you would like to do that when the device is initialized, you can place the reconfiguration in the .app_on_init callback and in the end of the pairing phase the .app_on_pairing_succeded is triggered.

Thanks MT_dialog

roinovi.
Offline
Last seen:3 years 9 months ago
加入:2015-11-04 18:11
hello

hello
i have reconfigured the uart rx pin to PID_GPIO and set it to active however i cant see the data flowing through the uart pins (and nothing on the dsps app)

void set_pad_functions(void) // set gpio port function mode
{

/ *
*配置应用程序端口。
i.e.
GPIO_ConfigurePin (GPIO_PORT_0 GPIO_PIN_1, OUTPUT, PID_GPIO, false ); // Set P_01 as Generic purpose Output
*/
gpio_configurepin(gpio_uart1_tx_port,gpio_uart1_tx_pin,输出,pid_uart1_tx,false);
GPIO_ConfigurePin( GPIO_UART1_RX_PORT, GPIO_UART1_RX_PIN, INPUT_PULLUP, PID_GPIO /*PID_UART1_RX*/, true );

is there another place in the code i need to reconfigure?

关于UART引脚处于活动状态时的初始通告问题(以及数据流入)
in the debug session i see that the code is stuck on the assert warning in :

静态void user_periph_push(uint8_t ** wrdata,uint16_t write_amount)
{
bool send_flow_off = false;

//write items to buffer
user_buffer_cfm_write(&periph_to_ble_buffer, write_amount);
if(user_buffer_write_check(&periph_to_ble_buffer,wrdata,rx_callback_size)!= rx_callback_size)
{
ASSERT_WARNING(0);
}

is there a way (other than to set the uart rx pin inactive) to fix this?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

来自引脚的RX功能停止,如果外部设备保持发送,则仍将看到RX线路上的数据,但这并不意味着它们进入580的UART线路,580的RX线仍然被驱动通过外部MCU的Tx,但不会有UART接收数据的中断,因此不应调用user_periph_push()才能导致错误。尽管PIN的重新配置,但是如果您在此时收到错误,那么这意味着显然,环形缓冲区中的可用空间是不够的,您将必须检查设置上发生的原因,因为这不应该发生普通手术。

Thanks MT_dialog

roinovi.
Offline
Last seen:3 years 9 months ago
加入:2015-11-04 18:11
just to clarify

just to clarify
the ASSERT_WARNING(0) happens when i configure the PID_UART1_RX (and then the code is stuck on that line)

when i configure PID_GPIO the code does not stuck but i cant see data on the dsps (because as you said no uart interrupt accures)

1) how do i fix the ASSERT_WARNING(0) when i configure PID_UART1_RX?
it happens because the ring buffer is full when the uart data is coming through but not getting out because there is no ble connection yet right?
2) if i configure PID_GPIO, what needs to be done (and where) in order to invoke a uart rx interrupt?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

您已提到的Assert_Warning(0)确实发生在Periph_to_ble_buffer中没有可用的空间,如果使用,则在DSPS项目中,不应发生。因此,如果您正在获得此警告,这意味着您不使用流量控制,因为在DSP中,如果缓冲区达到高水位级别(RX_BUFFER_HWM),它会向外部设备发出流量,因此您可以不使用流量控制或外部MCU继续将数据发送到580,而流关闭。因此,您正在将缓冲区的底线与缓冲区的Ammount的数据泛增泛增缓冲区,并且您从不免费缓冲区位置。没有解决方法,您必须尊重流量控制或根据您的要求自定义代码。

Regarding the configuration of the PID_GPIO, the fact that you are changing the functionallity of the pin will not allow you to get interrupts for UART since internally the pin is no longer connected to the UART module of the 580.

Thanks MT_dialog