2014-10-01 02:32 AM
I've tried running the USB example from the Discovery sample library, out of the box.
The issue is that once interrupts are enabled (by calling usb_pwr.c/PowerOn()), the MPU gets keeps calling the USB_LP_CAN1_RX0_IRQHandler() ISR, and the program is stuck.Any ideas?Technical details:STM32F3-Discovery Board Firmware Applications Package, version
V1.1.0 / 20-September-2012
Tasking IDE, on Windows 7 64-bit
2014-10-01 07:44 AM
How about the ''OSC clock supply'' of your board?
The USB examples (Demonstration and Peripheral_Examples\USB_Example) in the package (v1.1.0) expect 8 MHz from ST-Linksystem_stm32f30x.c
/* Select the PLL clock source */
//#define PLL_SOURCE_HSI // HSI (~8MHz) used to clock the PLL, and the PLL is used as system clock source
//#define PLL_SOURCE_HSE // HSE (8MHz) used to clock the PLL, and the PLL is used as system clock source
#define PLL_SOURCE_HSE_BYPASS // HSE bypassed with an external clock (8MHz, coming from ST-Link) used to clock
// the PLL, and the PLL is used as system clock source
To satisfy this setting, you may need to change the solder jumpers on the board, according to this chapter of the User manual of this board.
http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00063pdf
4.1 OSC clock supply
MCO from ST-LINK. From MCO of the STM32F103C8T6. This frequency cannot be changed, it is fixed at 8 MHz and connected to PF0-OSC_IN of the STM32F303VCT6. Configuration needed: – SB12 closed, SB17 open, R33 removed – SB18, R32, C22, C23, X2 = don't care
Tsuneo
2014-10-04 11:57 PM
Thank you Chinzei, but the clocks are configured OK.
After disabling the SUSPEND interrupt (by removing CNTR_SUSPM from the definition of the IMR_MSK macro in usb_conf.h), my device enumerated OK, but then, of course, it is unable to suspend.Some more info:My device has a battery, so it wakes up before the USB cable is attached (I emulate this on the eval board by allowing power from the ST-Link connector).The moment power is enabled, the USB_LP_CAN1_RX0_IRQHandler() interrupt handler keeps getting called, with the ERR, SUSP and ESOF flags set.I suspect a problem in the library interrupt handler routine USB_Istr() defined in usb_instr.c - it clears the SUSP flag, but it immediately gets set again, as the cable is disconnected.Any idea how to tackle this?