USB VCOM works only in debug mode

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

USB VCOM works only in debug mode

1,222件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tdqw on Mon Aug 06 09:12:27 MST 2012
Hi,

I use LPC1769 LPCXpresso Board with example RDB1768cmsis2_usb_serial. The example works fine in debug mode. When i use Terminate button and replug (or not) usb cable i still see virtual com in my system but it doesn't respond. After power reset system on my PC cannot detect even VCOM.

Do I need to use VBUS (J6-19) in this example?

Thans for any help,
tdqw
0 件の賞賛
返信
4 返答(返信)

1,190件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marian99 on Thu Dec 06 13:07:42 MST 2012

Quote: CodeRedSupport
From memory, that example uses semihosted output (printf calls), thus will only function as provided with the debugger attached.

http://support.code-red-tech.com/CodeRedWiki/WhatIsSemiHosting
http://support.code-red-tech.com/CodeRedWiki/CodeRedFAQ#CLibrary

Regards,
CodeRedSupport



Thank you so much!!! This has been very helpful. Do you know how to send a string instead of a unique char?

Regards,
0 件の賞賛
返信

1,190件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tdqw on Tue Aug 07 08:42:31 MST 2012
Without printf everything works properly! Nice feeling after two days trying to solve this problem;) Thank you Tsuneo for explaining VBUS issue.

Thanks everyone & Regards
tdqw
0 件の賞賛
返信

1,190件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Tue Aug 07 05:16:00 MST 2012

Quote: CodeRedSupport
From memory, that example uses semihosted output (printf calls), thus will only function as provided with the debugger attached.


Exactly.
A couple of "semihosted" printf are used in main_serial.c


Quote: tdqw


Do I need to use VBUS (J6-19) in this example?



The example enable VBUS sense function at P1.30, but it leaves PINMODE of this port as the default, on-chip pull-up. Therefore, even when this pin is open, "connection" is detected.
To make it actually work as VBUS sense pin, set it to pull-down using PINMODE3 register.

\RDB1768cmsis2_usbstack\src\usbhw_lpc.c
BOOL USBHwInit(void)
{
    ...
    // P1.18 -> USB_UP_LED
    // P1.30 -> VBUS
    LPC_PINCON->PINSEL3 &= ~0x30000030;
    LPC_PINCON->PINSEL3 |= 0x20000010;
                                           // add this line
    LPC_PINCON->PINMODE3 |= 0x30000000;    // set VBUS pin (P1.30) to pull-down


Tsuneo
0 件の賞賛
返信

1,190件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Aug 07 03:05:10 MST 2012
From memory, that example uses semihosted output (printf calls), thus will only function as provided with the debugger attached.

http://support.code-red-tech.com/CodeRedWiki/WhatIsSemiHosting
http://support.code-red-tech.com/CodeRedWiki/CodeRedFAQ#CLibrary

Regards,
CodeRedSupport
0 件の賞賛
返信