Kinetis driver error kl c90tfs help me.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Kinetis driver error kl c90tfs help me.

ソリューションへジャンプ
975件の閲覧回数
alejandro_df
Contributor I

Hi I'm using the kl05 kinetis the TSS library and want to emulate the EEPROM using the c90tfs driver. When I call the function FSL_InitEeprom () generates an interrupt me of

PE_ISR (Cpu_ivINT_Hard_Fault)

{

   / * This code can be changed using the CPU component property "Build Options / Unhandled int code" * /

   PE_DEBUGHALT ();

}

  Specifically there is the interruption in the line 392 of the file "ee_high_level.c"

     / * If it is not first time initialization * /

     / * Check if the current field has been Identified active * /

     if (EE_ERASED_STATE_32 == g_currentActiveSector)

     {

         / * If the current active has not been Identified industry,

            then the first turn before the alternative is the current active industry sectors * /

         sectorAddress = PREV_SECTOR (altSectorAddress);

----> here --- >>> sectorStatus = READ32 (sectorAddress);

         / * The first turn before the alternative sector, the industries is the latest Active field * /

         while (EE_SECTOR_STATUS_ACTIVE! = sectorStatus)

         {

             sectorAddress = PREV_SECTOR (sectorAddress);

             sectorStatus = READ32 (sectorAddress);

         }

         g_currentActiveSector = sectorAddress;

         g_freeSpaceAddress = sectorAddress + EE_SECTOR_SIZE - EE_SECTOR_WASTE;

     }

my master code is as follows:

int main (void)

/ * lint-restore Enable MISRA rule (6.3) checking. * /

{

   / * Variable local Write your definition here * /

  / / Delay_ms (500) / / DELAY MANDATORY for stability

   / *** Processor Expert internal initialization. DO NOT REMOVE THIS CODE! *** /

   PE_low_level_init ();

   / *** End of Processor Expert internal initialization. *** /

   / * Write your code here * /

   / * For example: for (;;) {} * /

   UINT32 fnSize = 0x200;

   UINT32 fnSrc = (UINT32) FSL_FlashCommandSequence - 1;

   UINT32 fnDest = (UINT32) __ram_for_command_sequence_func;

   CopyToRAM (fnDest, fnSize, fnSrc);

   / / Assign value to the global function pointer for FlashCommandSequence. / /

   / / The EED will use this pointer whenever service calls FlashCommandSequence it. / /

   g_pFlashCommandSequence = (pFLASHCOMMANDSEQUENCE) (fnDest + 1);

 

  

 

 

   returnCode = FSL_DeinitEeprom ();

     if (EE_OK! = returnCode)

     {

         ErrorTrap ();

     }

 

   returnCode = FSL_InitEeprom () ;/ / FSL_DeinitEeprom ();

   if (EE_OK! = returnCode) {ErrorTrap ();}

   WaitEepromReady ();

0 件の賞賛
返信
1 解決策
646件の閲覧回数
DerekLau
Contributor IV

Erase the whole chip and try again by disableinterrupts before calling initeeprom.

If error still happends, check whether sectorAddress is within the flash area. Reading of non-existing address will cause fault interrupt.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
647件の閲覧回数
DerekLau
Contributor IV

Erase the whole chip and try again by disableinterrupts before calling initeeprom.

If error still happends, check whether sectorAddress is within the flash area. Reading of non-existing address will cause fault interrupt.

0 件の賞賛
返信