资源简介
OpenMV固件所有资料
代码片段和文件信息
/*
* This file is part of the Micro Python project http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2013 2014 Damien P. George
*
* Permission is hereby granted free of charge to any person obtaining a copy
* of this software and associated documentation files (the “Software“) to deal
* in the Software without restriction including without limitation the rights
* to use copy modify merge publish distribute sublicense and/or sell
* copies of the Software and to permit persons to whom the Software is
* furnished to do so subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
* IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include STM32_HAL_H
#include “flash.h“
#if defined(STM32F765xx) || defined(STM32F769xx)
#define FLASH_FLAG_PGSERR (FLASH_FLAG_ERSERR)
#endif
extern void __fatal_error();
void flash_erase(uint32_t sector)
{
uint32_t SectorError = 0;
// unlock
HAL_FLASH_Unlock();
// Clear pending flags (if any)
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR |
FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);
// erase the sector(s)
FLASH_EraseInitTypeDef EraseInitStruct;
EraseInitStruct.TypeErase = TYPEERASE_SECTORS;
EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V
EraseInitStruct.Sector = sector;
EraseInitStruct.NbSectors = 1;
if (HAL_FLASHEx_Erase(&EraseInitStruct &SectorError) != HAL_OK) {
// error occurred during sector erase
HAL_FLASH_Lock(); // lock the flash
__fatal_error();
}
HAL_FLASH_Lock(); // lock the flash
}
void flash_write(const uint32_t *src uint32_t dst uint32_t size)
{
// unlock flash
HAL_FLASH_Unlock();
// program the flash word by word
for (int i=0; i if (HAL_FLASH_Program(TYPEPROGRAM_WORD dst *src) != HAL_OK) {
// error occurred during flash write
HAL_FLASH_Lock(); // lock the flash
__fatal_error();
}
src += 1;
dst += 4;
}
// lock the flash
HAL_FLASH_Lock();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-07-28 10:48 openmv-master\
文件 314 2017-03-27 04:25 openmv-master\.gitignore
文件 120 2017-03-27 04:25 openmv-master\.gitmodules
文件 8172 2017-03-27 04:25 openmv-master\CHANGELOG.md
目录 0 2017-07-28 10:48 openmv-master\design\
文件 2577011 2017-07-07 16:51 openmv-master\design\openmv.pdf
目录 0 2017-07-28 10:48 openmv-master\eagle\
目录 0 2017-07-28 10:48 openmv-master\eagle\lbr\
文件 10435 2017-03-27 04:25 openmv-master\eagle\lbr\omnivision.lbr
文件 96577 2017-03-27 04:25 openmv-master\eagle\lbr\openmv.lbr
目录 0 2017-07-28 10:48 openmv-master\eagle\openmv-sdr\
文件 277650 2017-03-27 04:25 openmv-master\eagle\openmv-sdr\openmv-sdr.brd
文件 51525 2017-03-27 04:25 openmv-master\eagle\openmv-sdr\openmv-sdr.pdf
文件 488205 2017-03-27 04:25 openmv-master\eagle\openmv-sdr\openmv-sdr.sch
目录 0 2017-07-28 10:48 openmv-master\eagle\openmv1\
目录 0 2017-07-28 10:48 openmv-master\eagle\openmv1\debug_adaptor\
文件 25323 2017-03-27 04:25 openmv-master\eagle\openmv1\debug_adaptor\debug_adaptor.brd
文件 23932 2017-03-27 04:25 openmv-master\eagle\openmv1\debug_adaptor\debug_adaptor.sch
文件 162290 2017-03-27 04:25 openmv-master\eagle\openmv1\openmv.brd
文件 2185 2017-03-27 04:25 openmv-master\eagle\openmv1\openmv.dru
文件 37197 2017-03-27 04:25 openmv-master\eagle\openmv1\openmv.pdf
文件 335273 2017-03-27 04:25 openmv-master\eagle\openmv1\openmv.sch
目录 0 2017-07-28 10:48 openmv-master\eagle\openmv1\shields\
目录 0 2017-07-28 10:48 openmv-master\eagle\openmv1\shields\ble\
文件 65442 2017-03-27 04:25 openmv-master\eagle\openmv1\shields\ble\openmv-ble.brd
文件 161456 2017-03-27 04:25 openmv-master\eagle\openmv1\shields\ble\openmv-ble.sch
目录 0 2017-07-28 10:48 openmv-master\eagle\openmv1\shields\cc3k\
文件 72320 2017-03-27 04:25 openmv-master\eagle\openmv1\shields\cc3k\openmv-cc.brd
文件 186920 2017-03-27 04:25 openmv-master\eagle\openmv1\shields\cc3k\openmv-cc.sch
目录 0 2017-07-28 10:48 openmv-master\eagle\openmv2\
文件 18226 2017-03-27 04:25 openmv-master\eagle\openmv2\BOM.ods
............此处省略1091个文件信息
- 上一篇:基于hadoop搜索引擎 离线处理程序
- 下一篇:svg开发实践PDF电子书
相关资源
- Openmv与STM32通信.zip
- 匿名openmv与拓空者pro代码
- 匿名拓空者Pro_TI版资料包-20190728.rar
- 可见光室内定位装置设计
- J3D多目三维重建系统V1.9
- openmv_windows驱动.zip
- OpenMV4 电路原理图.pdf
- openmv_windows驱动.rar
- openmv巡线小车优化程序
- Openmv.rar
- 基于openmv和舵机机械臂的物料颜色识
- OPENMV中文参考资料
- 板球系统.txt
- 基于MSP430F5529和OPENMV追球小车
- OpenMVG+OpenMVS配置Win10+VS2015
- K60(K66)与OpenMV的UART通信.rar
- OpenMVS三维重建开源代码
评论
共有 条评论