To access the internal flash of STM32F042K6.
This library provides a Partition class used to segment the STM32F042K6 internal flash so that the caller can read/write/erase the partition.
Examples
FlashPartition config(0x7c00, 0x400); uint8_t buf[16]; config.Read(address, buf, sizeof(buf)); config.EraseAll(); config.Write(address, buf, sizeof(buf));
Diff: f042k6_flash.cpp
- Revision:
- 1:7a490a05943a
- Parent:
- 0:a71e3b72379a
--- a/f042k6_flash.cpp Tue Aug 29 02:36:52 2017 +0000 +++ b/f042k6_flash.cpp Mon Sep 11 05:09:15 2017 +0000 @@ -55,7 +55,6 @@ void FlashPartition::UnlockControlRegister() { if (*REG32(FLASH_CR) & CR_LOCK) { - printf("Unlocking control register\r\n"); *REG32(FLASH_KEYR) = 0x45670123; *REG32(FLASH_KEYR) = 0xCDEF89AB; }