USB CDC problem

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

USB CDC problem

跳至解决方案
1,420 次查看
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 项奖励
回复
1 解答
1,407 次查看
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 项奖励
回复
3 回复数
1,372 次查看
raduansarif
Contributor I

Hello thank you i could solve the problem.

 

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