-
Notifications
You must be signed in to change notification settings - Fork 17
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
Upload: NUVOTON: Change GDB load command to flash post-build processed image #341
Upload: NUVOTON: Change GDB load command to flash post-build processed image #341
Conversation
Hmm... This is a really good catch, but it feels like this issue isn't actually specific to nuvoton devices at all. Maybe we should just change the load command to always use the hex file, and make the build system always generate the hex file. I will think about it. |
I have now added #369 which introduces a new option for the upload address. That would probably be useful in this PR! To clarify, I'd like to accept this, but I'd need it to be updated to (a) always build the bin and hex file, and (b) always make the GDB load command use the hex file. |
I will update to support above requirements. Besides, one thing to clarify: #369 introduces upload address |
Yeah, that's a fair point. Frankly I'm a bit confused, as every upload method except J-Link does let you specify an address with a hex file, so I wonder what offset they actually use |
For pyocd debug, it appears the device under debug must be halted after UPLOAD_LAUNCH_COMMANDS, or debugger will become abnormal.
This converts output to Intel HEX format unconditionally but to BIN format just on demand for the following reasons: 1. Most flash programming tools support Intel HEX format, e.g. GDB load command. 2. Output can have large holes in addresses which BIN format cannot handle and can generate very large file.
This gives chance to adjust GDB commands MBED_UPLOAD_LAUNCH_COMMANDS or MBED_UPLOAD_RESTART_COMMANDS for debug launch by implementing mbed_adjust_upload_debug_commands cmake function.
With this adjustment, GDB load command changes to "load <app>.hex" from just "load": 1. "Load" will load <app>.elf and is inappropriate for targets like bootloader or TF-M enabled which need to post-build process images. 2. "load <app>.bin" is not considered because GDB load command doesn't support binary format.
1c60c4e
to
176ebe6
Compare
Update as follows:
|
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.
Looks good, just need to resolve the issue with command line GDB usage, then will approve!
This enables generating GDB command line gdbinit file for single project multiple application scenario. The gdbinit file name would be <app>.gdbinit for distinct among multiple applications.
61e8b9d
to
5d31030
Compare
Looks good! Thanks for your work on this! |
Summary of changes
This PR includes two parts:
MBED_UPLOAD_LAUNCH_COMMANDS
orMBED_UPLOAD_RESTART_COMMANDS
for debug launch by implementingmbed_adjust_upload_debug_commands
cmake function.load
command to flash post-build processed imagePull request type