-
Notifications
You must be signed in to change notification settings - Fork 100
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
Debug: Adds RTT support to bootloader #1362
base: master
Are you sure you want to change the base?
Conversation
2150503
to
e7cc4b8
Compare
To support "handover" from bootloader to application, the RTT allocations are put in the same places in RAM in both projects. Without this the J-Link software will only find one of the allocations and therefore not read the other.
e7cc4b8
to
4481dbf
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.
The production bootloader.bin hash changes with this PR. I haven't investigated the difference yet. The size of it also increases by 176 bytes.
If it's only a debug build change I'd expect no change in the prod bootloader.
@@ -206,6 +207,8 @@ void _binExec(void* l_code_addr) | |||
|
|||
static void _binary_exec(void) | |||
{ | |||
util_log("Jumping to firmware"); | |||
rust_rtt_flush(); |
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.
should we maybe call this in util_log() by default?
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.
flush will wait until the debugger reads out the buffer and updates the read pointer. It isn't necessary in general, but if we don't do it here messages from the bootloader might be overwritten by the firmware.
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.
calling it every time will basically make RTT sync, when its speed/efficiency comes from it being async.
#if defined(BOOTLOADER) | ||
#define PREFIX "boot" | ||
#else | ||
#define PREFIX "app" |
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.
fw
or firmware
? to disambiguate from our other use of app (bitcoin/ethereum/u2f/...)
To support "handover" from bootloader to application, the RTT allocations are put in the same places in RAM in both projects. Without this the J-Link software will only find one of the allocations and therefore not read the other.
This does not have any impact on non-debug builds.