This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] 编译器/CC2541:UART 接收功能使代码崩溃

Guru**** 2553450 points
Other Parts Discussed in Thread: CC2541

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/573601/compiler-cc2541-uart-recieve-function-is-crashing-the-code

器件型号:CC2541

工具/软件:TI C/C++编译器

您好!

我是新手、我们正在开发 CC2541模块、并从文档 swrc257中获取帮助、以便将 UART 与我们的 BLE 模块连接。
我们将在 keyfobdemo 文件中附加我们的代码。

我们已使用9600波特率在 USART0 ALT1中初始化 UART、并在代码中定义了符号、如所示

HAL_UART=true

HAL_UART_ISR=1
HAL_UART_DMA=2
芯片=2541

我们在该文档 uart0Receive 中获得了函数、并将其添加到代码中、但当在定期函数中调用此函数时、我们无法连接到 BLE、如果我们注释此函数调用、则会连接到 BLE。

问题可能出在哪里?
请帮帮我

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    您正在使用哪个 UART 项目? 如果您要轮询、则程序将保持 while 循环、直到接收到所有字节。 我建议使用 ISR 或 DMA 方法。

    祝你一切顺利