嵌入式爱好者

查看: 14411|回复: 6

[硬件咨询] 飞凌ok1601板子提供的rt-thread-OK1061-S 加载flexspi nor flash 不能正常运行,j...

[复制链接]

5

主题

15

帖子

33

积分

i.MX RT通行证

扫一扫,手机访问本帖
发表于 2020-4-15 11:22:08 | 显示全部楼层 |阅读模式
您好,我使用飞凌提供的 源码包  rt-thread-OK1061-S 加载flexspi nor flash 不能正常运行。

我想在板子起来后通过写nor flash进行后续远程升级代码。所以需要把nor flash 读写功能使能。
加载drv_flexspi.c  drv_flexspi_nor.c  fsl_flexspi.c 三个文件后 ,调用 INIT_PREV_EXPORT(rt_hw_flexspi_init); 初始化后,打印  dbg_log(DBG_INFO, "NorFlash Init\r\n");  后, 板子一直反复重启,麻烦帮忙看看什么问题呢,比较急,谢谢。
回复

使用道具 举报

0

主题

1173

帖子

2194

积分

发表于 2020-4-15 11:42:42 | 显示全部楼层
我们的开发板目前不支持这个驱动。
重启的原因是,代码在flash中执行的,现在又操作flash,会导致重启。
点评回复 支持 反对

使用道具 举报

5

主题

15

帖子

33

积分

i.MX RT通行证

 楼主| 发表于 2020-4-15 13:45:44 | 显示全部楼层
谢谢回复,

但是我用SDK_2_5_0_EVKB_IMXRT1061的源码包,加载测试代码 \boards\evkmimxrt1060\driver_examples\flexspi\nor\polling_transfer:
flexspi_nor_flash_ops.c flexspi_nor_polling_transfer.c 就可以正常读写啊?

Vendor ID: 0x15
Erasing Serial NOR over FlexSPI...
Erase data - successfully.
Program data - successfully.
点评回复 支持 反对

使用道具 举报

0

主题

1173

帖子

2194

积分

发表于 2020-4-15 14:01:42 | 显示全部楼层
您可以在网上搜一下有没有相关内容,看看两者有什么区别
点评回复 支持 反对

使用道具 举报

5

主题

15

帖子

33

积分

i.MX RT通行证

 楼主| 发表于 2020-4-15 14:23:27 | 显示全部楼层
我对比了下两者的map文件,发现 sdk里面的norflash 函数是定义在 iram 空间的(0x20000000),
    i.FLEXSPI_WriteBlocking                  0x20000be4   Section        0  fsl_flexspi.o(i.FLEXSPI_WriteBlocking)
    i.flexspi_nor_enable_quad_mode           0x20000c7a   Section        0  flexspi_nor_flash_ops.o(i.flexspi_nor_enable_quad_mode)
    i.flexspi_nor_flash_erase_sector         0x20000cd4   Section        0  flexspi_nor_flash_ops.o(i.flexspi_nor_flash_erase_sector)
    i.flexspi_nor_flash_init                 0x20000d38   Section        0  flexspi_nor_flash_ops.o(i.flexspi_nor_flash_init)
    i.flexspi_nor_flash_page_program         0x20000dbc   Section        0  flexspi_nor_flash_ops.o(i.flexspi_nor_flash_page_program)
    i.flexspi_nor_get_vendor_id              0x20000e16   Section        0  flexspi_nor_flash_ops.o(i.flexspi_nor_get_vendor_id)
    i.flexspi_nor_wait_bus_busy              0x20000e54   Section        0  flexspi_nor_flash_ops.o(i.flexspi_nor_wait_bus_busy)
    i.flexspi_nor_write_enable               0x20000ea6   Section        0  flexspi_nor_flash_ops.o(i.flexspi_nor_write_enable)
    .constdata                               0x20000ed4   Section       24  fsl_flexspi.o(.constdata)


而 rtthread  sdk的 nor flash函数是定义在flash空间的(0x60000000),  

    FLEXSPI_GetInstance                      0x60007e61   Thumb Code    38  fsl_flexspi_1.o(i.FLEXSPI_GetInstance)
    FLEXSPI_Init                             0x60007ef5   Thumb Code   428  fsl_flexspi_1.o(i.FLEXSPI_Init)
    FLEXSPI_ReadBlocking                     0x600080fd   Thumb Code   172  fsl_flexspi_1.o(i.FLEXSPI_ReadBlocking)
    FLEXSPI_SetFlashConfig                   0x600081a9   Thumb Code   284  fsl_flexspi_1.o(i.FLEXSPI_SetFlashConfig)
    FLEXSPI_TransferAbort                    0x600082d9   Thumb Code    34  fsl_flexspi_1.o(i.FLEXSPI_TransferAbort)
    FLEXSPI_TransferBlocking                 0x60008345   Thumb Code   190  fsl_flexspi_1.o(i.FLEXSPI_TransferBlocking)
    FLEXSPI_TransferHandleIRQ                0x60008403   Thumb Code   346  fsl_flexspi_1.o(i.FLEXSPI_TransferHandleIRQ)
    FLEXSPI_UpdateLUT                        0x6000855d   Thumb Code    80  fsl_flexspi_1.o(i.FLEXSPI_UpdateLUT)


请问你知道如何将某个文件的函数定义在iram 或者 flash空间么?
点评回复 支持 反对

使用道具 举报

0

主题

1173

帖子

2194

积分

发表于 2020-4-15 14:52:17 | 显示全部楼层
您可以试试把对flash的操作放进ram中,具体方法您可以查一下
点评回复 支持 反对

使用道具 举报

5

主题

15

帖子

33

积分

i.MX RT通行证

 楼主| 发表于 2020-4-15 15:23:06 | 显示全部楼层
搞定了 多谢
点评回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-4-27 01:24

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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