Options: --help display this help screen --vsn display version information --output file the output file. (defaults to stdout for -text format) --nodebug do not put debug areas in the output image --nolinkview do not put sections in the output image
Binary Output Formats: --bin Plain Binary --m32 Motorola 32 bit Hex --i32 Intel 32 bit Hex --vhx Byte Oriented Hex format
--base addr Optionally set base address for m32,i32
Output Formats Requiring Debug Information --fieldoffsets Assembly Language Description of Structures/Classes --expandarrays Arrays inside and outside structures are expanded
Other Output Formats: --elf ELF --text Text Information
Flags for Text Information -v verbose -a print data addresses (For images built with debug) -c disassemble code -d print contents of data section -e print exception tables -g print debug tables -r print relocation information -s print symbol table -t print string table -y print dynamic segment contents -z print code and data size information
Usage: armlink option-list input-file-list where option-list is a list of case-insensitive options. input-file-list is a list of input object and library files.
General options (abbreviations shown capitalised): --help Print this summary. --output file Specify the name of the output file. --via file Read further arguments from file.
Options for specifying memory map information: --partial Generate a partially linked object. --scatter file Create the memory map as described in file. --ro-base n Set exec addr of region containing RO sections. --rw-base n Set exec addr of region containing RW/ZI sections.
Options for controlling image contents: --bestdebug Add debug information giving best debug view to image. --datacompressor off Do not compress RW data sections. --no_debug Do not add debug information to image. --entry Specify entry sections and entry point. --libpath Specify path to find system libraries from. --userlibpath Specify path to find user libraries from. --no_locals Do not add local symbols to image symbol table. --no_remove Do not remove unused sections from image.
Options for controlling image related information: --callgraph Create a static callgraph of functions. --feedback file Generate feedback that can be used by the compiler in file. --info topic List misc. information about image. Available topics: (separate multiple topics with comma) common List common sections eliminated from the image. debug List eliminated input debug sections. sizes List code and data sizes for objects in image. totals List total sizes of all objects in image. veneers List veneers that have been generated. unused List sections eliminated from the image. --map Display memory map of image. --symbols List symbols in image. --xref List all cross-references between input sections.
Usage: armcc [options] file1 file2 ... filen Main options: --arm Generate ARM code --thumb Generate Thumb code --c90 Switch to C mode (default for .c files) --cpp Switch to C++ mode (default for .cpp files) -O0 Minimum optimization -O1 Restricted optimization for debugging -O2 High optimization -O3 Maximum optimization -Ospace Optimize for codesize -Otime Optimize for maximum performance --cpu <cpu> Select CPU to generate code for --cpu list Output a list of all the selectable CPUs -o <file> Name the final output file of the compilation -c Compile only, do not link --asm Output assembly code as well as object code -S Output assembly code instead of object code --interleave Interleave source with disassembly (use with --asm or -S) -E Preprocess the C source code only -D<symbol> Define <symbol> on entry to the compiler -g Generate tables for high-level debugging -I<directory> Include <directory> on the #include search pat
MAKEFILE
make 可以在任一路径下执行,只需要加入 -C <path>
即可,即告诉make工具在 <path>
路径下执行编译。方便了在 windows 命令行环境下的执行。
PREFIX = arm-none-eabi- # The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx) # either it can be added to the PATH environment variable. ifdef GCC_PATH CC = $(GCC_PATH)/$(PREFIX)gcc AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp CP = $(GCC_PATH)/$(PREFIX)objcopy SZ = $(GCC_PATH)/$(PREFIX)size else CC = $(PREFIX)gcc AS = $(PREFIX)gcc -x assembler-with-cpp CP = $(PREFIX)objcopy SZ = $(PREFIX)size endif HEX = $(CP) -O ihex BIN = $(CP) -O binary -S
startup_stm32xxxxxx.s
是使用汇编语言写好的基本程序,当STM32
芯片上电启动的时候,会执行此处的汇编程序,从而建立 C
语言的运行环境,所以称之为启动文件。
由于编译器不一致,所以 .s
的启动文件也不能互相兼容,需要使用 CubeMX重新生成。
DEBUG
ERROR
ERROR
#35: PLEASE SELECT FIRST THE TARGET STM32L4XX DEVICE USED IN YOUR
APPLICATION
没有添加宏定义,添加 -DSTM32L476xx 和
-DUSE_HAL_DRIVER 即可。
ERROR
L6050U: THE CODE SIZE OF THE IMAGE EXCEEDS THE MAXIMUM
版权问题,当你在使用keil时,出现
error: L6050U: The code size of this image (45178 bytes) exceeds the maximum allowed for this version of the linker.
的时候,那就是 keil
没有被破解,软件本身的字节数有局限性,需要下载个MDK注册机进行破解!