what does [WEAK] mean in stm32 startup file?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
i was reading stm32f407 startup file in keil sofware to gathering some informations. i faced to this problem that what is [WEAK] symbol used?
a part of code that this symbol has been used in is :
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
there are more other places in the code that this symbol has been used. i just bring a part as an instance.
stm32 assembly keil
add a comment |Â
up vote
1
down vote
favorite
i was reading stm32f407 startup file in keil sofware to gathering some informations. i faced to this problem that what is [WEAK] symbol used?
a part of code that this symbol has been used in is :
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
there are more other places in the code that this symbol has been used. i just bring a part as an instance.
stm32 assembly keil
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
i was reading stm32f407 startup file in keil sofware to gathering some informations. i faced to this problem that what is [WEAK] symbol used?
a part of code that this symbol has been used in is :
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
there are more other places in the code that this symbol has been used. i just bring a part as an instance.
stm32 assembly keil
i was reading stm32f407 startup file in keil sofware to gathering some informations. i faced to this problem that what is [WEAK] symbol used?
a part of code that this symbol has been used in is :
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
there are more other places in the code that this symbol has been used. i just bring a part as an instance.
stm32 assembly keil
stm32 assembly keil
asked 2 hours ago
Amin
675
675
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
It says the implementation of the function should be weakly linked (as opposed to strongly linked, which is the usual).
This allows providing a "fallback" implementation of a function, in case no other (strongly linked) is found.
This is often used for default interrupt handlers in bare-metal MCU frameworks. This way, when you implement an interrupt, you just have to write your function, without having to remove the default one from the sources, and the linker does the job.
See https://en.m.wikipedia.org/wiki/Weak_symbol
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
It says the implementation of the function should be weakly linked (as opposed to strongly linked, which is the usual).
This allows providing a "fallback" implementation of a function, in case no other (strongly linked) is found.
This is often used for default interrupt handlers in bare-metal MCU frameworks. This way, when you implement an interrupt, you just have to write your function, without having to remove the default one from the sources, and the linker does the job.
See https://en.m.wikipedia.org/wiki/Weak_symbol
add a comment |Â
up vote
4
down vote
accepted
It says the implementation of the function should be weakly linked (as opposed to strongly linked, which is the usual).
This allows providing a "fallback" implementation of a function, in case no other (strongly linked) is found.
This is often used for default interrupt handlers in bare-metal MCU frameworks. This way, when you implement an interrupt, you just have to write your function, without having to remove the default one from the sources, and the linker does the job.
See https://en.m.wikipedia.org/wiki/Weak_symbol
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
It says the implementation of the function should be weakly linked (as opposed to strongly linked, which is the usual).
This allows providing a "fallback" implementation of a function, in case no other (strongly linked) is found.
This is often used for default interrupt handlers in bare-metal MCU frameworks. This way, when you implement an interrupt, you just have to write your function, without having to remove the default one from the sources, and the linker does the job.
See https://en.m.wikipedia.org/wiki/Weak_symbol
It says the implementation of the function should be weakly linked (as opposed to strongly linked, which is the usual).
This allows providing a "fallback" implementation of a function, in case no other (strongly linked) is found.
This is often used for default interrupt handlers in bare-metal MCU frameworks. This way, when you implement an interrupt, you just have to write your function, without having to remove the default one from the sources, and the linker does the job.
See https://en.m.wikipedia.org/wiki/Weak_symbol
answered 2 hours ago


dim
12.6k22263
12.6k22263
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f403511%2fwhat-does-weak-mean-in-stm32-startup-file%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password