AnsweredAssumed Answered

9S08PA60 in CW MCU 10.4/10.6, Processor Expert generated intFlash Code Fail

Question asked by Qu Kai on Oct 4, 2014
Latest reply on Oct 8, 2014 by Pascal Irrle

Hi all,


My MCU is 9S08PA60, use PE to generate a Flash component,

below is IFsh.c


typedef struct {

   uint8_t code[12];             /* Structure required to copy code to ram memory */

  /* Size of this structure needs to be at least (but best) the size of the FnCmdInRam_ */

} FnCmdInRamStruct;


typedef void (* near pFnCmdInRam)(void);


/* Global variables */


static void FnCmdInRam_(void)


  NVM_FSTAT = 0x80U;                   /* Clear flag command buffer empty */

  while (NVM_FSTAT_CCIF == 0U) {}      /* Wait to command complete */



#pragma MESSAGE DISABLE C1805          /* Disable warning C1805 "Non-standard conversion used" */

/*lint -save  -e740 -e931 Disable MISRA rule (1.2) checking. */

static void CallFnCmdInRam()


  FnCmdInRamStruct FnCmdInRam = *(FnCmdInRamStruct *)(FnCmdInRam_); /* Create a copy of Wait in RAM routine on stack */


  ((pFnCmdInRam)&FnCmdInRam)();        /* Call code in RAM */




size of the code array is 12, but size of function FnCmdInRam_ is 14, crash in all flash operation.

10.4 with this issue, updated to 10.6 + update 1.0.0 and it remains.

need help.