cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32f407 vs stm32f415 vcp driver

totti001
Associate II
Posted on January 30, 2014 at 15:20

Hello everybody!

I've a working vcp driver for stm32f4discovery board(stm32f407vg). Use the standard st usb library. This is working well. If I change the device with an stm32f415 mikrocontroller, the code is running, but at the device manager I don't see the com port.

Is anybody have an idea what is the problem? The usb pins are the same.

Thanks

#usb-vcp-stm32
20 REPLIES 20
totti001
Associate II
Posted on January 30, 2014 at 16:58

No unknow or bad device, and the pc not do anything when i plug the board.

chen
Associate II
Posted on January 30, 2014 at 17:09

Sound like the USB on the mikroe Mini-M4 with stm32f415rg controller is not working then.

Does it have any demo software you can try?

totti001
Associate II
Posted on January 30, 2014 at 17:13

Yes I have an st-s example for vcp this is working.

chen
Associate II
Posted on January 30, 2014 at 17:32

''Yes I have an st-s example for vcp this is working.''

''I have a mikroe Mini-M4 with stm32f415rg controller..I change the project settings(clock config etc) for this board, compile, download. ''

You will have to compare the differences between the 2 projects.

You said that you have checked the Clock tree settings, USB peripheral settings  and the IO port setting - they are the usual culprits.

totti001
Associate II
Posted on January 31, 2014 at 09:18

No working the code. The problem was I use VBUS_SENSING_ENABLED. I dont know why this define work with stm32f407 and not work with stm32f415.

chen
Associate II
Posted on January 31, 2014 at 10:20

Hi

''No working the code.''

I do not know what you mean by this.

'' The problem was I use VBUS_SENSING_ENABLED.''

Does that mean you have it working now?

''I use VBUS_SENSING_ENABLED. I dont know why this define work with stm32f407 and not work with stm32f415.''

I am not 100% clear on it, I have not studied the Hardware design properly (yet).

I believe the change made by the 'OTG' specification required a pull up on one of the data line, to signify either 'OTG compliance' or signify 'master/slave'.

Since you changed from one board to another - the hardware design may have changed hence not needing the define on the new processor.

Turning on/off VBUS_SENSING_ENABLED depends on what is implemented in the hardware design.

 

totti001
Associate II
Posted on January 31, 2014 at 12:03

no=now. Yes working well. I can communicate with pc. I will check the vbus sensing later, but I have no idea what is the problem with this.

tecnico
Associate
Posted on June 07, 2014 at 22:30

hi

i have the same problem ... with the same board

with the discovery board it works, with mini-m4 no way

i'm stuck with unknown device, probably some problem setting the PLL

does someone have an example for system_stm32f4xx.c with 16MHz HSE?

Posted on June 08, 2014 at 14:15

HSE_VALUE within the project, or stm32f4xx_conf.h must reflect the speed of the HSE clock, ie 16000000

The PLL settings in system_stm32f4xx.c must be changed, so the divider matches the MHZ of the clock.

...
/* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N */
//#define PLL_M 8 // 8 MHz HSE
#define PLL_M 16 // 16 MHz HSE
#define PLL_N 336
/* SYSCLK = PLL_VCO / PLL_P */
#define PLL_P 2 // 336/2 = 168 MHz

/* USB OTG FS, SDIO and RNG Clock = PLL_VCO / PLLQ */
#define PLL_Q 7 // 336 / 7 = 48 MHz, must be 48 MHz for USB
...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
tecnico
Associate
Posted on June 08, 2014 at 20:54

hi clive1

thanks for your support

there is something of strange in this board

it seems that wont work at 168MHz

when I use your parameters the execution generates an exeption and the code doesn't run (not only the usb but the whole program)

in the mikroe forum site I've found that their bootloader works at 120MHz so I changed the PLL and the prescalers according to this (with the help of cubemx) and now it works

here my settings:

#define PLL_M      16

#define PLL_N      240

#define PLL_P      2

#define PLL_Q     5

120MHz could be ok for my applications

I can try to go up; it could be useful to understand why this limitations

just another question:

I see that st has changed in their stdlib and now there is the new hal

is there a guide to upgrade a project from the old stdlib to the new hal?