CDC examples on imxrt1020-evk

cancel
Showing results for 
Search instead for 
Did you mean: 

CDC examples on imxrt1020-evk

Jump to solution
815 Views
alexeyusoltsev
Contributor IV

   Hi,

i'm trying to start any USB examples on mimxrt1020 and failed. It enumerates but no any other reaction. The system is W7.

No one of examples with vcom have succeed to send any message.

Labels (1)
Tags (3)
1 Solution
373 Views
alexeyusoltsev
Contributor IV

Ok, solve that problem. To make it work without CTS/RTS one need to modify virtual_com.c

In the function(callback) USB_DeviceCdcVcomCallback:

callback.jpg

commented line is initial one. The aim is to receive data having s_cdcVcom.startTransaction==0

And second thing to be modified is tha APPTask function. After we send all the data PC have to be notified.

To do that we need to add:

error = USB_DeviceCdcAcmRecv(s_cdcVcom.cdcAcmHandle, USB_CDC_VCOM_BULK_OUT_ENDPOINT, s_currRecvBuf,g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize);

In my case:

additional action.jpg

View solution in original post

0 Kudos
15 Replies
373 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Alexey,

   Please also check your SW8, please configure it as :

SW8 1-OFF, 2-OFF, 3-ON, 4-OFF.

  Then debug it again.


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
373 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Alexey Usoltsev,

    Which detail SDK code you are using?

    I will help you to check it.

    About the CDC action, you need to check it in the serial tools, in my memory, you can send some character to your com port, then the data will be send back, it is the response.

   You can try it again.

   If you still have question about it, please kindly let me know.

   


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
373 Views
alexeyusoltsev
Contributor IV

 Hi Kerry Zhou,

I've tried the following examples: dev_cdc_vcom_bm, dev_cdc_vcom_freertos, dev_cdc_vcom_lite_bm, dev_composite_cdc_msc_bm, hello_world_virtual_com .

As concern CDC and kinetis I've made several devices on kl26 and mk21. Basic code looks the same

.

After enumeration when I'm trying to send something to serial port it stacks.(Termite just stop response anything). Hercules in turns see no response.

 In my previous post I've putted down a breakpoint in the place where it checks if something is received(picture attached). And the flag is not asserted.(only flag of connection active set).

P.S.: I've tried several examples on other peripheral and found a lot of broken examples( all examples with CMP not working). I bet SDK for imx.rt is not production ready by the moment or have not been tested.

 Have you tried it on imx.rt evks?(i mean CDC examples)

Best regards,

Alexey.

0 Kudos
373 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Alexey,

   All the SDK has been tested internally, and have several round test.

   Today, I test the CDC code on my mimxrt1020-evk board, it works ok.

  The test project is:

SDK_2.5.0_EVK-MIMXRT1020\boards\evkmimxrt1020\usb_examples\usb_device_cdc_vcom\bm\iar

The test result is:

pastedImage_1.png

The USB CDC is never blocked.

 


Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
373 Views
alexeyusoltsev
Contributor IV

 Hi Kerry Zhou,

at least in IAR and your set up it worked out - good news. But i still can't succeed here.

stacked.jpg

MCUXpresso v10.3.0_2200 and SDK 2.5.0

Could you please try it under MCUXpress but IAR?

My board is:

P90412-115807[1].jpg

P.S.: share ".elf" file with me please, so I could check if it is an IDE problem or MCU.

Best regards,

Alexey.

0 Kudos
373 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Alexey,

   This is my mcuxpresso IDE debug result:

pastedImage_1.png

About the .elf file, please check my attached file, it is the .axf, you can modify it to .elf, I generate it from the MCUxpresso IDE.

Wish it helps you!

If you still have question about it, please kindly let me know.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

373 Views
alexeyusoltsev
Contributor IV

 Hi Kerry,

thanks a lot for your involvement in my case. It appears i can't see any files attached.

As concern your next post :yes, i have correct sw8 set. I have no issues with flashing device and some other examples worked out fine. Even with CDC example it enumerates( so at least no problem in physical layer of board/chip).

I think it is some of #defines or callback dependence are lost.

Best regards,

Alexey.

0 Kudos
373 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Alexey Usoltsev,

     Please check the attachment.

     You can try it on your side.

     If you still have question about it, please let me  know.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

373 Views
alexeyusoltsev
Contributor IV

 Well,

I've uploaded your image. And... have the same bug.

stacked2.jpg

*inf file used is attached to the message.

Tried both USB2.0 and 3.0 inputs of my notebook.

What type of problem could it be?

0 Kudos
373 Views
alexeyusoltsev
Contributor IV

I've tried another computer - same result. Also I tried TerraTerm. It looks like it worked but i cant figure that out since TT has inconvenient interface. Could you try Termite please(it's free).

0 Kudos
373 Views
alexeyusoltsev
Contributor IV

 Well,

it worked(i've changed the message it returns)worked.jpg

but other terminals: Termit and Hercules still stuck. After it stucked Tera Term can't connect too. Only replug helps.

During debug i've figured out that with TT is jumps in the loopback construction:

if ((1 == s_cdcVcom.attach) && (1 == s_cdcVcom.startTransactions))

s_cdcVcom.startTransactions is 0.

What is the difference between TT and other 2 terminals? Or what should be modified to make it work?

 Best regards,

Alexey.

0 Kudos
373 Views
alexeyusoltsev
Contributor IV

ok,

further research led me to that discussion:

https://community.nxp.com/thread/377609 

i've followed recommendation(activate cts/rts flow control) and it respond as it should to.

So a new question is what need to be modified to allow communication without flow control? 

0 Kudos
374 Views
alexeyusoltsev
Contributor IV

Ok, solve that problem. To make it work without CTS/RTS one need to modify virtual_com.c

In the function(callback) USB_DeviceCdcVcomCallback:

callback.jpg

commented line is initial one. The aim is to receive data having s_cdcVcom.startTransaction==0

And second thing to be modified is tha APPTask function. After we send all the data PC have to be notified.

To do that we need to add:

error = USB_DeviceCdcAcmRecv(s_cdcVcom.cdcAcmHandle, USB_CDC_VCOM_BULK_OUT_ENDPOINT, s_currRecvBuf,g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize);

In my case:

additional action.jpg

View solution in original post

0 Kudos
373 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Alexey,

  Thank you for your solution sharing.

   Now, do you still have problems about your topic?


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
373 Views
alexeyusoltsev
Contributor IV

Hi Kerry Zhou,

no more problem on the topic.

 Thank you!

0 Kudos