USB CDC problem

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

USB CDC problem

Jump to solution
1,082 Views
raduansarif
Contributor I

Hello, my frdmkl27z_dev_cdc_vcom_bm code stopped in the following part, what I need to do to work on this part..?

raduansarif_0-1648111046457.jpeg

 

0 Kudos
1 Solution
1,069 Views
bobpaddock
Senior Contributor III

 

Possibilities:

A) The structure pointer khciState is not initialize correctly.

B) The Buffer Description Table (BDT) is not aligned on a 512 byte boundary as I explained in other thread (It is best to keep everything in one thread, rather than starting many about the same subject).

As the BDT is part of a structure in this code the structure must start on a boundary, which may or many not account for structure packing and it matters here, that will place the BDT on that 512 byte boundary.

C) Something about the USB is not initialized correctly (->registerbase->).  Probably would not have gotten this far in the code if that is the case.  Using USB1 rather than USB0 on a part with only one USB.

Find out exactly where BDT is in the address map by looking at the listing, .sym or .map file.
Keeping in mind it is part of the larger structure containing it.





View solution in original post

0 Kudos
3 Replies
1,034 Views
raduansarif
Contributor I

Hello thank you i could solve the problem.

 

0 Kudos
1,070 Views
bobpaddock
Senior Contributor III

 

Possibilities:

A) The structure pointer khciState is not initialize correctly.

B) The Buffer Description Table (BDT) is not aligned on a 512 byte boundary as I explained in other thread (It is best to keep everything in one thread, rather than starting many about the same subject).

As the BDT is part of a structure in this code the structure must start on a boundary, which may or many not account for structure packing and it matters here, that will place the BDT on that 512 byte boundary.

C) Something about the USB is not initialized correctly (->registerbase->).  Probably would not have gotten this far in the code if that is the case.  Using USB1 rather than USB0 on a part with only one USB.

Find out exactly where BDT is in the address map by looking at the listing, .sym or .map file.
Keeping in mind it is part of the larger structure containing it.





0 Kudos
1,046 Views
raduansarif
Contributor I

hello bobpaddock 

Thanks for the reply.

In my MCU MKL27Z128LH4, this example ( frdmkl27z_hello_world_virtual_com) is working.

I try with frdmkl27z_dev_cdc_vcom_bm but I fails in 

if (kStatus_USB_Success != USB_DeviceClassInit(CONTROLLER_ID, &s_cdcAcmConfigList, &s_cdcVcom.deviceHandle))
{
usb_echo("USB device init failed\r\n");
}

this part. 

I try with frdmkl43z_dev_cdc_vcom_bm, it's also connected with the port.

What is the actual problem, I do not understand 

0 Kudos