I am using hw_uart_receive(HW_UART3, &var, 1, uart_data_cb, &var) from a main task.
I am using hw_uart_receive(HW_UART3, &var, 1, uart_data_cb, &var)一旦我在回调uart_data_cb中收到一个字节,我就通知主任务,然后发出另一个hw_uart_receive(HW_UART3, &var, 1, uart_data_cb, &var)。我试图得到一个字节一次,因为我不知道字节的数量,我可以接受。
我正在使用回调,以便可以使用中断处理程序。否则,hw_uart_receive只是块和旋转。
是否有一个好的方法来使用Dialog UART api来实现UART接收处理程序,这将有助于可靠地获得UART数据。我不知道我将收到多少字节,所以我认为它需要中断为基础。
任何帮助都将不胜感激。
Thanks and Regards,
Subramanyan
但是,我试图在UART不繁忙时将我的板设置为扩展睡眠模式以节省电源。换句话说,在扩展睡眠模式下,有两件事应该能够唤醒板:
1- BLE timer发送广告报文。
2- UART Rx引脚。
我理解为这个目的应该采取以下步骤:
1-就在要睡觉之前,我必须禁用uart,并设置Rx引脚用于唤醒板。
2-当从这个引脚有一个唤醒时,我应该激活uart并开始侦听消息。
我对如何正确配置扩展睡眠模式和设置回调有点困惑。您能在这方面给我一些指导吗? (Due to hardware limitations, I can't use UART in 4-wire mode, therefore; I'm trying to use the sam Rx pin for both purposes.)
Regards,
Hamid
我试图修改SDK中的UART示例,以便我能够每200 msc接收日期。这是我所做的:
#include <#include "arch_system.h" #include " user_user_setup .h" #include "uart_common.h" #include "uart_utils.h" #include "gpio.h" #include "app_easy_timer.h" #include "app_easy_timer.h" #include "rwip_config.h" #include "gap.h" static void receive_timer_cb();timer_hnd receive_timer_used;Int main(void) {system_init();//设置UART2引脚和配置uart_peripher_init (UART2);//执行UART2 receive blocking example receive_timer_used = app_easy_timer(200,receive_timer_cb); printf_string(UART2, "\n\n\n\r* UART examples finished successfully *\n\r"); } static void receive_timer_cb() { uart_receive_blocking_example(UART2); receive_timer_used = app_easy_timer(200, receive_timer_cb); }
However, when I try to compile this piece of code, I get the following error:
.\..\..\..\..\..\sdk\platform\core_modules\rwip\api\rwip_config.h(464): error: #20: identifier "BLE_NB_PROFILES" is undefined TASK_PRF_MAX = (TASK_RFU_5 + BLE_NB_PROFILES), ..\src\main.c(40): warning: #1295-D: Deprecated declaration receive_timer_cb - give arg types static void receive_timer_cb();
Other examples in the SDK use the same method to define and use a timer, but there is not such a problem while compiling. That being said, would you please give me some instructions about this error and how to remove it?
收到电路板后,我已经测试了Demo。一切正常:led闪烁,我的电脑终端通过UART接收到BD地址。< / p > < p >然后我试图利用作品的例子,解释在教程中,问题来了:< br / >当我启动调试会话在凯尔,我能看到led闪烁(我试图改变闪烁频率,以确保它是好的代码,和它),但是我不能接收通信终端。我是否遗漏了一些东西(如硬件配置、引脚分配或其他东西)?李> < / p > < ul > <开关缺省配置,李< / > < >李我第二个工具包(同样,USB)和默认的演示,我仍然能收到BD地址通过UART与这个,李< / > < >李我使用Realterm,也试过拉,腻子没有更好的结果李< / > < / ul > < p > < / p > < p >来解决这个问题,你有什么提示?
先谢谢你。< / p > < / div > < / div > < / div > < div class =”字段field-name-field-forum-keywords field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >关键词:,< / div > < div class = "字段条目" > < div class =”field-item甚至“> < a href = " / resource-keywords / da14531-kit-usb”“=“skos:概念”属性=“rdfs: label skos: prefLabel”数据类型= " " > DA14531Kit-USB
printf_byte_dec函数不工作!!??< / p > < / div > < / div > < / div > < div class =”字段field-name-field-forum-keywords field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >关键词:,< / div > < div class = "字段条目" > < div class =”field-item甚至“> < a href = " / resource-keywords / uart”“=“skos:概念”属性=“rdfs: label skos: prefLabel”数据类型= " " > UART < / > < / div > < / div > < / div > < div class =”字段field-name-field-device field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >设备:,< / div > < div class = "字段条目" > < div class =”field-item甚至“> < a href = " /分类/ / 1491”一词typeof =“skos:概念”属性=“rdfs: label skos: prefLabel”数据类型= " " > DA14585 < / > < / div > < / div > < / div >
不需要打开/关闭外部微控制器,我就能成功地在微控制器和手机之间来回发送数据。然而,我认为当我在运行时重新配置引脚时,它会导致数据在接收时丢失,有时会导致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
0x00028158 6B00 LDR r0,[r0, #0x30]
0x0002815A 4700 BX r0
0x0002815C B510 PUSH {r4,lr}SystemInit
0x0002815E 4822 LDR r0,[pc,#136]; @0x000281E8
0x00028160 6881 LDR r1,[r0,#0x08]
0x00028162 0709 LSLS r1,r1,#28]
0x00028164 0F09 LSRS r1,r1,#28main
0x00028166 2901 CMP r1,#0x0184] ; @0x20003A80
0x00028168 D01A BEQ 0x000281A0
对于一个应用程序,我想从UART1接收一些数据并发送一些数据到I2C设备。来自UART的数据包含I2C设备的地址和数据。
但是当我运行我的代码(只与UART接收),代码停止在“ASSERT_WARNING(xSemaphorePM != NULL);”
当我删除所有I2C和UART代码时,代码工作正常(测试时LED2闪烁)。
我想要的是从UART接收数据,接收一个中断,解码它并把它发送给i2c设备。因为我使用基本的开发板,所以我想为此使用UART1端口。< / p > < p >谢谢!< / p > < / div > < / div > < / div > < div class =”字段field-name-field-forum-keywords field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >关键词:,< / div > < div class = "字段条目" > < div class =”field-item甚至“> < a href = " / resource-keywords / uart”“=“skos:概念”属性=“rdfs: label skos: prefLabel”数据类型= " " > uart < / > < / div > < divclass="field-item odd">ad_i2c