Skip to main content
Dilbert K
Associate III
January 12, 2018
Question

scanf() issue

  • January 12, 2018
  • 2 replies
  • 624 views
Posted on January 12, 2018 at 21:33

I am using the 'STM32CubeFunctionPack_BLESTAR1_V1.4.0'.

When try to setup WiFi SSID, it try to prompt for serial terminal input for data.

It crash while calling first 'scanf()'....any setting require to enable this support ?

    This topic has been closed for replies.

    2 replies

    Dilbert K
    Dilbert KAuthor
    Associate III
    January 12, 2018
    Posted on January 12, 2018 at 21:36

    btw, I am using SW4STM32 on STM32F401RE-Nucleo

    Tesla DeLorean
    Guru
    January 12, 2018
    Posted on January 12, 2018 at 22:13

    Make sure you have some retargeting of STDIO functions

    #if defined (__GNUC__)

    /** @brief putchar call for standard output implementation

     * @param ch Character to print

     * @retval Character printed

     */

    int __io_putchar(int ch)

    {

      return uartSendChar(ch);

    }

    /** @brief getchar call for standard input implementation

     * @param None

     * @retval Character acquired from standard input

     */

    int __io_getchar(void)

    {

      return uartReceiveChar();

    }

    #endif

    And that you don't do '%d' or '%x' into an &char

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..