ULINK2 User's Guide

UnInit

Summary
int UnInit (
  unsigned long fnc);            /* Function code */
Description

The UnInit function de-initializes the microcontroller and is invoked at the end of an erasing, programming, or verifying step.

The UnInit function has a parameter fnc:

  • 1 - stands for Erase.
  • 2 - stands for Program.
  • 3 - stands for Verify.

Thus, different de-initialization sections can be implemented for each individual Flash programming step.

Return Value

The UnInit function returns a value:

  • 0 - on success.
  • 1 - on failure.

 

See Also

Init

Example
int UnInit (unsigned long fnc) {

  // Lock Flash
  FLASH->CR |=  FLASH_LOCK;

  return (0);
}

Complete example exists in folder \KEIL\ARM\FLASH\STM32F10x.