HardFault_Handler

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

HardFault_Handler

734件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rithus on Sat Apr 12 08:04:48 MST 2014
Hi all, i am using lpc1769 and whenever i run the program i will have a hard fault handler when i have a sprintf function in a header file is there any solution to this?

void callprint(int x)
{
char *msg;

sprintf(msg,"%d%d\n",x,x);
Uart_Send((uint8_t *)msg , strlen(msg));

}
0 件の賞賛
返信
2 返答(返信)

713件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rithus on Sat Apr 12 12:09:57 MST 2014
thanks it works!
0 件の賞賛
返信

713件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by capiman on Sat Apr 12 08:18:01 MST 2014
You have not allocated memory for the output string.

Try changing

char *msg;

to

char msg[128];
0 件の賞賛
返信