cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8 trouble with USB ''device not recognized'' WIN7

Bogdan
Senior
Posted on November 26, 2014 at 07:02

Hello all, yesturday i got this board with STM32F103c8t in wich i tryied to instal iNEMO library,

I am facing some dificulties trying to establish a usb conection with the chip. I am using the original IAR prebuild project with all the files config included. Everything is compiling well, without errors or warnings. The board is using the default system_stm32f10x wich ST says for STM32F10X_MD defined its configured as HSE with external 8MHZ crystal. The USB clock source is 1.5 divided I instaled the lastest x64 USB VCP drivers from st website... For the moment i run a simple program, in debug mode i see the program halts at while(bDeviceState != CONFIGURED); in the Stm32f1VCInit Bellow is my main prog code

#include ''stm32f10x.h''
#include ''LSM303DLHC.h''
#include ''L3Gx.h''
#include ''iNEMO_AHRS.h''
#include ''iNemo_Led.h''
#define USE_VCOM
#define USE_DFU
#ifdef USE_VCOM
#include ''STM32F1_VC_General.h''
#endif
int main(void)
{
#ifdef USE_DFU
/* Set the Vector Table base address at 0x08003000 */
NVIC_SetVectorTable( NVIC_VectTab_FLASH, 0x3000);
#endif
#ifdef USE_VCOM
/* Initialize Virtual Com */
Stm32f1VCInit();
#endif
while(1){
Stm32f1VCPrintf(''****'');
Stm32f1VCSendData();
iNEMO_Led_Toggle(LED1);
}
}

3 REPLIES 3
Bogdan
Senior
Posted on November 26, 2014 at 21:11

Hello, today in a strange moment of inspiration i tryied to comment out the 
 NVIC_SetVectorTable( NVIC_VectTab_FLASH, 0x3000); from the main.c and the VCP is working good, but why is this happening?

Posted on November 26, 2014 at 21:29

Because presumably the code you're attempting to build is an ''application'' which expects some boot loader to be present at the base of flash.

If the code really expects to be at 0x08003000, you'd want to confirm the Target settings, or .ICF file. If you're building it at 0x08000000 then the Vector Table setting would need to reflect this.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Bogdan
Senior
Posted on November 26, 2014 at 22:02

thanks clive for the information.

Indeed ST provides some .icf files, this time i loaded one wich says the following

/*-Specials-*/

define symbol __ICFEDIT_intvec_start__ = 0x08003000;

/*-Memory Regions-*/

define symbol __ICFEDIT_region_ROM_start__ = 0x08003000;

define symbol __ICFEDIT_region_ROM_end__   = 0x080FFFFF;

define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;

define symbol __ICFEDIT_region_RAM_end__   = 0x20017FFF;

/*-Sizes-*/

define symbol __ICFEDIT_size_cstack__ = 0x400;

define symbol __ICFEDIT_size_heap__   = 0x200;

/**** End of ICF editor section. ###ICF###*/

However with this new icf loaded into my IAR linker section, the Windows still says ''Unrecognized usb device... malfunction....''

Hope this has nothing to do with BOOT0 & BOOT1 pins, in the meaning that there both set to GND (low) wich means that it boots from flash