当前位置:网站首页>TC397 Flash
TC397 Flash
2022-06-22 21:42:00 【Delta-delta】
routine
In this example , Flash program memory (PFLASH) Of 64 Bytes are written and then verified . Besides ,64 Byte data flash (DFLASH) Be written and verified .
Before any write operation , Flash memory erased . If the corresponding flash After successful operation , For each test LED Will light up .
Data storage unit (DMU) Control in program and data flash memory (PFLASH and DFLASH) Command sequence executed on , Standard interface with flash memory (FSI) And program flash memory interface (PFI) Connect .
FSI Erase all flash memory 、 Programming and verification operations .
AURIX TC39x The device has :
- 6 Program Flash Banks (PFx)
- 2 Data Flash Banks (DFx)
AURIX TC39x It has five sizes 3 MB Of Program Flash bank (PF0…PF4) And a size of 1 MB Of Program Flash bank (PF5). Every Program Flash bank Divided into sizes of 1024 KB Physical sector of , Each physical sector is divided into 64 Size is 16 KB Logical sector of .
AURIX TC39x With two data flash sets ,DFLASH0 and DFLASH1. Both include commonly used for EEPROM Simulation of multiple EEPROM A sector . Only DFLASH0 Contains user configuration blocks for data protection (UCB) And configuration sectors that users cannot access directly (CFS).
DFLASH EEPROM It can be configured in single ended mode ( Default ) Or complement detection . According to the selected mode , The size of each sector is set to 4 KB and 2 KB.
The minimum amount of data that can be programmed in flash memory is page
- Program Flash pages are made of 32 Bytes
- Data Flash pages are made of 8 Bytes
The smallest unit in which an erase operation can be performed is the logical sector .


The minimum command sequence for programming the flash program memory or the data flash memory is as follows :
Flashing the Program Flash memory
To execute PFLASH Programming , It is recommended to start with the PFLASH Different memory locations run code . therefore , Before starting the flash operation , By function copyFunctionsToPSPR() Copy erase and programming routines to CPU0 Of Program Scratch-Pad SRAM (PSPR) in . This uses Standards c library string.h Medium memcpy() Function and allocate the function pointer to the new memory location . then , The actual flash programming operation starts from erasing the logical sectors involved .
Erase of Logical Sectors
To perform an erase operation , Must be cleared by EndInit The protection position is PFLASH Enable write operations on , By function IfxScuWdt_clearSafetyEndinitInline() complete . then , Can pass IfxFlash_eraseMultipleSectors() The erase() function executes a sequence of erase commands for one or more consecutive logical sectors , This function consists of a function pointer eraseSectors() from PSPR perform .
Last , Must pass the function IfxScuWdt_setSafetyEndinitInline() Set again EndInit Protection position .
A function pointer waitUnbusy() Called function IfxFlash_waitUnbusy() stop it , Until the sector is erased and PFLASH Be ready again .
Write operations
After erasing the required logical sectors , You can start writing .
A function pointer enterPageMode() from PSPR Called function IfxFlash_enterPageMode() Used to enter page mode . function waitUnbusy() For pause , until PFLASH Get ready , then , The data that must be written in the page is loaded , Call the function repeatedly IfxFlash_loadPage2X32(), from PSPR Use function pointers load2X32bits() perform .
Then by calling the function pointer writePage() To write the loaded page , The pointer from PSPR perform IfxFlash_writePage() function ( Before and after the write operation ,EndInit The protection bit is cleared and set separately ).
Last call waitUnbusy(), Wait for page write to complete ,PFLASH Ready again , The writing process can then be repeated , Until all the required data is successfully written PFLASH.
All the functions used to execute the flash operation command sequence can be found in iLLD The header file IfxFlash.h Find , And the function pointer is Flash_Programming.c Declared and assigned in the document .
Flashing the Data Flash memory
Except the address is different , Others follow PFLASH Agreement .
边栏推荐
- 第033讲:异常处理:你不可能总是对的2 | 课后测试题及答案
- Jerry's dynamic switching EQ document [chapter]
- Differences between watch, computed and methods
- How swiftui simulates the animation effect of view illumination increase
- Laravel+ pagoda planning task
- 大势智慧创建倾斜模型和切割单体化
- [redis] three new data types
- Summary of differences between localstorage, sessionstorage and cookies
- Lesson 032: exception handling: you can't always be right | after class test questions and answers
- 解决phpstudy中mysql无法启动,与本地安装的mysql冲突
猜你喜欢

redis学习笔记

基于C语言开发工资管理系统 课程论文+源码及可执行exe文件

2022年山东省安全员C证考试试题模拟考试平台操作

RealNetworks vs. 微软:早期流媒体行业之争

鸿蒙第三次培训
![List of outstanding talents: no crystal vibration, one drag, eight burn and upgrade [chapter]](/img/6c/333bc95fe390234d3d06043e4bded1.png)
List of outstanding talents: no crystal vibration, one drag, eight burn and upgrade [chapter]

Fluent system architecture

优化求解器 | Gurobi的MVar类:矩阵建模利器、求解对偶问题的备选方案 (附详细案例+代码)
![When the AUX1 or aux2 channel is used in Jerry's aux mode, the program will reset the problem [chapter]](/img/0a/93e95a3a2a923497d57895508ce92e.png)
When the AUX1 or aux2 channel is used in Jerry's aux mode, the program will reset the problem [chapter]
![[records of different objects required by QIPA]](/img/f7/c0f0f56e4f1bf4f1a0a61552afcd2b.png)
[records of different objects required by QIPA]
随机推荐
2022 a special equipment related management (elevator) examination questions and simulation examination
ACM. HJ24 合唱队 ●●
杰理之列免晶振一拖八烧录升级【篇】
优化求解器 | Gurobi的MVar类:矩阵建模利器、求解对偶问题的备选方案 (附详细案例+代码)
杰理之动态切换 EQ 文件【篇】
80- paging query, not only writing
Correspondence between int and char in C language
第021讲:函数:lambda表达式 | 课后测试题及答案
[redis] profile
Simulated 100 questions and simulated examination of hoisting machinery command examination in 2022
85- have you learned any of these SQL tuning tips?
300. 最长递增子序列 ●●
Lesson 026: Dictionary: when the index is not easy to use 2 | after class test questions and answers
Lesson 019: function: my site listen to my after-school test questions and answers
ACM. Hj24 chorus ●●
Differences between watch, computed and methods
92 match for several_ Recognize SQL write example
MySQL adds (appends) prefix and suffix to a column field
第014-15讲:字符串 (见小甲鱼新版27讲-32讲)| 课后测试题及答案
Lesson 030: file system: introduce a big thing | after class test questions and answers