完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我注意到访问 ESP 的 I/O 寄存器时有一种奇怪的行为 - 尤其是 SPI FIFO 注册器SPI_W0。15.
I need to fill the FIFO as fast as possible so I ended up using "pure" asm to squeeze the max out of it. I'm using a "plain" RAM to FIFO copy, and the CCOUNT register to count the cycles needed to complete the action. Here is the "main" code snippet (tmr hold the cycles count at the end): uint32 spiFIFO[16]; asm volatile ( "l32i.n %0, %2, 0 rn" // this is here to preload the registers with correct address so to count only cycles needed to actually transfer data from RAM to FIFO "l32i.n %0, %3, 0 rn" "rsr.ccount %1 rn" "l32i.n %0, %2, 0 rn" // this line and "s32i.n %0, %3, 0 rn" // this one are a "move pair", moving one DWORD from RAM to FIFO "l32i.n %0, %2, 4 rn" "s32i.n %0, %3, 4 rn" "l32i.n %0, %2, 8 rn" "s32i.n %0, %3, 8 rn" "l32i.n %0, %2, 12 rn" "s32i.n %0, %3, 12 rn" ... // "pairs" are repeated for various tests "rsr.ccount %0 rn" "sub %1, %0, %1 rn" : "=&r"(data),"=&r"(tmr):"r"(spiFIFO),"r"(SPI_W0(ESP_SPI_HSPI))); 所以,这是一件奇怪的事情: 5 对 = 11 个周期 (10 L32I/S32i RSR),看起来很棒 8 对 = 17 个周期再次很棒 10 对 = 28 个周期减速 - 1.4 cy/inst 12 对 = 51 个周期 16 对 = 64 个周期- 慢了2倍?! 为什么??或者更好 - 如何避免这种情况? It seems like some sort of "cache overrun" but the statement "ESP has no caches" is everywhere in the forum(s)... 读数 the FIFO register (or GPIO) is "constantly slow" - 12 cycles for a single l32i read instruction 有什么提示吗? |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
470 浏览 0 评论
991 浏览 0 评论
1709 浏览 0 评论
请问一下我想用ESP8685直接替换ESP8266而不用写程序,可以让ESP8685直接通过之前ESP8266的外挂的flash运行程序吗
1368 浏览 1 评论
1254 浏览 1 评论
为blufi_device设置自定义名称,但是无法修改,为什么?
1288浏览 4评论
请问ESP32-S2-WROOM怎么获得ESP32-S2外接FLASH的唯一序列号?
943浏览 3评论
2385浏览 3评论
ESP-IDF的VScode插件的build按钮点击会报错的原因?
2570浏览 3评论
ESP-Jumpstart例程中第5个工程:5_cloud连接报错是哪里的问题?
1071浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-13 10:38 , Processed in 0.658504 second(s), Total 69, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2537
