完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我正在通过 SPI 连接 nRF52832(M) 和 ESP8266 12E(S) 以发送图像数据。两者都在 4M 模式下,正常通信工作但传输 10kb 时,它没有得到正确的数据。
我正在使用 Arduino IDE 进行编程。使用 SPI.Slave 函数在 ESP 端接收数据的 问题是,当传输延迟(5000 毫秒)的数据时,数据接收正常,但使用更短的延迟,如 100 毫秒,它只接收大约 1800 字节而不是 10kb nrf 端发送 代码:全选uint32_t wifiSpiWrite(uint8_t *txBuf, uint32_t len) { uint32_t ret = SPI_SUCCESS; ret = nrf_drv_spi_transfer(&spi_2, txBuf, len, NULL, 0); return ret; } wifiSpiWrite(NotifyData,34); if(imageByteCount >= 10230 ) // when sent 10kb then send this { imageByteCount = 0; wifiMod.firstData[0] = 0x02; wifiMod.firstData[1] = 0x00; for(int i =2; i<34;i++) { wifiMod.firstData = 0x06; // when data is complete then send this } wifiSpiWrite(wifiMod.firstData, 34); for (int i = 0; i < 34; i++) { wifiMod.rxBuff = 0; } nrf_delay_ms(100); // so that spi can write and send } } ESP 端接收 SPI 的初始化 hspi_slave_begin(0, this); // 对于 4M 模式 代码:全选SPISlave.onData([](uint8_t * data, size_t len) { if (data[0] == 0x02 ) { Serial.printf("- - Value of index1 %d n",index1); memcpy(&Event_Data[index1],&data[1],31); index1 += 31; } } 以上输出 代码:全选- - Value of index1 32 - - Value of index1 63 - - Value of index1 94 - - Value of index1 125 - - Value of index1 156 - - Value of index1 187 - - Value of index1 218 - - Value of index1 249 - - Value of index1 280 - - Value of index1 311 - - Value of index1 342 - - Value of index1 373 - - Value of index1 404 - - Value of index1 435 - - Value of index1 466 - - Value of index1 497 - - Value of index1 528 - - Value of index1 559 - - Value of index1 590 - - Value of index1 621 - - Value of index1 652 - - Value of index1 683 - - Value of index1 714 - - Value of index1 745 - - Value of index1 776 - - Value of index1 807 - - Value of index1 838 - - Value of index1 869 - - Value of index1 900 - - Value of index1 931 - - Value of index1 962 - - Value of index1 993 - - Value of index1 1024 - - Value of index1 1055 - - Value of index1 1086 - - Value of index1 1117 - - Value of index1 1148 - - Value of index1 1179 - - Value of index1 1210 - - Value of index1 1241 - - Value of index1 1272 - - Value of index1 1303 - - Value of index1 1334 - - Value of index1 1365 - - Value of index1 1396 - - Value of index1 1427 - - Value of index1 1458 - - Value of index1 1489 - - Value of index1 1520 - - Value of index1 1551 - - Value of index1 1582 - - Value of index1 1613 - - Value of index1 1644 - - Value of index1 1675 - - Value of index1 1706 - - Value of index1 1737 - - Value of index1 1768 - - Value of index1 1799 - - Value of index1 1830 - - Value of index1 1861 - - Value of index1 1892 |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
944 浏览 0 评论
1671 浏览 0 评论
请问一下我想用ESP8685直接替换ESP8266而不用写程序,可以让ESP8685直接通过之前ESP8266的外挂的flash运行程序吗
1330 浏览 1 评论
1233 浏览 1 评论
5015 浏览 2 评论
为blufi_device设置自定义名称,但是无法修改,为什么?
1250浏览 4评论
请问ESP32-S2-WROOM怎么获得ESP32-S2外接FLASH的唯一序列号?
927浏览 3评论
2330浏览 3评论
ESP-IDF的VScode插件的build按钮点击会报错的原因?
2526浏览 3评论
ESP-Jumpstart例程中第5个工程:5_cloud连接报错是哪里的问题?
1051浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 22:58 , Processed in 0.572682 second(s), Total 69, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
474
