[mw_shl_code=c,true]int main()
{
u16 led0pwmval=300;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
uart_init(115200);
TIM5_PWM_Init(500-1,84-1);
USART_SendData(USART1,0xff);
TIM_SetCompare1(TIM5,led0pwmval);
}[/mw_shl_code]
执行完main函数之后就跳入启动文件
[mw_shl_code=c,true]Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP[/mw_shl_code]
然后卡在system_stm32f4xx.c文件
[mw_shl_code=c,true]while((RCC->CR & RCC_CR_PLLRDY) == 0)
{
}
#if defined (STM32F427_437xx) || defined (STM32F429_439xx)
/* Enable the Over-drive to extend the clock frequency to 180 Mhz */
PWR->CR |= PWR_CR_ODEN;
while((PWR->CSR & PWR_CSR_ODRDY) == 0)
{
}
PWR->CR |= PWR_CR_ODSWEN;
while((PWR->CSR & PWR_CSR_ODSWRDY) == 0)
{
} [/mw_shl_code]
一开始我像F103一样把启动文件里面SystemInit相关代码删除后程序就进入
hardfault_Hander故障
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
---------------------------------
int main哪里错了。。。
添上return 0也还是这样
一周热门 更多>