This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TM4C123GH6PZ这款芯片如何支持浮点数据打印

我使用串口进行浮点数据打印会进入FaultIsR中断。后面得知,TI的芯片进行浮点数据打印需要打开CCS的设置,选择支持串口浮点打印。请问keil如何进行让TM4C123GH6PZ这款芯片支持浮点数据打印?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void UART_printf(uint32_t baseAddress, const char *format,...)
{
uint32_t length;
va_list args;
uint32_t i;
char TxBuffer[128] = {0};
va_start(args, format);
length = vsnprintf((char*)TxBuffer, sizeof(TxBuffer), (char*)format, args);
va_end(args);
for(i = 0; i < length; i++)
{
while(UARTBusy(baseAddress));
UARTCharPut(baseAddress,TxBuffer[i]);
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
If you print floating point data, you enter a FaultlsR interrupt. But if you print integer data instead, there's no problem.

0