STM32开发环境

OpenSTM32开发环境
install_sw4stm32_macos_64bits-v2.6.run.tar
install_sw4stm32_linux_64bits-v2.6.run.tar
install_sw4stm32_win_64bits-v2.6.exe


辅助工具

官方下载地址 ST-LINK-SERVER
本站下载一份拷贝 ST-LINK-SERVER 1.0.6


ST的MEMOS开发参考

en.x-cube-mems1
en.stm32cubemx


使用说明如下:

用安装好的STM32CubeMX选择芯片/开发板型号,生成代码。然后使用System Workbench for STM32(SW4STM32)打开生成的工程即可。
对于使用官方开发板的情况,右侧会出现蓝色的开发板链接,需要在STM32CubeMX生成代码的时候选择箭头指向的步骤来操作,其他非开发板类型,需要双击栏目即可。


注意事项

1.  目前发现ST官方的开发板在接入USB HUB的情况下,会出现无法识别的情况。这种情况如果发生,请直接把设备插入到电脑上,不要通过USB HUB

2. 如果在使用System Workbench for STM32调试的时候,暂停代码的执行,出现如下提示:

Info : The target is not running when halt was requested, stopping GDB.
Warn : target STM32L073RZTx.cpu is not halted

并且不能执行单步运行,则重点关注WatchDog相关的代码,调试时候暂时注释掉WatchDog相关的代码。如果代码是从STM32CubeMX生成的,则注释掉可能存在的如下两行代码:

MX_IWDG_Init();
MX_WWDG_Init();

3. 如果需要执行内存分析功能,需要安装valgrind,ubuntu系统执行如下命令安装:

$ sudo apt-get install valgrind

4. 查看程序占用的内存,在System Workbench for STM32编译完成后(需要重新完整编译才行),最后会出现如下内容:

arm-none-eabi-size "STM32L073RZT6.elf"
   text	   data	    bss	    dec	    hex	filename
  10564	     16	   5152	  15732	   3d74	STM32L073RZT6.elf

其中最后的dec,hex字段就是程序运行时候的静态内存占用。dec,hex两个字段数值是相同的,只是一个是10进制显示,一个是16进制显示而已。一般我们在MCU上不会动态申请内存,这个数字加上我们为堆栈分配的内存,差不多就是整个的内存占用情况了,堆栈内存的分配参考工程同名的.ld文件。

5. macOSX系统上安装STM32CubeMX的时候比较复杂复杂,安装说明语焉不详。需要在安装完成JDK之后,在解压缩目录下执行如下命令:

$ sudo SetupSTM32CubeMX-4.26.1.app/Contents/MacOs/SetupSTM32CubeMX-4_26_1_macos

附上部分官网简介:

STMCube™ is an STMicroelectronics original initiative to make developers’ lives easier by reducing development effort, time and cost. STM32Cube is the implementation of STMCube that covers the whole STM32 portfolio and provides:
STM32CubeMX, available under Windows®, Linux® and macOS® is a tool able to generate initialization C-code for STM32 MCUs based on a graphical user interface and one embedded software library (Cube Embedded Software package) per series of STM32 products. This embedded software library comprises the hardware abstraction layer (HAL) and Low-Layer (LL) APIs for the STM32 peripherals and a set of Middleware (RTOS, USB, TCP/IP, Graphics, …) based on components that are either ST developed or open source.

The initialization code, Middleware libraries, HAL and LL APIs, are all compatible with every STM32 compilers. The included example projects are set up for IAR, Keil, and the GCC-based AC6 SW4STM32

STM32Cube comes with hundreds of application code examples and supports all the STM32 series.


参考链接


发布者

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注