This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TM4C123GH6PM:具有 float 的 sprintf、--printf_support=full、堆栈大小设置为1024次崩溃

Guru**** 1145030 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1186770/tm4c123gh6pm-sprintf-with-float---printf_support-full-and-stack-size-to-1024-crashes

器件型号:TM4C123GH6PM
主题中讨论的其他器件:TM4C123

您好!

我正在查看我在 tm4c123平台上打印浮点值的选项。 我已将 printf 支持设置为完整版、并将堆栈大小设置为1024、但下面的语句:

    sprintf(debug_buffer, "%f", 1.123f);
    UARTprintf("%s", debug_buffer);
    UARTprintf("\r\n");

在 sprintf 下崩溃。

我查看了 sensorhub 中的示例、并针对各种浮点打印目的实现了我自己的 Ftoa。 但我需要一种通用的方法来实现它、我在 GCC 中成功地使用它、但在 CCS 上遇到问题。

是否可以使用 CCS 在 tm4c123gh下午6点对 float 提供完整的 printf 支持、以及我需要打开什么?

此致、

CAN

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

     我将堆栈增加到1536、这对我来说是可行的。  

    部分

    .intvecs:> app_base
    .text:> FLASH
    .const:> FLASH
    .cinit:>闪存
    .pinit:> FLASH
    init_array:> FLASH

    .vtable:> RAM_base
    .data :> SRAM
    .bss:> SRAM
    .sysmem:> SRAM
    .stack:> SRAM

    __STACK_TOP =__STACK + 1536