Arm Community
Site
Search
User
Site
Search
User
Groups
Education Hub
Distinguished Ambassadors
Open Source Software and Platforms
Research Collaboration and Enablement
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello forum
Operating Systems forum
SoC Design and Simulation forum
SystemReady Forum
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Internet of Things (IoT) blog
Operating Systems blog
SoC Design and Simulation blog
Tools, Software and IDEs blog
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Arm Development Studio forum
[Cortex-M3] Execution code from RAM during Flash Programming
Jump...
Cancel
Locked
Locked
Replies
11 replies
Subscribers
120 subscribers
Views
21494 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
[Cortex-M3] Execution code from RAM during Flash Programming
Rohit Pathak
over 10 years ago
I am writing a bootloader for Cortex M3 Toshiba controller.
During Flash Programming I need to execute code from RAM as entire Flash is inaccessible during write/erase operations
I wish to know how to copy code from FLASH to RAM and execute that code from RAM.
Thanks...
Parents
Joseph Yiu
over 10 years ago
Note: This was originally posted on 15th March 2012 at
http://forums.arm.com
Hi Rohit,
In this case you could develop the bootloader and flash programming code as two separate projects.
The flash programming project is compiled and link using SRAM as program address.
Then you can generate hex image, and insert this into your boot loader project as a constant array.
Inside your boot loader, you can copy this constant array into SRAM.
To jump from boot loader to flash programming code, personally I got used to use embedded assembly:
/* ARM RVDS or Keil MDK */
__asm void jump_to_sram(void)
{
LDR R0,=0x20000000 ; starting address of program in SRAM.
LDR R1,[R0] ; Get initial MSP value
MOV SP, R1 ; Set SP value
LDR R1,[R0, #4] ; Get initial PC value
BX R1
}
You can use function pointer to do the same.
regards,
Joseph
Cancel
Up
0
Down
Cancel
Reply
Joseph Yiu
over 10 years ago
Note: This was originally posted on 15th March 2012 at
http://forums.arm.com
Hi Rohit,
In this case you could develop the bootloader and flash programming code as two separate projects.
The flash programming project is compiled and link using SRAM as program address.
Then you can generate hex image, and insert this into your boot loader project as a constant array.
Inside your boot loader, you can copy this constant array into SRAM.
To jump from boot loader to flash programming code, personally I got used to use embedded assembly:
/* ARM RVDS or Keil MDK */
__asm void jump_to_sram(void)
{
LDR R0,=0x20000000 ; starting address of program in SRAM.
LDR R1,[R0] ; Get initial MSP value
MOV SP, R1 ; Set SP value
LDR R1,[R0, #4] ; Get initial PC value
BX R1
}
You can use function pointer to do the same.
regards,
Joseph
Cancel
Up
0
Down
Cancel
Children
No data