完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
你好,
我怀疑用两个TDS配置一个DMA。例如,第一TD(TD〔0〕)从阵列的位置0到63,当它完成时,它切换到TD(1),在那里它从同一阵列的64到128。第一部分是正确的,但是,第二部分,DMA没有正确地传输数组的数据。 我已经设置了如下配置: -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- CydMatdStices配置(DMADSECRPPSORTOR〔0〕, TrimiMasaGeLead长度* 2,DMADSECRPPSOR(1), (TdyIn SrcAdAdR dMA11Ya TdTm) CydMatdStices配置(DMADSECRPPSORTOR〔1〕, TrimiMasaGeLead长度* 2,DMADSECRPPSOR(0), (TdyIn SrcAdAdR dMA11Ya TdTm) CydMatdStudio地址(DMADSECRPPSORTOR〔0〕, Lo16((UIT32)TrimeMead),Lo16((UIT32)UARTHAR11TXDATAYPPTR); CydMatdStudio地址(DMADSECRPPSORTOR〔1〕, Lo16((TrimeMe[TrimeMeaseGuangLim])),Lo16((UIT32)UARTHAR11TXDATAYPPTR); -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 我认为问题是我没有正确地设置偏移量(我也尝试使用指针)。 提前感谢 张 以上来自于百度翻译 以下为原文 Hello, I have a doubt about configuring a DMA with two TDs. For example, the first TD (TD[0]) goes from position 0 to 63 of an array, when it finishes, it switches to TD[1], where it goes from 64 to 128 of that same array. The first part is done correctly, however, the second part, the DMA is not transferring correctly the array's data. I have set up the configuration as below: ------------------------------------------------------------------------------------------------------------------------------------- CyDmaTdSetConfiguration(dmaDescriptor[0], TEXT_MESSAGE_LENGTH*2, dmaDescriptor[1], (TD_INC_SRC_ADR | DMA_1__TD_TERMOUT_EN)); CyDmaTdSetConfiguration(dmaDescriptor[1], TEXT_MESSAGE_LENGTH*2, dmaDescriptor[0], (TD_INC_SRC_ADR | DMA_1__TD_TERMOUT_EN)); CyDmaTdSetAddress(dmaDescriptor[0], LO16((uint32)textMessage), LO16((uint32)UART_1_TXDATA_PTR)); CyDmaTdSetAddress(dmaDescriptor[1], LO16((textMessage[TEXT_MESSAGE_LENGTH])), LO16((uint32)UART_1_TXDATA_PTR)); ------------------------------------------------------------------------------------------------------------------------------------- I think that the problem is that I didn't set up the offset correctly (I have tried using pointers also). Thank you in advance Chang |
|
相关推荐
4个回答
|
|
当我正确读取代码时,每个TD都会传输TrxiMasaGeLead长度*2字节。但是,将第二个TD的地址设置为TeXiMaseQueLoad的偏移量到文本消息数组的开头。这意味着两个TDS由TrimeMasaGeLead长度字节重叠。
以上来自于百度翻译 以下为原文 When I read your code right, each TD transfers TEXT_MESSAGE_LENGTH*2 bytes. But you set the address of the second TD with an offset of just TEXT_MESSAGE_LENGTH to the beginning of the textMessage array. This means the two TDs overlap by TEXT_MESSAGE_LENGTH bytes. |
|
|
|
我已经改变了TD的长度,但是我也对数组的下半部分产生了奇怪的输出。
以上来自于百度翻译 以下为原文 I have changed the length of the TD, but I am also I am getting strange output for the second half of the array. |
|
|
|
我终于明白了。原因是源地址(在这种情况下)是一个内存地址,所以要给出那个位置的地址,我们应该放“&”;
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- CydMatdStudio地址(DMADSECRPPSORTOR〔0〕, Lo16((UIT32)TrimeMead),Lo16((UIT32)UARTHAR11TXDATAYPPTR); CydMatdStudio地址(DMADSECRPPSORTOR〔1〕, Lo16((UIT32)(&;TrimeMe[TrimeMeaseGeLang])),Lo16((UIT32)UARTHAR11TXDATAYPPTR); -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 张 以上来自于百度翻译 以下为原文 I was able to figure it out. The reason was that the source address (in this case) is a memory address, so to give the address of that position we should put '&': ------------------------------------------------------------------------------------------------------------------------------------------------------------ CyDmaTdSetAddress(dmaDescriptor[0], LO16((uint32)textMessage), LO16((uint32)UART_1_TXDATA_PTR)); CyDmaTdSetAddress(dmaDescriptor[1], LO16((uint32)(&textMessage[TEXT_MESSAGE_LENGTH])), LO16((uint32)UART_1_TXDATA_PTR)); ------------------------------------------------------------------------------------------------------------------------------------------------------------ Chang |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2110 浏览 1 评论
1858 浏览 1 评论
3673 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1791 浏览 6 评论
1540 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
576浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
430浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
440浏览 2评论
390浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
933浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 15:55 , Processed in 1.033804 second(s), Total 82, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号