| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env bash | |
| 2 # Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | |
| 3 # for details. All rights reserved. Use of this source code is governed by a | |
| 4 # BSD-style license that can be found in the LICENSE.md file. | |
| 5 | |
| 6 # Update the generated source and template files from STMCubeMX. Right | |
| 7 # not the source file is disco_fletch.tar.gz - a tar of the generated | |
| 8 # project from a Windows machine. | |
| 9 | |
| 10 set -e | |
| 11 | |
| 12 tar xf disco_fletch.tar.gz | |
| 13 | |
| 14 for SRC in disco_fletch/Inc/* | |
| 15 do | |
| 16 BASENAME=$(basename "$SRC") | |
| 17 if test "$BASENAME" != "FreeRTOSConfig.h" | |
| 18 then | |
| 19 echo "$SRC" | |
| 20 DEST=generated/Inc/$BASENAME | |
| 21 cp "$SRC" "$DEST" | |
| 22 dos2unix -q $DEST | |
| 23 sed -i 's/[ \t]*$//' "$DEST" | |
| 24 fi | |
| 25 done | |
| 26 | |
| 27 for SRC in disco_fletch/Src/* $SRC_FILES | |
| 28 do | |
| 29 BASENAME=$(basename "$SRC") | |
| 30 if test "$BASENAME" != "freertos.c" | |
| 31 then | |
| 32 echo "$SRC" | |
| 33 DEST=generated/Src/$BASENAME | |
| 34 cp "$SRC" "$DEST" | |
| 35 dos2unix -q "$DEST" | |
| 36 sed -i 's/[ \t]*$//' "$DEST" | |
| 37 fi | |
| 38 done | |
| 39 | |
| 40 # Modify generated main.c to expose the MX_ initialization functions | |
| 41 # and not implement main. | |
| 42 sed -i 's/static void MX_/void MX_/' generated/Src/main.c | |
| 43 sed -i 's/int main/int _not_using_this_main/' generated/Src/main.c | |
| 44 mv generated/Src/main.c generated/Src/mx_init.c | |
| 45 | |
| 46 SRC="disco_fletch/SW4STM32/disco_fletch Configuration/STM32F746NGHx_FLASH.ld" | |
| 47 echo "$SRC" | |
| 48 cp "$SRC" generated/SW4STM32/configuration/STM32F746NGHx_FLASH.ld | |
| 49 dos2unix -q generated/SW4STM32/configuration/STM32F746NGHx_FLASH.ld | |
| 50 | |
| 51 SRC="disco_fletch/Drivers/CMSIS/Device/ST/STM32F7xx/Source/Templates/gcc/startup
_stm32f746xx.s" | |
| 52 echo "$SRC" | |
| 53 cp "$SRC" template/startup_stm32f746xx.s | |
| 54 dos2unix -q template/startup_stm32f746xx.s | |
| 55 | |
| 56 # Don't copy the disco_fletch/Drivers/CMSIS/Device/ST/STM32F7xx/Source/ | |
| 57 # Templates/system_stm32f7xx.c file, as the one provided by | |
| 58 # STM32CubeMX is the wrong one. It is the one for the EVAL2 board | |
| 59 # and not the Discovery board. | |
| 60 | |
| 61 cp disco_fletch/disco_fletch.ioc disco_fletch.ioc | |
| 62 dos2unix -q disco_fletch.ioc | |
| 63 | |
| 64 rm -rf disco_fletch | |
| OLD | NEW |