comparison wiki/Detailed CPU1-Discovery Project.md @ 47:a6580170de6f

Added instruction to optimize for size and to remove upper section from binary output
author Ideenmodellierer
date Sun, 29 Jul 2018 18:16:01 +0200
parents 5f11787b4f42
children
comparison
equal deleted inserted replaced
46:f39206facb93 47:a6580170de6f
27 27
28 1. In the _C/C++ Projects_ explorer, select your project top-level folder 28 1. In the _C/C++ Projects_ explorer, select your project top-level folder
29 2. Right on it, select `Properties`, `Resource` and set `Text file encoding` to **UTF-8** 29 2. Right on it, select `Properties`, `Resource` and set `Text file encoding` to **UTF-8**
30 3. Right on it, select `Properties`, `Resource` then `Linked Resources` and click on `New...` to define a new variable **OSTC4** that points to your source folder **D:\Dev\OSTC4** (or whatever path you used on your system). 30 3. Right on it, select `Properties`, `Resource` then `Linked Resources` and click on `New...` to define a new variable **OSTC4** that points to your source folder **D:\Dev\OSTC4** (or whatever path you used on your system).
31 This should allow to change the project's origin with a single variable change. 31 This should allow to change the project's origin with a single variable change.
32 4. Right on it, select `Properties`, `Settings`, `Optimization` and set `Optimization Level` to **Optimize for size (-Os)**
33
32 34
33 # Add Sources Folders # 35 # Add Sources Folders #
34 36
35 1. In the _C/C++ Projects_ explorer, select your project top-level folder 37 1. In the _C/C++ Projects_ explorer, select your project top-level folder
36 2. Right-click to add a `New` > `Folder`. In `Advanced settings >` click `Link to alternate location` and then the `Variables...` button. Click on the **OSTC4** variable, then click `Extend...` and select the **Common\\** sub-directory. Click `Finish` 38 2. Right-click to add a `New` > `Folder`. In `Advanced settings >` click `Link to alternate location` and then the `Variables...` button. Click on the **OSTC4** variable, then click `Extend...` and select the **Common\\** sub-directory. Click `Finish`
73 ## Add Link Options ## 75 ## Add Link Options ##
74 76
75 1. Select your top-level project, right-click to edit `properties`. In `C/C++ Build` choose `Settings`, then `MCU G++ Linker` and `General`. 77 1. Select your top-level project, right-click to edit `properties`. In `C/C++ Build` choose `Settings`, then `MCU G++ Linker` and `General`.
76 And select _linker Script_: `OSTC4/Common/CPU1-F429.ld` 78 And select _linker Script_: `OSTC4/Common/CPU1-F429.ld`
77 79
80
81 ## Prepare generation of bin file
82 1. Select your top-level project, right-click to edit `properties`. In `C/C++ Build` choose `Settings`, then tab `Build Steps` and `Post build step command`.
83 2. Add option -R .upper* to the command to removed the upper memory section, which is provided by the font library =>
84 `arm-none-eabi-objcopy -R .upper* -O binary "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.bin"; arm-none-eabi-size "${BuildArtifactFileName}"`
85
86
78 ## Build ELF firmware ## 87 ## Build ELF firmware ##
79 88
80 1. Click the `Build` button (hammer icon) on the top bar. 89 1. Click the `Build` button (hammer icon) on the top bar.