Error in DMA Code Generated by Processor Expert for the Kinetis K22F Models

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in DMA Code Generated by Processor Expert for the Kinetis K22F Models

Jump to solution
402 Views
brunopaillard
Contributor III

Hi

I am trying to use the DMA_Channel_LDD module of Processor Expert on the MK22FN512xxx12 processor.

It seems like there is an (obvious) error in the code generated in file DMA1.c

I am attaching the following clip from the HandleInterrupt() function.

Almost at the end (see error mark), the DMA_PDD_ClearChannelInterruptFlag() macro uses the symbol DmaMemMapPtr, instead of DMA_BASE_PTR!

This causes the code to fail to compile!

Capture.JPG.jpg

0 Kudos
1 Solution
197 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

The defect has been fixed and we have prepared the hot fix package for KDS 2.0.0. See the attached hot fix package.

Best Regards,

Marek Neuzil

View solution in original post

0 Kudos
7 Replies
197 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Bruno,

I have tried to reproduce the error but I can build the application without any error. The DmaMemMapPtr is defined as a local variable in the HandleInterrupt function, see below. Could you send me the project to reproduce the error, please?

/*
** ===================================================================
**     Method      :  HandleInterrupt (component DMAController)
**
**     Description :
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
static void HandleInterrupt(DMA1_TChnDevData *ChnDevDataPtr)
{
  DMA1_TChnDevConst const         *ChnDevConstPtr = ChnDevDataPtr->ChnDevConstPtr;
  DMA_MemMapPtr                    DmaMemMapPtr = ChnDevConstPtr->DmaMemMapPtr;
  uint32_t                         ErrorStatus;

  if (DMA1__GetChannelErrorInterruptFlag(DmaMemMapPtr, ChnDevConstPtr->PhyChnMask)) {
    /* Channel error detected */
    /* Transfer error */
    ErrorStatus = DMA1__GetErrorStatus(DmaMemMapPtr);      /* Get error flags */
    if (DMA1__GetErrorValidFlags(ErrorStatus)) {           /* Any error flags valid? */
      if (DMA1__GetErrorChannelNumber(ErrorStatus) == ChnDevConstPtr->PhyChnNum) { /* Channel error flags valid? */
        /* Remember all (device and channel) error flags */
        ChnDevDataPtr->ErrorFlags |= DMA1__GetErrorFlags(ErrorStatus);
      } else {
        /* Remember device error flags only (if any flag set) */
        ChnDevDataPtr->ErrorFlags |= DMA1__GetDeviceErrorFlags(ErrorStatus);
        /* Remember channel error flags are not valid */
        ChnDevDataPtr->ErrorFlags |= LDD_DMA_UNKNOWN_ERROR;
      }
    } else {
      /* Error flags not valid */
      ChnDevDataPtr->ErrorFlags |= LDD_DMA_UNKNOWN_ERROR;
    }
    DMA1__DisableRequest(DmaMemMapPtr, ChnDevConstPtr->PhyChnNum);
    DMA1__ClearChannelErrorInterruptFlag(DmaMemMapPtr, ChnDevConstPtr->PhyChnNum);
    if (ChnDevDataPtr->Events.OnErrorFnPtr != NULL) {
      ChnDevDataPtr->Events.OnErrorFnPtr(ChnDevDataPtr->UserDataPtr);
    }
  } else if (DMA1__GetTransferDoneFlag(ChnDevConstPtr->TCDPtr)) {
    /* Transfer done without error */
    DMA1__ClearChannelInterruptFlag(DmaMemMapPtr, ChnDevConstPtr->PhyChnNum);
    DMA1__ClearDoneFlag(DmaMemMapPtr, ChnDevConstPtr->PhyChnNum);
    if (ChnDevDataPtr->Events.OnCompleteFnPtr != NULL) {
      ChnDevDataPtr->Events.OnCompleteFnPtr(ChnDevDataPtr->UserDataPtr);
    }
  } else {
  }
}

Best Regards,

Marek Neuzil

0 Kudos
197 Views
brunopaillard
Contributor III

Hi Marek

Just to let you know: In the project that I sent just now the code will compile because I have manually changed the offending symbol to DMA_BASE_PTR.

But I have not disabled Processor Expert's code generation, so you will just have to regenerate that code in order to see the error again!

Thanks

Bruno

0 Kudos
197 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Bruno,

Thank you for the project. I have reproduced the error and I have reported the issue to Processor Expert development team (PEXMCU-2134).

Best Regards,

Marek Neuzil

0 Kudos
197 Views
brunopaillard
Contributor III

Thanks Marek!

Bruno

0 Kudos
198 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

The defect has been fixed and we have prepared the hot fix package for KDS 2.0.0. See the attached hot fix package.

Best Regards,

Marek Neuzil

View solution in original post

0 Kudos
197 Views
brunopaillard
Contributor III

Thanks Marek, that works!

Bruno

0 Kudos
197 Views
brunopaillard
Contributor III

Hi Marek

This is weird...!

The code that generated looks very similar... But not the same!

You can have the project at the link below:

https://dl.dropboxusercontent.com/u/24636754/DDCI_UserDemo.zip

Let me know what you find

Thanks!

Bruno

0 Kudos