You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unlike logging to usb cdc, logging to the debug header allows us to debug usb problems (CFG_TUSB_DEBUG), but this requires three uarts and the rp2040 only has two, so we currently disable the sun keyboard when doing so. wouldn’t it be nice if the debug header (tx + rx, but rx unused so far) could work without disabling the sun keyboard (tx + rx) or mouse (tx only)?
the good news is, SerialPIO allows us to set up a third uart, freeing up one of the hardware uarts for debugging. the docs say SoftwareSerial (and SerialPIO?) don’t support inverted mode, which are needed for the sun interfaces, but thankfully this is not (or no longer?) true.
to avoid running out of pio resources when beeping, we would need to go back to using analogWrite (hardware pwm) instead of tone (pio) for the buzzer (reverting 8922fe6), but that’s ok.
the bad news is, there seems to be no way to actually do this without pcb changes. here are our requirements:
usb tx needs 1/4 sm and 22/32 instructions (usb_tx.pio)
usb rx needs 2/4 sm and 31/32 instructions (usb_rx.pio)
UART_TX wired to pin 0 (valid for UART0 or SerialPIO)
UART_RX wired to pin 1 (valid for UART0 or SerialPIO)
INT_KTX wired to pin 12 (valid for UART0 or SerialPIO)
INT_KRX wired to pin 13 (valid for UART0 or SerialPIO)
INT_MTX wired to pin 8 (valid for UART1 or SerialPIO)
debug console needs to be on a hardware UART?
if we move sun mouse tx to SerialPIO (and bump pio_cfg.sm_tx etc accordingly), both the sun and usb interfaces still work, and this frees up hardware UART1! but UART1 is not allowed on pins 0 + 1 (UART_TX + UART_RX).
if we move sun keyboard tx and rx to SerialPIO (and bump pio_cfg.sm_tx etc accordingly), we are guaranteed to run out of pio instruction space for usb, because 6+7+min(22,31)>32 and min(6,7)+max(22,31)>32.
if we move sun keyboard tx only to SerialPIO (and bump pio_cfg.sm_tx etc accordingly), we can free up hardware UART0 tx for debug logging! believe it or not, UART0 can be set to tx on pin 0 (UART_TX) and rx on pin 13 (INT_KRX)! but sharing it with the sun keyboard like this means we need to log at 1200 baud, which not only would need a modified picoprobe firmware, but is also extremely slow: it takes 80(!) seconds to boot usb3sun with all debug logging on.
so we have three options, unless there’s some way to run the debug console over SerialPIO:
move sun mouse to SerialPIO, rewire UART_TX + UART_RX to pins valid for UART1
move sun mouse to SerialPIO, move sun keyboard to UART1, rewire sun keyboard to pins valid for UART1
do nothing, at least until we need a new pcb rev for some other reason
The text was updated successfully, but these errors were encountered:
unlike logging to usb cdc, logging to the debug header allows us to debug usb problems (CFG_TUSB_DEBUG), but this requires three uarts and the rp2040 only has two, so we currently disable the sun keyboard when doing so. wouldn’t it be nice if the debug header (tx + rx, but rx unused so far) could work without disabling the sun keyboard (tx + rx) or mouse (tx only)?
the good news is, SerialPIO allows us to set up a third uart, freeing up one of the hardware uarts for debugging. the docs say SoftwareSerial (and SerialPIO?) don’t support inverted mode, which are needed for the sun interfaces, but thankfully this is not (or no longer?) true.
to avoid running out of pio resources when beeping, we would need to go back to using analogWrite (hardware pwm) instead of tone (pio) for the buzzer (reverting 8922fe6), but that’s ok.
the bad news is, there seems to be no way to actually do this without pcb changes. here are our requirements:
if we move sun mouse tx to SerialPIO (and bump pio_cfg.sm_tx etc accordingly), both the sun and usb interfaces still work, and this frees up hardware UART1! but UART1 is not allowed on pins 0 + 1 (UART_TX + UART_RX).
if we move sun keyboard tx and rx to SerialPIO (and bump pio_cfg.sm_tx etc accordingly), we are guaranteed to run out of pio instruction space for usb, because 6+7+min(22,31)>32 and min(6,7)+max(22,31)>32.
if we move sun keyboard tx only to SerialPIO (and bump pio_cfg.sm_tx etc accordingly), we can free up hardware UART0 tx for debug logging! believe it or not, UART0 can be set to tx on pin 0 (UART_TX) and rx on pin 13 (INT_KRX)! but sharing it with the sun keyboard like this means we need to log at 1200 baud, which not only would need a modified picoprobe firmware, but is also extremely slow: it takes 80(!) seconds to boot usb3sun with all debug logging on.
so we have three options, unless there’s some way to run the debug console over SerialPIO:
The text was updated successfully, but these errors were encountered: