Skip to content
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

Samples #6

Open
teburd opened this issue Nov 8, 2019 · 3 comments
Open

Samples #6

teburd opened this issue Nov 8, 2019 · 3 comments
Labels
docs good first issue Good for newcomers

Comments

@teburd
Copy link

teburd commented Nov 8, 2019

It would be extremely helpful to see how semihosting and itm works with this crate

@DoumanAsh
Copy link
Owner

DoumanAsh commented Nov 8, 2019

For example semihosting with log https://docs.rs/cortex-m-log/0.6.1/cortex_m_log/log/index.html

For Itm you'll need registry block https://docs.rs/cortex-m/0.6.1/cortex_m/peripheral/struct.ITM.html
and then cortex_m_log::printer::itm::InterruptFree::new(cortex_m_log::destination::itm::Itm::new(<itm registers>))

@DoumanAsh DoumanAsh added docs good first issue Good for newcomers labels Nov 8, 2019
@teburd
Copy link
Author

teburd commented Nov 9, 2019

This is only part of the example though, how do you take advantage of the Itm logging with say gdb and openocd attached? There's some other stuff that needs to happen right? I'm not that familiar with Itm, mostly familiar with RTT and UART style logging

@DoumanAsh
Copy link
Owner

It depends on how you configure gdb

E.g. https://github.com/DoumanAsh/2B/blob/master/scripts/.gdbinit is the script I was using to log semihosting output in opencd's stdout

For details for semihosting: https://docs.rs/cortex-m-semihosting/0.3.5/cortex_m_semihosting/
For ITM you need to run:
monitor tpiu config internal itm.fifo uart off 8000000 in gdb or in init script

OpenCD will log output into file itm.fifo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants