-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCC: ARM_CM0: Fix L6286E error on Keil MDK #1131
GCC: ARM_CM0: Fix L6286E error on Keil MDK #1131
Conversation
Can you share the project that we can use to repro the problem? |
53ec2eb
to
6b7a5fc
Compare
Branch and Link (bl) instruction changes the value of Link Register (LR) which needs to be preserved. There are 2 ways to solve this problem -
Thanks. |
6b7a5fc
to
6abb4df
Compare
Great! Thanks for your fix. I have applied your provided patch. |
portable/GCC/ARM_CM0/portasm.c
Outdated
" ldr r3, =%1 \n" | ||
" cmp r2, r3 \n" | ||
" beq system_call_exit \n" | ||
" ldr r3, vPortSVCHandler_C_Address \n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" ldr r3, vPortSVCHandler_C_Address \n" | |
" ldr r3, =vPortSVCHandler_C \n" |
@TomasGalbickaNXP @aggarg Apologies for the nit. With this style, we can avoid the constant pool defined at the end of the function and let the linker handle the needed alignement.
Thanks @urutva for pointing that out. Here is the updated patch - use_bx_updated.patch. I have tested it on M0+ for both MPU enable and disable. @TomasGalbickaNXP please use this patch instead. Apologies for back and forth. |
6abb4df
to
57744d9
Compare
Change the .b instruction to .bx with higher range to solve error reported by MDK descibed bellow. Fix: Error: L6286E: Relocation #REL:0 in portasm.o(.text.SVC_Handler) with respect to vPortSVCHandler_C. Value(0x1a04) out of range(-0x800 - 0x7fe) for (R_ARM_THM_JUMP11) Compiler: Keil MDK ARMClang 6.22.0 https://developer.arm.com/documentation/ka002847/latest/ https://developer.arm.com/documentation/dui0496/m/Linker-Errors-and-Warnings/List-of-the-armlink-error-and-warning-messages Signed-off-by: Tomas Galbicka <[email protected]>
57744d9
to
74b50e4
Compare
Quality Gate passedIssues Measures |
OK patch applied. |
Thank you for your contribution! |
Thank you for great assistance! |
Keil MDK Compilation for CM0 core reports L6286E: Relocation #REL:0 in portasm.o
Description
Change the .b instruction to .bl with higher range to solve error reported by MDK descibed bellow.
Fix:
Error: L6286E: Relocation #REL:0 in portasm.o(.text.SVC_Handler) with respect to vPortSVCHandler_C. Value(0x1a04) out of range(-0x800 - 0x7fe) for (R_ARM_THM_JUMP11)
Compiler: Keil MDK ARMClang 6.22.0
https://developer.arm.com/documentation/ka002847/latest/ https://developer.arm.com/documentation/dui0496/m/Linker-Errors-and-Warnings/List-of-the-armlink-error-and-warning-messages
See the issue #1130
Test Steps
See the issue #1130
To Reproduce
git clone https://github.com/TomasGalbickaNXP/freertos-port-cm0-core-issue.git
Checkout the Example with added CM0 MPU port.
git checkout 40af92d06408450e11ca10ad17cd578760fd861a
Open MDK Project and build. It will fail with error reported above.
Checkout fix
git checkout 72a9d6246277ae32594bab69fef66c6e13af3cd1
Open MDK Project and build.
The build reports no Errors.
Checklist:
Related Issue
#1130
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.