Article ID: 000086187 Content Type: Troubleshooting Last Reviewed: 09/11/2012

Can I perform a software reset on a Nios® II embedded processor?

Environment

  • Nios® II Processor
  • Reset
  • BUILT IN - ARTICLE INTRO SECOND COMPONENT
    Description Yes, you can reset a Nios II processor within your software application by using a function pointer set to the reset address of your processor. A software reset is illustrated in the code segment shown below:

    #include <stdio.h>
    
    #include "system.h"
    
    #include "nios2.h"
    
    
    
    #define HAL_PLATFORM_RESET() 
      NIOS2_WRITE_STATUS(0); 
      NIOS2_WRITE_IENABLE(0); 
      ((void (*) (void)) NIOS2_RESET_ADDR) ()
    
    
    
    
    
    int main()
    
    {
    
      printf("Hello from Nios II!\n");
    
    
    
      HAL_PLATFORM_RESET();
    
    
    
      return 0;
    
    }
    
    

    The HAL_PLATFORM_RESET macro disables interrupts and then calls a pointer to a function set to the reset address. This causes the processor to jump to the hardware reset address.

    Related Products

    This article applies to 1 products

    Intel® Programmable Devices