Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Programming STM32-Discovery using GNU tools. Linker script

Previously we went through setting up a development environment for ARM Cortex-M3 microcontroller. We decided that two equal choices will do the same job – either CodeSourcery G++ Lite or Yagarto. Both use the same base of GNU tool-set. Developing with GCC tools To get a working binary, there is a series of tools involved during code development. Several tools are necessary to compile simple applications. These are compiler, assembler, linker and binary generator. Each of them does its task in a chain process. When you start compiling your project, usually there is a linker invoked, which with correct parameters links libraries, object files. Once executable is generated, then the binary image generator creates a binary image (.bin or .hex) that can be uploaded to MCU. We won’t go into details right now as this will be more convenient to do in later code examples. Let us get directly to code writing part which is very important for linker and tasks before main() routine. Continue reading