1、Options for Target对话框,Target页面中,勾选Use MicroLib
2、main.c的最后增加如下代码:
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d
", file, line) */
我刚才试验了一下,楼主的现象的确会出现,我采取如下的方式,可以达成单步进入到main()中:
1、在system_stm32f4xx.c中的void SystemInit(void)里面的 RCC->CR |= (uint32_t)0x00000001;语句一行设置断点
2、在main()主函数的第一行 delay_init();设置断点
3、进入DEBUG Session后,系统会停在第1个断点处,然后单步执行,直至汇编代码中的BX R0处
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
4、再按F5连续运行,此时,系统会停在main()的第1行语句断点处。
原因尚不清楚,怀疑是否要align 4bytes
是的。继续研究......
基本搞定:
1、Options for Target对话框,Target页面中,勾选Use MicroLib
2、main.c的最后增加如下代码:
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d ", file, line) */
/* Infinite loop */
while (1)
{
}
}
void __aeabi_assert(const char * x1, const char * x2, int x3)
{
}
#endif
昨天猜估计也是这问题,不过还没折腾,搞其他的去了,呵呵,等会折腾一下
一周热门 更多>