Browse files


  • Loading branch information...
dpiegdon committed Feb 22, 2017
1 parent 4b99ea3 commit c215528bbaf9df3e62a9d4b5d2d5cb8d62867c3f
Showing with 48 additions and 13 deletions.
  1. +0 −4 Makefile
  2. +48 −9
@@ -103,10 +103,6 @@ gdb-server:
gdb: $(PROJECT).elf
$(GDB) --eval-command="target extended-remote localhost:$(GDB_PORT)" --eval-command="monitor halt" $(PROJECT).elf
# usefull commands in gdb:
# load => load elf file into device, i.e. flash and start app via gdb
# kill => stop execution of application
# run => start application again
# dependency graphs for wildcard rules
@@ -9,34 +9,71 @@ hackers choice of tools:
* Make
* GNU Make
* GDB and one of st-link or openocd for debugging
* GDB and one of ST-Link or OpenOCD for debugging and flashing
Originally based on
(thanks to!), the Makefile has been enhanced with
additional debugging options and simple GDB integration.
The sources and Makefile have been stripped to bare minimum by referencing the
original CUBE7 package downloadable from ST at
original CUBE7 package downloadable from ST.
* You need to download the CUBE F7 zip from ST and set the correspondig
environment variable or fix the Makefile (see Notes and pointers).
* The setup is optimized for debugging and GDB integration. Thus, it uses `-O0
-g -gdwarf2` to allow remote debugging. For production use, you might want to
change `DEBUG_OPTIMIZE_FLAGS` to `-O2`
change `DEBUG_OPTIMIZE_FLAGS` to `-O2`.
* HEAP SIZE is currently fixed to 0x400 (in the Makefile). For a larger heap,
fix this. It is used in `sys/_sbrk.c`. A better solution would be to create an
appropriate linker script that defines the value for `HEAP_SIZE`, just like it
currently defines the start of the heap as `_end`.
* You need to download the CUBE F7 zip from ST and set the correspondig
environment variable or fix the Makefile.
Notes and pointers
### Tools
* STM32 CUBEF7 package -
* GNU ARM Embedded Toolchain -
* ST-Link tool for linux -
* OpenOCD (you probably will need version 0.10.0 or higher for STM32F7xx
support) -
### Documentation
* STM32F767ZI documentation, especially the Reference Manual, the Programming
Manual and the DataSheet -
* STM32F767ZI-Nucleo-144 documentation, especially the User Manual and the
Schematic Packs -
* GCC linker scripts -
* NewLib, the provided libc -
* GDB command documentation - --
`load` to flash firmware, `kill` to stop execution of currently running
application, `run` to start execution.
* ARM documentation for delwing really deep into the subject - ARMv7-M
Architecture Reference Manual and ARM Cortex-M7 Processor Technical Reference
Manual and the ARM and Thumb-2 InstructionSet QuickRefCard
@@ -64,3 +101,5 @@
* ChibiOS has an example for many different boards, including this one:
* plenty of howtos and guides when searching for `gcc gdb stm32 gnu make`

0 comments on commit c215528

Please sign in to comment.