PE DMA Controller Issues

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PE DMA Controller Issues

Jump to solution
1,144 Views
davidzhou
Contributor V

Hi,

I have K60F120M tower board.

I have issues with ISR event callback problem and want to remove the DMA controller and regenerate through PE. But after I removed DMA controller, I couldn't put it back as the same as before. I copied back the saved version, but The order of the channels in the Property page (attached) is not Chan 0 to Chan 3.

148211_148211.pngpastedImage_0.png

which creates a huge problem for me after PE generated code.

All channel numbers are reassigned into a different number, e.g. DMACH1 should be DMA1_STATIC_CHANNEL_1, but it reassigned to DMA1_STATIC_CHANNEL_3 even the Channel is chan 1 in the DMA1 controller as shown above.

 

148212_148212.pngpastedImage_1.png

 

The green line is new code generated by PE and the red line is removed/changed from previously generated code.

 

How to fix it?

Thank you,

David Zhou

Labels (1)
0 Kudos
1 Solution
896 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

This is just one logical channel, not the actual physical channel.

It meaning, this is just stand for the sequence of configure the DMA channel,

for example , we add three channel , at start , in turn to configuration : DMACH1 ,2, 3,then

from the DMACHx.c file , we can see they are in turn :

pastedImage_0.png

If then you change one , for example the component of DMACH2, we will see that ,

in the DMACH2.C file , the logical channel number become 2, not 1 , while in the DMACH3.C file ,

is "DMA1_STATIC_CHANNEL_1, ", the reason is we last configure the DMACH2, so the his logical nummber

is the last :

pastedImage_2.png

While it doesn't matter , the actual channel control is at the DMA1.C FILE :

pastedImage_3.png

they are one to one correspondence.

If you think this is confused , i recommend you if change one channles configure, you can from the first one ,then change all of them one by one , only need change one place on each channel, for the do not need changed

channel , you  change it to other , then change it back .

Hope it hleps


Have a great day,
Alice

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
9 Replies
896 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

Yes, i also think so with you , hope the next version of PE can fix this problem.

Sorry for the inconvenient to you .

BR

Alice

0 Kudos
896 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

You can change the Channel settings for chan 3 to chan 1, then generate code to have a try.

pastedImage_0.png

If still can not work well , please tell me which IDE do you use , and which DMA component ,

please take a screenshot . Then you'd better how to reproduce your error , i will check on

my side .

Hope  it helps

Alice

0 Kudos
896 Views
davidzhou
Contributor V

Hi Alice,

Those parameters are not editable. They are fixed.

Is there any way to enable for editing?

Thank you,

David Zhou

0 Kudos
896 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi David,,

Send your project to me , or take a screenshot about which DMA component do you add.

BR

Alice

0 Kudos
896 Views
davidzhou
Contributor V

Hi Alice,

The screen dump of PE compoents: (This is before generating code)

pastedImage_0.png

After regenerating code:  ( - Red Code Lines are removed, and + Green Code Lines are added into the new code) (Screen Dump From GIT)

From DMA1_DevConst, Channel 0  is changed from (DMA_Channel_0)  (- Red Line ) to Channel 0 (DMA_Channel 2) ( Green Line), and so on.


pastedImage_1.png

In AD1_DMA0.c, before regenerating, the ChInit data has DMA1_STATIC_CHANNEL_0, but now it is DMA1_STATIC_CHANNEL_2

and  for other channels in DMACH1, DMACH2, etc.

pastedImage_3.png

Now I have to manually make changes, for example, if I want to enable interrupt for a DMA channel, which was disabled.

I have also zipped my bsp_ project. I cannot attach to this thread. May I send it to you by email?

Thank you,

David Zhou

0 Kudos
896 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

About the DMA channel configuration , please configure the component of "DMAChannel_LDD":

pastedImage_0.png

Not on the DMAConroller.

Hope it helps


Have a great day,
Alice

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
896 Views
davidzhou
Contributor V

Hi Alice,

All DMA_Channels in DMALDD_Components are selected with correct channel numbers:

For example DMA_Channel3 is selected as DMA_Channel3:

pastedImage_0.png

But generated channel number changed from CHANNEL3 to CHANNEL1 for DMACH3

pastedImage_2.png

Thanks,

David Zhou

0 Kudos
897 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

This is just one logical channel, not the actual physical channel.

It meaning, this is just stand for the sequence of configure the DMA channel,

for example , we add three channel , at start , in turn to configuration : DMACH1 ,2, 3,then

from the DMACHx.c file , we can see they are in turn :

pastedImage_0.png

If then you change one , for example the component of DMACH2, we will see that ,

in the DMACH2.C file , the logical channel number become 2, not 1 , while in the DMACH3.C file ,

is "DMA1_STATIC_CHANNEL_1, ", the reason is we last configure the DMACH2, so the his logical nummber

is the last :

pastedImage_2.png

While it doesn't matter , the actual channel control is at the DMA1.C FILE :

pastedImage_3.png

they are one to one correspondence.

If you think this is confused , i recommend you if change one channles configure, you can from the first one ,then change all of them one by one , only need change one place on each channel, for the do not need changed

channel , you  change it to other , then change it back .

Hope it hleps


Have a great day,
Alice

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
896 Views
davidzhou
Contributor V

Hi Alice,

Thank you for your input.

I think if the program only uses the code generated by PE, this is OK and it will work. I know these numbers are logical. But if logical matches physical will be less confusion and less prone to error/bugs, because if the code is modified and using the macros, such as DMA_TCD1_CS,

    pDMA->SERQ = DMA_SERQ_SERQ(DMA_CHANNEL1);

then all these codes need to be modified again. The logical numbers are shuffled by PE.  I think I need to make such modifications for my customized code.

Thank you for your support.

David Zhou

0 Kudos