5 years, 9 months ago.

is there any software reset command for nucleo l152re

int main() 
{
 
  
  int i = 0;
  float time;
  pin_up.mode(PullDown);
  pin_down.mode(PullDown);
  pin_start.mode(PullDown);
  pin_delay.mode(PullDown);
  pin_reset.mode(PullDown);
  
 if(pin_reset==1){
     NVIC_SystemReset();        //...................................where should i put this to reset my system anytime
 }
  pin_start.rise(&startRun);
            lcd.cls();
        lcd.locate(3,0);
        lcd.printf("READY");
        wait(1);
              
           lcd.cls();
        lcd.locate(3,0);
        lcd.printf("SET TIME");
            
             do{
          if(pin_up==1)
           {i= i++;
           wait(0.1);
           if (i>200)
            i=200;
            time = i;
            if(i<4){
             lcd.cls();
             lcd.locate(1,0);
             lcd.printf("Time= %2.2f mn", time*15);
           
                          }
             else{
                 lcd.cls();
                 lcd.locate(1,0);
             lcd.printf("Time= %1.2f Hr", time*15/60);
             
           }
            }
                 else if(pin_down==1){
                     i=i--;
                     wait(0.1);
                     if( i<0)
                     i=0;
                     time = i;
                     if(i<4){
                         lcd.cls();
                         lcd.locate(1,0);
             lcd.printf("Time= %1.2f mn", time*15);
             }
              else{      
              lcd.cls();
              lcd.locate(1,0);
              lcd.printf("Time= %1.2f Hr",time*15/60);
              
                     }
                     }
                     } while(pin_start==0);

  Quarters = i; //Initial selected number of quarters 
 
   if(runtimeleft > 0){
        startRun();
   // call to (re)start engine run)
}
else{
   pin_start.rise(&startRun);
   
   }// just wait for keypress
while(1);
}
// just wait for keypress

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32L152RET6 microcontroller.

1 Answer

5 years, 9 months ago.

If you want to reset the board everytime a button is pressed, it makes more sense to connect it to the reset pin.

But besides that, use an InterruptIn, and it will interrupt your program to reset it.

Accepted Answer

thats what I was thinking , but on the board I cannot find any reset pin connection, like it has of user pin.

posted by jayendra mishra 10 Feb 2016

DO YOU HAVE AN IDEA HOW CAN I CONNECT TO RESET BUTTON?

posted by jayendra mishra 12 Feb 2016