谢谢,只是我现在工程设置都还没搞定呢,我是在之前的STM32F103VE的一个工程上来改的(使用的是3.5的库),步骤如下:
1.在Options for Target的Device页由STM32F103VE改选为STM32F105RC
2.在Options for Target的C/C++页把STM32F10X_HD改为STM32F10X_CL
3.启动文件由startup_stm32f10x_hd.s改为startup_stm32f10x_cl.s
编译正常,但用Use Simulator调试的时候,起始地址是0x00000000,内容也是全0,不能执行,显示
*** error 65: access violation at 0x0000000C : no 'read' permission
/* Wait till HSE is ready and if Time out is reached exit */
do
{
HSEStatus = RCC->CR & RCC_CR_HSERDY;
StartUpCounter++;
} while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
/* Wait till PLL is ready */
while((RCC->CR & RCC_CR_PLLRDY) == 0)
{
}
/* Select PLL as system clock source */
RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08)
{
}
}
else
{ /* If HSE fails to start-up, the application will have wrong clock
configuration. User can add here some code to deal with this error */
}
}
我明白,我就是用的8MH在的晶振,我想知道帖子上说USB需要配置成48MHz,这个需要改哪里呢?因为我现在是获取前8位描述符不成功,然后跳出进入
case HOST_CTRL_XFER:
/* process control transfer state machine */
USBH_HandleControl(pdev, phost);
break;
一直在这里循环。就是说获取描述符,设置地址,配置描述符什么的都还没进行。。