Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大疆remote 的Wordlength应该是9(Including Parity),但是代码中是8却可以使用双缓存区,为什么? #1

Open
Specific-Cola opened this issue Jan 25, 2024 · 4 comments

Comments

@Specific-Cola
Copy link

尝试用单缓存区接收遥控器数据,发现一直HAL_UART_ErrorCallback,最后发现是帧错误,是Wordlength应该是9,但代码里一直都是8搭配双缓存区,居然可以运行,为什么呢?

@thinvy
Copy link
Owner

thinvy commented Jan 27, 2024

尝试用单缓存区接收遥控器数据,发现一直HAL_UART_ErrorCallback,最后发现是帧错误,是Wordlength应该是9,但代码里一直都是8搭配双缓存区,居然可以运行,为什么呢?

手册上写的是8位数据位,一位偶校验,一位停止位,只有8位是会被存入dma接收buffer的有效信息,校验位不会存入的,这里没问题的呀

https://rm-static.djicdn.com/tem/4.RoboMaster%20机器人专用遥控器(接收机)用户手册.pdf

image image

之前开单缓冲区也是没问题的,先使能串口中断,再直接用HAL_Uart_Receive_DMA这个函数开,空闲中断读取后再继续掉这个HAL的dma接收函数,具体可以看看20年的步兵代码。不要随意更改wordlength,在场上信号差的环境下可能会断连

@nViol3t
Copy link

nViol3t commented Jan 29, 2024

O.o

@Specific-Cola
Copy link
Author

W)3T1`8} M}92V47T$R$A54 它这里写的是including parity 为什么更改wordlength 会影响信号呢?
目前我用了9测试单双缓存区都是能收到遥控器数据的

@thinvy
Copy link
Owner

thinvy commented Jan 29, 2024

W)3T1`8} M}92V47T$R$A54 它这里写的是including parity 为什么更改wordlength 会影响信号呢? 目前我用了9测试单双缓存区都是能收到遥控器数据的

看了st论坛,如果协议是这样确实应该配成9bit,以前完全没注意过这个问题,看来例程或者协议可能有一个是错的😂

感觉最好问一下官方,因为不好说接收器的发射端是不是也这样写的😂😂

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants