File: readme.txt

package info (click to toggle)
gcc-arm-none-eabi 15%3A7-2018-q2-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 539,240 kB
  • sloc: ansic: 2,739,935; cpp: 848,238; ada: 602,637; makefile: 62,919; asm: 55,632; xml: 46,238; exp: 23,020; sh: 19,616; python: 6,371; pascal: 3,889; awk: 3,278; perl: 2,691; yacc: 316; ml: 285; f90: 234; lex: 198; objc: 194; haskell: 119
file content (78 lines) | stat: -rw-r--r-- 3,450 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Samples of GNU Tools for ARM Embedded Processors v4.7+

* Directory structure *
samples/startup   - Startup code needed by samples
       /ldscripts - Shared linker script pieces needed by samples
       /src       - Sample source code and Makefile, each sub-dir is a case

* Build *
For Windows, linux-like tools is required to run command like make and rm.
These samples are tested with cygwin.

To build all samples, set arm-none-eabi-gcc in path, cd src and make.

The makefile is configured to use newlib-nano by default. To disable it,
pass USE_NANO= to make command line like:
$ make USE_NANO=

The makefile is configured to build for Cortex-M0 by default. To build for
M3, M4 or M7, pass CORTEX_M=3/4/7 respectively:
$ make CORTEX_M=3

* Porting *
These samples are written in a way that easily porting to variant Cortex-M
boards. Usually there are only two files you need modify for your boards.

ldscripts/mem.ld defines address ranges for flash and RAM. Modify them to
reflect start address and length of flash/RAM banks in your board, by
following the embedded comments.

src/retarget/retarget.c implements how to initialize UART, send/receive
strings via UART. Since UART is configured and operated differently in
different boards, you need put your board specific code in retarget.c
to make UART work.

Recommend to make clean after modifying mem.ld.

* Sample cases introduction *
** minimum - A minimum skeleton to start a C program with limited features.
This case has a empty main. Code size built from it is only about 150 bytes,
since it has almost no "fat" for a Cortex-M C program. Be noticed that this
case doesn't support semihosting or C++ global constructor/destructor.

** semihost - Show how to use semihosting for file IO.
This case uses printf to output a string. Here printf is backup by
semihosting, which does the real print job to a host machine.

** retarget - Show how to use retarget (UART) for standard IO.
This case uses printf to output a string. Here printf is backup by retarget.
There is a retarget.c showing which libc interfaces need overloading to
re-direct file IO operations to on-board devices (usually UART). This case
isn't complete, real board specific code need adding to make UART work.

This case also doesn't support semihosting or C++ global
constructor/destructor.

** fpout - Show how to print floating point.
This case uses printf from newlib-nano to print floating point values. Since
newlib-nano by default doesn't link code needed by floating point IO, this
case demonstrates how to use this function in command line options. It also
uses semihosting.

** fpin - Show how to input/output floating point.
This case uses sscanf from newlib-nano to input floating point values. Since
newlib-nano by default doesn't link code needed by floating point IO, this
case demonstrates how to use this function in command line options. It also
uses semihosting.

** qemu - Show how to build a Cortex-M bare-metal program running on qemu.
This case builds a simple application that can run on qemu for ARM. It uses
semihosting for file IO, which qemu supports.

** cpp - How to setup a C++ project
This case builds a simple C++ application using memory allocator, integer IO
and global constructor/destructor.

** multiram - How to use multiple RAM banks
This case works with system with two RAM banks. It include startup and linker
scripts that initializing multiple data sections and bss sections.