这是我在这个网站上的第一个问题,我不确定我的英文..
我想知道是否有办法在不使用任何IDE的情况下对Nucleo STM32F446RE进行编程(通过USB,而不是通过JTAG).
出于培训目的,我想只使用文本编辑器(我使用kate),Makefile和命令行进行编程.
我已经找到/安装的内容:
它包含,我认为,我们需要编译所有(但我不认为那里有asm编译器).
在C和makefile中有代码示例(我不完全理解).它似乎编译得很好(我尝试了"最小"的例子).
这是我使用的示例:
#ifndef __NO_SYSTEM_INIT
void SystemInit()
{}
#endif
void main()
{
for (;;);
}
Run Code Online (Sandbox Code Playgroud)
这是Makefile:
# Selecting Core
CORTEX_M=4
# Use newlib-nano. To disable it, specify USE_NANO=
USE_NANO=--specs=nano.specs
# Use seimhosting or not
USE_SEMIHOST=--specs=rdimon.specs
USE_NOHOST=--specs=nosys.specs
CORE=CM$(CORTEX_M)
BASE=../..
# Compiler & Linker
CC=arm-none-eabi-gcc
CXX=arm-none-eabi-g++
# Options for specific architecture
ARCH_FLAGS=-mthumb -mcpu=cortex-m$(CORTEX_M)
# Startup code
STARTUP=$(BASE)/startup/startup_ARM$(CORE).S
# -Os -flto -ffunction-sections -fdata-sections to compile for code size
CFLAGS=$(ARCH_FLAGS) $(STARTUP_DEFS) -Os -flto -ffunction-sections -fdata-sections
CXXFLAGS=$(CFLAGS)
# …Run Code Online (Sandbox Code Playgroud)