title: Erasing STM32 Flash Sector is hanging program
body: <p>I am using FreeRtos and in one of the tasks I Erase a sector of the flash using the following code</p>
  <pre><code>HAL_FLASH_Unlock();
      // Fill EraseInit structure
          static FLASH_EraseInitTypeDef EraseInitStruct;
      EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS; 
      EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;
      EraseInitStruct.Sector = sector;
      EraseInitStruct.NbSectors = numOfSectorsToErase;
  HAL_FLASHEx_Erase_IT(&amp;EraseInitStruct); 
    
      HAL_FLASH_Lock();
  </code></pre>
  <p>I thought this was a non-blocking invocation to erase the sector however when this is called, all other threads seem to be Preempted for 100 ms (as seen on oscilloscope) until the erase is completed. I must be doing something wrong because I am using the interrupt version of the erase. It shouldn't hang everything like this correct?</p>
  <p>(I am sure that I am erasing the sector where the program code does not reside. Sector 6)</p>