cancel
Showing results for 
Search instead for 
Did you mean: 

scanf() issue

Dilbert K
Senior
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 ?

2 REPLIES 2
Dilbert K
Senior
Posted on January 12, 2018 at 21:36

btw, I am using SW4STM32 on STM32F401RE-Nucleo

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 Up vote any posts that you find helpful, it shows what's working..