AnsweredAssumed Answered

Unkown Problem in SPCStudio compiler

Question asked by vanima.nooshin on May 11, 2016
Latest reply on May 14, 2016 by vanima.nooshin
Hello Erwan,
I have a problem with spcstudio compiler i guess.
my project have 3 section :
1.initialize modules like CAN-LIN-Serial-ADC-PWM-Timer
2.Read From eeprom
3.Main Loop with 50 cases in while(1)

in one switches when i check some data the MCU goes to sleep mode ,
some times the MCU go to sleep correctly  but some times the MCU not go to sleep correctly i think the compiler have some problems with this issue because when i compile the code with some enters between lines or some condition happen in code the program work correctly all time but if i add new code or some changes happen in code the MCU not correctly go to sleep.

I use this functions u send for me :

__attribute__ ((section (".codeinram"))) void gotoStandbyMode(void)
{

    WKUP.WISR.R = 0x00040000;        //Clear interrupt flag

    if ((ME.GS.B.S_CURRENTMODE < SPC5_RUNMODE_RUN3)|| (ME.GS.B.S_CURRENTMODE > SPC5_RUNMODE_RUN0))
    {
        if (OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_STANDBY))//
        {
          SPC5_CLOCK_FAILURE_HOOK();
        }
      }
}

__attribute__ ((section (".codeinram"))) void gotoRunMode(void)
{
        if (OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_DRUN))
        {
          SPC5_CLOCK_FAILURE_HOOK();
        }
}

i change the application.ld with the sample u send for me .

Your earliest help in this regard will be highly appreciated. Thanks in advance.

Best Regards,
Nazerian Vanima

Outcomes