Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
flashwrapper.cpp
00001 /* 00002 * flashwrapper.c 00003 * 00004 * Author: spookee 00005 */ 00006 00007 #include "stm32f4xx_hal.h" 00008 00009 #include "flashwrapper.h" 00010 00011 00012 uint32_t flashRead(uint32_t address) { 00013 return (*(uint32_t*)(address+START_ADRESS)); 00014 } 00015 00016 void flashWrite(uint32_t address, uint32_t *p_data, uint16_t size) { 00017 HAL_FLASH_Unlock(); 00018 __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR); 00019 FLASH_Erase_Sector(FLASH_SECTOR_12, VOLTAGE_RANGE_3); 00020 for (int i = 0; i < size; i++) { 00021 HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, START_ADRESS+address + i*4, p_data[i]); 00022 } 00023 HAL_FLASH_Lock(); 00024 } 00025
Generated on Wed Jul 13 2022 07:07:37 by
1.7.2