windows 安装 xtensa tool chain
xtensa-toolchain
Install the following tools:
- Git for windows
- mingw32-make
- Python 2.7
Then:
$ git clone git://github.com/icamgo/xtensa-toolchain.git xtensa-toolchain
$ cd xtensa-toolchain
$ python gen.py # download the win32 package
$ cd release
$ make win32 # build the toolchain used in windows
执行python gen.py 时可能会遇到下面的问题
Downloading win32-xtensa-lx106-elf-gb404fb9-2.tar.gz 0%Traceback (most recent call last): File “gen.py”, line 165, in get_tool(tool, arch) File “gen.py”, line 82, in get_tool urllib.urlretrieve(url, local_path, report_progress) File “C:\Users\suse1.pyenv\pyenv-win\versions\2.7.18\lib\urllib.py”, line 98, in urlretrieve return opener.retrieve(url, filename, reporthook, data) File “C:\Users\suse1.pyenv\pyenv-win\versions\2.7.18\lib\urllib.py”, line 275, in retrieve block = fp.read(bs) File “C:\Users\suse1.pyenv\pyenv-win\versions\2.7.18\lib\socket.py”, line 384, in read data = self._sock.recv(left) socket.error: [Errno 10054]
修改 get_tool函数
def get_tool(tool, arch):
archive_name = tool['archiveFileName']
local_path = dist_dir + archive_name
url = tool['url']
real_hash = tool['checksum'].split(':')[1]
if not os.path.isfile(local_path):
print('Downloading ' + archive_name);
try:
urllib.urlretrieve(url, local_path, report_progress)
except:
print("%s download fai" % (url))
return
print("local_path=",local_path)
print("url",url)
sys.stdout.write("\rDone\n")
sys.stdout.flush()
else:
print('Tool {0} already downloaded'.format(archive_name))
local_hash = sha256sum(local_path)
if local_hash != real_hash:
print('Hash mismatch for {0}, delete the file and try again'.format(local_path))
return
if archive_name == 'gcc-arm-none-eabi-7-2017-q4-major-win32.zip':
tc_dir = 'gcc-arm-none-eabi';
mkdir_p(tc_dir)
unpack(local_path, tc_dir, arch)
else:
unpack(local_path, '.', arch)
|