How to check DMA buffer?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Philip
Level 3
Level 3
50 sign-ins 25 replies posted 25 sign-ins

Hello,

I'm trying to develop a custom module.

The module has embedded data but I cannot receive the data that I expected.

In order to check EMB data, I modified a BulkLoop example to print some logs as below.

Philip_0-1618463861878.png

I expected "Phase Idx" 0, 1, 2, and 3 should be repeated but they didn't.

At first, I thought I'm able to use "CyU3PDebugPrint()" function.

However when I added that function to DMA callback function which names CyCx3UvcAppDmaCallback(), the firmware didn't work.

 

I want to check the DMA buffer to make sure that the firmware is no problem.

In this case, how can I access the DMA buffer to check values?

or Is there any way to check the EMB data?

Thank you.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

It is not recommended to use blocking calls like debug prints inside DMA callback functions.

I have modified the SDK example project cyfxbulklpmanual for meeting your requirement. The modifications done are mentioned below:

1. Used the API CyU3PDmaBufferAlloc() for allocating the required amount of buffer memory.

2. Copied the DMA buffer contents inside the DMA callback to the buffer allocated in step 1.

3. Printed the contents of the buffer allocated in step 1 in the infinite for loop.

The modified project is attached along with this response. I have tested this modified project at my end and it works as expected. Please try this at your end and let me know if it helps.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

It is not recommended to use blocking calls like debug prints inside DMA callback functions.

I have modified the SDK example project cyfxbulklpmanual for meeting your requirement. The modifications done are mentioned below:

1. Used the API CyU3PDmaBufferAlloc() for allocating the required amount of buffer memory.

2. Copied the DMA buffer contents inside the DMA callback to the buffer allocated in step 1.

3. Printed the contents of the buffer allocated in step 1 in the infinite for loop.

The modified project is attached along with this response. I have tested this modified project at my end and it works as expected. Please try this at your end and let me know if it helps.

Best Regards,
Jayakrishna
0 Likes