lccosy opened a new pull request, #19112:
URL: https://github.com/apache/nuttx/pull/19112

   ## Summary
   
   Fix a bug in \up_disableusartint()\ where USART interrupt state is saved 
without CTL selector bits (bits 24-27), causing \up_restoreusartint()\ to never 
restore interrupt enables.
   
   ## Problem
   
   \up_disableusartint()\ saves interrupt state from hardware CTL0-CTL3 
registers into an encoded \ie\ value, but omits the CTL selector bits. When 
\up_restoreusartint()\ later restores interrupts using \ie >> 24\ to determine 
which CTL register to write, this evaluates to 0, so no CTL register is updated 
and all interrupt enables (including RBNEIE) are permanently lost.
   
   This causes RX interrupts to never fire after any call to \up_putc()\ (e.g. 
via syslog), making the serial console unable to receive input on GD32F4 
platforms.
   
   ## Impact
   
   - Serial console TX works normally (output is visible)
   - Serial console RX is completely broken (no input accepted, no NSH prompt)
   - Affects all GD32F4 USART ports when syslog or \up_putc()\ is used
   
   ## Fix
   
   Add the corresponding CTL selector bit (\USART_CFG_CTLx_INT << 
USART_CFG_SHIFT\) whenever a CTL register has active interrupt bits, so that 
\up_restoreusartint()\ can correctly identify and restore the interrupt state.
   
   ## Testing
   
   Tested on mplant-gd32f450 custom board (GD32F450ZGT6) with USART5 as serial 
console:
   - Before fix: NSH can output debug prints but cannot accept input, no \
   sh>\ prompt
   - After fix: NSH works correctly with both input and output, \
   sh>\ prompt appears


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to