Open vDorst opened 6 months ago
can you post trace-level logs?
@Dirbaio here the trace log.
The crash happens when the host wants to send sound samples to the device.
log-level = trace.
Finished release [optimized + debuginfo] target(s) in 16.60s
Running `probe-rs run --chip nRF52840_xxAA target/thumbv7em-none-eabihf/release/stm32_audio`
Erasing ✔ [00:00:00] [##############################################################################################################################] 36.00 KiB/36.00 KiB @ 39.25 KiB/s (eta 0s )
Programming ✔ [00:00:00] [##############################################################################################################################] 36.00 KiB/36.00 KiB @ 48.26 KiB/s (eta 0s )
Finished in 1.683s
0.000000 INFO Enabling ext hfosc...
└─ stm32_audio::____embassy_main_task::{async_fn#0} @ src/main.rs:176
0.000274 INFO 30 == 30
└─ stm32_audio::usb_audio_class::{impl#0}::new @ src/usb_audio_class.rs:214
0.000366 INFO USB: device_descriptor used: 18
└─ embassy_usb::builder::{impl#1}::build @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:143
0.000396 INFO USB: config_descriptor used: 98
└─ embassy_usb::builder::{impl#1}::build @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:143
0.000427 INFO USB: bos_descriptor used: 12
└─ embassy_usb::builder::{impl#1}::build @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:143
0.000488 INFO USB: msos_descriptor used: 0
└─ embassy_usb::builder::{impl#1}::build @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:143
0.000518 INFO USB: control_buf size: 256
└─ embassy_usb::builder::{impl#1}::build @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:143
0.000610 INFO write done
└─ stm32_audio::____embassy_main_task::{async_fn#0} @ src/main.rs:227
0.000640 INFO init usb runner
└─ stm32_audio::__usb_runner_task::{async_fn#0} @ src/main.rs:82
0.000671 TRACE Power event: available
└─ embassy_nrf::usb::{impl#3}::poll::{async_fn#0}::{closure#0} @ /home/r/dev/rust/embassy/embassy-nrf/src/fmt.rs:117
0.000701 TRACE usb: power detected
└─ embassy_usb::{impl#2}::handle_bus_event::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.001739 TRACE enabled
└─ embassy_nrf::usb::{impl#3}::enable::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-nrf/src/fmt.rs:117
0.001770 INFO EN: true
└─ stm32_audio::usb_audio_class::{impl#8}::enabled @ src/usb_audio_class.rs:653
0.004852 TRACE usb: suspend
└─ embassy_usb::{impl#2}::handle_bus_event::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
loop 00
0.010681 INFO Wait for USB Audio samples
└─ stm32_audio::__usb_samples_task_task::{async_fn#0} @ src/main.rs:123
0.102355 TRACE usb: reset
└─ embassy_usb::{impl#2}::handle_bus_event::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.102386 INFO AUC: Reset
└─ stm32_audio::usb_audio_class::{impl#8}::reset @ src/usb_audio_class.rs:477
0.102416 INFO ALT: inf# 0 a_setting: 0
└─ stm32_audio::usb_audio_class::{impl#8}::set_alternate_setting @ src/usb_audio_class.rs:661
0.102478 INFO ALT: inf# 1 a_setting: 0
└─ stm32_audio::usb_audio_class::{impl#8}::set_alternate_setting @ src/usb_audio_class.rs:661
0.102539 TRACE usb: resume
└─ embassy_usb::{impl#2}::handle_bus_event::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.190490 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 256, index: 0, length: 64 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.190765 TRACE control request: Request { direction: Out, request_type: Standard, recipient: Device, request: 5, value: 7, index: 0, length: 0 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.190856 TRACE control out data: []
└─ embassy_usb::{impl#1}::handle_control_out::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.201324 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 256, index: 0, length: 18 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.204376 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 512, index: 0, length: 255 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.204742 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 3840, index: 0, length: 255 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.204956 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 771, index: 1033, length: 255 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.205230 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 768, index: 0, length: 255 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.205444 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 770, index: 1033, length: 255 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.205688 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 1536, index: 0, length: 10 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.218933 TRACE control request: Request { direction: Out, request_type: Standard, recipient: Device, request: 9, value: 1, index: 0, length: 0 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.219024 TRACE control out data: []
└─ embassy_usb::{impl#1}::handle_control_out::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.219055 DEBUG SET_CONFIGURATION: configured
└─ embassy_usb::{impl#2}::handle_control_out @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:130
0.219116 DEBUG endpoint_set_enabled EndpointAddress(8) false
└─ embassy_nrf::usb::{impl#3}::endpoint_set_enabled @ /home/r/dev/rust/embassy/embassy-nrf/src/fmt.rs:130
0.219177 INFO CFG: true
└─ stm32_audio::usb_audio_class::{impl#8}::configured @ src/usb_audio_class.rs:657
0.219329 TRACE control request: Request { direction: Out, request_type: Standard, recipient: Interface, request: 11, value: 0, index: 1, length: 0 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.219421 TRACE control out data: []
└─ embassy_usb::{impl#1}::handle_control_out::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.219512 DEBUG endpoint_set_enabled EndpointAddress(8) false
└─ embassy_nrf::usb::{impl#3}::endpoint_set_enabled @ /home/r/dev/rust/embassy/embassy-nrf/src/fmt.rs:130
0.219573 INFO ALT: inf# 1 a_setting: 0
└─ stm32_audio::usb_audio_class::{impl#8}::set_alternate_setting @ src/usb_audio_class.rs:661
0.220245 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 770, index: 1033, length: 4 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.220458 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 770, index: 1033, length: 20 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.221435 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 768, index: 0, length: 255 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.221771 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 769, index: 1033, length: 255 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.222167 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 770, index: 1033, length: 255 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.224029 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 770, index: 1033, length: 4 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.224365 TRACE control request: Request { direction: In, request_type: Standard, recipient: Device, request: 6, value: 770, index: 1033, length: 20 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.224670 TRACE control request: Request { direction: Out, request_type: Standard, recipient: Interface, request: 11, value: 0, index: 1, length: 0 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.224761 TRACE control out data: []
└─ embassy_usb::{impl#1}::handle_control_out::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
0.224853 DEBUG endpoint_set_enabled EndpointAddress(8) false
└─ embassy_nrf::usb::{impl#3}::endpoint_set_enabled @ /home/r/dev/rust/embassy/embassy-nrf/src/fmt.rs:130
0.224914 INFO ALT: inf# 1 a_setting: 0
└─ stm32_audio::usb_audio_class::{impl#8}::set_alternate_setting @ src/usb_audio_class.rs:661
loop 01
loop 02
loop 03
loop 04
loop 05
loop 06
loop 07
loop 08
loop 09
9.068664 TRACE control request: Request { direction: Out, request_type: Standard, recipient: Interface, request: 11, value: 1, index: 1, length: 0 }
└─ embassy_usb::{impl#1}::handle_control::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
9.068756 TRACE control out data: []
└─ embassy_usb::{impl#1}::handle_control_out::{async_fn#0} @ /home/r/dev/rust/embassy/embassy-usb/src/fmt.rs:117
9.068847 DEBUG endpoint_set_enabled EndpointAddress(8) true
└─ embassy_nrf::usb::{impl#3}::endpoint_set_enabled @ /home/r/dev/rust/embassy/embassy-nrf/src/fmt.rs:130
9.068878 ERROR panicked at /home/r/dev/rust/embassy/embassy-nrf/src/usb/mod.rs:359:21:
index out of bounds: the len is 8 but the index is 8
└─ panic_probe::print_defmt::print @ /home/r/.cargo/registry/src/index.crates.io-6f17d22bba15001f/panic-probe-0.3.1/src/lib.rs:104
I am trying to create a usb soundcard, first I started with a blackpill stm32f401. But I had issues with sample delivery it was every 2mS instead of the wanted 1mS. So I thought to rule out the stm32 usb stack I port the basic code over to a nrf52820.
But I hit a
index out of bounds: the len is 8 but the index is 8
error.Code: https://github.com/vDorst/stm32_audio/tree/nrf own embassy brach but it is not needed I think: https://github.com/vDorst/embassy/tree/i2s-no-mclk
For the UAC1.0 I only using a usb controll and isoch out endpoint.
Cargo run log
dmesg log