-
Notifications
You must be signed in to change notification settings - Fork 677
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
zephyr: Add CONFIG_MCUBOOT_CLEANUP_RAM #2127
Conversation
75c44f6
to
6373888
Compare
boot/zephyr/main.c
Outdated
@@ -236,7 +236,34 @@ static void do_boot(struct boot_rsp *rsp) | |||
__set_CONTROL(0x00); /* application will configures core on its own */ | |||
__ISB(); | |||
#endif | |||
#if CONFIG_MCUBOOT_CLEANUP_RAM | |||
__asm__ volatile ( | |||
/* rt->reset -> r0 */ |
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.
/* rt->reset -> r0 */ | |
/* vt->reset -> r0 */ |
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.
Fixed
boot/zephyr/main.c
Outdated
" bx r0\n" | ||
: | ||
: "r" (vt->reset), "i" (CONFIG_SRAM_BASE_ADDRESS), | ||
"i" (CONFIG_SRAM_SIZE * 1024), "i" (0), "i" (sizeof(uint32_t)) |
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.
"i" (sizeof(uint32_t))
operand is not used, assembly above used immediate value - which is just perfect.
%4, it is used
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.
Yeah, so I have hardcoded this to #4 and remove the parameter.
6373888
to
872283d
Compare
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.
Does not work with ARMv6:
/tmp/ccmsO9XM.s: Assembler messages:
/tmp/ccmsO9XM.s:495: Error: selected processor does not support `cbz r2,out' in Thumb mode
/tmp/ccmsO9XM.s:488: Error: invalid immediate: 536870912 is out of range
/tmp/ccmsO9XM.s:488: Error: value of 20000000 too large for field of 2 bytes at 000000c2
/tmp/ccmsO9XM.s:489: Error: invalid immediate: 32768 is out of range
872283d
to
c173a24
Compare
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.
Bit confused here, different symbol has been changed and depends on m7, we don't have any cortex m7's
I am now confused too, because it compiled and worked and the code is actually picked up. |
Yeah, sure, because I did the change to wrong Kconfig. |
c173a24
to
aad9c10
Compare
Add Kconfig option to cleanup RAM in MCUboot before passing control to an application. Signed-off-by: Dominik Ermel <[email protected]>
aad9c10
to
1c58002
Compare
Add Kconfig option to cleanup RAM in MCUboot before passing control to an application.