⚠️
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.
6 posts / 0 new
Last post
Dsandbue.
Offline
Last seen:1 year 9 months ago
加入:2017-02-15 14:09
UART问题

Hello there,

I'm having problems with a UART-communication and I'd greatly appreciate your help. :-)
So, I'm working with the pxp-reporter (SUOTA enabled) demo as the basis, and I've added UART2 (9600 baud, ad_uart) to read in Information from a different device, parse the information and send it via BLE. It's working in general, but sometimes the DA14681 crashes when reading in via UART. It never crashes when I don't connect the UART, so it's definitely related to it. I'm testing around with the configuration and stumbled upon some questions:

1) As far as I understand it, it's not good to mix the usage of the Adapters and the LLDs. However, if I try to disable hw_uart, I get Compiler Errors because of unresolved variables (e.g. " HW_UART_ID" in ad_uart.c.
Is it possible to use only the Adapter? Or doesn't it matter anyway if I never call functions from hw_uart?

2) The same is true for DMA. If I disable HW_UAR_USE_DMA_SUPPORT, I get loads of Errors from the Compiler because of missing variables.
Or is it possible/better to use DMA in my "setup" (sorry if that's a stupid question, I've only encountered Interrupt-driven UART so far)?

4)根据数据表,UART2的FIFO缓冲区长为16个字节。如果我想用软件fifo说出100字节,我是否需要调用“ad_uart_set_soft_fifo”,或者是否足以将“dg_configuart2_software_fifo_size”设置为100?

3)我通过AD_UART_READ(SYNC)和50毫秒的超时读取信息字节字节。如果发生超时,它是否会重置设备或简单地继续使用代码?

5) Is it possible to use Pin 1_3 for ADC? Because at startup, the DA14681 is using the pin for UART-Communication (sending out "DA14681" a few times).
有没有一些配置,所以这个引脚完全用于ADC?

Thanks a lot in advance,
Philipp

设备:
TR_Dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2014-06-30 23:52
Hi Phillipp:

Hi Phillipp:

I will discuss these questions internally at Dialog and post a reply.

谢谢,

TR_DIALOG

Dsandbue.
Offline
Last seen:1 year 9 months ago
加入:2017-02-15 14:09
Thank you very much!

Thank you very much!

Dsandbue.
Offline
Last seen:1 year 9 months ago
加入:2017-02-15 14:09
Hello again,

Hello again,

我在我的代码中找到了一个非常讨厌的错误,Uart现在就像魅力一样。:-)

什么仍在困扰我的是问题5:
是否可以使用PIN 1_3进行ADC?因为在启动时,DA14681使用PIN用于UART通信(发送“DA14681”几次“)。
有没有一些配置,所以这个引脚完全用于ADC?

一些附加信息:当我测量〜2 V下的电压时,AD转换工作正常工作。但是,如果我插入超过2 V的电压并拔下电源,请将引脚1_3上的电压上升到近3 V.当我接地时别针,它留在地上,但否则它左右3 V.
Unfortunately, I'm bound to use this pin and no other one for ADC.

非常感谢你的help,
Philipp

TR_Dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2014-06-30 23:52
Hi,

Hi,

Here is the information I gathered. I would like to post it as they are important guidelines:

1) Please note that adapters is anLLD顶部的附加层(low level drivers) and are not implemented as separate tasks. This is the reason why如果禁用或扰乱相应外围模块的正常操作,它们无法正常工作。因此,您要么直接使用UART LLD(在HW_UART.H文件中描述)或UART适配器(描述于AD_UART.H文件)without intervening在UART LLD。

Tip:We recommend the usage of adapters for accessing hardware peripherals because not only provide access to the peripheral, but also make sure that other tasks which are currently accessing it, suspend their operation until the peripheral is once again released. So you don't have to worry if another task tries accessing the same peripheral at the same time.

2) As far as the 1st part of this query is concerned the same apply and in this case (if you disable the DMA hardware peripheral you will not be able to use successfully the adapters). Now, a few things about DMAs. So far you are aware of the interrupt-driven concepts i.e. a character is arrived on the RX pin of your MCU and an interrupt is triggered so you can read that character from the receiver and all this with CPU interval. DMAs is a feature which gives you the opportunity to make all your transfers from/to a peripheralwithout CPU interval, in other words DMAs can run simultaneously with the CPU.

Tip:It is your choice if you work with DMAs or not, depending on the application you work with but, if there are many characters to be sent it will be preferable to use DMAs and not forcing the CPU to do this task, depriving the latter to execute other crucial tasks.

3) As far as the超时输入参数ad_uart_read()function is concerned there are two options to work with. The first one is to set it equal toOS_EVENT_FOREVR这迫使应用程序斯图ck until all the amount of data (specified with the second input parameter of this function) is received. In all other cases, function can exit after timeout with less bytes than requested.This means that your application does not stuck waiting for all amount of data.

4) You must define两个都dg_configUART2_SOFTWARE_FIFO_SIZEdg_configuart_software_fifo.macros. The first definition determines the amount of allocated space and the second one启用与否使用AD_UART_SET_SOFT_FIFO()函数。

5) By default P1_3 and P2_3 pins are reserved by the bootloader as UART_TX and UART_RX respectively.
虽然您可以更改默认映射(请参阅可用的配置选项Table 6: Scanning steps for booting from serialof datasheet) it
is not recommended as it requires bootROM changes. Instead, you can use any other available ADC pins as depicted onTable 2: Pin descriptionof DA14681-01_2v3.pdf

谢谢,

TR_DIALOG

Dsandbue.
Offline
Last seen:1 year 9 months ago
加入:2017-02-15 14:09
非常感谢你的

非常感谢您的时间和努力,答案非常好,非常有信息。

只是作为关于PIN 1_3作为ADC的最后一个问题的补充:它现在完美工作,解决方案是删除J15(在Pro-Lobs)上,有些周边搞砸了PIN,现在它很好。:-)