9 years, 11 months ago.

do you have git.exe in your PATH environment variable? error compiler keil

error on compiler Keil v5.1

where to put the path GIT.exe on python pre_build_script.py file?

Rebuild target 'k20dx128_bootloader'
Before Build - User command #1: python ..\..\..\tools\pre_build_script.py
--- Error: User Command terminated, Exit-Code = 1
assembling startup_MK20D5.s...
compiling system_MK20D5.c...
compiling flash_svc.c...
compiling main.c...
compiling RTX_Config.c...
assembling SVC_Table.s...
compiling usb_config.c...
compiling usbd_user_msc.c...
compiling version.c...
..\..\Common\inc\mbed_htm.h(19): error:  #5: cannot open source input file "version_git.h": No such file or directory
  #include "version_git.h"
..\..\Common\src\version.c: 0 warnings, 1 error
compiling gpio.c...
compiling read_uid.c...
compiling usbd_MK20D5.c...
compiling vector_table.c...
compiling flash_hal.c...
compiling usbd_core.c...
compiling usbd_core_msc.c...
compiling usbd_msc.c...
compiling HAL_CM3.c...
compiling rt_Event.c...
compiling rt_List.c...
compiling rt_Mailbox.c...
compiling rt_MemBox.c...
compiling rt_Mutex.c...
compiling rt_Robin.c...
compiling rt_Semaphore.c...
compiling rt_System.c...
compiling rt_Task.c...
compiling rt_Time.c...
compiling rt_Timer.c...
compiling flash_command_sequence.c...
compiling flash_densities_k_series.c...
compiling flash_erase.c...
compiling flash_erase_all.c...
compiling flash_init.c...
compiling flash_program.c...
compiling flash_verify_erase.c...
compiling flash_verify_erase_all.c...
compiling flash_verify_program.c...
".\Obj\k20dx128_bootloader.axf" - 2 Error(s), 0 Warning(s).
Target not created

1 Answer

9 years, 11 months ago.

Hello Sacchetti Giampaolo,

You could share the output (as you included it in the headline, was not obvious for me). This is the error:

print "#> ERROR: Failed to get git SHA, do you have git.exe in your PATH environment variable?"

have you installed git? the prebuild script uses git commands to create the git version header file. The installation of git provides an option to add git to PATH variables (talking about windows OS).

Regards,
0xc0170

Accepted Answer

I installed the program correctly in windows 7

shell screen:

Microsoft Windows [Versione 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Tutti i diritti riservati.

C:\Users\dell690>git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty Git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and integrate with another repository or a local branch

   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG

'git help -a' and 'git help -g' lists available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

C:\Users\dell690>

C:\Users\dell690>git --info-path
C:\Program Files (x86)\Git/share/info

but I have always the same error

posted by Sacchetti Giampaolo 29 May 2014