Kinetis processorexpert code generation bug2?

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

Kinetis processorexpert code generation bug2?

Jump to solution
808 Views
BenFan
Contributor III

I discovered a difference in code generation for processorexpert SynchroMaster (SPI) component when I use 2 cpu clock configurations.

It's in function SendChar.

One cpu clock configuration OK:

byte SPIFLASH_SendChar(SPIFLASH_TComData Chr)

{

  SPIFLASH_TComData TmpChr = OutBuffer; /* Save OutBuffer value */

  if ((SerFlag & FULL_TX) != 0U) {     /* Is last character send? */

    return ERR_TXFULL;                 /* If no then return error */

  }

  if (EnUser) {                        /* Is device enabled? */

    SMasterLdd1_Main(SMasterLdd1_DeviceDataPtr);

    OutBuffer = Chr;                   /* Save character */

    if (SMasterLdd1_SendBlock(SMasterLdd1_DeviceDataPtr, (LDD_TData *)&OutBuffer, 1U) == ERR_BUSY) { /* Send one data byte */

      OutBuffer = TmpChr;              /* If is device busy, restore OutBuffer value */

      return ERR_TXFULL;

    }

    SMasterLdd1_Main(SMasterLdd1_DeviceDataPtr);

  } else {

    OutBuffer = Chr;                   /* Save character */

    SerFlag |= FULL_TX;                /* ...and set flag */

  }

  return ERR_OK;

}

Two cpu clock configurations ERROR

byte SPIFLASH_SendChar(SPIFLASH_TComData Chr)

{

  if (!EnMode) {                       /* Is the device disabled in the actual speed CPU mode? */

    return ERR_SPEED;                  /* If yes then error */

  }

  SPIFLASH_TComData TmpChr = OutBuffer; /* Save OutBuffer value */

  SMasterLdd1_Main(SMasterLdd1_DeviceDataPtr);

  OutBuffer = Chr;                     /* Save character */

  if (SMasterLdd1_SendBlock(SMasterLdd1_DeviceDataPtr, (LDD_TData *)&OutBuffer, 1U) == ERR_BUSY) { /* Send one data byte */

    OutBuffer = TmpChr;                /* If is device busy, restore OutBuffer value */

    return ERR_TXFULL;

  }

  SerFlag &= (byte)~(TX_BUF_EMPTY);    /* Clear TX_BUF_EMPTY flag */

  SMasterLdd1_Main(SMasterLdd1_DeviceDataPtr);

  return ERR_OK;

}

I have tested this with few test projects and different toolchains in CW 10.4.

Any suggestions what should I try to get this solved?

thnx,b

Labels (1)
1 Solution
599 Views
vfilip
NXP Employee
NXP Employee

Hello,

I have just find out that issue was already fixed in CW V10.5.

Could you please to move to this version or you would like rather prefer hot-fix for CW V10.4?

Best regards

Vojtech Filip

Processor Expert Support Team

View solution in original post

4 Replies
599 Views
vfilip
NXP Employee
NXP Employee

Hello,

I have reproduce it and I have classified it as bug in CW V10.4. The fix of this issue will be published in CW V10.6 (Q1-Q2 2014). For now as workaround is necessary to freeze generated code of this component. This feature is available after right click on the component, command Code Generation -> "Don´t Write ...."

Note: For future issue related to the Processor Expert please use corresponding forum: https://community.freescale.com/community/pex

In case the workaround would not be sufficient for you we will prepare hot-fix for this issue.

We are sorry for inconvenience.

Best regards

Vojtech Filip

Processor Expert Support Team

0 Kudos
599 Views
bgag
Contributor I

Screwed again. Seems like every time I find out the last 3 days were wasted because of a "bug" that is resolved by a CW version update, it costs our company $1600 to get the license file updated.

0 Kudos
600 Views
vfilip
NXP Employee
NXP Employee

Hello,

I have just find out that issue was already fixed in CW V10.5.

Could you please to move to this version or you would like rather prefer hot-fix for CW V10.4?

Best regards

Vojtech Filip

Processor Expert Support Team

599 Views
BenFan
Contributor III

I will go with 10.5

thank you for help!

0 Kudos