2016-04-01 07:05 AM
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 : 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 :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
2016-04-01 11:20 AM
> 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.2016-04-04 03:05 AM
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.2016-04-04 03:24 AM
You have some printf() but lack any retargeting code that associates that with some output method or USART on your board?
2016-04-04 05:05 AM
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.