13 Star 22 Fork 20

Phytium嵌入式软件 / Phytium-FreeRTOS-SDK

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
install.py 2.68 KB
一键复制 编辑 原始数据 按行查看 历史
zhugengyu 提交于 2024-05-17 06:42 . !61适配 GPIO 驱动修改
#!/usr/bin/env python3
import os
import platform
import re
### platform constant
platform_tags = ["Linux_X86_64" "Linux_AARCH64" "Windows_x64"]
linux_x86 = 0
linux_aarch64 = 1
windows_x64 = 2
# STEP 1: Check environment
if (platform.system() == 'Linux' ) and (platform.processor() == 'x86_64'):
install_platform = linux_x86
elif (platform.system() == 'Linux' ) and (platform.processor() == 'aarch64'): # Arm64 computer
install_platform = linux_aarch64
elif (platform.system() == 'Windows') and (platform.machine() == 'AMD64'):
install_platform = windows_x64
else:
print("Platform not support !!! ")
exit()
# get absoulte path current pwd to install sdk
install_path, install_script = os.path.split(os.path.abspath(__file__))
curr_path = os.getcwd()
freertos_sdk_path = ''
# in case user call this script not from current path
if (curr_path != install_path):
print("Please cd to install script path first !!!")
exit()
# get absolute path of sdk install dir
freertos_sdk_path = install_path
print("Standalone SDK at {}".format(freertos_sdk_path))
# Add standalone sdk
standalone_sdk_v="588db75e0ca38c0559563303d4ab8cbabab0e3ec"
if (install_platform == windows_x64):
standalone_path=freertos_sdk_path + '\\standalone'
else:
standalone_path=freertos_sdk_path + '/standalone'
standalone_branch="release_v1.3.1"
standalone_remote="https://gitee.com/phytium_embedded/phytium-standalone-sdk.git"
if not os.path.exists(standalone_path):
current_path = os.getcwd()
os.system("git clone -b {} {} {}".format(standalone_branch, standalone_remote,standalone_path))
os.chdir(standalone_path)# 切换工作路径至standalone 路径
os.system("git config core.sparsecheckout true")
os.system("git config advice.detachedHead false")
os.system("git sparse-checkout init")
# 适配 windows 环境,路径不兼容
os.system("git sparse-checkout set /arch \
/board \
/common \
/drivers \
/standalone.mk \
/lib \
/doc \
/third-party \
!/third-party/lwip-2.1.2/ports/arch \
/tools \
/soc")
os.system("git checkout {}".format(standalone_sdk_v))
print('Standalone sdk download is succeed')
else:
print('Standalone sdk is exist')
pass
## STEP 2: display success message and enable environment
print("Success!!! Phytium FreeRTOS SDK is Install at {}".format(freertos_sdk_path))
C
1
https://gitee.com/phytium_embedded/phytium-free-rtos-sdk.git
git@gitee.com:phytium_embedded/phytium-free-rtos-sdk.git
phytium_embedded
phytium-free-rtos-sdk
Phytium-FreeRTOS-SDK
master

搜索帮助