Bug when I plug a USB device
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-01 7:05 AM
Posted on April 01, 2016 at 16:05
Here is a little connection diagram :
The LP2980 is a linear regulator. Its ground is connected with the ST's one. The ST32 is powered by the micro-usb (U5V so).
This is how I configure my GPIOs into usb_conf.c :
Hi,
I'm facing trouble when I try to connect a USB device (whatever it is) to myhttp://www.st.com/web/en/catalog/tools/PF260320
. As I plug it, my program is stuck here :GPIO_InitStruct.Pin = (GPIO_PIN_11 | GPIO_PIN_12);
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
Then I set PA6 to have 3.3V.
Has Anyone a idea about this ?
#usb #stm32f411re
Labels:
- Labels:
-
STM32F4 Series
-
USB
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-01 11:20 AM
Posted on April 01, 2016 at 20:20
> Has Anyone a idea about this ?
Looks like an exception handler gets called that has just a default implementation and that default implementation is just an endless loop.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-04 3:05 AM
Posted on April 04, 2016 at 12:05
Thanks,
Indeed I forgot to add OTG_FS_IRQHandler in stm32f4xx_it.c. Now I'm facing another problem when I plug it. When I do that, the programm stops running and get stuck somewhere in the dissassembly code.0x08003068 BEAB BKPT 0xABWhen I look into the .map file I've got :[...]fputc 0x0800305d Thumb code 18 fputc.ofree 0x08003071 Thumb code 75 malloc.o[...]I precise that I'm using Keil and I began with the Hal_TimeBase (from STM32F411RE-Nucleo) example and be inspired by the MSC_Standalone (from STM324xG_EVAL) to make my project.I didn't find yet what could be wrong.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-04 3:24 AM
Posted on April 04, 2016 at 12:24
You have some printf() but lack any retargeting code that associates that with some output method or USART on your board?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-04 5:05 AM
Posted on April 04, 2016 at 14:05
Hi clive1,
You point out the right thing. I delete the usb's debug messages which use printf() and now my program run.Still I cannot detect my device but this is another story and I can debug correctly now.Thanks you both.