Closed Artefaritaj closed 3 years ago
Reproduced the issue following your steps. Thanks for the great report!
Could you remove this line from the LoggingConfig
struct, and see if that helps?
That usb
example will only show log messages that are emitted from the "usb"
module. Since we've changed the name of our program from "usb" to "usbtest," our module name doesn't match the logging filter. That's why we don't see any output.
After removing that line, you should see the log messages from the program. Before the main loop, you may also see debug-level log messages that have to do with clock configuration in the HAL. To filter those out, add a filter with the name "usbtest"
.
Thank you ! It works perfectly as described. May I suggest to add a comment in the usb example :
filters: &[("usb", None)], // "usb" to denote that we are keeping only messages originating from the "usb" crate/binary.
On a related note, I had the same issue with the "Getting Started" example on the project starting page. Turns out for some reason my module identifies as hello_world
instead of hello-world
, so I had to change to
const FILTERS: &'static [bsp::usb::Filter] = &[
("hello_world", None),
];
in logging.rs
accordingly to see the log output.
Sorry for the trouble. I removed the default filter from the template project to avoid confusion.
The issue was a {{project-name}}
cargo generate template that should have been {{crate_name}}
.
Quick description of the problem
I am trying to test the usb examples on my Teensy 4.1. They are working perfectly fine when compiled from this repo as an example (led is blinking, messages are displayed in the terminal). But if I want to do the same in a new crate, messages are not displayed (but the LED is blinking).
How to reproduce
Generate a new project:
Copy the usb.rs from the examples
Update the Cargo.toml to match the example's one
Build
and program.
How the bug can be observed
The LED is blinking every 5s as it should, but no messages are displayed on the serial over usb console. Messages can be observed when compiling directly from the examples/bsp directory.
What I tried
Since the code is identical, the problem is probably in the Cargo.toml. I tried to modify the features for the teensy4-bsp crate (adding and removing "usb-logging") but nothing changes. Looking in the source, "usb-logging" is enabled by default.
I feel I am missing something obvious, but what ?