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
Tools and Software
Software Tools
Jump...
Cancel
Software Tools
Arm Development Studio forum
Branching to main form assembly error
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
3 replies
Subscribers
126 subscribers
Views
1995 views
Users
0 members are here
Related
Branching to main form assembly error
Offline
sasa pavlovic
over 7 years ago
Note: This was originally posted on 25th August 2012 at http://forums.arm.com
Hey guys, do you know why a simple branch to main from the reset handler causes an hard fault? Heres an example where I try to branch to main via the reset hander in the startup file provided by Keil and this causes an
hard fault. Any cue?
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT __main
LDR R0, =__main
BX R0
ENDP
Offline
sasa pavlovic
over 7 years ago
Note: This was originally posted on 26th August 2012 at
http://forums.arm.com
I found it, I don't know why the startup file Keilprovides load the register r0 with the address of the label
__
mainbut it certainly doesn't work for me. Instead, I load this register with the label main without the two
underscores and it work perfectly.
IMPORT main
LDR R0, =main
BLX R0
ENDP
Cancel
Up
0
Down
Reply
Cancel
Offline
Martin Weidmann
over 7 years ago
Note: This was originally posted on 28th August 2012 at
http://forums.arm.com
Your solution could cause you other problems.
The __main label is ARM's scatter loading + C library init code, which itself calls main(). So by calling main() you are by-passing the C library initialization. This may be ok, but could lead to interesting problems. For example, global variables probably won't have their initial values set.
I don't know the Keil tools to know why it didn't work before. Have you tried the dedicated Keil forums?
Cancel
Up
0
Down
Reply
Cancel
Offline
Joseph Yiu
over 7 years ago
Cancel
Up
0
Down
Reply
Cancel
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
Suggested Answer
Optimized ARM version of memcmp
0
9770
views
3
replies
Latest
5 months ago
by
Ronan Synnott
Not Answered
Develop Kotlin apps with OpenCl to run in a Samsung mobile that use Mali G71
0
8789
views
2
replies
Latest
5 months ago
by
ARMStrongssen
Answered
FVP Debug problems for Blinky Example project on Cortex-M4
0
Fixed Virtual Platforms (FVPs)
Debugging
Cortex-M4
9572
views
2
replies
Latest
5 months ago
by
Sagittarius
Answered
Product license check-out for feature "platform_editor:202003" failed
0
ARM Development Suite (ADS)
DSTREAM
9534
views
2
replies
Latest
5 months ago
by
David DV
Suggested Answer
How to execute tag manipulation instructions in Cortex-A76 FVP
0
9379
views
2
replies
Latest
5 months ago
by
Stephen Theobald
<
>
View all questions in Arm Development Studio forum