How to use serial manager with virtual com port MCUXpresso

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to use serial manager with virtual com port MCUXpresso

2,324 次查看
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)

标签 (1)
0 项奖励
回复
4 回复数

1,921 次查看
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 项奖励
回复

1,921 次查看
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 项奖励
回复

1,238 次查看
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 项奖励
回复

1,921 次查看
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 项奖励
回复