Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
tools/build_release.bat@0:01f31e923fe2, 2020-04-07 (annotated)
- Committer:
- Pawel Zarembski
- Date:
- Tue Apr 07 12:55:42 2020 +0200
- Revision:
- 0:01f31e923fe2
hani: DAPLink with reset workaround
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Pawel Zarembski |
0:01f31e923fe2 | 1 | :: |
Pawel Zarembski |
0:01f31e923fe2 | 2 | :: DAPLink Interface Firmware |
Pawel Zarembski |
0:01f31e923fe2 | 3 | :: Copyright (c) 2009-2016, ARM Limited, All Rights Reserved |
Pawel Zarembski |
0:01f31e923fe2 | 4 | :: SPDX-License-Identifier: Apache-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 5 | :: |
Pawel Zarembski |
0:01f31e923fe2 | 6 | :: Licensed under the Apache License, Version 2.0 (the "License"); you may |
Pawel Zarembski |
0:01f31e923fe2 | 7 | :: not use this file except in compliance with the License. |
Pawel Zarembski |
0:01f31e923fe2 | 8 | :: You may obtain a copy of the License at |
Pawel Zarembski |
0:01f31e923fe2 | 9 | :: |
Pawel Zarembski |
0:01f31e923fe2 | 10 | :: http://www.apache.org/licenses/LICENSE-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 11 | :: |
Pawel Zarembski |
0:01f31e923fe2 | 12 | :: Unless required by applicable law or agreed to in writing, software |
Pawel Zarembski |
0:01f31e923fe2 | 13 | :: distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
Pawel Zarembski |
0:01f31e923fe2 | 14 | :: WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Pawel Zarembski |
0:01f31e923fe2 | 15 | :: See the License for the specific language governing permissions and |
Pawel Zarembski |
0:01f31e923fe2 | 16 | :: limitations under the License. |
Pawel Zarembski |
0:01f31e923fe2 | 17 | :: |
Pawel Zarembski |
0:01f31e923fe2 | 18 | setlocal enabledelayedexpansion |
Pawel Zarembski |
0:01f31e923fe2 | 19 | @rem Script assumes working directory is workspace root. Force it. |
Pawel Zarembski |
0:01f31e923fe2 | 20 | cd %~dp0..\ |
Pawel Zarembski |
0:01f31e923fe2 | 21 | |
Pawel Zarembski |
0:01f31e923fe2 | 22 | @rem See if we can find uVision. This logic is consistent with progen |
Pawel Zarembski |
0:01f31e923fe2 | 23 | @if [%UV4%]==[] ( |
Pawel Zarembski |
0:01f31e923fe2 | 24 | @echo UV4 variable is not set, trying to autodetect.. |
Pawel Zarembski |
0:01f31e923fe2 | 25 | if EXIST c:\keil\uv4\uv4.exe ( |
Pawel Zarembski |
0:01f31e923fe2 | 26 | set UV4=c:\keil\uv4\uv4.exe |
Pawel Zarembski |
0:01f31e923fe2 | 27 | ) else if EXIST c:\keil_v5\uv4\uv4.exe ( |
Pawel Zarembski |
0:01f31e923fe2 | 28 | set UV4=c:\keil_v5\uv4\uv4.exe |
Pawel Zarembski |
0:01f31e923fe2 | 29 | ) else goto error_nomdk |
Pawel Zarembski |
0:01f31e923fe2 | 30 | ) |
Pawel Zarembski |
0:01f31e923fe2 | 31 | @echo USING UV4=%UV4% |
Pawel Zarembski |
0:01f31e923fe2 | 32 | |
Pawel Zarembski |
0:01f31e923fe2 | 33 | @set project_tool=%1 |
Pawel Zarembski |
0:01f31e923fe2 | 34 | @set env_folder=%2 |
Pawel Zarembski |
0:01f31e923fe2 | 35 | @set requirements_file=%3 |
Pawel Zarembski |
0:01f31e923fe2 | 36 | |
Pawel Zarembski |
0:01f31e923fe2 | 37 | |
Pawel Zarembski |
0:01f31e923fe2 | 38 | @rem Select an existing virtualenv as first parameter |
Pawel Zarembski |
0:01f31e923fe2 | 39 | @if not [%env_folder%]==[] ( |
Pawel Zarembski |
0:01f31e923fe2 | 40 | echo Using virtualenv %env_folder% |
Pawel Zarembski |
0:01f31e923fe2 | 41 | @if exist %env_folder% call %env_folder%\Scripts\activate && goto :env_folder_ok |
Pawel Zarembski |
0:01f31e923fe2 | 42 | ) else ( |
Pawel Zarembski |
0:01f31e923fe2 | 43 | echo Checking env folder |
Pawel Zarembski |
0:01f31e923fe2 | 44 | @if exist env goto :env_ok |
Pawel Zarembski |
0:01f31e923fe2 | 45 | ) |
Pawel Zarembski |
0:01f31e923fe2 | 46 | |
Pawel Zarembski |
0:01f31e923fe2 | 47 | |
Pawel Zarembski |
0:01f31e923fe2 | 48 | echo Creating python virtual environment && virtualenv env |
Pawel Zarembski |
0:01f31e923fe2 | 49 | :env_ok |
Pawel Zarembski |
0:01f31e923fe2 | 50 | call env\Scripts\activate |
Pawel Zarembski |
0:01f31e923fe2 | 51 | :env_folder_ok |
Pawel Zarembski |
0:01f31e923fe2 | 52 | |
Pawel Zarembski |
0:01f31e923fe2 | 53 | @echo Doing pip install |
Pawel Zarembski |
0:01f31e923fe2 | 54 | @REM use project requirements if not specified |
Pawel Zarembski |
0:01f31e923fe2 | 55 | if [%requirements_file%]==[] pip install -r requirements.txt |
Pawel Zarembski |
0:01f31e923fe2 | 56 | @REM use custom requirements if specified |
Pawel Zarembski |
0:01f31e923fe2 | 57 | if not [%requirements_file%]==[] pip install -r %requirements_file% |
Pawel Zarembski |
0:01f31e923fe2 | 58 | |
Pawel Zarembski |
0:01f31e923fe2 | 59 | @if [%project_tool%]==[mbedcli] ( |
Pawel Zarembski |
0:01f31e923fe2 | 60 | @REM setup mbed dependencies |
Pawel Zarembski |
0:01f31e923fe2 | 61 | echo Building for mbed cli |
Pawel Zarembski |
0:01f31e923fe2 | 62 | |
Pawel Zarembski |
0:01f31e923fe2 | 63 | @if [%ARM_PATH%]==[] ( |
Pawel Zarembski |
0:01f31e923fe2 | 64 | @echo ARM_PATH variable is not set, trying to autodetect.. |
Pawel Zarembski |
0:01f31e923fe2 | 65 | if EXIST C:\KEIL_V4\ARM\ARMCC\ ( |
Pawel Zarembski |
0:01f31e923fe2 | 66 | set ARM_PATH=C:\KEIL_V4\ARM\ARMCC |
Pawel Zarembski |
0:01f31e923fe2 | 67 | ) else if EXIST C:\KEIL_V5\ARM\ARMCC\ ( |
Pawel Zarembski |
0:01f31e923fe2 | 68 | set ARM_PATH=C:\KEIL_V5\ARM\ARMCC |
Pawel Zarembski |
0:01f31e923fe2 | 69 | ) else goto error_armpath |
Pawel Zarembski |
0:01f31e923fe2 | 70 | ) |
Pawel Zarembski |
0:01f31e923fe2 | 71 | @echo USING ARM_PATH=!ARM_PATH! |
Pawel Zarembski |
0:01f31e923fe2 | 72 | |
Pawel Zarembski |
0:01f31e923fe2 | 73 | mbed deploy |
Pawel Zarembski |
0:01f31e923fe2 | 74 | mbed config root . |
Pawel Zarembski |
0:01f31e923fe2 | 75 | mbed config ARM_PATH !ARM_PATH! |
Pawel Zarembski |
0:01f31e923fe2 | 76 | python tools/mbedcli_compile.py --clean --release |
Pawel Zarembski |
0:01f31e923fe2 | 77 | @if !errorlevel! neq 0 exit /B !errorlevel! |
Pawel Zarembski |
0:01f31e923fe2 | 78 | python tools/copy_release_files.py --project-tool mbedcli |
Pawel Zarembski |
0:01f31e923fe2 | 79 | exit /B !errorlevel! |
Pawel Zarembski |
0:01f31e923fe2 | 80 | ) else ( |
Pawel Zarembski |
0:01f31e923fe2 | 81 | |
Pawel Zarembski |
0:01f31e923fe2 | 82 | @REM build bootloader images first (In the future this should be done with a pattern like *_bl) |
Pawel Zarembski |
0:01f31e923fe2 | 83 | echo Building for uvision release |
Pawel Zarembski |
0:01f31e923fe2 | 84 | progen generate -t uvision -b -p kl26z_bl |
Pawel Zarembski |
0:01f31e923fe2 | 85 | progen generate -t uvision -b -p k20dx_bl |
Pawel Zarembski |
0:01f31e923fe2 | 86 | progen generate -t uvision -b -p sam3u2c_bl |
Pawel Zarembski |
0:01f31e923fe2 | 87 | @REM build but continue if there are errors |
Pawel Zarembski |
0:01f31e923fe2 | 88 | progen generate -t uvision -b |
Pawel Zarembski |
0:01f31e923fe2 | 89 | @if !errorlevel! neq 0 exit /B !errorlevel! |
Pawel Zarembski |
0:01f31e923fe2 | 90 | python tools/copy_release_files.py --project-tool uvision |
Pawel Zarembski |
0:01f31e923fe2 | 91 | exit /B !errorlevel! |
Pawel Zarembski |
0:01f31e923fe2 | 92 | ) |
Pawel Zarembski |
0:01f31e923fe2 | 93 | |
Pawel Zarembski |
0:01f31e923fe2 | 94 | :error_nomdk |
Pawel Zarembski |
0:01f31e923fe2 | 95 | @echo Error: Keil MDK not installed or not found. If you installed it to a |
Pawel Zarembski |
0:01f31e923fe2 | 96 | @echo non-default location, you need to set environment variable UV4 to |
Pawel Zarembski |
0:01f31e923fe2 | 97 | @echo the path of the executable |
Pawel Zarembski |
0:01f31e923fe2 | 98 | @exit /B 1 |
Pawel Zarembski |
0:01f31e923fe2 | 99 | |
Pawel Zarembski |
0:01f31e923fe2 | 100 | :error_armpath |
Pawel Zarembski |
0:01f31e923fe2 | 101 | @echo Error: Need to set environment variable ARM_PATH to |
Pawel Zarembski |
0:01f31e923fe2 | 102 | @echo the path of ARM compiler |
Pawel Zarembski |
0:01f31e923fe2 | 103 | @exit /B 1 |