查看: 3339|回复: 4

[已解决] 求MKL25擦写Flash的demo-(已解决)

[复制链接]

该用户从未签到

34

主题

101

帖子

0

新手上路

Rank: 1

积分
293
最后登录
1970-1-1
发表于 2013-7-2 15:16:17 | 显示全部楼层 |阅读模式
请问有擦写Flash的demo吗?
我知道答案 目前已有3人回答
回复

使用道具 举报

该用户从未签到

0

主题

218

帖子

0

中级会员

Rank: 3Rank: 3

积分
472
最后登录
1970-1-1
发表于 2013-7-2 17:41:30 | 显示全部楼层

回复:求MKL25擦写Flash的demo

__ram_for_command_sequence_func 是在link command file里面定义的,在MKL25Z128_flash.ld 文件中包含这一段:
 .ram_func :
  {
    . = ALIGN(4);
    KEEP(*(.run_from_ram))
    . = ALIGN(4);
    __ram_for_command_sequence_func = .;
  } > m_ram_func
__ram_for_command_sequence_func 就是将flash操作的代码 拷贝到ram中的目标地址
回复 支持 反对

使用道具 举报

该用户从未签到

0

主题

6

帖子

0

新手上路

Rank: 1

积分
6
最后登录
1970-1-1
发表于 2013-7-3 13:33:57 | 显示全部楼层

回复:求MKL25擦写Flash的demo

 同求 对KLxx Flash操作的demo程序。
回复 支持 反对

使用道具 举报

该用户从未签到

34

主题

101

帖子

0

新手上路

Rank: 1

积分
293
最后登录
1970-1-1
 楼主| 发表于 2013-7-3 13:56:24 | 显示全部楼层

RE:求MKL25擦写Flash的demo

十分感谢2楼的回复,你说的是对的。。
但我现在碰到一个问题是,2个Demo都是可以使用的,
但我整合到一起,就出问题了。。。。
回复 支持 反对

使用道具 举报

该用户从未签到

10

主题

459

帖子

0

中级会员

Rank: 3Rank: 3

积分
303
最后登录
2024-10-24
发表于 2013-7-3 14:18:44 | 显示全部楼层

回复:求MKL25擦写Flash的demo-(已解决)

其实在每个KL25的demo程序的cpu文件夹中都有一个start.c文件,里面有一个简单的Flash操作的函数,,代码如下:
void flash_identify (void)
{
    /* Get the flash parameter version */
    /* Write the flash FCCOB registers with the values for a read resource command */
    FTFA_FCCOB0 = 0x03;
    FTFA_FCCOB1 = 0x00;
    FTFA_FCCOB2 = 0x00;
    FTFA_FCCOB3 = 0x00;
    FTFA_FCCOB8 = 0x01;
    /* All required FCCOBx registers are written, so launch the command */
    FTFA_FSTAT = FTFA_FSTAT_CCIF_MASK;
    /* Wait for the command to complete */
    while(!(FTFA_FSTAT & FTFA_FSTAT_CCIF_MASK));
   
    printf("Flash parameter version %d ",FTFA_FCCOB4);
    printf(" %d ",FTFA_FCCOB5);
    printf(" %d ",FTFA_FCCOB6);
    printf(" %d\n\r",FTFA_FCCOB7);
    /* Get the flash version ID */   
    /* Write the flash FCCOB registers with the values for a read resource command */
    FTFA_FCCOB0 = 0x03;
    FTFA_FCCOB1 = 0x00;
    FTFA_FCCOB2 = 0x00;
    FTFA_FCCOB3 = 0x04;
    FTFA_FCCOB8 = 0x01;
    /* All required FCCOBx registers are written, so launch the command */
    FTFA_FSTAT = FTFA_FSTAT_CCIF_MASK;
    /* Wait for the command to complete */
    while(!(FTFA_FSTAT & FTFA_FSTAT_CCIF_MASK));
    printf("Flash version ID %d ",FTFA_FCCOB4);  
    printf(" %d",FTFA_FCCOB5);  
    printf(" %d ",FTFA_FCCOB6);  
    printf("%d\n\r",FTFA_FCCOB7);  
}
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

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

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

GMT+8, 2025-7-19 19:43 , Processed in 0.097121 second(s), 25 queries , MemCache On.

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

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