This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
In TDA4 application Notes: ZHCAB72,I test GPIO+UDMA for USS Capture in section 3.2,it can work normality in MCU2_0,But when I migrate to MCU2_1,it get all GTC values for zero,what corresponds changes should do in MCU2_1?
Hi,
Can you please share the link of app note you are referring to here?
Regards,
Parth
Hi,
Can you please share the link to PDF itself or the title of the appnote.
Also, please mention which SDK you are using and if you are using any example from SDK, please point to that as well.
Regards,
Parth
Hi,
The SDK version is V7.2,and tested on vision_apps/apps/basic_demos/app_tirtos/tirtos_linuxzhcab72.pdf,
Hi,
Have you re-allocated UDMA resources from mcu2_0 to mcu2_1? Can you please check if you are seeing any udma channel allocation failure error?
Regards,
Brijesh
I don't know how to Re-allocated UDMA resources,just change as follows,no see any channel allocation failure error.
Hi,
Can you please show the output of running of vision_apps_init.sh script? I wanted to see first what exactly error are you getting?
UDMA channels needs to be allocated in the resource manager. You could refer to below faq to understand and allocate udma channels for mcu2_1.
Regards,
Brijesh
ok, looking at the log, it seems the udma allocation is fine and you are also able to get the GPIO interrupt.
Somehow GTC is not running or not able to capture timestamp.
Can you please check GTC location, (0xA90000 + 0x8), on mcu2_1 from CCS memory browser and see if it is toggling?
Also can you please check if cache operations are taken care for the image buffer where it is getting stored? It might have to invalidate the cache for this buffer before accessing it if it is allocated from cached region..
Regards,
Brijesh
Hi expert,
GTC is running normally. It's in the same problem at MCU1_0.
Can you test it in your EVM?
Hi,
Sure, can you please share your code that you are using?
Regards,
Brijesh
Hi expert,
I hasn't permission to send source code,but you can download from the following link:
e2e.ti.com/.../faq-tda4vm-gpio-dma-trigger-in-tda4-and-test-in-sdk7-1
Hi,
I see it working fine even for mcu2_1. I checked it on SDK8.4, similar patch, i just have to make below changes,
1, Allocate block copy channels in sysfw.itb file. I guess you have already taken care of it.
2, Change Interrupt Offset to 12 (uint32_t INTR_OFFSET = 12u;) This is required because GPIO output interrupt starts from 12 for mcu2_1.
After these two changes, i do see correct timestamp in mcu2_1.
[MCU2_1] 64.553253 s: Diff 1866606
[MCU2_1] 64.553301 s: Diff 1999056
[MCU2_1] 64.553337 s: Diff 1999829
[MCU2_1] 64.553367 s: Diff 1999998
[MCU2_1] 64.553398 s: Diff 1999999
[MCU2_1] 64.553425 s: Diff 1999998
[MCU2_1] 64.553455 s: Diff 2000002
[MCU2_1] 64.553483 s: Diff 2000000
[MCU2_1] 64.553512 s: Diff 2000000
Regards,
Brijesh
Hi expert,
Thanks a lot!
can you help to explain how to change Interrupt offset(INTR_OFFSET ) and local event ID(gIntAggrLeviEvtId) in different MCU?
Another question is that whether udma resources can meet 12 ultrasonic applications? If default allocation can't meet it,how to Re-allocated?
Hi,
Out of the 16 outputs reserved for R5F, first 8 are allocated to mcu3_0/1 cores and then 4 are for mcu2_0, so i used offset of 12.
Can you please refer to below faq for channel allocation?
Regards,
Brijesh
Hi expert,
OK! I'll try later.
How do I know the UDMA transmission has been completed? When I add print log at funtion App_eventDmaCb() and App_eventTdCb(),it prints nothing.
Well, when the DMA completes, it will call this callback App_eventDmaCb, which unblocks the semaphore and unblocks task waiting on the semaphore, so you could print the messages in the main task, after semaphore is unblocked..
Regards,
Brijesh
Hi expert,
As below,when use SemaphoreP_WAIT_FOREVER, the task will be block forever. when set to 10ms, it always print timout .
Hi expert,
As below,when use SemaphoreP_WAIT_FOREVER, the task will be block forever. when set to 10ms, it always print timout .
Can you please check if you are using below statement in the code? If yes, please comment it out and then use Wait_Foreever..
CSL_udmapCppi5TrSetReload((CSL_UdmapCppi5TRPD*)pTrpd, 0x1FF, 0U);
Regards,
Brijesh
Hi expert,
The last forums works,thanks!
Now I'm simulating the actual work scenario of ultrasonic sensor. I'm commented App_delete() and App_deinit() in App_GpioDmaTest(),then add the funtion App_GpioDmaTestMain() which been called in main task continuously,and I found that the transferDoneSem been blocked forever,how to resolve it?
Hi,
Without code, it would be difficult for me to check for the reason. All i can say is, if it works for once and twice, there is no reason for it not to work multiple times.. looks like to be some issue in your code logic. So please check the code.
Regards,
Brijesh
Hi expert,
you can copy AppGpioDmaTest() to App_GpioDmaTestMain(), just comment out App_trpdInit() and Udma_ringQueueRaw(),then called in MCU21 main task.
Hi,
We cannot comment out call to App_trpdInit and Udma_ringQueueRaw. The first API initializes UDMA descriptor and second enqueues it to the UDMA queue, without this, request itself would not be submitted and so there will not be any completion interrupt.
Regards,
Brijesh
Hi expert,
I mean App_trpdInit and Udma_ringQueueRaw are initialized in App_GpioDmaTest(),no more calls App_GpioDmaTestMain().
I want to achieve continuous capture sensor signals.
What this API App_GpioDmaTestMain is doing? I dont see it my code.
The code is directly calling App_GpioDmaTest and demonstrates how DMA can be used with GPIO.
If you want to continuous capture, please check the original code from the FAQ. In this code, you will not the completion interrupt, so you need to use some timeout kind of mechanism to process the data..
Regards,
Brijesh
Hi expert,
OK!Thanks!
When ultrasonic sensor measure distance,it responds the number of pluses uncertainty. so I must define more of destination buffer(such as : 40) , if the response pluses only 30,the destination buffer will roll over, how to let destination address start from index 0 everytime?
That will be done by below statement, which you have commented our earlier to get the interrupt. This statement will make sure to reload TR descriptor again, after it captures specified amount of data. Lets say if you configured TR to capture 100 data, then after it finishes capturing 100 data, it would reload the same descriptor and start from 0 again.
CSL_udmapCppi5TrSetReload((CSL_UdmapCppi5TRPD*)pTrpd, 0x1FF, 0U);
HI expert,
when GPIO Interrupt events trigger the DMA transfer,does it consume CPU resources?
Hi,
No, it does not use CPU. You would just need to process the interrupt at the end of transfer..
Regards,
Brijesh
HI expert,
How to config INTR_OFFSET,GPIOMUX_INTRTRO_OUTP_START_R5FSS0,and
gIntAggrLeviEvtId for MCU1_0?
The above mechanism is currently tested only on main domain R5F.
Regards,
Brijesh