DMA_ready flag seems to do the opposite of what I expect.

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

cross mob
ThAl_4704151
Level 4
Level 4
25 sign-ins 25 replies posted 10 replies posted

I'm using a GPIF-II interface to communicate with another chip, and I have FLAGA set up to be connected to Current_Thread_DMA_ready, initially low and with active high. I'm only using 4 endpoints, so if I understand correctly, each thread corresponds to only one GPIF address and one USB endpoint, so that should hopefully keep things simple.

My chip sets the address pins to 3, and then checks the pin connected to FLAGA. Then I wait a bit to make sure the flags have time to get updated, and FLAGA is 0. This is the first time I've written anything to the endpoint, so I doubt it's full. I'm not sure what else could be making it not ready, but waiting for it more doesn't seem to help at all.

Next, as a test, I negated the check, so it only tries to send the message when the Current_Thread_DMA_ready flag is false, ostensibly meaning that the thread associated with the endpoint is not ready. That said, when I configured it that way I was able to send data to the host without any trouble. What gives?

It's possible that I'm a bit unclear about what exactly the DMA_ready flag in the GPIF-II interface means. I see a couple places in a couple manuals that say things along the lines of "This is true when the DMA is ready to send or receive data." What exactly is the criteria for "ready" though? Does that just mean the buffer has enough space to queue up a message? Does the state machine also need to be in one of the states with the DATA_IN action? Is there some other constraint?

0 Likes
1 Solution

Hello ThAl_4704151,

"When I said I negated the Current_Thread_DMA_ready check, I meant I changed the logic in the legacy microcontroller. I've also tried it by switching the polarity of the signal in the GPIF-II designer, and that works just as well."

=> Please refer to section b. Output pins (when used as DMA Flags): of the following KBA: GPIF Pin Polarity – KBA224208

Since the flag is configured with initial value: LOW and polarity: Active High, this means that initially, the flag would be low, but as soon as the initialization is done, the flag will:

1.) stay LOW, if there is buffer space available for the thread.

2.) go HIGH, if there is no buffer space available for the thread.

So, your understanding of the FLAG is correct.

Regards,

Yashwant

View solution in original post

0 Likes
7 Replies