- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3
          Fix rtt_target blocking panic handler.
          #491
        
          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
base: main
Are you sure you want to change the base?
Conversation
| Why would this only be triggered in release? IIRC the unsafe conjure is there to avoid deadlock/borrow failure. with_terminal_channel looks like it would panic when nested. | 
| And a hang on panic doesn't sound too bad here. IIRC the watchdog should kick in. | 
| 
 Right, it isn't. It's triggered when no debug probe is connected. However there is already an assumption in the  
 The watchdog does indeed kick in, but I'd like the device to immediately reset without delay rather than wait for 4 seconds for the watchdog. Maybe adding an  | 
| Ack the  
 The reboot on panic never actually solves any problem or bug. I'm fine with keeping it as is. It seems slightly better than the alternative. But I won't spend time on "optimizing the panic experience". Rather fix the cause of the panic. | 
3f233c1    to
    e9ec34b      
    Compare
  
    e9ec34b    to
    8c6c052      
    Compare
  
    |  | ||
| #[cfg(debug_assertions)] | ||
| loop {} | ||
| cortex_m::asm::bkpt(); | 
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.
Is this, combined with watchdog.stop_on_debug(...), enough, or do you additionally want to completely disable the watchdog when the rtt feature is enabled?
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.
Ah. Just watchdog.stop_on_debug is fine. Good find.
| @jordens, anything still missing here? | 
| The review request was. | 
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.
Linker script needs fixing AFAICT
| Seems like  | 
|  | 
In release mode, the
panic_persist::report_panic_infowas never reached because the panic handler would block when writing to the RTT target (since none is connected).Only set
BlockIfFullin debug mode, and replace unsafeUpChannel::conjurewithwith_terminal_channelwhile we're at it.