AnsweredAssumed Answered

Memset() with RAM segments

Question asked by Ambarish Hundekar on Feb 13, 2018
Latest reply on Feb 15, 2018 by Daniel Martynek

Hi NXP team,

 

I am using S32K144 controller in our project.

 

I used the meset() with linker script global variables.

 memset(&__FSLCODE_SECTION_START, 0x00, __FSLCODE_SECTION_END - __FSLCODE_SECTION_START);

 

but that FSL code  segment (section) is not set to zero.

 

find the attached document for more information on memeset() problem.

 

Regarding the watchdog timer :

I used the code given in the reference manual for watchdog configuration 

 

DISABLE_INTERRUPTS(); // disable global interrupt
WDOG->CNT = 0xD928C520; //unlock watchdog
while(((WDOG->CS & WDOG_CS_ULK_MASK) >> WDOG_CS_ULK_SHIFT) == 0); //wait until registers are unlocked
WDOG->TOVAL = 256; //set timeout value
WDOG->CS = WDOG_CS_EN(1) | WDOG_CS_CLK(1) | WDOG_CS_INT(0) |
WDOG_CS_WIN(0) | WDOG_CS_UPDATE(0);
while(((WDOG->CS & WDOG_CS_RCS_MASK ) >> WDOG_CS_RCS_SHIFT) == 0); //wait until new configuration takes effect
ENABLE_INTERRUPTS(); //enable global interrupt

if(WDOG->CNT >= 125)
{
DISABLE_INTERRUPTS(); // disable global interrupt
WDOG->CNT = 0xB480A602; // refresh watchdog
ENABLE_INTERRUPTS(); //
}

 

in the above code , control not come out of the while(((WDOG->CS & WDOG_CS_ULK_MASK) >> WDOG_CS_ULK_SHIFT) == 0);

 

Kindly help in this.

 

Regards,

Ambarish 

Outcomes