Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
IP Products
Processors
Jump...
Cancel
Processors
Cortex-M / M-Profile forum
Cortex-M unintentional Flash Read-While-Write
Blogs
Forums
Videos & Files
Help
Jump...
Cancel
New
State
Accepted Answer
Replies
7 replies
Subscribers
8 subscribers
Views
5048 views
Users
0 members are here
Cortex-M7
Memory Protection Unit (MPU)
Cortex-M
Related
Cortex-M unintentional Flash Read-While-Write
Offline
piotr_r
over 2 years ago
Hello,
I am developing a bootloader for the ARM Cortex M7. All the functions that modify (either write or erase) the internal Flash are run from the RAM memory, the other code is run from the internal Flash. So there are RAM <-> Flash transitions in the bootloader execution flow.
It works just fine. But there is one thing that I would like to consult with the experts.
I'd like to ask if either cache or the processor's processing pipeline, with e.g. speculative fetches and branch prediction, can be a safety concern in that case.
I'd like to know answers to the following questions:
1) If the code is being executed from RAM, but the MCU decides to fetch code from the internal Flash, when the Flash is being written at the same time. Is it Flash access that may cause the processor to stall or do something unexpected?
2) If yes, then how to prevent it?
I will appreciate your help.
Thanks,
Piotr
Top replies
Offline
Joseph Yiu
over 2 years ago
in reply to
42Bastian Schick
+2
verified
Things could get a bit messy with branch prediction. It is possible for the cortex-M7 to speculatively prefetch instructions in other "Normal" memory locations due to misprediction. Normally, you won...
Offline
42Bastian Schick
over 2 years ago
+1
verified
How _your_ MCU reacts on Flash read while writing can only be answered by the manufacturer (ideal: it can be found in the manual). Common traps are enabled interrupts and the vector table still points...
Offline
42Bastian Schick
over 2 years ago
in reply to
piotr_r
+1
I doubt that there will be someone with an guarantee. But from my understanding, turning off caches and executing from RAM will prevent further read access. Maybe some data barriers are needed in case...
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Not Answered
What Operating Systems support TrustZone M?
0
258
views
0
replies
Started
2 months ago
by
PseudorandomlyGeneratedString
Not Answered
Trustzone with Wifi
0
wifi
TrustZone
Cortex-M33
257
views
0
replies
Started
2 months ago
by
beze
Not Answered
Why the address of fuction printed is not same as the one mentioned in map file
0
Cortex-M7
Memory
1555
views
8
replies
Latest
2 months ago
by
42Bastian Schick
Answered
stmdb instruction *appears* not to work correctly - Cortex M4 / SAM4L
+1
Armv7-M
Cortex-M4
667
views
1
reply
Latest
2 months ago
by
HarryAtElpro
Not Answered
I have a doubt about memory addresses ¿Any expert?
0
433
views
1
reply
Latest
3 months ago
by
Bill Westfeild
<
>
View all questions in Cortex-M / M-Profile forum