Clone of official tools
export/sw4stm32/__init__.py@42:2cf3f29fece1, 2017-11-06 (annotated)
- Committer:
- theotherjimmy
- Date:
- Mon Nov 06 13:17:14 2017 -0600
- Revision:
- 42:2cf3f29fece1
- Parent:
- 41:2a77626a4c21
- Child:
- 43:2a7da56ebd24
Update tools to 5.6.4
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
The Other Jimmy |
35:da9c89f8be7d | 1 | """ |
The Other Jimmy |
35:da9c89f8be7d | 2 | mbed SDK |
theotherjimmy |
40:7d3fa6b99b2b | 3 | Copyright (c) 2011-2017 ARM Limited |
The Other Jimmy |
35:da9c89f8be7d | 4 | |
The Other Jimmy |
35:da9c89f8be7d | 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
The Other Jimmy |
35:da9c89f8be7d | 6 | you may not use this file except in compliance with the License. |
The Other Jimmy |
35:da9c89f8be7d | 7 | You may obtain a copy of the License at |
The Other Jimmy |
35:da9c89f8be7d | 8 | |
The Other Jimmy |
35:da9c89f8be7d | 9 | http://www.apache.org/licenses/LICENSE-2.0 |
The Other Jimmy |
35:da9c89f8be7d | 10 | |
The Other Jimmy |
35:da9c89f8be7d | 11 | Unless required by applicable law or agreed to in writing, software |
The Other Jimmy |
35:da9c89f8be7d | 12 | distributed under the License is distributed on an "AS IS" BASIS, |
The Other Jimmy |
35:da9c89f8be7d | 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
The Other Jimmy |
35:da9c89f8be7d | 14 | See the License for the specific language governing permissions and |
The Other Jimmy |
35:da9c89f8be7d | 15 | limitations under the License. |
The Other Jimmy |
35:da9c89f8be7d | 16 | """ |
theotherjimmy |
40:7d3fa6b99b2b | 17 | |
The Other Jimmy |
35:da9c89f8be7d | 18 | from os.path import splitext, basename, join |
The Other Jimmy |
35:da9c89f8be7d | 19 | from tools.utils import mkdir |
theotherjimmy |
40:7d3fa6b99b2b | 20 | from tools.export.gnuarmeclipse import GNUARMEclipse |
theotherjimmy |
40:7d3fa6b99b2b | 21 | from tools.export.gnuarmeclipse import UID |
theotherjimmy |
40:7d3fa6b99b2b | 22 | from tools.build_api import prepare_toolchain |
theotherjimmy |
40:7d3fa6b99b2b | 23 | from sys import flags, platform |
theotherjimmy |
40:7d3fa6b99b2b | 24 | |
theotherjimmy |
40:7d3fa6b99b2b | 25 | # Global random number generator instance. |
theotherjimmy |
40:7d3fa6b99b2b | 26 | u = UID() |
The Other Jimmy |
35:da9c89f8be7d | 27 | |
The Other Jimmy |
35:da9c89f8be7d | 28 | |
theotherjimmy |
40:7d3fa6b99b2b | 29 | class Sw4STM32(GNUARMEclipse): |
theotherjimmy |
40:7d3fa6b99b2b | 30 | """ |
theotherjimmy |
40:7d3fa6b99b2b | 31 | Sw4STM32 class |
theotherjimmy |
40:7d3fa6b99b2b | 32 | """ |
The Other Jimmy |
35:da9c89f8be7d | 33 | NAME = 'Sw4STM32' |
The Other Jimmy |
35:da9c89f8be7d | 34 | TOOLCHAIN = 'GCC_ARM' |
The Other Jimmy |
35:da9c89f8be7d | 35 | |
The Other Jimmy |
35:da9c89f8be7d | 36 | BOARDS = { |
theotherjimmy |
40:7d3fa6b99b2b | 37 | 'B96B_F446VE': |
theotherjimmy |
40:7d3fa6b99b2b | 38 | { |
theotherjimmy |
40:7d3fa6b99b2b | 39 | 'name': 'B96B-F446VE', |
theotherjimmy |
40:7d3fa6b99b2b | 40 | 'mcuId': 'STM32F446VETx' |
theotherjimmy |
40:7d3fa6b99b2b | 41 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 42 | 'DISCO_F051R8': |
theotherjimmy |
40:7d3fa6b99b2b | 43 | { |
theotherjimmy |
40:7d3fa6b99b2b | 44 | 'name': 'STM32F0DISCOVERY', |
theotherjimmy |
40:7d3fa6b99b2b | 45 | 'mcuId': 'STM32F051R8Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 46 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 47 | 'DISCO_F303VC': |
theotherjimmy |
40:7d3fa6b99b2b | 48 | { |
theotherjimmy |
40:7d3fa6b99b2b | 49 | 'name': 'STM32F3DISCOVERY', |
theotherjimmy |
40:7d3fa6b99b2b | 50 | 'mcuId': 'STM32F303VCTx' |
theotherjimmy |
40:7d3fa6b99b2b | 51 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 52 | 'DISCO_F334C8': |
theotherjimmy |
40:7d3fa6b99b2b | 53 | { |
theotherjimmy |
40:7d3fa6b99b2b | 54 | 'name': 'STM32F3348DISCOVERY', |
theotherjimmy |
40:7d3fa6b99b2b | 55 | 'mcuId': 'STM32F334C8Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 56 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 57 | 'DISCO_F401VC': |
theotherjimmy |
40:7d3fa6b99b2b | 58 | { |
theotherjimmy |
40:7d3fa6b99b2b | 59 | 'name': 'STM32F401C-DISCO', |
theotherjimmy |
40:7d3fa6b99b2b | 60 | 'mcuId': 'STM32F401VCTx' |
theotherjimmy |
40:7d3fa6b99b2b | 61 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 62 | 'DISCO_F407VG': |
theotherjimmy |
40:7d3fa6b99b2b | 63 | { |
theotherjimmy |
40:7d3fa6b99b2b | 64 | 'name': 'STM32F4DISCOVERY', |
theotherjimmy |
40:7d3fa6b99b2b | 65 | 'mcuId': 'STM32F407VGTx' |
theotherjimmy |
40:7d3fa6b99b2b | 66 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 67 | 'DISCO_F413ZH': |
theotherjimmy |
40:7d3fa6b99b2b | 68 | { |
theotherjimmy |
40:7d3fa6b99b2b | 69 | 'name': 'DISCO_F413', |
theotherjimmy |
40:7d3fa6b99b2b | 70 | 'mcuId': 'STM32F413ZHTx' |
theotherjimmy |
40:7d3fa6b99b2b | 71 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 72 | 'DISCO_F429ZI': |
theotherjimmy |
40:7d3fa6b99b2b | 73 | { |
theotherjimmy |
40:7d3fa6b99b2b | 74 | 'name': 'STM32F429I-DISCO', |
theotherjimmy |
40:7d3fa6b99b2b | 75 | 'mcuId': 'STM32F429ZITx' |
theotherjimmy |
40:7d3fa6b99b2b | 76 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 77 | 'DISCO_F469NI': |
theotherjimmy |
40:7d3fa6b99b2b | 78 | { |
theotherjimmy |
40:7d3fa6b99b2b | 79 | 'name': 'DISCO-F469NI', |
theotherjimmy |
40:7d3fa6b99b2b | 80 | 'mcuId': 'STM32F469NIHx' |
theotherjimmy |
40:7d3fa6b99b2b | 81 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 82 | 'DISCO_F746NG': |
theotherjimmy |
40:7d3fa6b99b2b | 83 | { |
theotherjimmy |
40:7d3fa6b99b2b | 84 | 'name': 'STM32F746G-DISCO', |
theotherjimmy |
40:7d3fa6b99b2b | 85 | 'mcuId': 'STM32F746NGHx' |
theotherjimmy |
40:7d3fa6b99b2b | 86 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 87 | 'DISCO_F769NI': |
theotherjimmy |
40:7d3fa6b99b2b | 88 | { |
theotherjimmy |
40:7d3fa6b99b2b | 89 | 'name': 'DISCO-F769NI', |
theotherjimmy |
40:7d3fa6b99b2b | 90 | 'mcuId': 'STM32F769NIHx' |
theotherjimmy |
40:7d3fa6b99b2b | 91 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 92 | 'DISCO_L053C8': |
theotherjimmy |
40:7d3fa6b99b2b | 93 | { |
theotherjimmy |
40:7d3fa6b99b2b | 94 | 'name': 'STM32L0538DISCOVERY', |
theotherjimmy |
40:7d3fa6b99b2b | 95 | 'mcuId': 'STM32L053C8Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 96 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 97 | 'DISCO_L072CZ_LRWAN1': |
theotherjimmy |
40:7d3fa6b99b2b | 98 | { |
theotherjimmy |
40:7d3fa6b99b2b | 99 | 'name': 'DISCO-L072CZ-LRWAN1', |
theotherjimmy |
40:7d3fa6b99b2b | 100 | 'mcuId': 'STM32L072CZTx' |
theotherjimmy |
40:7d3fa6b99b2b | 101 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 102 | 'DISCO_L475VG_IOT01A': |
theotherjimmy |
40:7d3fa6b99b2b | 103 | { |
theotherjimmy |
40:7d3fa6b99b2b | 104 | 'name': 'STM32L475G-DISCO', |
theotherjimmy |
40:7d3fa6b99b2b | 105 | 'mcuId': 'STM32L475VGTx' |
theotherjimmy |
40:7d3fa6b99b2b | 106 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 107 | 'DISCO_L476VG': |
theotherjimmy |
40:7d3fa6b99b2b | 108 | { |
theotherjimmy |
40:7d3fa6b99b2b | 109 | 'name': 'STM32L476G-DISCO', |
theotherjimmy |
40:7d3fa6b99b2b | 110 | 'mcuId': 'STM32L476VGTx' |
theotherjimmy |
40:7d3fa6b99b2b | 111 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 112 | 'NUCLEO_F030R8': |
theotherjimmy |
40:7d3fa6b99b2b | 113 | { |
theotherjimmy |
40:7d3fa6b99b2b | 114 | 'name': 'NUCLEO-F030R8', |
theotherjimmy |
40:7d3fa6b99b2b | 115 | 'mcuId': 'STM32F030R8Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 116 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 117 | 'NUCLEO_F031K6': |
theotherjimmy |
40:7d3fa6b99b2b | 118 | { |
theotherjimmy |
40:7d3fa6b99b2b | 119 | 'name': 'NUCLEO-F031K6', |
theotherjimmy |
40:7d3fa6b99b2b | 120 | 'mcuId': 'STM32F031K6Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 121 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 122 | 'NUCLEO_F042K6': |
theotherjimmy |
40:7d3fa6b99b2b | 123 | { |
theotherjimmy |
40:7d3fa6b99b2b | 124 | 'name': 'NUCLEO-F042K6', |
theotherjimmy |
40:7d3fa6b99b2b | 125 | 'mcuId': 'STM32F042K6Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 126 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 127 | 'NUCLEO_F070RB': |
theotherjimmy |
40:7d3fa6b99b2b | 128 | { |
theotherjimmy |
40:7d3fa6b99b2b | 129 | 'name': 'NUCLEO-F070RB', |
theotherjimmy |
40:7d3fa6b99b2b | 130 | 'mcuId': 'STM32F070RBTx' |
theotherjimmy |
40:7d3fa6b99b2b | 131 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 132 | 'NUCLEO_F072RB': |
theotherjimmy |
40:7d3fa6b99b2b | 133 | { |
theotherjimmy |
40:7d3fa6b99b2b | 134 | 'name': 'NUCLEO-F072RB', |
theotherjimmy |
40:7d3fa6b99b2b | 135 | 'mcuId': 'STM32F072RBTx' |
theotherjimmy |
40:7d3fa6b99b2b | 136 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 137 | 'NUCLEO_F091RC': |
theotherjimmy |
40:7d3fa6b99b2b | 138 | { |
theotherjimmy |
40:7d3fa6b99b2b | 139 | 'name': 'NUCLEO-F091RC', |
theotherjimmy |
40:7d3fa6b99b2b | 140 | 'mcuId': 'STM32F091RCTx' |
theotherjimmy |
40:7d3fa6b99b2b | 141 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 142 | 'NUCLEO_F103RB': |
theotherjimmy |
40:7d3fa6b99b2b | 143 | { |
theotherjimmy |
40:7d3fa6b99b2b | 144 | 'name': 'NUCLEO-F103RB', |
theotherjimmy |
40:7d3fa6b99b2b | 145 | 'mcuId': 'STM32F103RBTx' |
theotherjimmy |
40:7d3fa6b99b2b | 146 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 147 | 'NUCLEO_F207ZG': |
theotherjimmy |
40:7d3fa6b99b2b | 148 | { |
theotherjimmy |
40:7d3fa6b99b2b | 149 | 'name': 'NUCLEO-F207ZG', |
theotherjimmy |
40:7d3fa6b99b2b | 150 | 'mcuId': 'STM32F207ZGTx' |
theotherjimmy |
40:7d3fa6b99b2b | 151 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 152 | 'NUCLEO_F302R8': |
theotherjimmy |
40:7d3fa6b99b2b | 153 | { |
theotherjimmy |
40:7d3fa6b99b2b | 154 | 'name': 'NUCLEO-F302R8', |
theotherjimmy |
40:7d3fa6b99b2b | 155 | 'mcuId': 'STM32F302R8Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 156 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 157 | 'NUCLEO_F303K8': |
theotherjimmy |
40:7d3fa6b99b2b | 158 | { |
theotherjimmy |
40:7d3fa6b99b2b | 159 | 'name': 'NUCLEO-F303K8', |
theotherjimmy |
40:7d3fa6b99b2b | 160 | 'mcuId': 'STM32F303K8Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 161 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 162 | 'NUCLEO_F303RE': |
theotherjimmy |
40:7d3fa6b99b2b | 163 | { |
theotherjimmy |
40:7d3fa6b99b2b | 164 | 'name': 'NUCLEO-F303RE', |
theotherjimmy |
40:7d3fa6b99b2b | 165 | 'mcuId': 'STM32F303RETx' |
theotherjimmy |
40:7d3fa6b99b2b | 166 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 167 | 'NUCLEO_F303ZE': |
theotherjimmy |
40:7d3fa6b99b2b | 168 | { |
theotherjimmy |
40:7d3fa6b99b2b | 169 | 'name': 'NUCLEO-F303ZE', |
theotherjimmy |
40:7d3fa6b99b2b | 170 | 'mcuId': 'STM32F303ZETx' |
theotherjimmy |
40:7d3fa6b99b2b | 171 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 172 | 'NUCLEO_F334R8': |
theotherjimmy |
40:7d3fa6b99b2b | 173 | { |
theotherjimmy |
40:7d3fa6b99b2b | 174 | 'name': 'NUCLEO-F334R8', |
theotherjimmy |
40:7d3fa6b99b2b | 175 | 'mcuId': 'STM32F334R8Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 176 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 177 | 'NUCLEO_F401RE': |
theotherjimmy |
40:7d3fa6b99b2b | 178 | { |
theotherjimmy |
40:7d3fa6b99b2b | 179 | 'name': 'NUCLEO-F401RE', |
theotherjimmy |
40:7d3fa6b99b2b | 180 | 'mcuId': 'STM32F401RETx' |
theotherjimmy |
40:7d3fa6b99b2b | 181 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 182 | 'NUCLEO_F410RB': |
theotherjimmy |
40:7d3fa6b99b2b | 183 | { |
theotherjimmy |
40:7d3fa6b99b2b | 184 | 'name': 'NUCLEO-F410RB', |
theotherjimmy |
40:7d3fa6b99b2b | 185 | 'mcuId': 'STM32F410RBTx' |
theotherjimmy |
40:7d3fa6b99b2b | 186 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 187 | 'NUCLEO_F411RE': |
theotherjimmy |
40:7d3fa6b99b2b | 188 | { |
theotherjimmy |
40:7d3fa6b99b2b | 189 | 'name': 'NUCLEO-F411RE', |
theotherjimmy |
40:7d3fa6b99b2b | 190 | 'mcuId': 'STM32F411RETx' |
theotherjimmy |
40:7d3fa6b99b2b | 191 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 192 | 'NUCLEO_F429ZI': |
theotherjimmy |
40:7d3fa6b99b2b | 193 | { |
theotherjimmy |
40:7d3fa6b99b2b | 194 | 'name': 'NUCLEO-F429ZI', |
theotherjimmy |
40:7d3fa6b99b2b | 195 | 'mcuId': 'STM32F429ZITx' |
theotherjimmy |
40:7d3fa6b99b2b | 196 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 197 | 'NUCLEO_F446RE': |
theotherjimmy |
40:7d3fa6b99b2b | 198 | { |
theotherjimmy |
40:7d3fa6b99b2b | 199 | 'name': 'NUCLEO-F446RE', |
theotherjimmy |
40:7d3fa6b99b2b | 200 | 'mcuId': 'STM32F446RETx' |
theotherjimmy |
40:7d3fa6b99b2b | 201 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 202 | 'NUCLEO_F446ZE': |
theotherjimmy |
40:7d3fa6b99b2b | 203 | { |
theotherjimmy |
40:7d3fa6b99b2b | 204 | 'name': 'NUCLEO-F446ZE', |
theotherjimmy |
40:7d3fa6b99b2b | 205 | 'mcuId': 'STM32F446ZETx' |
theotherjimmy |
40:7d3fa6b99b2b | 206 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 207 | 'NUCLEO_F746ZG': |
theotherjimmy |
40:7d3fa6b99b2b | 208 | { |
theotherjimmy |
40:7d3fa6b99b2b | 209 | 'name': 'NUCLEO-F746ZG', |
theotherjimmy |
40:7d3fa6b99b2b | 210 | 'mcuId': 'STM32F746ZGTx' |
theotherjimmy |
40:7d3fa6b99b2b | 211 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 212 | 'NUCLEO_F767ZI': |
theotherjimmy |
40:7d3fa6b99b2b | 213 | { |
theotherjimmy |
40:7d3fa6b99b2b | 214 | 'name': 'NUCLEO-F767ZI', |
theotherjimmy |
40:7d3fa6b99b2b | 215 | 'mcuId': 'STM32F767ZITx' |
theotherjimmy |
40:7d3fa6b99b2b | 216 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 217 | 'NUCLEO_L011K4': |
theotherjimmy |
40:7d3fa6b99b2b | 218 | { |
theotherjimmy |
40:7d3fa6b99b2b | 219 | 'name': 'NUCLEO-L011K4', |
theotherjimmy |
40:7d3fa6b99b2b | 220 | 'mcuId': 'STM32L011K4Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 221 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 222 | 'NUCLEO_L031K6': |
theotherjimmy |
40:7d3fa6b99b2b | 223 | { |
theotherjimmy |
40:7d3fa6b99b2b | 224 | 'name': 'NUCLEO-L031K6', |
theotherjimmy |
40:7d3fa6b99b2b | 225 | 'mcuId': 'STM32L031K6Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 226 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 227 | 'NUCLEO_L053R8': |
theotherjimmy |
40:7d3fa6b99b2b | 228 | { |
theotherjimmy |
40:7d3fa6b99b2b | 229 | 'name': 'NUCLEO-L053R8', |
theotherjimmy |
40:7d3fa6b99b2b | 230 | 'mcuId': 'STM32L053R8Tx' |
theotherjimmy |
40:7d3fa6b99b2b | 231 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 232 | 'NUCLEO_L073RZ': |
theotherjimmy |
40:7d3fa6b99b2b | 233 | { |
theotherjimmy |
40:7d3fa6b99b2b | 234 | 'name': 'NUCLEO-L073RZ', |
theotherjimmy |
40:7d3fa6b99b2b | 235 | 'mcuId': 'STM32L073RZTx' |
theotherjimmy |
40:7d3fa6b99b2b | 236 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 237 | 'NUCLEO_L152RE': |
theotherjimmy |
40:7d3fa6b99b2b | 238 | { |
theotherjimmy |
40:7d3fa6b99b2b | 239 | 'name': 'NUCLEO-L152RE', |
theotherjimmy |
40:7d3fa6b99b2b | 240 | 'mcuId': 'STM32L152RETx' |
theotherjimmy |
40:7d3fa6b99b2b | 241 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 242 | 'NUCLEO_L432KC': |
theotherjimmy |
40:7d3fa6b99b2b | 243 | { |
theotherjimmy |
40:7d3fa6b99b2b | 244 | 'name': 'NUCLEO-L432KC', |
theotherjimmy |
40:7d3fa6b99b2b | 245 | 'mcuId': 'STM32L432KCUx' |
theotherjimmy |
40:7d3fa6b99b2b | 246 | }, |
theotherjimmy |
40:7d3fa6b99b2b | 247 | 'NUCLEO_L476RG': |
theotherjimmy |
40:7d3fa6b99b2b | 248 | { |
theotherjimmy |
40:7d3fa6b99b2b | 249 | 'name': 'NUCLEO-L476RG', |
theotherjimmy |
40:7d3fa6b99b2b | 250 | 'mcuId': 'STM32L476RGTx' |
theotherjimmy |
40:7d3fa6b99b2b | 251 | }, |
theotherjimmy |
41:2a77626a4c21 | 252 | 'NUCLEO_L486RG': |
theotherjimmy |
41:2a77626a4c21 | 253 | { |
theotherjimmy |
41:2a77626a4c21 | 254 | 'name': 'NUCLEO-L486RG', |
theotherjimmy |
41:2a77626a4c21 | 255 | 'mcuId': 'STM32L486RGTx' |
theotherjimmy |
41:2a77626a4c21 | 256 | }, |
theotherjimmy |
42:2cf3f29fece1 | 257 | 'NUCLEO_L496ZG': |
theotherjimmy |
42:2cf3f29fece1 | 258 | { |
theotherjimmy |
42:2cf3f29fece1 | 259 | 'name': 'NUCLEO-L496ZG', |
theotherjimmy |
42:2cf3f29fece1 | 260 | 'mcuId': 'STM32L496ZGTx' |
theotherjimmy |
42:2cf3f29fece1 | 261 | }, |
The Other Jimmy |
35:da9c89f8be7d | 262 | } |
The Other Jimmy |
35:da9c89f8be7d | 263 | |
The Other Jimmy |
35:da9c89f8be7d | 264 | TARGETS = BOARDS.keys() |
The Other Jimmy |
35:da9c89f8be7d | 265 | |
theotherjimmy |
40:7d3fa6b99b2b | 266 | def __gen_dir(self, dir_name): |
theotherjimmy |
40:7d3fa6b99b2b | 267 | """ |
theotherjimmy |
40:7d3fa6b99b2b | 268 | Method that creates directory |
theotherjimmy |
40:7d3fa6b99b2b | 269 | """ |
theotherjimmy |
40:7d3fa6b99b2b | 270 | settings = join(self.export_dir, dir_name) |
The Other Jimmy |
35:da9c89f8be7d | 271 | mkdir(settings) |
The Other Jimmy |
35:da9c89f8be7d | 272 | |
theotherjimmy |
40:7d3fa6b99b2b | 273 | def get_fpu_hardware(self, fpu_unit): |
theotherjimmy |
40:7d3fa6b99b2b | 274 | """ |
theotherjimmy |
40:7d3fa6b99b2b | 275 | Convert fpu unit name into hardware name. |
theotherjimmy |
40:7d3fa6b99b2b | 276 | """ |
theotherjimmy |
40:7d3fa6b99b2b | 277 | hw = '' |
theotherjimmy |
40:7d3fa6b99b2b | 278 | fpus = { |
theotherjimmy |
40:7d3fa6b99b2b | 279 | 'fpv4spd16': 'fpv4-sp-d16', |
theotherjimmy |
40:7d3fa6b99b2b | 280 | 'fpv5d16': 'fpv5-d16', |
theotherjimmy |
40:7d3fa6b99b2b | 281 | 'fpv5spd16': 'fpv5-sp-d16' |
theotherjimmy |
40:7d3fa6b99b2b | 282 | } |
theotherjimmy |
40:7d3fa6b99b2b | 283 | if fpu_unit in fpus: |
theotherjimmy |
40:7d3fa6b99b2b | 284 | hw = fpus[fpu_unit] |
theotherjimmy |
40:7d3fa6b99b2b | 285 | return hw |
theotherjimmy |
40:7d3fa6b99b2b | 286 | |
theotherjimmy |
40:7d3fa6b99b2b | 287 | def process_sw_options(self, opts, flags_in): |
theotherjimmy |
40:7d3fa6b99b2b | 288 | """ |
theotherjimmy |
40:7d3fa6b99b2b | 289 | Process System Workbench specific options. |
theotherjimmy |
40:7d3fa6b99b2b | 290 | |
theotherjimmy |
40:7d3fa6b99b2b | 291 | System Workbench for STM32 has some compile options, which are not recognized by the GNUARMEclipse exporter. |
theotherjimmy |
40:7d3fa6b99b2b | 292 | Those are handled in this method. |
theotherjimmy |
40:7d3fa6b99b2b | 293 | """ |
theotherjimmy |
40:7d3fa6b99b2b | 294 | opts['c']['preprocess'] = False |
theotherjimmy |
40:7d3fa6b99b2b | 295 | if '-E' in flags_in['c_flags']: |
theotherjimmy |
40:7d3fa6b99b2b | 296 | opts['c']['preprocess'] = True |
theotherjimmy |
40:7d3fa6b99b2b | 297 | opts['cpp']['preprocess'] = False |
theotherjimmy |
40:7d3fa6b99b2b | 298 | if '-E' in flags_in['cxx_flags']: |
theotherjimmy |
40:7d3fa6b99b2b | 299 | opts['cpp']['preprocess'] = True |
theotherjimmy |
40:7d3fa6b99b2b | 300 | opts['c']['slowflashdata'] = False |
theotherjimmy |
40:7d3fa6b99b2b | 301 | if '-mslow-flash-data' in flags_in['c_flags']: |
theotherjimmy |
40:7d3fa6b99b2b | 302 | opts['c']['slowflashdata'] = True |
theotherjimmy |
40:7d3fa6b99b2b | 303 | opts['cpp']['slowflashdata'] = False |
theotherjimmy |
40:7d3fa6b99b2b | 304 | if '-mslow-flash-data' in flags_in['cxx_flags']: |
theotherjimmy |
40:7d3fa6b99b2b | 305 | opts['cpp']['slowflashdata'] = True |
theotherjimmy |
40:7d3fa6b99b2b | 306 | if opts['common']['optimization.messagelength']: |
theotherjimmy |
40:7d3fa6b99b2b | 307 | opts['common']['optimization.other'] += ' -fmessage-length=0' |
theotherjimmy |
40:7d3fa6b99b2b | 308 | if opts['common']['optimization.signedchar']: |
theotherjimmy |
40:7d3fa6b99b2b | 309 | opts['common']['optimization.other'] += ' -fsigned-char' |
theotherjimmy |
40:7d3fa6b99b2b | 310 | if opts['common']['optimization.nocommon']: |
theotherjimmy |
40:7d3fa6b99b2b | 311 | opts['common']['optimization.other'] += ' -fno-common' |
theotherjimmy |
40:7d3fa6b99b2b | 312 | if opts['common']['optimization.noinlinefunctions']: |
theotherjimmy |
40:7d3fa6b99b2b | 313 | opts['common']['optimization.other'] += ' -fno-inline-functions' |
theotherjimmy |
40:7d3fa6b99b2b | 314 | if opts['common']['optimization.freestanding']: |
theotherjimmy |
40:7d3fa6b99b2b | 315 | opts['common']['optimization.other'] += ' -ffreestanding' |
theotherjimmy |
40:7d3fa6b99b2b | 316 | if opts['common']['optimization.nobuiltin']: |
theotherjimmy |
40:7d3fa6b99b2b | 317 | opts['common']['optimization.other'] += ' -fno-builtin' |
theotherjimmy |
40:7d3fa6b99b2b | 318 | if opts['common']['optimization.spconstant']: |
theotherjimmy |
40:7d3fa6b99b2b | 319 | opts['common']['optimization.other'] += ' -fsingle-precision-constant' |
theotherjimmy |
40:7d3fa6b99b2b | 320 | if opts['common']['optimization.nomoveloopinvariants']: |
theotherjimmy |
40:7d3fa6b99b2b | 321 | opts['common']['optimization.other'] += ' -fno-move-loop-invariants' |
theotherjimmy |
40:7d3fa6b99b2b | 322 | if opts['common']['warnings.unused']: |
theotherjimmy |
40:7d3fa6b99b2b | 323 | opts['common']['warnings.other'] += ' -Wunused' |
theotherjimmy |
40:7d3fa6b99b2b | 324 | if opts['common']['warnings.uninitialized']: |
theotherjimmy |
40:7d3fa6b99b2b | 325 | opts['common']['warnings.other'] += ' -Wuninitialized' |
theotherjimmy |
40:7d3fa6b99b2b | 326 | if opts['common']['warnings.missingdeclaration']: |
theotherjimmy |
40:7d3fa6b99b2b | 327 | opts['common']['warnings.other'] += ' -Wmissing-declarations' |
theotherjimmy |
40:7d3fa6b99b2b | 328 | if opts['common']['warnings.pointerarith']: |
theotherjimmy |
40:7d3fa6b99b2b | 329 | opts['common']['warnings.other'] += ' -Wpointer-arith' |
theotherjimmy |
40:7d3fa6b99b2b | 330 | if opts['common']['warnings.padded']: |
theotherjimmy |
40:7d3fa6b99b2b | 331 | opts['common']['warnings.other'] += ' -Wpadded' |
theotherjimmy |
40:7d3fa6b99b2b | 332 | if opts['common']['warnings.shadow']: |
theotherjimmy |
40:7d3fa6b99b2b | 333 | opts['common']['warnings.other'] += ' -Wshadow' |
theotherjimmy |
40:7d3fa6b99b2b | 334 | if opts['common']['warnings.logicalop']: |
theotherjimmy |
40:7d3fa6b99b2b | 335 | opts['common']['warnings.other'] += ' -Wlogical-op' |
theotherjimmy |
40:7d3fa6b99b2b | 336 | if opts['common']['warnings.agreggatereturn']: |
theotherjimmy |
40:7d3fa6b99b2b | 337 | opts['common']['warnings.other'] += ' -Waggregate-return' |
theotherjimmy |
40:7d3fa6b99b2b | 338 | if opts['common']['warnings.floatequal']: |
theotherjimmy |
40:7d3fa6b99b2b | 339 | opts['common']['warnings.other'] += ' -Wfloat-equal' |
theotherjimmy |
40:7d3fa6b99b2b | 340 | opts['ld']['strip'] = False |
theotherjimmy |
40:7d3fa6b99b2b | 341 | if '-s' in flags_in['ld_flags']: |
theotherjimmy |
40:7d3fa6b99b2b | 342 | opts['ld']['strip'] = True |
theotherjimmy |
40:7d3fa6b99b2b | 343 | opts['ld']['shared'] = False |
theotherjimmy |
40:7d3fa6b99b2b | 344 | if '-shared' in flags_in['ld_flags']: |
theotherjimmy |
40:7d3fa6b99b2b | 345 | opts['ld']['shared'] = True |
theotherjimmy |
40:7d3fa6b99b2b | 346 | opts['ld']['soname'] = '' |
theotherjimmy |
40:7d3fa6b99b2b | 347 | opts['ld']['implname'] = '' |
theotherjimmy |
40:7d3fa6b99b2b | 348 | opts['ld']['defname'] = '' |
theotherjimmy |
40:7d3fa6b99b2b | 349 | for item in flags_in['ld_flags']: |
theotherjimmy |
40:7d3fa6b99b2b | 350 | if item.startswith('-Wl,-soname='): |
theotherjimmy |
40:7d3fa6b99b2b | 351 | opts['ld']['soname'] = item[len('-Wl,-soname='):] |
theotherjimmy |
40:7d3fa6b99b2b | 352 | if item.startswith('-Wl,--out-implib='): |
theotherjimmy |
40:7d3fa6b99b2b | 353 | opts['ld']['implname'] = item[len('-Wl,--out-implib='):] |
theotherjimmy |
40:7d3fa6b99b2b | 354 | if item.startswith('-Wl,--output-def='): |
theotherjimmy |
40:7d3fa6b99b2b | 355 | opts['ld']['defname'] = item[len('-Wl,--output-def='):] |
theotherjimmy |
40:7d3fa6b99b2b | 356 | opts['common']['arm.target.fpu.hardware'] = self.get_fpu_hardware( |
theotherjimmy |
40:7d3fa6b99b2b | 357 | opts['common']['arm.target.fpu.unit']) |
theotherjimmy |
40:7d3fa6b99b2b | 358 | opts['common']['debugging.codecov'] = False |
theotherjimmy |
40:7d3fa6b99b2b | 359 | if '-fprofile-arcs' in flags_in['common_flags'] and '-ftest-coverage' in flags_in['common_flags']: |
theotherjimmy |
40:7d3fa6b99b2b | 360 | opts['common']['debugging.codecov'] = True |
theotherjimmy |
40:7d3fa6b99b2b | 361 | # Passing linker options to linker with '-Wl,'-prefix. |
theotherjimmy |
40:7d3fa6b99b2b | 362 | for index in range(len(opts['ld']['flags'])): |
theotherjimmy |
40:7d3fa6b99b2b | 363 | item = opts['ld']['flags'][index] |
theotherjimmy |
40:7d3fa6b99b2b | 364 | if not item.startswith('-Wl,'): |
theotherjimmy |
40:7d3fa6b99b2b | 365 | opts['ld']['flags'][index] = '-Wl,' + item |
theotherjimmy |
40:7d3fa6b99b2b | 366 | # Strange System Workbench feature: If first parameter in Other flags is a |
theotherjimmy |
40:7d3fa6b99b2b | 367 | # define (-D...), Other flags will be replaced by defines and other flags |
theotherjimmy |
40:7d3fa6b99b2b | 368 | # are completely ignored. Moving -D parameters to defines. |
theotherjimmy |
40:7d3fa6b99b2b | 369 | for compiler in ['c', 'cpp', 'as']: |
theotherjimmy |
40:7d3fa6b99b2b | 370 | tmpList = opts[compiler]['other'].split(' ') |
theotherjimmy |
40:7d3fa6b99b2b | 371 | otherList = [] |
theotherjimmy |
40:7d3fa6b99b2b | 372 | for item in tmpList: |
theotherjimmy |
40:7d3fa6b99b2b | 373 | if item.startswith('-D'): |
theotherjimmy |
40:7d3fa6b99b2b | 374 | opts[compiler]['defines'].append(str(item[2:])) |
theotherjimmy |
40:7d3fa6b99b2b | 375 | else: |
theotherjimmy |
40:7d3fa6b99b2b | 376 | otherList.append(item) |
theotherjimmy |
40:7d3fa6b99b2b | 377 | opts[compiler]['other'] = ' '.join(otherList) |
theotherjimmy |
40:7d3fa6b99b2b | 378 | # Assembler options |
theotherjimmy |
40:7d3fa6b99b2b | 379 | for as_def in opts['as']['defines']: |
theotherjimmy |
40:7d3fa6b99b2b | 380 | if '=' in as_def: |
theotherjimmy |
40:7d3fa6b99b2b | 381 | opts['as']['other'] += ' --defsym ' + as_def |
theotherjimmy |
40:7d3fa6b99b2b | 382 | else: |
theotherjimmy |
40:7d3fa6b99b2b | 383 | opts['as']['other'] += ' --defsym ' + as_def + '=1' |
The Other Jimmy |
35:da9c89f8be7d | 384 | |
The Other Jimmy |
35:da9c89f8be7d | 385 | def generate(self): |
theotherjimmy |
40:7d3fa6b99b2b | 386 | """ |
theotherjimmy |
40:7d3fa6b99b2b | 387 | Generate the .project and .cproject files. |
theotherjimmy |
40:7d3fa6b99b2b | 388 | """ |
theotherjimmy |
40:7d3fa6b99b2b | 389 | options = {} |
theotherjimmy |
40:7d3fa6b99b2b | 390 | |
theotherjimmy |
40:7d3fa6b99b2b | 391 | if not self.resources.linker_script: |
theotherjimmy |
40:7d3fa6b99b2b | 392 | raise NotSupportedException("No linker script found.") |
theotherjimmy |
40:7d3fa6b99b2b | 393 | |
theotherjimmy |
40:7d3fa6b99b2b | 394 | print ('\nCreate a System Workbench for STM32 managed project') |
theotherjimmy |
40:7d3fa6b99b2b | 395 | print ('Project name: {0}'.format(self.project_name)) |
theotherjimmy |
40:7d3fa6b99b2b | 396 | print ('Target: {0}'.format(self.toolchain.target.name)) |
theotherjimmy |
40:7d3fa6b99b2b | 397 | print ('Toolchain: {0}'.format(self.TOOLCHAIN) + '\n') |
theotherjimmy |
40:7d3fa6b99b2b | 398 | |
theotherjimmy |
40:7d3fa6b99b2b | 399 | self.resources.win_to_unix() |
theotherjimmy |
40:7d3fa6b99b2b | 400 | |
theotherjimmy |
40:7d3fa6b99b2b | 401 | config_header = self.filter_dot(self.toolchain.get_config_header()) |
theotherjimmy |
40:7d3fa6b99b2b | 402 | |
The Other Jimmy |
35:da9c89f8be7d | 403 | libraries = [] |
The Other Jimmy |
35:da9c89f8be7d | 404 | for lib in self.resources.libraries: |
theotherjimmy |
40:7d3fa6b99b2b | 405 | library, _ = splitext(basename(lib)) |
theotherjimmy |
40:7d3fa6b99b2b | 406 | libraries.append(library[3:]) |
theotherjimmy |
40:7d3fa6b99b2b | 407 | |
theotherjimmy |
40:7d3fa6b99b2b | 408 | self.system_libraries = [ |
theotherjimmy |
40:7d3fa6b99b2b | 409 | 'stdc++', 'supc++', 'm', 'c', 'gcc', 'nosys' |
theotherjimmy |
40:7d3fa6b99b2b | 410 | ] |
theotherjimmy |
40:7d3fa6b99b2b | 411 | |
theotherjimmy |
40:7d3fa6b99b2b | 412 | profiles = self.get_all_profiles() |
theotherjimmy |
40:7d3fa6b99b2b | 413 | self.as_defines = [s.replace('"', '"') |
theotherjimmy |
40:7d3fa6b99b2b | 414 | for s in self.toolchain.get_symbols(True)] |
theotherjimmy |
40:7d3fa6b99b2b | 415 | self.c_defines = [s.replace('"', '"') |
theotherjimmy |
40:7d3fa6b99b2b | 416 | for s in self.toolchain.get_symbols()] |
theotherjimmy |
40:7d3fa6b99b2b | 417 | self.cpp_defines = self.c_defines |
theotherjimmy |
40:7d3fa6b99b2b | 418 | print 'Symbols: {0}'.format(len(self.c_defines)) |
theotherjimmy |
40:7d3fa6b99b2b | 419 | |
theotherjimmy |
40:7d3fa6b99b2b | 420 | self.include_path = [] |
theotherjimmy |
40:7d3fa6b99b2b | 421 | for s in self.resources.inc_dirs: |
theotherjimmy |
40:7d3fa6b99b2b | 422 | self.include_path.append("../" + self.filter_dot(s)) |
theotherjimmy |
40:7d3fa6b99b2b | 423 | print ('Include folders: {0}'.format(len(self.include_path))) |
theotherjimmy |
40:7d3fa6b99b2b | 424 | |
theotherjimmy |
40:7d3fa6b99b2b | 425 | self.compute_exclusions() |
theotherjimmy |
40:7d3fa6b99b2b | 426 | |
theotherjimmy |
40:7d3fa6b99b2b | 427 | print ('Exclude folders: {0}'.format(len(self.excluded_folders))) |
theotherjimmy |
40:7d3fa6b99b2b | 428 | |
theotherjimmy |
40:7d3fa6b99b2b | 429 | ld_script = self.filter_dot(self.resources.linker_script) |
theotherjimmy |
40:7d3fa6b99b2b | 430 | print ('Linker script: {0}'.format(ld_script)) |
theotherjimmy |
40:7d3fa6b99b2b | 431 | |
theotherjimmy |
40:7d3fa6b99b2b | 432 | lib_dirs = [self.filter_dot(s) for s in self.resources.lib_dirs] |
theotherjimmy |
40:7d3fa6b99b2b | 433 | |
theotherjimmy |
40:7d3fa6b99b2b | 434 | preproc_cmd = basename(self.toolchain.preproc[0]) + " " + " ".join(self.toolchain.preproc[1:]) |
theotherjimmy |
40:7d3fa6b99b2b | 435 | |
theotherjimmy |
40:7d3fa6b99b2b | 436 | for id in ['debug', 'release']: |
theotherjimmy |
40:7d3fa6b99b2b | 437 | opts = {} |
theotherjimmy |
40:7d3fa6b99b2b | 438 | opts['common'] = {} |
theotherjimmy |
40:7d3fa6b99b2b | 439 | opts['as'] = {} |
theotherjimmy |
40:7d3fa6b99b2b | 440 | opts['c'] = {} |
theotherjimmy |
40:7d3fa6b99b2b | 441 | opts['cpp'] = {} |
theotherjimmy |
40:7d3fa6b99b2b | 442 | opts['ld'] = {} |
theotherjimmy |
40:7d3fa6b99b2b | 443 | |
theotherjimmy |
40:7d3fa6b99b2b | 444 | opts['id'] = id |
theotherjimmy |
40:7d3fa6b99b2b | 445 | opts['name'] = opts['id'].capitalize() |
theotherjimmy |
40:7d3fa6b99b2b | 446 | |
theotherjimmy |
40:7d3fa6b99b2b | 447 | # TODO: Add prints to log or console in verbose mode. |
theotherjimmy |
40:7d3fa6b99b2b | 448 | #print ('\nBuild configuration: {0}'.format(opts['name'])) |
theotherjimmy |
40:7d3fa6b99b2b | 449 | |
theotherjimmy |
40:7d3fa6b99b2b | 450 | profile = profiles[id] |
theotherjimmy |
40:7d3fa6b99b2b | 451 | |
theotherjimmy |
40:7d3fa6b99b2b | 452 | # A small hack, do not bother with src_path again, |
theotherjimmy |
40:7d3fa6b99b2b | 453 | # pass an empty string to avoid crashing. |
theotherjimmy |
40:7d3fa6b99b2b | 454 | src_paths = [''] |
theotherjimmy |
40:7d3fa6b99b2b | 455 | toolchain = prepare_toolchain( |
theotherjimmy |
40:7d3fa6b99b2b | 456 | src_paths, "", self.toolchain.target.name, self.TOOLCHAIN, build_profile=[profile]) |
theotherjimmy |
40:7d3fa6b99b2b | 457 | |
theotherjimmy |
40:7d3fa6b99b2b | 458 | # Hack to fill in build_dir |
theotherjimmy |
40:7d3fa6b99b2b | 459 | toolchain.build_dir = self.toolchain.build_dir |
theotherjimmy |
40:7d3fa6b99b2b | 460 | |
theotherjimmy |
40:7d3fa6b99b2b | 461 | flags = self.toolchain_flags(toolchain) |
theotherjimmy |
40:7d3fa6b99b2b | 462 | |
theotherjimmy |
40:7d3fa6b99b2b | 463 | # TODO: Add prints to log or console in verbose mode. |
theotherjimmy |
40:7d3fa6b99b2b | 464 | # print 'Common flags:', ' '.join(flags['common_flags']) |
theotherjimmy |
40:7d3fa6b99b2b | 465 | # print 'C++ flags:', ' '.join(flags['cxx_flags']) |
theotherjimmy |
40:7d3fa6b99b2b | 466 | # print 'C flags:', ' '.join(flags['c_flags']) |
theotherjimmy |
40:7d3fa6b99b2b | 467 | # print 'ASM flags:', ' '.join(flags['asm_flags']) |
theotherjimmy |
40:7d3fa6b99b2b | 468 | # print 'Linker flags:', ' '.join(flags['ld_flags']) |
theotherjimmy |
40:7d3fa6b99b2b | 469 | |
theotherjimmy |
40:7d3fa6b99b2b | 470 | # Most GNU ARM Eclipse options have a parent, |
theotherjimmy |
40:7d3fa6b99b2b | 471 | # either debug or release. |
theotherjimmy |
40:7d3fa6b99b2b | 472 | if '-O0' in flags['common_flags'] or '-Og' in flags['common_flags']: |
theotherjimmy |
40:7d3fa6b99b2b | 473 | opts['parent_id'] = 'debug' |
theotherjimmy |
40:7d3fa6b99b2b | 474 | else: |
theotherjimmy |
40:7d3fa6b99b2b | 475 | opts['parent_id'] = 'release' |
theotherjimmy |
40:7d3fa6b99b2b | 476 | |
theotherjimmy |
40:7d3fa6b99b2b | 477 | self.process_options(opts, flags) |
theotherjimmy |
40:7d3fa6b99b2b | 478 | |
theotherjimmy |
40:7d3fa6b99b2b | 479 | opts['c']['defines'] = self.c_defines |
theotherjimmy |
40:7d3fa6b99b2b | 480 | opts['cpp']['defines'] = self.cpp_defines |
theotherjimmy |
40:7d3fa6b99b2b | 481 | opts['as']['defines'] = self.as_defines |
theotherjimmy |
40:7d3fa6b99b2b | 482 | |
theotherjimmy |
40:7d3fa6b99b2b | 483 | self.process_sw_options(opts, flags) |
theotherjimmy |
40:7d3fa6b99b2b | 484 | |
theotherjimmy |
40:7d3fa6b99b2b | 485 | opts['ld']['library_paths'] = [ |
theotherjimmy |
40:7d3fa6b99b2b | 486 | self.filter_dot(s) for s in self.resources.lib_dirs] |
theotherjimmy |
40:7d3fa6b99b2b | 487 | |
theotherjimmy |
40:7d3fa6b99b2b | 488 | opts['ld']['user_libraries'] = libraries |
theotherjimmy |
40:7d3fa6b99b2b | 489 | opts['ld']['system_libraries'] = self.system_libraries |
theotherjimmy |
40:7d3fa6b99b2b | 490 | opts['ld']['script'] = "linker-script-" + id + ".ld" |
theotherjimmy |
40:7d3fa6b99b2b | 491 | |
theotherjimmy |
40:7d3fa6b99b2b | 492 | # Unique IDs used in multiple places. |
theotherjimmy |
40:7d3fa6b99b2b | 493 | uid = {} |
theotherjimmy |
40:7d3fa6b99b2b | 494 | uid['config'] = u.id |
theotherjimmy |
40:7d3fa6b99b2b | 495 | uid['tool_c_compiler'] = u.id |
theotherjimmy |
40:7d3fa6b99b2b | 496 | uid['tool_c_compiler_input'] = u.id |
theotherjimmy |
40:7d3fa6b99b2b | 497 | uid['tool_cpp_compiler'] = u.id |
theotherjimmy |
40:7d3fa6b99b2b | 498 | uid['tool_cpp_compiler_input'] = u.id |
theotherjimmy |
40:7d3fa6b99b2b | 499 | |
theotherjimmy |
40:7d3fa6b99b2b | 500 | opts['uid'] = uid |
theotherjimmy |
40:7d3fa6b99b2b | 501 | |
theotherjimmy |
40:7d3fa6b99b2b | 502 | options[id] = opts |
The Other Jimmy |
35:da9c89f8be7d | 503 | |
The Other Jimmy |
35:da9c89f8be7d | 504 | ctx = { |
The Other Jimmy |
35:da9c89f8be7d | 505 | 'name': self.project_name, |
theotherjimmy |
40:7d3fa6b99b2b | 506 | 'platform': platform, |
theotherjimmy |
40:7d3fa6b99b2b | 507 | 'include_paths': self.include_path, |
theotherjimmy |
40:7d3fa6b99b2b | 508 | 'config_header': config_header, |
theotherjimmy |
40:7d3fa6b99b2b | 509 | 'exclude_paths': '|'.join(self.excluded_folders), |
theotherjimmy |
40:7d3fa6b99b2b | 510 | 'ld_script': ld_script, |
theotherjimmy |
40:7d3fa6b99b2b | 511 | 'library_paths': lib_dirs, |
The Other Jimmy |
35:da9c89f8be7d | 512 | 'object_files': self.resources.objects, |
The Other Jimmy |
35:da9c89f8be7d | 513 | 'libraries': libraries, |
The Other Jimmy |
35:da9c89f8be7d | 514 | 'board_name': self.BOARDS[self.target.upper()]['name'], |
The Other Jimmy |
35:da9c89f8be7d | 515 | 'mcu_name': self.BOARDS[self.target.upper()]['mcuId'], |
theotherjimmy |
40:7d3fa6b99b2b | 516 | 'cpp_cmd': preproc_cmd, |
theotherjimmy |
40:7d3fa6b99b2b | 517 | 'options': options, |
theotherjimmy |
40:7d3fa6b99b2b | 518 | # id property of 'u' will generate new random identifier every time |
theotherjimmy |
40:7d3fa6b99b2b | 519 | # when called. |
theotherjimmy |
40:7d3fa6b99b2b | 520 | 'u': u |
The Other Jimmy |
35:da9c89f8be7d | 521 | } |
The Other Jimmy |
35:da9c89f8be7d | 522 | |
The Other Jimmy |
35:da9c89f8be7d | 523 | self.__gen_dir('.settings') |
theotherjimmy |
40:7d3fa6b99b2b | 524 | self.gen_file('sw4stm32/language_settings_commom.tmpl', |
theotherjimmy |
40:7d3fa6b99b2b | 525 | ctx, '.settings/language.settings.xml') |
The Other Jimmy |
35:da9c89f8be7d | 526 | self.gen_file('sw4stm32/project_common.tmpl', ctx, '.project') |
The Other Jimmy |
35:da9c89f8be7d | 527 | self.gen_file('sw4stm32/cproject_common.tmpl', ctx, '.cproject') |
theotherjimmy |
40:7d3fa6b99b2b | 528 | self.gen_file('sw4stm32/makefile.targets.tmpl', ctx, |
theotherjimmy |
40:7d3fa6b99b2b | 529 | 'makefile.targets', trim_blocks=True, lstrip_blocks=True) |
theotherjimmy |
40:7d3fa6b99b2b | 530 | self.gen_file('sw4stm32/launch.tmpl', ctx, self.project_name + |
theotherjimmy |
40:7d3fa6b99b2b | 531 | ' ' + options['debug']['name'] + '.launch') |