abdallah-ali-abdallah commented on issue #7331: URL: https://github.com/apache/incubator-nuttx/issues/7331#issuecomment-1283174034
Hi @acassis Thank you for your help, I did what you explained and after some hacking, tweaking and a lot of jumping between files I was able to operate the NSH over composite mode and used multiple serial instances for extra data transfers I will state all the steps I did (and I think there might be a way less hacky, please if you have any recommendation for better way mention it) ------------ steps goes as following -------- 1- I started with **tools/configure.sh raspberry-pico:composite** 2- Disable the default serial consol over **UART0** **_Device Drivers → Serial Driver Support → No serial console_**  3- Activate alternative consol **_Application Configuration → NSH Library → Console Configuration_**  4- Now for testing I added 2 serial CDC/ACM by editing **arm/rp2040/common/src/rp2040_composite.c**  5- (Here is the tricky part) When I tried to compile the project, no usb detected, after some jumping around files, I missed a simple fact, NSH need access to /dev/ttyACM0 which never initialized because by default we need to call application "conn" from NSH (which not started yet...uuuh). So the fix is to init the USB composite before starting the NSH, which I did by modifying **nsh_initialize** inside **_apps/nshlib/nsh_init.c_** where I added 2 actions applied to USB - ctrl.action = BOARDIOC_USBDEV_INITIALIZE; - ctrl.action = BOARDIOC_USBDEV_CONNECT;  6- Recompile everything and upload ... Finally,, dmesg on linux telling me I have 2 serial interfaces attached to my machine  and NSH is working perfectly on /dev/ttyACM0 ... extra problem. Based on documentation [here](https://nuttx.apache.org/docs/latest/applications/nsh/config.html)  NSH will not print '\r\n' to devices except /dev/consol. that causes the consol to read shofted and miss aligned lines I applied some fix to this by modifying **nuttx/drivers/serial/serial.c** and forced serial to convert every '\n' to '\r\n' (based on if TERMIOS is enabled or not) This  Or that  Now everything works perfectly and NSH lines printed correctly on minicom. So, Do you have any recommendation for **_cleaner way_** to do it without modifying any core nuttx files for manipulating the nsh_initialize function Thank you. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org