完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我有简单的方案(见PIC)FX3从嵌入式FPGA寄存器中读取16位数据。
我用GPIF设计器制作GPIF状态机(见PIC)。 GPIF状态机从状态“开始”开始,然后使用CYU3PGPIFSMFLAST(256,RDYSTART,256, 0, 0)在入口函数SRAMAPTHADRADIONT中切换到状态“RDYSTART”; 在STATE6中,用代码称为中断回调函数: { CYU3PDMACHANNEL SETRALAPUP(&GLCHANDANSELAMPUTHY48); } 为(; { /以前的代码 ApIdReStase= CYU3PGPIFSM交换机(256,RDYSTART,256, 0, 0); 如果(ApRestStand)!= CYU-U3PY成功){ CYU3pDebug打印(CyfxxDebug)优先级,“CYU3PGPIFSM交换机失败,错误代码=%Drn”,ApIrSTAtiON; } /代码后 } 断点集APIReSTATION= CUU3PGPIFSM交换机(256,RDYSTART,256, 0, 0); 我想读一个16位字,但是我在控制中心窗口中有“零长度”。当我试着读2个单词的时候,我没有问题,我收到了2个单词。 我不会读奇数的单词。如果我尝试读奇数词-n,我有n-1个单词(甚至是数字的单词)。 是我的错 附笔。 /*---DMA-P-端口配置(自动模式)-----------------------------------------------------*/*/-*/-/-*-/----------------------------------------*/* DMACFG通知=0; DMACGF.CB=NULL; DMACGF.PRODSCKID=CyfxFxPurthuleU***SoCKET4; DCMAFG.COXSCHAVE=CyfxFuxEuffer-PpPosiSosik; DMACFG计数=1; ApItReStase= CYU3PDMACHANNEL CREATION(&GLCHANDANSLAMUTPOP48,CYU-U3PYDMAX Type AUTO,和DMACFG); 如果(ApRestStand)!= CYU-U3PY成功 { CYU3pDebug打印(CyfxxDebug)优先级,“CyU3PDMACHANNEAR CREATION失败,错误代码= %DN”,APIRSTATION; CyFxAppErrorHandler(ApRestStand); } DMACFG通知=0; DMACGF.CB=NULL; DMACGF.PRODSCKID = CyfxxPuxelyPpPosiSosik; DCMAFG.CascSKID= CyfxfxEuthuliSubSoCKEY8; DMACFG计数=1; ApIdReStase= CYU3PDMACHANNEL CREATION(&GLCHANDANSELAMPUTHEY48,CYU-U3PYDMAX Type AUTO,和DMACFG); 如果(ApRestStand)!= CYU-U3PY成功 { CYU3pDebug打印(CyfxxDebug)优先级,“CyU3PDMACHANNELCONFIG失败,错误代码= %DN”,APIRSTATION; CyFxAppErrorHandler(ApRestStand); } -----------------------------------------------------------*/ 以上来自于百度翻译 以下为原文 I have simple scheme (see pic.) FX3 read 16 bit data from slave FPGA with embedded registers array. I have made GPIF State Machine with GPIF designer (see pic.) GPIF State Machine starts from state "START" and then I switch to state "RD_START" in Entry function SRamAppThread_Entry using CyU3PGpifSMSwitch (256, RD_START, 256, 0, 0); In STATE6 is called interrupt callback function with code: { CyU3PDmaChannelSetWrapUp(&glChHandleSRamPtoU_48); } for (; { // code before apiRetStatus = CyU3PGpifSMSwitch (256, RD_START, 256, 0, 0); if(apiRetStatus != CY_U3P_SUCCESS){ CyU3PDebugPrint (CY_FX_DEBUG_PRIORITY, "CyU3PGpifSMSwitch failed, Error code = %drn", apiRetStatus); } // code after } breakpoint set apiRetStatus = CyU3PGpifSMSwitch (256, RD_START, 256, 0, 0); I want to read one 16 bit word, but I have "zero length" in Control Center window. When I try to read 2 words I haven't problem and I receive 2 words. I cant read odd number of words. If I try to read odd number of words - N, I have N-1 words (even numer of words). Were is my mistake P.S. /*------DMA P-Port config (AUTO mode)---------------------------------------------------------------------------------------------*/ dmaCfg.notification = 0; dmaCfg.cb = NULL; dmaCfg.prodSckId = CY_FX_PRODUCER_USB_SOCKET_4; dmaCfg.consSckId = CY_FX_CONSUMER_PPORT_SOCKET; dmaCfg.count = 1; apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSRamUtoP_48, CY_U3P_DMA_TYPE_AUTO, &dmaCfg); if (apiRetStatus != CY_U3P_SUCCESS) { CyU3PDebugPrint (CY_FX_DEBUG_PRIORITY, "CyU3PDmaChannelCreate failed, Error code = %dn", apiRetStatus); CyFxAppErrorHandler(apiRetStatus); } dmaCfg.notification = 0; dmaCfg.cb = NULL; dmaCfg.prodSckId = CY_FX_PRODUCER_PPORT_SOCKET; dmaCfg.consSckId = CY_FX_CONSUMER_USB_SOCKET_8; dmaCfg.count = 1; apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSRamPtoU_48, CY_U3P_DMA_TYPE_AUTO, &dmaCfg); if (apiRetStatus != CY_U3P_SUCCESS) { CyU3PDebugPrint (CY_FX_DEBUG_PRIORITY, "CyU3PDmaChannelconfig Failed, Error code = %dn", apiRetStatus); CyFxAppErrorHandler(apiRetStatus); } /*-------------------------------------------------------------------------------------------------------------------------*/ |
|
相关推荐
7个回答
|
|
你好,埃文,
在线程主循环中调用CYU3PGPIFSMwitter()API,这将导致GPIF状态机在每次迭代时从RDYSTART状态重新启动。在这种情况下,执行STATE4的次数是随机的,不能确定。因此,正在执行的InDATA动作的数量也不是确定性的。 此外,在CPU中断回调函数中,没有调用CYU3PGPFIFECTSWIN()API,这意味着FWYTRG根本没有发生。 -仅在故障时修改状态机来实现切换到RDYSTATE。 -转变方程从state6到state1为fw_trg和CPU一样执行固件中断回调函数。 CYU3PGPIF控制输入(Cyress); CYU3PGPIFIN控制输入(CyFLUE); -过渡方程状态1变rd_state作为逻辑。 最好的问候, 斯里纳斯 以上来自于百度翻译 以下为原文 Hello Evgen, - The CyU3PGpifSMSwitch() API is called in the thread main loop which will cause the GPIF state machine to restart from RD_START state upon every iteration. In this case, the number of times the STATE4 gets executed would be random and cannot be determined. So, the number of IN_DATA action that is being performed is also not deterministic. - Also, in the CPU interrupt callback function, the CyU3PGpifControlSWInput() API is not called which means that the FW_TRG is not happening at all. - Modify the state machine to implement the switch to RD_STATE only upon a failure. - Change the transition equation from STATE6 to STATE1 as FW_TRG and implement the same in the CPU interrupt callback function in the firmware. CyU3PGpifControlSWInput(CyTrue); CyU3PGpifControlSWInput(CyFalse); - Change the transition equation from STATE1 to RD_STATE as LOGIC ONE. Best regards, Srinath S |
|
|
|
wangcong12138 发表于 2018-9-7 18:34 你好,斯里纳斯! 不使用FWYTRG,它不需要转换,也不需要CYU3PGPIFIN控制输入。 我的主要循环包括许多命令。在CYU3PGPIFSM开关前后设置断路器。然后尝试使用控制中心接收数据。 因此CYU3PGPIFSM开关仅限一次。 以上来自于百度翻译 以下为原文 Hello Srinath! FW_TRG not used - it blocks transition and CyU3PGpifControlSWInput is not needed. My main loop for (;;) consists of many commands. I set breakpionts before and after CyU3PGpifSMSwitch. Then I try to receive data using Control Center. So CyU3PGpifSMSwitch is calld only once. |
|
|
|
bisong13 发表于 2018-9-7 18:47 我使用CyfxSRAM例子并修改。 以上来自于百度翻译 以下为原文 P.S I use CYFXSRAM example and modify. |
|
|
|
你好,埃文, 因为你说过,你是设置断点,我明白你正在使用JTAG调试和编程。如果我错了请纠正我。 -请分享UART的日志中收集。调试CPU打印中断回调收集的日志前,包括。 另外,包括GPIF状态机在调试输出。 最好的问候, 斯里纳斯 以上来自于百度翻译 以下为原文 Hello Evgen, - Since you have mentioned that you are setting breakpoints, I understand that you are using JTAG debugging and programming. Please correct me if I am wrong. - Please share the UART logs that is collected during the process. Include debug prints in the CPU interrupt callback before collecting the logs. Also, include the GPIF state machine number in the debug prints. Best regards, Srinath S |
|
|
|
wangcong12138 发表于 2018-9-7 19:19 我有2个断点。在工作循环中调用CUU3PGPIFSwitt()函数之前的第一个断点。第二个断点是在Cyu3PDMACHANEL SETRAWAPUP()函数之前的中断CPU回调中设置的。 CYFXGPIF2CONFIG.H的状态定义 /*摘要 将用户定义的状态名映射到状态索引 */ 定义开始0 定义空2状态 定义状态1 定义RDY启动4 定义状态6 5 定义状态3 邮编 1.2 K 后置开关 1.4 K 预先切换 9.2 K 以上来自于百度翻译 以下为原文 I have 2 breakpoints. The first breakpoint before call CyU3PGpifSMSwitch() function in working loop. Second breakpoint is set in interruption CPU callback before CyU3PDmaChannelSetWrapUp() function. States definition from cyfxgpif2config.h /* Summary Mapping of user defined state names to state indices */ #define START 0 #define EMPTY_STATE 2 #define STATE1 1 #define RD_START 4 #define STATE6 5 #define STATE4 3
|
|
|
|
bisong13 发表于 2018-9-7 19:36 你好,埃文, -亲切地,共享UART日志,可以使用像TeraTerm这样的终端仿真器来收集,因为它可以更容易调试。 此外,使用CYU3PGPIFGETSMSTATE()API获取GPIF的当前状态,并在UART上打印GPIF。 最好的问候, 斯里纳斯 以上来自于百度翻译 以下为原文 Hello Evgen, - Kindly, share the UART logs that can be collected using a Terminal Emulator like TeraTerm as it can be easier to debug. - Also, use the CyU3PGpifGetSMState() API to obtain the current state of the GPIF and print the same over the UART. Best regards, Srinath S |
|
|
|
wangcong12138 发表于 2018-9-7 19:54 你好,斯里纳斯! 我已经修改了CB功能: 空GpifStopReadDataCb(CUU3PGPIFEvType事件,UIT88T当前状态) { Cyu3PrimtStutsUsIt APIRTYSTATION; Unt8St SMOSTATE; CYU3PGPIFGETSMSTATE(和SMStand); CYU3pDebug打印(CyfxxDebug)优先级,“SM状态= %DN”,SMOSTATE; If(事件=CYU3PY-GPIFIAEVTSM中断){ ApReStisty= CYU3PDMACHANNEL SETRAWAPUP(&GLCHANDANSELAMPUTHY48); } } 我还有下一个UART日志: 以上来自于百度翻译 以下为原文 Hello Srinath! I have modyfied cb function: void GpifStopReadDataCb(CyU3PGpifEventType event, uint8_t currentState) { CyU3PReturnStatus_t apiRetStatus; uint8_t smstate; CyU3PGpifGetSMState(&smstate); CyU3PDebugPrint (CY_FX_DEBUG_PRIORITY, "SM State = %dn", smstate); if(event==CYU3P_GPIF_EVT_SM_INTERRUPT){ apiRetStatus = CyU3PDmaChannelSetWrapUp(&glChHandleSRamPtoU_48); } } And I have got next UART log: |
|
|
|
只有小组成员才能发言,加入小组>>
750个成员聚集在这个小组
加入小组2055 浏览 1 评论
1811 浏览 1 评论
3622 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1747 浏览 6 评论
1499 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
484浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
339浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
401浏览 2评论
343浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
836浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-10 14:49 , Processed in 0.683832 second(s), Total 56, Slave 51 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号