title: STM32L151 on-chip EEPROM write time
body: <p>When I apply these function on my code, I can write and read data on STM32 on-chip EEPROM.</p>
  <pre><code>#define EEPROM_BASE_ADDR    0x08080000
  #define EEPROM_BYTE_SIZE    0x03FF
  </code></pre>
  <p>.</p>
  <pre><code>//Byte write
  void EEPROM_WRITE(uint16_t BiasAddress, uint8_t *Data, uint16_t len)
  {
     uint16_t i;
     HAL_StatusTypeDef status = HAL_OK;
  
     HAL_FLASHEx_DATAEEPROM_Unlock();
     for(i=0;i&lt;len;i++)
     {
         status +=HAL_FLASHEx_DATAEEPROM_Program(FLASH_TYPEPROGRAMDATA_BYTE, EEPROM_BASE_ADDR+BiasAddress+i, *Data);
         Data++;
     }
     HAL_FLASHEx_DATAEEPROM_Lock();
   }
  </code></pre>
  <p>.</p>
  <pre><code>//Byte read
  void EEPROM_READ(uint16_t BiasAddress,uint8_t *Buffer,uint16_t Len)
  {
     uint8_t *wAddr;
     wAddr=(uint8_t *)(EEPROM_BASE_ADDR+BiasAddress);
     while(Len--)
     {
         *Buffer++=*wAddr++;
     }
  }
  </code></pre>
  <p>My problem is that only one byte EEPROM write process taking too much time (6.57ms). How can I decrease this?</p>