How to use serial manager with virtual com port MCUXpresso

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

How to use serial manager with virtual com port MCUXpresso

2,602 Views
apunch
Contributor I

Is it possible to use the Serial Manager library to set up a shell for a virtual com port? Here is my configuration using the code from the docs for cdc usb, except I am using config.type = kSerialPort_UsbCdcVirtual instead of config.type = kSerialPort_UsbCdc. 

#define SERIAL_MANAGER_RING_BUFFER_SIZE (256U)
static uint8_t s_serialHandleBuffer[SERIAL_MANAGER_HANDLE_SIZE];
static serial_handle_t s_serialHandle = &s_serialHandleBuffer[0];
static uint8_t s_ringBuffer[SERIAL_MANAGER_RING_BUFFER_SIZE];

serial_manager_config_t config;
serial_port_usb_cdc_config_t usbCdcConfig;
config.type = kSerialPort_UsbCdcVirtual;
config.ringBuffer = &s_ringBuffer[0];
config.ringBufferSize = SERIAL_MANAGER_RING_BUFFER_SIZE;
usbCdcConfig.controllerIndex =
   kSerialManager_UsbControllerKhci0;
config.portConfig = &usbCdcConfig;
SerialManager_Init(s_serialHandle, &config);


/* Init SHELL */
s_shellHandle = &s_shellHandleBuffer[0];
SHELL_Init(s_shellHandle, s_serialHandle, "SHELL>> ");
SHELL_Task(s_shellHandle);

I'm using SDK_2.6.0_MK66FX1M0xxx18 (MCUXpresso processor MK66FX1M0xxx18)

Labels (1)
0 Kudos
Reply
4 Replies

2,199 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

I'm not sure what Serial Manager library is . Do you mean the fsl_shell.c? I think it's ok to combine the shell example and dev_cdc_vcom_bm example.

Regards,

Jing

0 Kudos
Reply

2,199 Views
apunch
Contributor I

Hi Jing,

The serial manager library is in serial_manager.c but it is used in fsl_shell.c. I am also using FreeRTOS. Do you know if you can incorporate the code from fsl_shell.c in the usb_dev_vcom_freertos example? Thanks!

0 Kudos
Reply

1,516 Views
Mc2023
Contributor IV

Hi @apunch ,

I am implementing a similar task.

Did you manage to  incorporate the code from fsl_shell.c in the usb_dev_vcom_freertos example?

0 Kudos
Reply

2,199 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Amanda,

serial manager is a new component in SDK2.6.0. But it seems this component is not ready. As you can see in the link USB SDK files explanation 

The user's guide is not ready. There is also no example.

The usb_dev_vcom_freertos has include serial_manage component already. You can see it in component directory. I think after you copy shell related code to a USB CDC demo, you should modify the settings in serial_manager.h.

Regards,

Jing

0 Kudos
Reply