Okey, if I changed to OTG1 instead of OTG2 it started working while having the external 1.5k resistor.
But when I removed the external 1.5k resistor it stopped enumerating again.
What is it that I have to change to enable the internal 1.5k Pull-up for OTG1?
USB CDC on STM32F746 with ChibiOS 16.1
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: USB CDC on STM32F746 with ChibiOS 16.1
OTG2 can have an external PHY or not have it, the board configuration differs.
The STM32F7-Discovery has the external PHY for example.
Giovanni
The STM32F7-Discovery has the external PHY for example.
Giovanni
Re: USB CDC on STM32F746 with ChibiOS 16.1
Yes, but the USB FS that I am using should have an internal 1.5k pull-up resistor?
I checked the RM for the bit:
But it does not exist, do you know which it is? I cannot seem to find it.
I checked the RM for the bit:
Code: Select all
/**
* @brief Connects the USB device.
*
* @api
*/
#if !defined(usb_lld_connect_bus)
#define usb_lld_connect_bus(usbp) (STM32_USB->BCDR |= USB_BCDR_DPPU)
#endifBut it does not exist, do you know which it is? I cannot seem to find it.
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: USB CDC on STM32F746 with ChibiOS 16.1
The pull-up is internal and the driver works on the Discovery board. If the enumeration starts then the resistor is working or plugging the device would not even be detected by host.
Giovanni
Giovanni
Re: USB CDC on STM32F746 with ChibiOS 16.1
The thing is that the USB resistor is not working.
If I add an external resistor it works.
I checked the stm32f746x.h for the USB resistor pull-up bit for USB FS (OTG1) but it does not exist.
I am starting to believe that it is not there. I am though not familiar with the USB part of the RM, so I cannot find anything about the internal 1.5k when using USB FS.
Are you sure it is there?
If I add an external resistor it works.
I checked the stm32f746x.h for the USB resistor pull-up bit for USB FS (OTG1) but it does not exist.
I am starting to believe that it is not there. I am though not familiar with the USB part of the RM, so I cannot find anything about the internal 1.5k when using USB FS.
Are you sure it is there?
Re: USB CDC on STM32F746 with ChibiOS 16.1
Okey, I now found what gave the intermitent nature of the error, one of the 22 ohm resistors where broken and soldiering the big resistor made a connection.
When it was removed to try again, the resistor was broken. Now replaced it seems to work as it should.
When it was removed to try again, the resistor was broken. Now replaced it seems to work as it should.
Re: USB CDC on STM32F746 with ChibiOS 16.1
Final question on the USB.
When opening the USB serial port from the PC the board Halts with the error:
and I get the error on the PC side:
It seems that something is not implemented that has to do with the DTR/RTS signals that I am missing, does anyone know what it is?
I am unable to find it in any example code for the CDC.
Thanks!
When opening the USB serial port from the PC the board Halts with the error:
chSysHalt (reason=0x8008c84 <__func__.9659> "obqReleaseEmptyBufferI") at ./ChibiOS/os/rt/src/chsys.c:184
and I get the error on the PC side:
cdc_acm 1-2:1.0: failed to set dtr/rts
It seems that something is not implemented that has to do with the DTR/RTS signals that I am missing, does anyone know what it is?
I am unable to find it in any example code for the CDC.
Thanks!
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: USB CDC on STM32F746 with ChibiOS 16.1
Probably an unimplemented CDC message, the CDC driver only implement a minium of them, you need to provide handlers for the others.
I cannot explain that error however, post a stack trace.
Giovanni
I cannot explain that error however, post a stack trace.
Giovanni
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: USB CDC on STM32F746 with ChibiOS 16.1
The default handler is sduRequestsHook(), place a breakpoint there and you will know why it fails (return false).
Giovanni
Giovanni