-
Notifications
You must be signed in to change notification settings - Fork 98
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
Nickez/add debug target #1323
Nickez/add debug target #1323
Conversation
05be931
to
82668e7
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.
Please add docs for how to use this in BUILD.md.
869864 build-debug/bin/firmware.bin
715956 Build/bin/firmware.bin
This new debug firmware uses 849.48kB of the available 864kB, and adds 150kB on top of the release builds. This is super tight - when we add more code to the firmware, the debug build will be too large to fit. Any ideas what to do about it?
150kB seems generally like way too much for RTT support, any idea what uses so much space? The panic strings, or something else too?
Debug builds (by default) check for example overflow in arithmetics, so they introduce a lot of new panic places, with that comes of course lots of static strings and probably some formatting. Setting Setting We could add both, but eventually the release build will be equivalent to the debug build. So then we can just go back to only using release build and ignore the debug build. edit: I guess there still is a point in having a debug build that enables pretty-printing of panics and enables RTT but keeps everything else the same. |
82668e7
to
d54830b
Compare
e53c451
to
dd206fb
Compare
Previously the debug build was to large to flash due to the optimization flag
dd206fb
to
b19de45
Compare
df31acc
to
b416c0a
Compare
Is there any way to make rust_log in C have a sprintf signature like the screen debug equivalent?
then one can much more conveniently log data, like I guess you could just add a wrapper around rust_log in C that builds the string that is passed to rust_log. |
b416c0a
to
7c1bf61
Compare
Good idea, I called it |
325d016
to
4f49869
Compare
4d78e11
to
2bc35c3
Compare
i have some bootloader specific changes that I will create separate PRs of. |
aa9a1c5
to
3d78a39
Compare
Even if you don't find a solution to the networking thing, it would still help me to just install libncurses5 in the docker image so I can use it. Currently I |
65d24c6
to
91dc575
Compare
I'll add that in a separate PR. |
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.
Super mega useful 👏
e435b46
to
edf92e5
Compare
fe1d617
to
ee318c2
Compare
This commit introduces a new `log` macro that calls `rprintln` in case the `rtt` feature is enabled. It also creates a new c function called `util_log` that reuses the rust RTT machinery. The rust `log` macro is used the same way `println` is used. `util_log` is used the same way `printf` is used.
Add a section about debugging with GDB and restructure the docs for more clarity.
ee318c2
to
5921931
Compare
This improves the developer experience. You can now run the following shortcuts in separate terminals.
Let the gdb-server and rtt-client run forever:
make gdb-server # launches JLinkGDBServer
make rtt-client # connects to gdb server with telnet to get the RTT output
Whenever you built the firmware, rerun this:
make run-debug # runs gdb and flashes the firmware over the gdb-server before executing it
To compile the debug firmware, run: