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
Pelion IoT Platform
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
Tools and Software
Software Tools
Jump...
Cancel
Software Tools
Arm Development Studio forum
Custom Bootloader Query
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
2 replies
Subscribers
127 subscribers
Views
2086 views
Users
0 members are here
Related
Custom Bootloader Query
Offline
Alistair Lowe
over 7 years ago
Note: This was originally posted on 13th September 2012 at http://forums.arm.com
Hi guys,
I'm currently writing the code for a custom bootloader for a Cortex-M0 and am tripping over myself a little with memory allocation.
From what I gather with the ARM compiler, globals and statics head into RW CODE space, not on the stack.
In my situation, I have a two stage bootloader and application code.
I'm guessing I'll have to reserve space for any globals so that the second stage doesn't overwrite anything in the first stage, my question then is, when branching from my first stage to the second stage, what's the best way to deal with the stack pointer? I'll still be using the main stack at this point.
To elaborate a little further, right now it's feeling simplest to reserve some space in RAM and then assign the same stack details to each bootloader and use only stack memory and link into the reserved memory through pointers.
It would be ideal for maintainence/clarity if there was a way to use standard globals and statics as opposed to having to leave RAM free to tie into later on, whilst not having the two bootloader stages step on each other's toes.
Does anyone have any recommendations or suggestions of approaches that they've tried before and gotten along with?
Many thanks
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
Forum FAQs
0
ARM Community
1138
views
0
replies
Started
6 days ago
by
Annie Cracknell
Suggested Answer
How to view SFRs in DS during debugging?
0
475
views
1
reply
Latest
2 days ago
by
Ronan Synnott
Answered
Dual-core debugging in DS
0
3345
views
2
replies
Latest
15 days ago
by
Ivan Savvateev
Answered
Failure to get an evaluation license with error Unable to execute API call /api/v1/connect
0
4280
views
3
replies
Latest
20 days ago
by
Tim Holt
Suggested Answer
DS52020.0 connection to Musca-A/B boards not working
0
Arm Development Studio
Musca-A
5313
views
4
replies
Latest
23 days ago
by
Daniel Oliveira
>
View all questions in Arm Development Studio forum