/**
* @brief Reports the name of the source file and the source line number where
* the assert error has occurred.
* 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)
* @retval void None
* @par Required preconditions:
* None
* @par Called functions:
* None
*/
#ifdef FULL_ASSERT
void assert_failed(u8 *file, u16 line)
#else
void assert_failed(void)
#endif
{
/* Add your own code to manage an assert error */
/* Infinite loop */
while (1)
{
}
}
在main函数下面加入这些代码:
/**
* @brief Reports the name of the source file and the source line number where
* the assert error has occurred.
* 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)
* @retval void None
* @par Required preconditions:
* None
* @par Called functions:
* None
*/
#ifdef FULL_ASSERT
void assert_failed(u8 *file, u16 line)
#else
void assert_failed(void)
#endif
{
/* Add your own code to manage an assert error */
/* Infinite loop */
while (1)
{
}
}
#error clnk Debug t.lkf:26 can't open file crtsi0.sm8
#error clnk Debug t.lkf:38 can't open file libis0.sm8
#error clnk Debug t.lkf:39 can't open file libm0.sm8
The command: "clnk -l"C:Program FilesSTMicroelectronicsst_toolsetstvdLib" -o Debug t.sm8 -mDebug t.map Debug t.lkf " has failed, the returned value is: 1
exit code=1.
问题已经解决了,中断文件改为
typedef void @far(*interrupt_handler_t)(void);
struct interrupt_vector
{
unsigned char interrupt_instruction;
interrupt_handler_t interrupt_handler;
};
@near void _stext(); /* startup routine */
大家注意一下,程序大于32k后,要把const数据,main还有中断函数等定位到32k(地址64k)以内,不然程序会跑飞,
而且编译链接的时候也不会报错,我就被黑了一下。
还是好好读一下cosmic的文档。
还有中断向量表是在64K之内呀,谁能解释一下?也遇到这个问题。
一周热门 更多>