1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[メモ] STM32L1xx: 内蔵フラッシュメモリを壊す!(...ハズが...)

Posted at

概要

  • STM32L1系のFLASHの特定のところ消去、書き込みを繰り返し行い、どの程度で不良がでるか、を見たかったのだが。。

  • だいぶ前にテストをおこなったのだが、一晩、二晩程度続けたくらいでは大丈夫だった。(ハズ..)

  • データ保存に使用するのに、どの程度、耐えられるか知りたかったんだが、製品では、気にせず、使うことに。

  • うまい テスト・手順・回数(日数)などあれば、コメントお願いします。

環境

  • STM32L15xVC系

  • Cortex®-M3, 256KB Flash, 32KB SRAM, 8KB EEPROM

  • Reference manual:RM0038のProduct category definitionから、Cat.3のチップ。

  • 内蔵フラッシュについて(Cat.3)

    • Page: 消去の単位
      • 256 Bytes: 計 1024 pages
    • Sector:
      • 0 ~ 31 sector: 16 pages = 4 KB
      • 32 ~ 64 sector: 256 pages = 64 KB
    • 書き込みは、WORD(32bit)単位
  • Memory map (STM32L151xC STM32L152xCのデータシートの Memory mapより)
    image.png

  • FLASH関連の使用HAL API

    • 書き込み: HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data)
    • 消去: HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError)
    • FLASHロック: HAL_StatusTypeDef HAL_FLASH_Lock(void)
    • FLASHアンロック: HAL_StatusTypeDef HAL_FLASH_Unlock(void)

テスト内容

テスト1

  1. テスト方法
    1. ページ消去
    2. データチェック(ALL 0x00 ?)
    3. ページ書き込み(256Bytes 0xFFで埋める)
    4. データチェック(ALL 0xFF ?)
    5. ループ
  2. 結果... 普通に使えた(ハズ)

その他

  • テストのソースコードは、見つかったら、載せる.
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?