32
32
board = env .BoardConfig ()
33
33
34
34
FRAMEWORK_DIR = platform .get_package_dir ("framework-arduinoststm32" )
35
- CMSIS_DIR = join (platform .get_package_dir ("framework-arduinoststm32" ), "CMSIS" , "CMSIS" )
35
+ CMSIS_DIR = join (platform .get_package_dir ("framework-cmsis" ) , "CMSIS" )
36
36
assert isdir (FRAMEWORK_DIR )
37
37
assert isdir (CMSIS_DIR )
38
38
@@ -168,6 +168,7 @@ def configure_application_offset(mcu, upload_protocol):
168
168
join (FRAMEWORK_DIR , "cores" , "arduino" , "stm32" ),
169
169
join (FRAMEWORK_DIR , "cores" , "arduino" , "stm32" , "LL" ),
170
170
join (FRAMEWORK_DIR , "cores" , "arduino" , "stm32" , "usb" ),
171
+ join (FRAMEWORK_DIR , "cores" , "arduino" , "stm32" , "OpenAMP" ),
171
172
join (FRAMEWORK_DIR , "cores" , "arduino" , "stm32" , "usb" , "hid" ),
172
173
join (FRAMEWORK_DIR , "cores" , "arduino" , "stm32" , "usb" , "cdc" ),
173
174
join (FRAMEWORK_DIR , "system" , "Drivers" , series + "_HAL_Driver" , "Inc" ),
@@ -191,6 +192,37 @@ def configure_application_offset(mcu, upload_protocol):
191
192
"Core" ,
192
193
"Src" ,
193
194
),
195
+ join (
196
+ FRAMEWORK_DIR ,
197
+ "system" ,
198
+ "Middlewares" ,
199
+ "OpenAMP"
200
+ ),
201
+ join (
202
+ FRAMEWORK_DIR ,
203
+ "system" ,
204
+ "Middlewares" ,
205
+ "OpenAMP" ,
206
+ "open-amp" ,
207
+ "lib" ,
208
+ "include" ,
209
+ ),
210
+ join (
211
+ FRAMEWORK_DIR ,
212
+ "system" ,
213
+ "Middlewares" ,
214
+ "OpenAMP" ,
215
+ "libmetal" ,
216
+ "lib" ,
217
+ "include" ,
218
+ ),
219
+ join (
220
+ FRAMEWORK_DIR ,
221
+ "system" ,
222
+ "Middlewares" ,
223
+ "OpenAMP" ,
224
+ "virtual_driver"
225
+ ),
194
226
join (CMSIS_DIR , "Core" , "Include" ),
195
227
join (
196
228
FRAMEWORK_DIR ,
@@ -202,7 +234,6 @@ def configure_application_offset(mcu, upload_protocol):
202
234
series ,
203
235
"Include" ,
204
236
),
205
- join (CMSIS_DIR , "DSP" , "Include" ),
206
237
join (
207
238
FRAMEWORK_DIR ,
208
239
"system" ,
@@ -215,6 +246,7 @@ def configure_application_offset(mcu, upload_protocol):
215
246
"Templates" ,
216
247
"gcc" ,
217
248
),
249
+ join (CMSIS_DIR , "DSP" , "Include" ),
218
250
join (FRAMEWORK_DIR , "cores" , "arduino" ),
219
251
variant_dir ,
220
252
],
@@ -241,6 +273,18 @@ def configure_application_offset(mcu, upload_protocol):
241
273
LIBPATH = [variant_dir , join (CMSIS_DIR , "DSP" , "Lib" , "GCC" )],
242
274
)
243
275
276
+ if "build.usb_product" in board :
277
+ env .Append (
278
+ CPPDEFINES = [
279
+ ("USB_VID" , board .get ("build.hwids" )[0 ][0 ]),
280
+ ("USB_PID" , board .get ("build.hwids" )[0 ][1 ]),
281
+ ("USB_PRODUCT" , '\\ "%s\\ "' %
282
+ board .get ("build.usb_product" , "" ).replace ('"' , "" )),
283
+ ("USB_MANUFACTURER" , '\\ "%s\\ "' %
284
+ board .get ("vendor" , "" ).replace ('"' , "" ))
285
+ ]
286
+ )
287
+
244
288
env .ProcessFlags (board .get ("build.framework_extra_flags.arduino" , "" ))
245
289
246
290
configure_application_offset (mcu , upload_protocol )
@@ -250,9 +294,10 @@ def configure_application_offset(mcu, upload_protocol):
250
294
#
251
295
252
296
if not board .get ("build.ldscript" , "" ):
297
+ env .Replace (LDSCRIPT_PATH = join (FRAMEWORK_DIR , "system" , "ldscript.ld" ))
253
298
if not isfile (join (env .subst (variant_dir ), "ldscript.ld" )):
254
299
print ("Warning! Cannot find linker script for the current target!\n " )
255
- env .Replace ( LDSCRIPT_PATH = join (variant_dir , "ldscript.ld" ))
300
+ env .Append ( LINKFLAGS = [( "-Wl,--default-script" , join (variant_dir , "ldscript.ld" ))] )
256
301
257
302
#
258
303
# Process configuration flags
0 commit comments