
________________________________ Från: Patrik Svensson <patsv@outlook.com> Skickat: den 5 maj 2025 19:09 Till: Branden Ghena <branden@northwestern.edu> Ämne: Sv: [Tock Devel] Kerneldebug with uart Thanks, I was not aware of the #4416 so I have my own 2350 port from 2040. I will look into that and perhaps contribute some code if needed. Being new to tock I am not 100% familiar with the muxes, I try to use a hard UART1 to my openocd debugger. // Patrik ________________________________ Från: Branden Ghena <branden@northwestern.edu> Skickat: den 5 maj 2025 16:57 Till: Patrik Svensson <patsv@outlook.com> Kopia: devel@lists.tockos.org <devel@lists.tockos.org> Ämne: Re: [Tock Devel] Kerneldebug with uart Hi Patrik, Welcome to Tock! Kind of a silly question, but did you see the recent PR with code for the RPi Pico 2? https://github.com/tock/tock/pull/4416 (apologies if you were involved with this PR and I misunderstood) If not, that might solve some of your problems. Assuming that the code in #4416 does not just solve your problem, my hypothesis for you would be an issue with flushing or configuring the UART. When a panic occurs, the code in your board src/io.rs<http://io.rs/> gets called, which configures the UART and writes to it. If debug prints are appearing then, that implies to me that something about the panic writer actions is letting the UART finally work. A second idea though. Based on the code you wrote above, are you using serial-over-USB instead of a UART? (You called it a `cdc`, and USB CDC is serial-over-USB) If that's the case, you should double-check your configuration code compared to another board with a USB serial stack. The Nano33BLE would probably be a good example: https://github.com/tock/tock/blob/master/boards/nano33ble_rev2/src/main.rs Thanks, Branden Ghena Northwestern University On Mon, May 5, 2025 at 1:47 AM Patrik Svensson via Devel <devel@lists.tockos.org<mailto:devel@lists.tockos.org>> wrote: Hi, new developer here. Trying to get a Raspberry Pico2 (2350) card running, almost there. Need to check things by printing to UART from kernel. However cannot get the debug!,debug_verbose to come out unless I do a panic! then it will come out. I suspect that there is some flush needed or is there something to enable in the kernel? Snip from my main.rs<http://main.rs/> code for enabling uart: // UART // Create a shared UART channel for kernel debug. let uart_mux = components::console::UartMuxComponent::new(cdc, 115200) .finalize(components::uart_mux_component_static!()); // Uncomment this to use UART as an output let uart_mux2 = components::console::UartMuxComponent::new( &peripherals.uart0, 115200, ) .finalize(components::uart_mux_component_static!()); // Setup the console. let console = components::console::ConsoleComponent::new( board_kernel, capsules_core::console::DRIVER_NUM, uart_mux2, ) .finalize(components::console_component_static!()); // Create the debugger object that handles calls to `debug!()`. components::debug_writer::DebugWriterComponent::new(uart_mux2) .finalize(components::debug_writer_component_static!());
participants (1)
-
Patrik Svensson