Getting a Shell on USB VCOM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting a Shell on USB VCOM

1,351 Views
StuartTyler
Contributor II

I have a LPC55S28 project that uses SDK 2.12.0

StuartTyler_3-1669898163762.png

I am trying to get the USBHSD (usb_device_interface_0_cic_vcom .c/.h) working with fsl_shell .c/.h - it is the first time using both of these, and I see the vcom loopback, and see the receive and transmit buffers, and call to USB_DeviceCdcAcmSend.

What I am unsure about is how to hook this into fsl_shell. What I want is to generate a shell that is accessible over the USB vcom interface, so I can send the device commands from the PC.

StuartTyler_0-1669898093208.png

SHELL_Init seems to need a serial_handle_t

StuartTyler_1-1669898093209.png

In the SDK components I notice serial_manager_usb_cdc

I was sort of hoping that this would expose the usb vcom port as a serial handle that could be passed to SHELL_Init. But I could not work it out. Am I on the right path, or is this incorrect?

StuartTyler_2-1669898093210.png

Any clues on how to get USB VCOM being passed to SHELL_Init, so that I can build up a command system easily accessible over USB?

An example project for the LPC55S28-EVK would be really nice.

When I install fsl_component_serial_port_usb.c there are compile errors. 

StuartTyler_4-1669898565787.png

A basic example of using fsl_component_serial_port_usb.c with fsl_shell and USBHSD would be good.

 

 

8 Replies

1,181 Views
Mc2023
Contributor IV

Hi @StuartTyler 

Did you manage to get a Shell on USB VCOM?

I am trying to implement a similar feature.

Best regards,

 

1,177 Views
StuartTyler
Contributor II

<rant start>

No, I never got it working. The link provided by xiangiun rong did not help me.

I hacked together my own command handler very quickly and never came back to this. Its annoying because I dont have backspace or command history which I really want - but I could implement this but the command line is used 90% automated interface, humans only use it occasionally.

The USB CDC driver is a horrible implementation as is only gives you a rx buffer and tx buffer and an error handler and you have to work out all the interfacing. What I want is a serial stream, which I would think is what most engineers want so that they can connect it to Shell easily.

So close NXP, but no good. Everyone has to get in and hack away at the USB CDC driver to use it. And handle the errors - they occur frequently.

<rant end>

1,156 Views
Mc2023
Contributor IV

Hi @StuartTyler ,

Thanks a lot for your feedback!

0 Kudos

1,166 Views
ErichStyger
Senior Contributor V

Me too, I ended up with my own shell and command line interface.

You can find the core module here: https://github.com/ErichStyger/McuOnEclipseLibrary/blob/master/lib/src/McuShell.c along with example in the same GitHub.

It includes support for backspace and history (I rarely use it), but it comes with support for any kind of 'serial' communication interface: UART, RTT, USB CDC, even UDP, both for bare metal and RTOS. I used it mostly as a user interface and testing interface running with FreeRTOS, or in combination with a logging module (https://mcuoneclipse.com/2020/06/01/mculog-logging-framework-for-small-embedded-microcontroller-syst...).

I hope this helps,

Erich

1,155 Views
Mc2023
Contributor IV

HI @ErichStyger ,

Thanks a lot for your feedback!

I have feeling that NXP should improve their sdk when I read your comment and the one from @StuartTyler. I think some of NXP competitors already provide this feature.

 

 

0 Kudos

1,142 Views
ErichStyger
Senior Contributor V

Hi @Mc2023 ,

It all depends what you want and need for your project. To me, the implementation in the SDK probably fits most users or applications, nothing wrong with it imho. And if you want it different or with different features, there are always choices or other open source implementations.

Just my 1 cent,

Erich

0 Kudos

1,130 Views
Mc2023
Contributor IV

Hi @ErichStyger 

There is always room for improvement and it is really obvious by looking at the comments about the shell not working with usb cdc.

0 Kudos

1,336 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I have not found any application note or the other doc which addresses the shell via USB CDC stack instead of shell via uart module.

But the ticket maybe helpful.

https://community.nxp.com/t5/i-MX-RT/using-SDK-SHELL-with-Serial-Manager-on-USB-CDC-Interface/m-p/10...

 

I do not think there is problem for shell via USB CDC stack.

BR

XiangJun Rong