HardFault exception - configuring EEEPROM Functionality

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

HardFault exception - configuring EEEPROM Functionality

760 Views
Alberto_C
Contributor I

Hello

I'm currently working with S32K144 , I'm trying to configure EEEPROM Functionality with no SDK but during my SW execution I'm getting a hardfault exception.

here is my code configuration:

 

/* Clear RDCOLERR & ACCERR & FPVIOL & MGSTAT0 flag in flash status register. Write 1 to clear */
IP_FTFC->FSTAT = (uint8_t)(FTFC_FSTAT_FPVIOL_MASK | FTFC_FSTAT_ACCERR_MASK | FTFC_FSTAT_RDCOLERR_MASK);

/* The program partition command configures FlexRAM as EEPROM and FlexNVM as EEPROM backup region */
IP_FTFC-> FCCOB [3] = 0x80; /* FCCOB0: Selects the PGMPART command */
IP_FTFC-> FCCOB [2] = 0x00; /* FCCOB1: No CSEc operation */
IP_FTFC-> FCCOB [1] = 0x00; /* FCCOB2: No CSEc operation */
IP_FTFC-> FCCOB [0] = 0x00; /* FCCOB3: FlexRAM loaded with valid EEPROM during reset sequence */
IP_FTFC-> FCCOB [7] = 0x02; /* FCCOB4: EEPROM data set size code: EEESIZE = 2 (4 kB) */
IP_FTFC-> FCCOB [6] = 0x04; /* FCCOB5: FlexNVM Partition code: DEPART = 4 (Data flash: 0 kB, EEPROM backup: 64 kB) */

/* Enable the command complete interrupt */
IP_FTFC->FCNFG |= FTFC_FCNFG_CCIE_MASK;
/* Clear CCIF bit by writing a '1' to launch command */
IP_FTFC->FSTAT |= FTFC_FSTAT_CCIF_MASK;

/* Clear RDCOLERR & ACCERR & FPVIOL & MGSTAT0 flag in flash status register. Write 1 to clear */
IP_FTFC->FSTAT = (uint8_t)(FTFC_FSTAT_FPVIOL_MASK | FTFC_FSTAT_ACCERR_MASK | FTFC_FSTAT_RDCOLERR_MASK);

/* FlexRAM Function command changes the function of the FlexRAM */
IP_FTFC-> FCCOB [3] = 0x81; /* FCCOB0: Selects the SETRAM command */
IP_FTFC-> FCCOB [2] = 0x00; /* FCCOB1: Make FlexRAM available for emulated EEPROM */

/* Enable the command complete interrupt */
IP_FTFC->FCNFG |= FTFC_FCNFG_CCIE_MASK;
/* Clear CCIF bit by writing a '1' to launch command */
IP_FTFC->FSTAT |= FTFC_FSTAT_CCIF_MASK;

Also I have enable the FTFC interrupt in the NVIC and Interrupt Service Routine to handle the command completion event.

Any idea on what the issue is ? should I configure in a separate functions the Program Partition command and set FlexRAM ?

Thanks
Alberto

0 Kudos
Reply
6 Replies

675 Views
Alberto_C
Contributor I

Hi Daniel, quick update on this topic.

I have enabled the FTFC interrupt and put it into the SRAM but I'm still getting the Hardfault exception. ( see the image below)
The HardFault happens when the execute_command function is being executed ( 
HardFault exception at 0x1FFF8424)

Alberto_C_0-1759963584535.png

here is my linker configuration:

Flash:

Alberto_C_1-1759963913884.pngAlberto_C_2-1759964029933.png

 

RAM:

Alberto_C_3-1759964089153.png

Alberto_C_4-1759964153410.png

Am I missing something in the linker configuration ?

Is it mandatory to enable the FTFC interrupt ?

Thanks 
Alberto 

 

 

 

0 Kudos
Reply

649 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Alberto_C,

Regarding the interrupt, please disregard my previous response.
The issue here is that during the command operation, the core must not execute any code from flash memory. This limitation makes it impractical to use interrupt mode for partitioning. Instead, polling mode should be used. Partitioning should be done only once during the device’s lifetime anyway.

Regards,

Daniel

0 Kudos
Reply

639 Views
Alberto_C
Contributor I
Hi Daniel, thanks for your reply.

Using the polling mode and execute the command from SRAM , I'm still getting the hardfault,
Strangely this does not happen, when I step through the program line by line (debugging the sw execution). Then the configuration for FlexRAM as EEPROM and FlexNVM as EEPROM backupp gets programmed correctly.
any missing configuration ?

How can the partition be reverted ? - I'm testing my code , but with the hardfault I can not perform any write testing.

Thanks for your support.
Alberto
0 Kudos
Reply

741 Views
Alberto_C
Contributor I
I have noticed that the issue occurs here:
/* Clear CCIF bit by writing a '1' to launch command */
IP_FTFC->FSTAT |= FTFC_FSTAT_CCIF_MASK;

I'm handling the command complete interrupt in ISR but I can not reach that part of code since the hardfault happens inmediatly after the command is launch.
Does anyone have any idea on how to solve it ?
0 Kudos
Reply

713 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Alberto_C,

It must be partitioned from SRAM.

This code must be in SRAM:

FTFC->FSTAT = FTFC_FSTAT_CCIF_MASK; // launch command
while((FTFC->FSTAT & FTFC_FSTAT_CCIF_MASK) == 0); // wait until complete

Place the code into a function and the function place in SRAM:

__attribute__ ((section(".code_ram"))) // place the function below into .code_ram
uint8_t partition(void);

 

If you use the FTFC interrupt, the core must not read any data or execute any code from the Flash.

 

Regards,

Daniel

0 Kudos
Reply

697 Views
Alberto_C
Contributor I
Hi Daniel, thanks for your reply.

I have create a function and put it into the SRAM but I'm still getting the Hardfault exception.

here is my code:
__attribute__((section (".code_ram")))
void execute_command(void);

void execute_command(void)
{
IP_FTFC->FSTAT |= FTFC_FSTAT_CCIF_MASK;
while ((IP_FTFC->FSTAT & FTFC_FSTAT_CCIF_MASK) == 0);
}

Note: I disabled the FTFC interrupt.

While debugging I noticed that there is warning icon in the function saying " value may be incorrect : runtime code areas(RAM) not yet initialized"
Am I missing something ?

Thanks
Alberto
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2181350%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHardFault%20exception%20-%20configuring%20EEEPROM%20Functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2181350%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3EI'm%20currently%20working%20with%20S32K144%20%2C%20I'm%20trying%20to%20configure%20EEEPROM%20Functionality%20with%20no%20SDK%20but%20during%20my%20SW%20execution%20I'm%20getting%20a%20hardfault%20exception.%3C%2FP%3E%3CP%3Ehere%20is%20my%20code%20configuration%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%2F*%20Clear%20RDCOLERR%20%26amp%3B%20ACCERR%20%26amp%3B%20FPVIOL%20%26amp%3B%20MGSTAT0%20flag%20in%20flash%20status%20register.%20Write%201%20to%20clear%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3BFSTAT%20%3D%20(uint8_t)(FTFC_FSTAT_FPVIOL_MASK%20%7C%20FTFC_FSTAT_ACCERR_MASK%20%7C%20FTFC_FSTAT_RDCOLERR_MASK)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20The%20program%20partition%20command%20configures%20FlexRAM%20as%20EEPROM%20and%20FlexNVM%20as%20EEPROM%20backup%20region%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3B%20FCCOB%20%5B3%5D%20%3D%200x80%3B%20%2F*%20FCCOB0%3A%20Selects%20the%20PGMPART%20command%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3B%20FCCOB%20%5B2%5D%20%3D%200x00%3B%20%2F*%20FCCOB1%3A%20No%20CSEc%20operation%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3B%20FCCOB%20%5B1%5D%20%3D%200x00%3B%20%2F*%20FCCOB2%3A%20No%20CSEc%20operation%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3B%20FCCOB%20%5B0%5D%20%3D%200x00%3B%20%2F*%20FCCOB3%3A%20FlexRAM%20loaded%20with%20valid%20EEPROM%20during%20reset%20sequence%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3B%20FCCOB%20%5B7%5D%20%3D%200x02%3B%20%2F*%20FCCOB4%3A%20EEPROM%20data%20set%20size%20code%3A%20EEESIZE%20%3D%202%20(4%20kB)%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3B%20FCCOB%20%5B6%5D%20%3D%200x04%3B%20%2F*%20FCCOB5%3A%20FlexNVM%20Partition%20code%3A%20DEPART%20%3D%204%20(Data%20flash%3A%200%20kB%2C%20EEPROM%20backup%3A%2064%20kB)%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20Enable%20the%20command%20complete%20interrupt%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3BFCNFG%20%7C%3D%20FTFC_FCNFG_CCIE_MASK%3B%3CBR%20%2F%3E%2F*%20Clear%20CCIF%20bit%20by%20writing%20a%20'1'%20to%20launch%20command%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3BFSTAT%20%7C%3D%20FTFC_FSTAT_CCIF_MASK%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20Clear%20RDCOLERR%20%26amp%3B%20ACCERR%20%26amp%3B%20FPVIOL%20%26amp%3B%20MGSTAT0%20flag%20in%20flash%20status%20register.%20Write%201%20to%20clear%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3BFSTAT%20%3D%20(uint8_t)(FTFC_FSTAT_FPVIOL_MASK%20%7C%20FTFC_FSTAT_ACCERR_MASK%20%7C%20FTFC_FSTAT_RDCOLERR_MASK)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20FlexRAM%20Function%20command%20changes%20the%20function%20of%20the%20FlexRAM%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3B%20FCCOB%20%5B3%5D%20%3D%200x81%3B%20%2F*%20FCCOB0%3A%20Selects%20the%20SETRAM%20command%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3B%20FCCOB%20%5B2%5D%20%3D%200x00%3B%20%2F*%20FCCOB1%3A%20Make%20FlexRAM%20available%20for%20emulated%20EEPROM%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20Enable%20the%20command%20complete%20interrupt%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3BFCNFG%20%7C%3D%20FTFC_FCNFG_CCIE_MASK%3B%3CBR%20%2F%3E%2F*%20Clear%20CCIF%20bit%20by%20writing%20a%20'1'%20to%20launch%20command%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3BFSTAT%20%7C%3D%20FTFC_FSTAT_CCIF_MASK%3B%3CBR%20%2F%3E%3CBR%20%2F%3EAlso%20I%20have%20enable%20the%20FTFC%20interrupt%20in%20the%20NVIC%20and%20Interrupt%20Service%20Routine%20to%20handle%20the%20command%20completion%20event.%3CBR%20%2F%3E%3CBR%20%2F%3EAny%20idea%20on%20what%20the%20issue%20is%20%3F%20should%20I%20configure%20in%20a%20separate%20functions%20the%20Program%20Partition%20command%20and%20set%20FlexRAM%20%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%3CBR%20%2F%3EAlberto%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2183087%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HardFault%20exception%20-%20configuring%20EEEPROM%20Functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2183087%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHi%20Daniel%2C%20thanks%20for%20your%20reply.%3CBR%20%2F%3E%3CBR%20%2F%3EUsing%20the%20polling%20mode%20and%20execute%20the%20command%20from%20SRAM%20%2C%20I'm%20still%20getting%20the%20hardfault%2C%3CBR%20%2F%3EStrangely%20this%20does%20not%20happen%2C%20when%20I%20step%20through%20the%20program%20line%20by%20line%20(debugging%20the%20sw%20execution).%20Then%20the%20configuration%20for%20FlexRAM%20as%20EEPROM%20and%20FlexNVM%20as%20EEPROM%20backupp%20gets%20programmed%20correctly.%3CBR%20%2F%3Eany%20missing%20configuration%20%3F%3CBR%20%2F%3E%3CBR%20%2F%3EHow%20can%20the%20partition%20be%20reverted%20%3F%20-%20I'm%20testing%20my%20code%20%2C%20but%20with%20the%20hardfault%20I%20can%20not%20perform%20any%20write%20testing.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20your%20support.%3CBR%20%2F%3EAlberto%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2182979%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HardFault%20exception%20-%20configuring%20EEEPROM%20Functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2182979%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F255593%22%20target%3D%22_blank%22%3E%40Alberto_C%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3ERegarding%20the%20interrupt%2C%20please%20disregard%20my%20previous%20response.%3CBR%20%2F%3EThe%20issue%20here%20is%20that%20during%20the%20command%20operation%2C%20the%20core%20must%20not%20execute%20any%20code%20from%20flash%20memory.%20This%20limitation%20makes%20it%20impractical%20to%20use%20interrupt%20mode%20for%20partitioning.%20Instead%2C%20polling%20mode%20should%20be%20used.%20Partitioning%20should%20be%20done%20only%20once%20during%20the%20device%E2%80%99s%20lifetime%20anyway.%3C%2FP%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2182335%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HardFault%20exception%20-%20configuring%20EEEPROM%20Functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2182335%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Daniel%2C%20quick%20update%20on%20this%20topic.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20enabled%20the%20FTFC%20interrupt%20and%26nbsp%3B%3CSPAN%3Eput%20it%20into%20the%20SRAM%20but%20I'm%20still%20getting%20the%20Hardfault%20exception.%20(%20see%20the%20image%20below)%3CBR%20%2F%3EThe%20HardFault%20happens%20when%20the%20%3CSTRONG%3Eexecute_command%3C%2FSTRONG%3E%20function%20is%20being%20executed%20(%26nbsp%3B%3C%2FSPAN%3EHardFault%20exception%20at%200x1FFF8424)%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Alberto_C_0-1759963584535.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Alberto_C_0-1759963584535.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359957i0371A06F48BF0197%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Alberto_C_0-1759963584535.png%22%20alt%3D%22Alberto_C_0-1759963584535.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ehere%20is%20my%20linker%20configuration%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EFlash%3C%2FSTRONG%3E%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Alberto_C_1-1759963913884.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Alberto_C_1-1759963913884.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359959i03026AC4FEA6035F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Alberto_C_1-1759963913884.png%22%20alt%3D%22Alberto_C_1-1759963913884.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Alberto_C_2-1759964029933.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Alberto_C_2-1759964029933.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359960iFFBEA8150CC3B4B1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Alberto_C_2-1759964029933.png%22%20alt%3D%22Alberto_C_2-1759964029933.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3ERAM%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Alberto_C_3-1759964089153.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Alberto_C_3-1759964089153.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359961i7C67316B1717A235%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Alberto_C_3-1759964089153.png%22%20alt%3D%22Alberto_C_3-1759964089153.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Alberto_C_4-1759964153410.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Alberto_C_4-1759964153410.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359962i594EA3ADB6CE7F20%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Alberto_C_4-1759964153410.png%22%20alt%3D%22Alberto_C_4-1759964153410.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAm%20I%20missing%20something%20in%20the%20linker%20configuration%20%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EIs%20it%20mandatory%20to%20enable%20the%20FTFC%20interrupt%20%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThanks%26nbsp%3B%3CBR%20%2F%3EAlberto%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2182003%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HardFault%20exception%20-%20configuring%20EEEPROM%20Functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2182003%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHi%20Daniel%2C%20thanks%20for%20your%20reply.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20create%20a%20function%20and%20put%20it%20into%20the%20SRAM%20but%20I'm%20still%20getting%20the%20Hardfault%20exception.%3CBR%20%2F%3E%3CBR%20%2F%3Ehere%20is%20my%20code%3A%3CBR%20%2F%3E__attribute__((section%20(%22.code_ram%22)))%3CBR%20%2F%3Evoid%20execute_command(void)%3B%3CBR%20%2F%3E%3CBR%20%2F%3Evoid%20execute_command(void)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EIP_FTFC-%26gt%3BFSTAT%20%7C%3D%20FTFC_FSTAT_CCIF_MASK%3B%3CBR%20%2F%3Ewhile%20((IP_FTFC-%26gt%3BFSTAT%20%26amp%3B%20FTFC_FSTAT_CCIF_MASK)%20%3D%3D%200)%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3ENote%3A%20I%20disabled%20the%20FTFC%20interrupt.%3CBR%20%2F%3E%3CBR%20%2F%3EWhile%20debugging%20I%20noticed%20that%20there%20is%20warning%20icon%20in%20the%20function%20saying%20%22%20value%20may%20be%20incorrect%20%3A%20runtime%20code%20areas(RAM)%20not%20yet%20initialized%22%3CBR%20%2F%3EAm%20I%20missing%20something%20%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%3CBR%20%2F%3EAlberto%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2181705%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HardFault%20exception%20-%20configuring%20EEEPROM%20Functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2181705%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F255593%22%20target%3D%22_blank%22%3E%40Alberto_C%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EIt%20must%20be%20partitioned%20from%20SRAM.%3C%2FP%3E%0A%3CP%3EThis%20code%20must%20be%20in%20SRAM%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3EFTFC-%26gt%3BFSTAT%20%3D%20FTFC_FSTAT_CCIF_MASK%3B%20%2F%2F%20launch%20command%0Awhile((FTFC-%26gt%3BFSTAT%20%26amp%3B%20FTFC_FSTAT_CCIF_MASK)%20%3D%3D%200)%3B%20%2F%2F%20wait%20until%20complete%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EPlace%20the%20code%20into%20a%20function%20and%20the%20function%20place%20in%20SRAM%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E__attribute__%20((section(%22.code_ram%22)))%20%2F%2F%20place%20the%20function%20below%20into%20.code_ram%0Auint8_t%20partition(void)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIf%20you%20use%20the%20FTFC%20interrupt%2C%20the%20core%20must%20not%20read%20any%20data%20or%20execute%20any%20code%20from%20the%20Flash.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2181451%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20HardFault%20exception%20-%20configuring%20EEEPROM%20Functionality%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2181451%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI%20have%20noticed%20that%20the%20issue%20occurs%20here%3A%3CBR%20%2F%3E%2F*%20Clear%20CCIF%20bit%20by%20writing%20a%20'1'%20to%20launch%20command%20*%2F%3CBR%20%2F%3EIP_FTFC-%26gt%3BFSTAT%20%7C%3D%20FTFC_FSTAT_CCIF_MASK%3B%3CBR%20%2F%3E%3CBR%20%2F%3EI'm%20handling%20the%20command%20complete%20interrupt%20in%20ISR%20but%20I%20can%20not%20reach%20that%20part%20of%20code%20since%20the%20hardfault%20happens%20inmediatly%20after%20the%20command%20is%20launch.%3CBR%20%2F%3EDoes%20anyone%20have%20any%20idea%20on%20how%20to%20solve%20it%20%3F%3C%2FLINGO-BODY%3E