查看: 4280|回复: 1

[求助] keil kinetis 问题

[复制链接]

该用户从未签到

2

主题

5

帖子

0

新手上路

Rank: 1

积分
17
最后登录
1970-1-1
发表于 2011-7-20 16:34:23 | 显示全部楼层 |阅读模式
e2448:FMC: Flash prefetch could result in incorrect read data
Errata type: Errata
Description: A flash read access could result in incorrect data being returned if the SIM_DIV1 register is
written to change the divide value for the flash clock and a flash prefetch occurs during the
clock change sequence.
Workaround:1. Create a function in the SRAM that performs the following operations:
a. Save value of FMC_PFAPR[23:16].
b. Disable flash prefetching by writing 8’hff to FMC_PFAPR[23:16].
c. Change value of flash divider SIM_DIV1[OUTDIV4].
d. Wait for clock change.
e. Re-enable flash prefetching by restoring the saved FMC_PFACR[23:16] value.
f. Return from the function.
2. Call the SRAM code function.
3. Once the function returns from its SRAM execution, the flash clock divider has been safely
altered.
 
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV3=1,OUTDIV4=1,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0 */
  SIM->CLKDIV1 = (uint32_t)0x00110000u; /* Update system prescalers */
 
keil中没有到ram里去分频啊,而是直接在flash里分频了
我知道答案 目前已有0人回答
回复

使用道具 举报

该用户从未签到

2

主题

224

帖子

0

版主

Rank: 7Rank: 7Rank: 7

积分
322
最后登录
1970-1-1
发表于 2011-7-27 16:17:59 | 显示全部楼层

RE:keil kinetis 问题

如果你不改flash clock divider的话,就当没看到这个errata。
另外,如果你要改变MCG mode的话,请在切换到PLL模式或FLL模式之前更改clock divider这个寄存器。
如果一定要改flash clock divider,若KEIL wizard新建的工程没有把更改代码放到ram中运行,请自行更改代码。
您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条

Archiver|手机版|小黑屋|恩智浦技术社区

GMT+8, 2025-7-19 16:46 , Processed in 0.087600 second(s), 22 queries , MemCache On.

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表