Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


sprintf call causes STM32L4xx to crash

STM32 crashes when using the sprintf function

1. Software environment: Keil MDK 5.15
2. Hardware environment: STM32F103C8T6 minimum system
Today, when I was programming STM32, I made a strange mistake. The program was blocked in a function. After looking it up for a long time, I found that it was blocked in the sprintf function!!
Serial port printed the first sentence, the card died, the next sentence did not execute to.



The reasons are as follows

__’‘void foo(char *path)
{
...
printu(“enter dir:%s\r\n”, path);
sprintf(path + i, “/%s”, fn);
printu(“enter1 dir:%s\r\n”, path);
...

}

call foo(“0:”);’‘__



The access to the path array is out of bounds! When calling, write as follows:

__’‘char path10 =”0:”;
foo(path);’‘__