资源简介
RT1052 W25Q256 QSPI 擦写编程源码。 内含sct分散加载文件,当使用QSPI启动后,通过该分散加载文件把程序尽量全部搬到TCM运行,使用该例程可以编程QSPI FLASH,实现固件的在线升级。
代码片段和文件信息
#include “qspi.h“
#include “lpuart.h“
#include “trng.h“
#include
#include “system.h“
/*******************************************************************************
* Prototypes
******************************************************************************/
#define ERASE_SECTORS 20
/*******************************************************************************
* Variables
******************************************************************************/
extern const uint32_t customLUT[CUSTOM_LUT_LENGTH];
//static uint8_t s_nor_program_buffer[FLASH_PAGE_SIZE];
//static uint8_t s_nor_read_buffer[FLASH_PAGE_SIZE];
/*******************************************************************************
* Code
******************************************************************************/
flexspi_device_config_t deviceconfig = {
.flexspiRootClk = 120000000
.flashSize = FLASH_SIZE
.CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle
.CSInterval = 2
.CSHoldTime = 3
.CSSetupTime = 3
.dataValidTime = 0
.columnspace = 0
.enableWordAddress = 0
.AWRSeqIndex = 0
.AWRSeqNumber = 0
.ARDSeqIndex = NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD
.ARDSeqNumber = 1
.AHBWriteWaitUnit = kFLEXSPI_AhbWriteWaitUnit2AhbCycle
.AHBWriteWaitInterval = 0
};
const uint32_t customLUT[CUSTOM_LUT_LENGTH] = {
/* Normal read mode -SDR */
[4 * NOR_CMD_LUT_SEQ_IDX_READ_NORMAL] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR kFLEXSPI_1PAD 0x03 kFLEXSPI_Command_RADDR_SDR kFLEXSPI_1PAD 0x18)
[4 * NOR_CMD_LUT_SEQ_IDX_READ_NORMAL + 1] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_READ_SDR kFLEXSPI_1PAD 0x04 kFLEXSPI_Command_STOP kFLEXSPI_1PAD 0)
/* Fast read mode - SDR */
[4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR kFLEXSPI_1PAD 0x0B kFLEXSPI_Command_RADDR_SDR kFLEXSPI_1PAD 0x18)
[4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST + 1] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_DUMMY_SDR kFLEXSPI_1PAD 0x08 kFLEXSPI_Command_READ_SDR kFLEXSPI_1PAD 0x04)
/* Fast read quad mode - SDR */
[4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR kFLEXSPI_1PAD 0x6B kFLEXSPI_Command_RADDR_SDR kFLEXSPI_1PAD 0x18)
[4 * NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD + 1] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_DUMMY_SDR kFLEXSPI_4PAD 0x08 kFLEXSPI_Command_READ_SDR kFLEXSPI_4PAD 0x04)
/* Read extend parameters */
[4 * NOR_CMD_LUT_SEQ_IDX_READ_EA_STATUS] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR kFLEXSPI_1PAD 0xC8 kFLEXSPI_Command_READ_SDR kFLEXSPI_1PAD 0x04)
/* Write Enable */
[4 * NOR_CMD_LUT_SEQ_IDX_WRITEENABLE] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR kFLEXSPI_1PAD 0x06 kFLEXSPI_Command_STOP kFLEXSPI_1PAD 0)
/* Erase Secto
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-04-01 14:28 qspi\
文件 5304 2018-03-30 23:18 qspi\MIMXRT1052xxxxx_flexspi_nor_A.scf
文件 30202 2018-03-30 22:28 qspi\qspi.c
文件 1832 2018-03-30 17:30 qspi\qspi.h
- 上一篇:1-wire\“从机\“模拟程序
- 下一篇:软件项目考核的标准新
评论
共有 条评论