nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

imxrt106x serial registration fixes when no dev console defined

Open dirksavage88 opened this issue 2 months ago • 2 comments

Summary

Addresses inconsistencies in serial uart registration when no DEV_CONSOLE is defined/assigned (See https://github.com/apache/nuttx/issues/17116). The registration order is implicitly based on DEV_CONSOLE definition, and it results in lpuart1 registration on ttys0 and ttys1 with no dev console defined.

Impact

Minor impact to users using imxrt106x boards: will impact those who do not have a dev console enabled.

Testing

Compiled on ubuntu 24.04. Tested on Teensy 4.1 derivative board when no dev console defined, but need to test with a dev console on each successive lpuart to make sure the registration order is correct. This derivative board has all 8 lpuarts pins broken out, whereas the teensy4.1 nsh board only has several uarts defined. build.zip

TODO: test on actual teensy 4.1

dirksavage88 avatar Sep 29 '25 21:09 dirksavage88

Hi @dirksavage88 please fix this long line:

/* Pick ttys1/ttys2.  This could be one of UART2-12. It can't be UART1 because that

acassis avatar Sep 30 '25 20:09 acassis

Hi @dirksavage88 please fix this long line:

/* Pick ttys1/ttys2.  This could be one of UART2-12. It can't be UART1 because that

I've fixed these long comments

dirksavage88 avatar Oct 10 '25 14:10 dirksavage88

Hello @acassis I would like to test this PR on my Teensy 4.1, but am looking for recommendations to validate the test case where there is no dev console defined, but the serial ports are all enabled (or a subset of them are). Since the console is the main way to validate what is going on, is there another application or peripheral I could use to validate this PR? image

One other issue is that uarts 2,4, 5, 7, & 8 are not enabled in board.h for the Teensy 4.x

dirksavage88 avatar Dec 16 '25 19:12 dirksavage88

@dirksavage88 you can use USBNSH as console (I just noticed that there is not usbnsh board profile example to teensy-4.x board or any imxrt board, arggg!). If you have an SWD programmer supported by OpenOCD, you can try using LWL as console: https://www.youtube.com/watch?v=A4aCwoABGB8 it is very slow, but will help.

Alternatively you can just use semihost to see the debug messages and confirm if the devices numbering are correct using semihosting with syslog: https://nuttx.apache.org/docs/latest/guides/semihosting.html

acassis avatar Dec 16 '25 19:12 acassis