How to disable DMA Address Alignment Checking?

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

How to disable DMA Address Alignment Checking?

Jump to solution
735 Views
vitomarolda
Contributor I

Hi, I am using KL46Z SPI with DMA, and I do receive a block using the following code (which works flawlessly):

SPIMasterLDD_1_ReceiveBlock(SPIMasterLDD_1_TDD_Ptr,reg_data,cnt);

SPIMasterLDD_1_SendBlock(SPIMasterLDD_1_TDD_Ptr,reg_data,cnt);

while(SPIMasterLDD_1_GetBlockReceivedStatus(SPIMasterLDD_1_TDD_Ptr)==FALSE);

I use slow clock in order to save battery (core=8MHz).

I noticed a long delay (120us) before rx/tx, and I finally figured it out the delay is due to SetDestinationAddress/SetSourceAddress:

LDD_TError DMA1_SetSourceAddress(DMA1_TChanDeviceData *ChanDeviceDataPtr, LDD_DMA_TData *Address)

{

  /* This test can be disabled by setting the "Ignore state checking"

     property to the "yes" value in the "Configuration inspector" */

  if (((uint32_t)Address % GetTransactionUnitSize(((DMA1_TChnDevData *)ChanDeviceDataPtr)->TCDPtr)) != 0U) {

    return ERR_PARAM_ADDRESS;

  }

  DMA1__SetSrcAddress(((DMA1_TChnDevData *)ChanDeviceDataPtr)->TCDPtr, (uint32_t)Address);

  return ERR_OK;

}

they both perform a 32 bit modulo operation for preliminary address alignment checking. I would like to disable this test. Comment on the function states:

This test can be disabled by setting the "Ignore state checking"  property to the "yes" value in the "Configuration inspector"

But such option does not exist on KDS3.0.0:

pastedImage_3.png

Does anybody know how to disable DMA Address Alignment checking?

Thank you in advance.

Best Regards.

Vito.

Tags (1)
0 Kudos
1 Solution
408 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Vito,

I am sorry I have discussed the issue with the author of the driver and the comment is incorrect. There is not any Ignore state checking option in the Processor Expert.

You can modify the source code (remove the source code of checking) when you disable generating of these source code files by Processor Expert. Open the context menu of the component in the Component window and select Code Generation - Don't Write Generated Component Modules, see the screenshot below:

pastedImage_0.png

This option ensures that the source code of the DMA component will not be modified by Processor Expert (during Generate Processor Expert Code operation).

Best Regards,

Marek Neuzil

View solution in original post

2 Replies
409 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Vito,

I am sorry I have discussed the issue with the author of the driver and the comment is incorrect. There is not any Ignore state checking option in the Processor Expert.

You can modify the source code (remove the source code of checking) when you disable generating of these source code files by Processor Expert. Open the context menu of the component in the Component window and select Code Generation - Don't Write Generated Component Modules, see the screenshot below:

pastedImage_0.png

This option ensures that the source code of the DMA component will not be modified by Processor Expert (during Generate Processor Expert Code operation).

Best Regards,

Marek Neuzil

408 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Vito,

I  test it on my side , and under the function of " DMAT1_SetSourceAddress", there is not have the "test",

pastedImage_0.png

I use the KDS 3.0,  only add the component of "DMATransfer_LDD" and almost do nothing.

And doest your code is generate on the KDS3.0 or porting if from other place ?

BR

Alice

0 Kudos