📄 flash_reg_modify.c
字号:
/*************************************************************************/
/* TMS320F2810 C Language File */
/* The C Language File For Modify FLASH Register Version number: 1.0 */
/* */
/* File name : Flash_Reg_Modify.c */
/* Date/Time created: Jan 25 2006 */
/* Author: Anakin.Lee */
/*************************************************************************/
#include <stdio.h>
#include <string.h>
#include "TMS320F2810_REG.h"
// Functions that will be run from RAM need to be assigned to
// a different section. This section will then be mapped to a load and
// run address using the linker cmd file.
#pragma CODE_SECTION(Flash_Reg_Modify,"secureRamFuncs");
/******************注意********************/
/* 对Flash寄存器的设置不能在Flash内部运行 */
/* 而应该装载在Flash中,在RAM中运行!!!!!!! */
/******************************************/
// CAUTION
// This function MUST be executed out of RAM. Executing it
// out of OTP/Flash will yield unpredictable results
void Flash_Reg_Modify(void)
{ EALLOW;
*FOPT=0x1; /* Flash流水线模式激活 */
*FSTDBYWAIT=0xFF; /* 设置Flash从休眠到待机等待255个SYSCLKOUT周期 */
*FACTIVEWAIT=0xFF; /* 设置Flash从待机到激活等待255个SYSCLKOUT周期 */
*FBANKWAIT=0x0505; /* 设置Flash页读等待5个SYSCLKOUT周期,随机读操作等待5个SYSCLKOUT周期 */
EDIS;
asm(" RPT #7 || NOP");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -