title: stm32l0: Failed to execute MI command. Error erasing flash with vFlashErase packet
body: <p>I'm using a Nucleo STM32L031 with AC6 STM32 workbench (eclipse).</p>
  
  <p>I write my application and go to debug mode, everthing was working well until I add another function in my application. I notice that when I remove/comment the "<em>new_function</em>", the software can go to debug mode again. However when I add the "<em>new_function</em>" to the code and go to debug, an error occurs and it cannot go to debug mode.</p>
  
  <pre><code>Error: Error in final launch sequence
  Failed to execute MI command:
  load C:Project_STM32L031K6-Nucleo\\Debug\\Project.elf 
  
  Error message from debugger back end:
  Error erasing flash with vFlashErase packet
  Error erasing flash with vFlashErase packet
  </code></pre>
  
  <p>This error does not occur only for this specific "new_function", but also for other functions e.g TIM21_Init() generated by STM32Cube.</p>
  
  <p>I tried to search for the solution, but couldn't find it.</p>
  
  <p>Thanks
  Bien</p>