rel_1.6.0 init

This commit is contained in:
guocheng.kgc 2020-06-18 20:06:52 +08:00 committed by shengdong.dsd
commit 27b3e2883d
19359 changed files with 8093121 additions and 0 deletions

View file

@ -0,0 +1,10 @@
import sys, os
component_mk_str = "#warning: aos auto component, don't change everything here.\nNAME := auto_component\n$(NAME)_TYPE := kernel\n"
if len(sys.argv) == 2:
file_dir = os.path.join(os.getcwd(), sys.argv[1])
if not os.path.exists(file_dir):
os.makedirs(file_dir)
with open(os.path.join(file_dir, "auto_component.mk"), "w") as f:
f.write(component_mk_str)

View file

@ -0,0 +1,13 @@
import sys, os, json
if len(sys.argv) == 3:
file_dir = os.path.join(os.getcwd(), sys.argv[1])
if not os.path.exists(file_dir):
os.makedirs(file_dir)
dependency = eval(sys.argv[2])
for component in dependency:
dependency[component] = dependency[component].split()
with open(os.path.join(file_dir, "dependency.json"), "w") as f:
f.write(json.dumps(dependency, sort_keys=True, indent=4) +"\n")

View file

@ -0,0 +1,128 @@
import sys, os, json, glob, re
from itertools import chain
config_mk_str = ""
def process_config_mk(config_mk_file, filename):
global config_mk_str
config_mk_replace = False
config_mk_lines = config_mk_str.splitlines()
for i, line in enumerate(config_mk_lines):
if line.find("auto_component_SOURCES") != -1: #auto component line
if line.find(filename) == -1: #add source file to config.mk
replace_str = line + " " + filename
config_mk_lines[i] = replace_str
config_mk_replace = True
if config_mk_replace:
#auto component change config.mk.
buf = ""
for line in config_mk_lines:
buf += line + "\n"
config_mk_str = buf
with open(config_mk_file, "w") as config_mk:
config_mk.write(config_mk_str)
def process_component_test(source_directory):
global config_mk_str
test_register_src = "testcase_register.c"
code_list = []
source_codes = "/*\n * warning: testcase collection code is auto generate, please don't change!!!\n */\n\n"
source_codes += "#include <aos/aos.h>\n\n"
components = re.findall(r"COMPONENTS\s+\:\=\s+.+\n", config_mk_str)[0]
for name in components.split(" "):
if name.endswith("_test"):
location = name + "_LOCATION\s+\:\=\s+.+"
# find all source code files related to test components
for root, dirs, files in chain.from_iterable(os.walk(path.strip()) for path in \
re.findall(location, config_mk_str)[0].split(":= ")[1:]):
for source in [source for source in files if source.endswith(".c")]:
with open(os.path.join(root, source), "r") as head:
codes = head.read()
# find AOS_TESTCASE macro function
for code in re.findall("AOS_TESTCASE\s*\((.+\)\s*;)", codes):
code_list.append(code[:len(code)-2])
for code in code_list:
source_codes += "extern void %s(void);\n"%(code)
source_codes += "\nvoid add_test(void) {\n\n"
# temporary work around for the process sequence of mesh & netmgr testcase
mesh_test_code = ""
netmgr_test_code = ""
for code in code_list:
if code.find("mesh") == -1 and code.find("netmgr") == -1 :
source_codes += " %s();\n\n"%(code)
else:
if code.find("mesh") == -1:
netmgr_test_code = code
else:
mesh_test_code = code
if mesh_test_code:
source_codes += " %s();\n\n"%(mesh_test_code)
if netmgr_test_code:
source_codes += " %s();\n\n"%(netmgr_test_code)
source_codes += "}"
with open(os.path.join(source_directory, test_register_src), "w") as f:
f.write(source_codes)
process_config_mk(sys.argv[1], test_register_src)
def process_component_init(init_dir):
global config_mk_str
component_init_src = "component_init.c"
init_codes = "/*\n * warning: component init code, don't change!!!\n */\n\n#include <aos/aos.h>\n\nvoid aos_components_init(void) {\n"
# find all head file through config.mk
for root, dirs, files in chain.from_iterable(os.walk(path.strip()) for path in \
re.findall("AOS_SDK_INCLUDES\s+\+\=\s+(.+\n)", config_mk_str)[0].split("-I")[1:]):
for include in [include for include in files if include.endswith(".h")]:
with open(os.path.join(root, include), "r") as head:
code = head.read()
# find AOS_COMPONENT_INIT macro function
for init in re.findall("AOS_COMPONENT_INIT\s*\((.+\)\s*;)", code):
init_code = init.replace(',', '(', 1)
if init == init_code:#init function no argument
init_code = init[:len(init)-2] +'(' + init[len(init)-2:]
init_codes += ' ' + init_code + '\n'
init_codes += "}"
# write component init code.
with open(os.path.join(init_dir, component_init_src), "w") as f:
f.write(init_codes)
process_config_mk(sys.argv[1], component_init_src)
def main():
global config_mk_str
with open(sys.argv[1], "r") as f:
config_mk_str = f.read()
process_component_init(sys.argv[2])
process_component_test(sys.argv[2])
if __name__ == "__main__":
main()

View file

@ -0,0 +1,99 @@
#! /usr/bin/env python
# Load application to ram helper script
# Note: sys.stdout.flush() and sys.stderr.flush() are required for proper
# console output in eclipse
import os, sys, re, struct, platform, getopt, subprocess
from sys import platform as _platform
def print_usage():
print ""
print "Usage: Merge a bin file into an exist bin file, create one if target is not exist"
print sys.argv[0]
print "Optional Usage:"
print " [<-o> <target binary file>]"
print " The file that will be merged into, create <input binary file>_out if not defined."
print " [<-f> <the offset>]"
print " The input file will be merged into this address. 0x0 if not defined."
print " [-h | --help]"
print " Display usage"
print " [<input binary file>]"
print " The input file need to be merged into the exist file."
sys.stdout.flush()
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], 'o:f:h')
except getopt.GetoptError as err:
print str(err)
print_usage()
sys.exit(2)
OFFSET = 0
OUTPUT_FILE = 0
if not len(args) == 1:
print_usage()
sys.exit(2)
else:
INPUT_FILE = args[0]
if not os.path.exists(INPUT_FILE):
print "Please input an existed input binary file"
sys.exit(2)
for opt, arg in opts:
if opt == "-o":
OUTPUT_FILE = arg
elif opt == "-f":
OFFSET = int(arg, 16)
elif opt == "-h":
print_usage()
sys.exit()
if OUTPUT_FILE == 0:
OUTPUT_FILE = re.sub(r'.bin$', '.output.bin', INPUT_FILE)
input_file = open(INPUT_FILE, 'rb')
output_file = open(OUTPUT_FILE, 'ab')
input = input_file.read()
gap_szie = OFFSET - os.path.getsize(OUTPUT_FILE)
if gap_szie > 0:
output_file.seek(os.path.getsize(OUTPUT_FILE))
output_file.write('\xFF'*gap_szie)
output_file.write(input)
input_file.close()
output_file.close()
#app = moc_app.read()
# kernel = moc_kernel.read()
# crc = CRC16( bytes(app[8::]) )
# moc_app_output.write( struct.pack('<L', os.path.getsize(MOC_APP_FILE)-8 ) )
# moc_app_output.write( struct.pack('<HH', crc, crc ) )
# moc_app_output.write( bytes(app[8::]) )
# moc_ota_output.write( bytes(kernel) )
# moc_ota_output.seek(MOC_APP_OFFSET)
# # moc_ota_output.write( struct.pack('<L', os.path.getsize(MOC_APP_FILE)-8 ) )
# moc_ota_output.write( struct.pack('<HH', crc, crc ) )
# moc_ota_output.write( bytes(app[8::]) )
# moc_app.close()
# moc_kernel.close()
# moc_app_output.close()
# moc_ota_output.close()
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
pass

View file

@ -0,0 +1,34 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys, os, re
def gen_readme_file(bin_output_path, version):
readmename = os.path.join(bin_output_path, "readme.txt")
with open(readmename, "w") as f:
f.write("version : " + version + " \r\n")
def find_version(config_file):
version = None
with open(config_file, "r") as f:
config_mk_str = f.read()
find_str = re.search( r'DSYSINFO_APP_VERSION=.*', config_mk_str, re.M|re.I)
if find_str:
version = find_str.group()
version = version.replace('DSYSINFO_APP_VERSION=', '')
version = version.replace('\\"', '')
version = version.split()[0]
return version
def main():
bin_output_path = sys.argv[1]
config_file = sys.argv[2]
version = find_version(config_file)
if version:
gen_readme_file(bin_output_path, version)
if __name__ == "__main__":
main()

View file

@ -0,0 +1,517 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys,os,re
import time,logging
rootdirs = ['./board', \
'./bootloader', \
'./device', \
'./example', \
'./framework', \
'./include', \
'./kernel', \
'./platform', \
'./security', \
'./test', \
'./tools', \
'./utility']
filterType = ['gif','png','bmp','jpg','jpeg','rar','zip',
'ico','apk','ipa','doc','docx','xls','jar',
'xlsx','ppt','pptx','pdf','gz','pyc','class']
filterOutType = ['h','c','cpp','s','S','ld','i']
num = 0
syscall_num = 0
symbol_list = []
# DEBUG < INFO < WARNING < ERROR < CRITICAL
logging.basicConfig(level=logging.WARNING)
def search_symbols(path=None, cont=None):
if not path or not cont:
print('path or searchString is empty')
return
_loopFolder(path, cont)
return
def _loopFolder(path, cont):
arr = path.split('/')
if not arr[-1].startswith('.'): #Do not check hidden folders
if os.path.isdir(path):
folderList = os.listdir(path)
logging.debug(folderList)
for x in folderList:
_loopFolder(path + "/" + x, cont)
elif os.path.isfile(path):
_verifyContent(path, cont)
return
def _verifyContent(path, cont):
if path.split('.')[-1].lower() in filterType:
return
global num
global symbol_list
try:
fh = open(path, 'r+')
fhContent = fh.read()
fh.close()
symbols = re.findall(cont, fhContent, re.M | re.S)
if symbols:
logging.debug(symbols)
symbol_list.extend(symbols)
num += 1
logging.debug("%s" % (path))
except:
print "File '" + path + "'can't be read"
return
def _disableSyscall(sd_path):
if os.path.exists(sd_path):
fsn = open(sd_path, "r+") # read from syscall_num
sysdata = fsn.readlines()
fsn.seek(0)
for line in sysdata:
u = line[-(len(line) - line.find((" "))):-1]
logging.debug(u)
line = r"%s %s" %(0, u.strip()) + "\n"
fsn.write(line)
fsn.close()
return
def _writeSyscallData(sd_path):
if os.path.exists(sd_path):
fsd = open(sd_path, "r+") # read from syscall_data
else:
fsd = open(sd_path, "w+") # read from syscall_data
sysdata = fsd.readlines()
sysdata_num = len(sysdata)
global symbol_list
find = 0
for symbol in symbol_list: # write to syscall_data
for line in sysdata:
if(re.findall(r"\d+\s\d+\s" + symbol[1] + r"\s\".*?\"\s\".*?\"\n", line, re.M | re.S)):
serial_num = line.strip().split(" ", line.strip().count(" "))[1]
newline = r"%s %s %s %s %s" %(1, serial_num, symbol[1], "\"" + symbol[0] + "\"", "\"" + symbol[2] + "\"") + "\n"
find = 1
logging.debug(newline)
sysdata[sysdata.index(line)] = newline
break
if find == 0:
line = r"%s %s %s %s %s" %(1, sysdata_num, symbol[1], "\"" + symbol[0] + "\"", "\"" + symbol[2] + "\"") + "\n"
sysdata.append(line)
sysdata_num += 1
find = 0
fsd.truncate(0)
fsd.seek(0, 0)
fsd.writelines(sysdata)
fsd.flush()
fsd.close()
return
def _writeSyscallHeader(cr_path, sh_path, sd_path, sn_path, stype):
fcr = open(cr_path, 'r') # read copyright
copyright = fcr.read()
fcr.close()
fsh = open(sh_path, "w+") # creat syscall_tbl.h
fsh.seek(0, 0)
fsh.write(copyright)
fsh.write("#define SYSCALL_MAX 0" + "\n")
fsh.write("#define SYSCALL(nr, func) [nr] = func," + "\n\n")
if stype == "kernel":
fsh.write("const void *syscall_ktbl[] __attribute__ ((section(\".syscall_ktbl\"))) = {" + "\n")
elif stype == "framework":
fsh.write("const void *syscall_ftbl[] __attribute__ ((section(\".syscall_ftbl\"))) = {" + "\n")
fsh.write("[0 ... SYSCALL_MAX - 1] = (void *)NULL," + "\n\n")
fsn = open(sn_path, "w+") # creat syscall_num.h
fsn.seek(0, 0)
fsn.write(copyright)
if os.path.exists(sd_path):
fsd = open(sd_path, "r+") # read from syscall_data
else:
fsd = open(sd_path, "w+") # read from syscall_data
sysdata = fsd.readlines()
global syscall_num
syscall_num = len(sysdata)
global symbol_list
find = 0
for symbol in symbol_list: # write to syscall_data
for line in sysdata:
if(re.findall(r"\d+\s\d+\s" + symbol[1] + r"\s\".*?\"\s\".*?\"\n", line, re.M | re.S)):
serial_num = line.strip().split(" ", line.strip().count(" "))[1]
# create syscall_xtbl.h
strdef = "#define SYS_" + symbol[1].upper() + " " + serial_num + "\n"
strsysc = "SYSCALL(SYS_" + symbol[1].upper() + ", " + symbol[1] + ")"
fsh.write(strdef + strsysc + "\n")
fsh.write("\n")
# create syscall_xnum.h
fsn.write(strdef)
fsn.write("\n")
find = 1
if find == 0:
logging.error(symbol[1] + " not find of h file!")
find = 0
fsh.write("};" + "\n")
fsn.close()
fsd.close()
fsh.close()
return
def _writeSyscallUapi(sc_path, sd_path, ui_path, stype):
fui = open(ui_path, 'r') # read xsyscall_include
usys_incl = fui.read()
fui.close()
fsc = open(sc_path, "w+") # creat xsyscall_tbl.c
fsc.seek(0, 0)
fsc.write(usys_incl)
fsc.write("\n")
if os.path.exists(sd_path):
fsd = open(sd_path, "r+") # read from syscall_data
else:
fsd = open(sd_path, "w+") # read from syscall_data
fsdContent = fsd.read()
newsymbols = re.findall(r"(\d+)\s(\d+)\s(.*?)\s\"(.*?)\"\s\"(.*?)\"\n", fsdContent, re.M | re.S)
find = 0
global symbol_list
for ele in symbol_list: # write to syscall_data
for symbol in newsymbols:
if ele[1] == symbol[2]:
fsc.write(symbol[3].strip() + " " + symbol[2].strip() + "(")
snum = 0
seri = 0
conti = 0
variable_arg = 0
args_num = symbol[4].strip().count(",")
args = symbol[4].strip().split(",")
if r"(*)" in symbol[4].strip(): ######## fun((void (*)()))
for arg in args:
if r"(*)" in arg:
substr = arg.strip().split("(*")
fsc.write(substr[0] + "(*a" + str(snum) + substr[1])
snum += 1
if arg.count("(") != arg.count(")"):
conti = 1
else:
if conti == 1:
if r")" in arg:
fsc.write(arg.strip())
conti = 0
else:
fsc.write(arg.strip())
else:
if arg.strip() == r"...":
fsc.write(arg.strip())
snum += 1
variable_arg = 1
else:
fsc.write(arg.strip() + " a" + str(snum))
snum += 1
if seri != args_num:
fsc.write(", ")
seri += 1
elif r"..." in symbol[4].strip(): ######## fun(fmt, ...)
for arg in args:
if arg.strip() == r"...":
fsc.write(arg.strip())
snum += 1
variable_arg = 1
else:
fsc.write(arg.strip() + " a" + str(snum))
snum += 1
if seri != args_num:
fsc.write(", ")
seri += 1
elif r"void" == symbol[4].strip(): ######## fun(void)
fsc.write(symbol[4].strip())
else: ######## normal
for arg in args:
fsc.write(arg.strip() + " a" + str(snum))
snum += 1
if seri != args_num:
fsc.write(", ")
seri += 1
fsc.write(")" + "\n" + "{\n")
if variable_arg == 1:
if snum < 2:
snum = 2
fsc.write(" va_list args;\n char msg[128];\n int ret;\n\n memset(msg, 0, 128);\n\n")
fsc.write(" va_start(args, a" + str(snum - 2) + ");\n ret = vsnprintf(msg, 128, a" + str(snum - 2) + ", args);\n va_end(args);\n\n")
fsc.write(r" if (SYSCALL_TBL[" + "SYS_" + symbol[2].upper() + "] != NULL) {\n" + " ")
needreturn = 0
if symbol[3].strip() != r"void":
fsc.write("return ")
needreturn = 1
fsc.write("SYS_CALL" + str(snum) + "(SYS_" + symbol[2].upper() + ", " + symbol[3].strip())
snum = 0
conti = 0
if r"(*)" in symbol[4].strip(): ######## fun((void (*)()))
for arg in args:
if r"(*)" in arg:
fsc.write(", " + arg.strip())
if arg.count("(") == arg.count(")"):
fsc.write(", " + "a" + str(snum))
snum += 1
else:
conti = 1
else:
if conti == 1:
if r")" in arg:
fsc.write(", " + arg.strip() + ", " + "a" + str(snum))
snum += 1
conti = 0
else:
fsc.write(", " + arg.strip())
else:
if arg.strip() == r"...":
fsc.write(", " + "..." + "," + "msg")
else:
fsc.write(", " + arg.strip() + ", " + "a" + str(snum))
snum += 1
elif r"..." in symbol[4].strip(): ######## fun(fmt, ...)
for arg in args:
if arg.strip() == r"...":
fsc.write(", " + "..." + "," + "msg")
else:
fsc.write(", " + arg.strip() + ", " + "a" + str(snum))
snum += 1
else: ######## normal
if r"void" != symbol[4].strip():
for arg in args:
fsc.write(", " + arg.strip() + ", " + "a" + str(snum))
snum += 1
fsc.write(r");")
fsc.write("\n } else {\n" + " ")
fsc.write("LOGE(\"BINS\", \"%s is NULL in SYSCALL_TBL\", __func__);\n")
if needreturn == 1:
fsc.write(" return;\n")
fsc.write(" }\n}\n\n")
find = 1
if find == 0:
logging.error(ele[1] + " not find of c file!")
find = 0
fsc.close()
return
def _writeKsyscallMk(sm_path):
fsh = open(sm_path, "w+") # creat ksyscall.mk
fsh.seek(0, 0)
fsh.write(r"NAME := syscall_kapi" + "\n\n")
fsh.write(r"$(NAME)_TYPE := app&framework" + "\n\n")
fsh.write(r"$(NAME)_INCLUDES := ./ ../../../framework/fsyscall/syscall_kapi" + "\n\n")
fsh.write(r"$(NAME)_CFLAGS += -Wall -Werror" + "\n\n")
fsh.write(r"$(NAME)_SOURCES := syscall_kapi.c" + "\n\n")
fsh.write(r"GLOBAL_DEFINES += AOS_BINS" + "\n")
fsh.close()
return
def _writeFsyscallMk(sm_path):
fsh = open(sm_path, "w+") # creat fsyscall.mk
fsh.seek(0, 0)
fsh.write(r"NAME := syscall_fapi" + "\n\n")
fsh.write(r"$(NAME)_TYPE := app" + "\n\n")
fsh.write(r"$(NAME)_INCLUDES := ./ ../../../app/usyscall/syscall_fapi" + "\n\n")
fsh.write(r"$(NAME)_CFLAGS += -Wall -Werror" + "\n\n")
fsh.write(r"$(NAME)_SOURCES := syscall_fapi.c" + "\n\n")
fsh.write(r"GLOBAL_DEFINES += AOS_BINS" + "\n")
fsh.close()
return
def _modifySyscallMax(sc_path, snum):
fcr = open(sc_path, 'r+') # read syscall_tbl.c
tblc = fcr.readlines()
fcr.seek(0)
logging.debug(snum)
for line in tblc:
if(line.find(r"#define SYSCALL_MAX") == 0):
line = r"#define SYSCALL_MAX %s" % (snum + 1) + "\n"
fcr.write(line)
fcr.close()
return
def _removeSyscallData(sd_path):
if os.path.exists(sd_path):
logging.debug(sd_path)
os.remove(sd_path) # remove syscall_num
return
def _preCreateSyscall(path):
fpath = open(path, "w+")
fpath.close()
return
def main():
syscall_path = sys.argv[1]
logging.info(sys.argv[1])
# stage for create syscall, pre-create/create
syscall_stage = sys.argv[2]
logging.info(sys.argv[2])
search_string = r"AOS_EXPORT\((.*?)\s*?\,\s*?[\\|\s]\s*?(\S*?)\s*?\,\s*?(.*?)\);$"
syscall_data_path = r"./build/scripts/syscall_data"
copyright_path = r"./build/copyright"
ksearch_rootdirs = syscall_path + r"/precompile/kernel"
ksearch_rootdirs_additional = r"kernel/ksyscall"
fsearch_rootdirs = syscall_path + r"/precompile/framework"
fsearch_rootdirs_additional = r"framework/fsyscall"
ksyscall_kapi_path = syscall_path + r"/syscall/syscall_kapi/syscall_kapi.c"
ksyscall_tbl_path = syscall_path + r"/syscall/syscall_kapi/syscall_ktbl.h"
ksyscall_num_path = syscall_path + r"/syscall/syscall_kapi/syscall_knum.h"
ksyscall_mk_path = syscall_path + r"/syscall/syscall_kapi/syscall_kapi.mk"
ksyscall_data_path = r"./build/scripts/syscall_kdata"
ksyscall_incl_path = r"./framework/fsyscall/syscall_kapi/syscall_kapi.h"
fsyscall_fapi_path = syscall_path + r"/syscall/syscall_fapi/syscall_fapi.c"
fsyscall_tbl_path = syscall_path + r"/syscall/syscall_fapi/syscall_ftbl.h"
fsyscall_num_path = syscall_path + r"/syscall/syscall_fapi/syscall_fnum.h"
fsyscall_mk_path = syscall_path + r"/syscall/syscall_fapi/syscall_fapi.mk"
fsyscall_data_path = r"./build/scripts/syscall_fdata"
fsyscall_incl_path = r"./app/usyscall/syscall_fapi.h"
global symbol_list
global num
global syscall_num
if syscall_stage == r"pre-create":
starttime = time.time()
# pre-create ksyscall
_preCreateSyscall(ksyscall_kapi_path)
_preCreateSyscall(ksyscall_tbl_path)
_preCreateSyscall(ksyscall_num_path)
_writeKsyscallMk(ksyscall_mk_path)
# pre-create fsyscall
_preCreateSyscall(fsyscall_fapi_path)
_preCreateSyscall(fsyscall_tbl_path)
_preCreateSyscall(fsyscall_num_path)
_writeFsyscallMk(fsyscall_mk_path)
# Search for each directory, find the symbol
for rootdir in rootdirs:
search_symbols(rootdir, search_string)
# Remove duplicate element & Element sorting
symbol_list = sorted(set(symbol_list),key=symbol_list.index)
symbol_list = sorted(symbol_list, key=lambda fun: fun[1].lower())
# set syscall serial num to 0
_disableSyscall(syscall_data_path)
# Creat and write to syscall_data
_writeSyscallData(syscall_data_path)
endtime = time.time()
logging.info(" pre-create total time: %s s." % (endtime - starttime))
elif syscall_stage == r"create":
symbol_list = []
num = 0
starttime = time.time()
######################## ksyscall ##############################
# Search for each directory, find the symbol
search_symbols(ksearch_rootdirs, search_string)
#search_symbols(ksearch_rootdirs_additional, search_string)
# Remove duplicate element & Element sorting
symbol_list = sorted(set(symbol_list),key=symbol_list.index)
symbol_list = sorted(symbol_list, key=lambda fun: fun[1].lower())
stype = "kernel"
logging.info("======================================")
logging.info(" ksyscall new symbol:")
# Creat and write to syscall_ktbl.h syscall_knum.h syscall_kdata
_writeSyscallHeader(copyright_path, ksyscall_tbl_path, syscall_data_path, ksyscall_num_path, stype)
logging.info("======================================")
# Creat and write to syscall_kapi.c
_writeSyscallUapi(ksyscall_kapi_path, syscall_data_path, ksyscall_incl_path, stype)
# Creat and write to ksyscall.mk
#_writeKsyscallMk(ksyscall_mk_path)
#modify SYSCALL_MAX
_modifySyscallMax(ksyscall_tbl_path, syscall_num)
print "======================================"
print (" create ksyscall file:")
print (" total: %s ksymbol find." % len(symbol_list))
print (" total: %s file find." % num)
print "--------------------------------------"
######################## fsyscall ##############################
# reset global variable
symbol_list = []
num = 0
# Search for each directory, find the symbol
search_symbols(fsearch_rootdirs, search_string)
#search_symbols(fsearch_rootdirs_additional, search_string)
# Remove duplicate element & Element sorting
symbol_list = sorted(set(symbol_list),key=symbol_list.index)
symbol_list = sorted(symbol_list, key=lambda fun: fun[1].lower())
stype = "framework"
logging.info("======================================")
logging.info(" fsyscall new symbol:")
# Creat and write to syscall_ftbl.h syscall_fnum.h syscall_fdata
_writeSyscallHeader(copyright_path, fsyscall_tbl_path, syscall_data_path, fsyscall_num_path, stype)
logging.info("======================================")
# Creat and write to syscall_fapi.c
_writeSyscallUapi(fsyscall_fapi_path, syscall_data_path, fsyscall_incl_path, stype)
# Creat and write to fsyscall.mk
#_writeFsyscallMk(fsyscall_mk_path)
#modify SYSCALL_MAX
_modifySyscallMax(fsyscall_tbl_path, syscall_num)
endtime = time.time()
print (" create fsyscall file:")
print (" total: %s fsymbol find." % len(symbol_list))
print (" total: %s file find." % num)
print "--------------------------------------"
print (" total time: %s s." % (endtime - starttime))
print "======================================"
if __name__ == "__main__":
main()

View file

@ -0,0 +1,17 @@
import sys, os, glob
if len(sys.argv) == 3:
file_dir = os.path.join(os.getcwd(), sys.argv[1])
if not os.path.exists(file_dir):
os.makedirs(file_dir)
else:
if os.path.exists("auto_component.mk"):
os.remove("auto_component.mk")
for f in os.listdir(sys.argv[1]):
if "test_collection" in f:
os.remove(sys.argv[1] + "/" + f)
file_obj = open(sys.argv[2], "w")
file_obj.write("")
file_obj.close()

View file

@ -0,0 +1,167 @@
import os
import sys
import string
import shutil
import xml.etree.ElementTree as etree
from xml.etree.ElementTree import SubElement
from os.path import basename
from xml_format import gen_indent
from config_mk import Projects
def add_group(parent, name, files, includes, project_path):
cur_encoding = sys.getfilesystemencoding()
group = SubElement(parent, 'group')
group_name = SubElement(group, 'name')
group_name.text = name
group_config = SubElement(group, 'configuration')
group_config_name = SubElement(group_config, 'name')
group_config_name.text = 'Debug'
group_config_settings = SubElement(group_config, 'settings')
group_settings_name = SubElement(group_config_settings, 'name')
group_settings_name.text = 'ICCARM'
group_settings_data = SubElement(group_config_settings, 'data')
group_data_option = SubElement(group_settings_data, 'option')
group_option_name = SubElement(group_data_option, 'name')
group_option_name.text = 'IExtraOptionsCheck'
group_option_state = SubElement(group_data_option, 'state')
group_option_state.text = '1'
group_data_option2 = SubElement(group_settings_data, 'option')
group_option_name = SubElement(group_data_option2, 'name')
group_option_name.text = 'IExtraOptions'
group_option_state = SubElement(group_data_option2, 'state')
group_option_state.text = '-f '+opt_dir+name+".c_opts"
group_data_option3 = SubElement(group_settings_data, 'option')
group_option_name = SubElement(group_data_option3, 'name')
group_option_name.text = 'CCIncludePath2'
for i in includes:
stateTemp = SubElement(group_data_option3, 'state')
stateTemp.text = (aos_relative_path + i).decode(cur_encoding)
group_config_settings2 = SubElement(group_config, 'settings')
group_settings_name = SubElement(group_config_settings2, 'name')
group_settings_name.text = 'AARM'
group_settings_data = SubElement(group_config_settings2, 'data')
group_data_option = SubElement(group_settings_data, 'option')
group_option_name = SubElement(group_data_option, 'name')
group_option_name.text = 'AExtraOptionsCheckV2'
group_option_state = SubElement(group_data_option, 'state')
group_option_state.text = '1'
group_data_option2 = SubElement(group_settings_data, 'option')
group_option_name = SubElement(group_data_option2, 'name')
group_option_name.text = 'AExtraOptionsV2'
group_option_state = SubElement(group_data_option2, 'state')
group_option_state.text = '-f '+opt_dir+name+".as_opts"
for f in files:
if repeat_path.count(f):
fnewName = f.replace('./','')
fnewName = fnewName.replace('/','_')
fnewPath = proj_output_dir+'/'+fnewName
#print 'copy', f, 'to', fnewPath
shutil.copyfile(f,fnewPath)
f = fnewPath
file = SubElement(group, 'file')
file_name = SubElement(file, 'name')
file_name.text = (aos_relative_path + f).decode(cur_encoding)
# automation to do
def changeItemForMcu( tree ):
for config in tree.findall('configuration'):
for settings in config.findall('settings'):
if settings.find('name').text == 'ILINK':
data = settings.find('data')
for option in data.findall('option'):
if option.find('name').text == 'IlinkOutputFile':
option.find('state').text = buildstring + '.out'
if option.find('name').text == 'IlinkIcfFile':
if 'starterkit' in buildstring:
option.find('state').text = '$PROJ_DIR$\../../../../'+'platform/mcu/stm32l4xx/src/STM32L433RC-Nucleo/STM32L433.icf'
if 'stm32l432' in buildstring:
option.find('state').text = '$PROJ_DIR$\../../../../'+'platform/mcu/stm32l4xx/src/STM32L432KC-Nucleo/STM32L432.icf'
work_space_content = '''<?xml version="1.0" encoding="UTF-8"?>
<workspace>
<project>
<path>$WS_DIR$\%s</path>
</project>
<batchBuild/>
</workspace>
'''
def gen_workspace(target):
# make an workspace
workspace = target.replace('.ewp', '.eww')
out = file(workspace, 'wb')
xml = work_space_content % (buildstring+'.ewp')
out.write(xml)
out.close()
repeat_path=[]
def gen_project(target, script):
project_path = os.path.dirname(os.path.abspath(target))
tree = etree.parse('build/scripts/template.ewp')
root = tree.getroot()
out = file(target, 'wb')
existedFileNameString=[]
# copy repeat source file and replace old one
for group in script:
for filePath in group['src']:
filename = os.path.splitext(basename(filePath))
if existedFileNameString.count(filename):
repeat_path.append(filePath)
else:
existedFileNameString.append(filename)
if len(repeat_path):
print 'repeat name files:', repeat_path
print 'will copy them to '+proj_output_dir+'/ !'
# add group
for group in script:
add_group(root, group['name'], group['src'], group['include'], project_path)
changeItemForMcu(tree)
gen_indent(root)
projString = etree.tostring(root, encoding='utf-8')
if 'starterkit' in buildstring:
projString = projString.replace('STM32L475VG','STM32L433RC')
if 'stm32l432' in buildstring:
projString = projString.replace('STM32L475VG','STM32L432KC')
out.write(projString)
out.close()
gen_workspace(target)
#argv[1]: buildstring, eg: nano@b_l475e
buildstring = sys.argv[1]
proj_output_dir = 'projects/autogen/'+buildstring+'/iar_project'
#use in xml text
aos_relative_path = '$PROJ_DIR$\\' + '../../../../'
projectPath = proj_output_dir+'/'+buildstring+'.ewp'
opt_dir = '$PROJ_DIR$\\opts/'
print 'Making iar project '+buildstring
gen_project(projectPath, Projects)
print 'iar project: '+ projectPath + ' has generated over'

View file

@ -0,0 +1,40 @@
#! /usr/bin/env python
import os, sys, getopt
def print_usage():
print ""
print "Usage:"
print sys.argv[0]
print " Usage: return size of the input file"
sys.stdout.flush()
def main():
if not len(sys.argv)==2:
print_usage()
sys.exit(2)
IMAGE_FILE = sys.argv[1]
if not os.path.isfile(IMAGE_FILE):
print "Input a iamge file!"
sys.stdout.flush()
sys.exit()
if not os.path.exists(IMAGE_FILE):
print "Input image file not exist!"
sys.stdout.flush()
sys.exit()
image_size = os.path.getsize(IMAGE_FILE)
print image_size
sys.stdout.flush()
sys.exit(0)
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
pass

View file

@ -0,0 +1,149 @@
import os
import sys
import string
import xml.etree.ElementTree as etree
from xml.etree.ElementTree import SubElement
from xml_format import gen_indent
from config_mk import Projects
def file_type_value(fn):
if fn.endswith('.h'):
return 5
if fn.endswith('.s') or fn.endswith('.S'):
return 2
if fn.endswith('.lib') or fn.endswith('.a'):
return 4
if fn.endswith('.cpp') or fn.endswith('.cxx'):
return 8
if fn.endswith('.c') or fn.endswith('.C'):
return 1
return 5
#ProjectFiles use for remove same name files
#add files
def add_group(parent, name, files, project_path):
cur_encoding = sys.getfilesystemencoding()
group = SubElement(parent, 'Group')
group_name = SubElement(group, 'GroupName')
group_name.text = name
for f in files:
files = SubElement(group, 'Files')
file = SubElement(files, 'File')
file_name = SubElement(file, 'FileName')
name = os.path.basename(f)
file_name.text = name.decode(cur_encoding)
file_type = SubElement(file, 'FileType')
file_type.text = '%d' % file_type_value(name)
file_path = SubElement(file, 'FilePath')
file_path.text = (aos_relative_path + f).decode(cur_encoding)
return group
# automation to do
def changeItemForMcu( tree ):
ScatterFile = tree.find('Targets/Target/TargetOption/TargetArmAds/LDads/ScatterFile')
if 'starterkit' in buildstring:
ScatterFile.text = '..\..\..\..\platform\mcu\stm32l4xx\src\STM32L433RC-Nucleo\STM32L433.sct'
if 'stm32l432' in buildstring:
ScatterFile.text = '..\..\..\..\platform\mcu\stm32l4xx\src\STM32L432KC-Nucleo\STM32L432.sct'
# change key word in project file. automation to do
def ModifyProjString( projString ):
if 'starterkit' in buildstring:
projString = projString.replace('STM32L475VGTx','STM32L433RCTx')
if 'stm32l432' in buildstring:
projString = projString.replace('STM32L475VGTx','STM32L432KCTx')
return projString
def gen_project(tree, target, script):
project_path = os.path.dirname(os.path.abspath(target))
root = tree.getroot()
out = file(target, 'wb')
out.write('<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n')
#change target name
TargetName = tree.find('Targets/Target/TargetName')
TargetName.text = buildstring
OutputName = tree.find('Targets/Target/TargetOption/TargetCommonOption/OutputName')
OutputName.text = buildstring
# add group
groups = tree.find('Targets/Target/Groups')
if groups is None:
groups = SubElement(tree.find('Targets/Target'), 'Groups')
groups.clear() # clean old groups
for group in script:
# don't add an empty group
if len(group['src']) != 0:
group_tree = add_group(groups, group['name'], group['src'], project_path)
# add GroupOption
GroupOption = SubElement(group_tree, 'GroupOption')
GroupArmAds = SubElement(GroupOption, 'GroupArmAds')
Cads = SubElement(GroupArmAds, 'Cads')
VariousControls = SubElement(Cads, 'VariousControls')
MiscControls = SubElement(VariousControls, 'MiscControls')
MiscControls.text = '--via '+opt_dir+group['name']+'.c_opts'
Aads = SubElement(GroupArmAds, 'Aads')
VariousControls = SubElement(Aads, 'VariousControls')
MiscControls = SubElement(VariousControls, 'MiscControls')
MiscControls.text = '--via '+opt_dir+group['name']+'.as_opts'
# set <OutputName>B-L475E-IOT01</OutputName>
gen_indent(root)
changeItemForMcu(tree)
projString = ModifyProjString( etree.tostring(root, encoding='utf-8') )
out.write(projString)
out.close()
def gen_main(target, script):
template_tree = etree.parse('build/scripts/template.uvprojx')
# create uvprojx file
gen_project(template_tree, target, script)
# create uvoptx file
opt_file = target.replace('.uvprojx', '.uvoptx')
opt_tree = etree.parse('build/scripts/template.uvoptx')
TargetName = opt_tree.find('Target/TargetName')
TargetName.text = buildstring
out = file(opt_file, 'wb')
projString = ModifyProjString( etree.tostring(opt_tree.getroot(), encoding='utf-8') )
out.write(projString)
out.close()
'''
Projects = [
{'name':'alicrypto',
'src':[
'a.c',
'a_1.s',
]
},
{'name':'alinkapp',
'src':[
'./example/alinkapp/alink_sample.c',
]
}
]
'''
#argv[1]: buildstring, eg: nano@b_l475e
buildstring = sys.argv[1]
proj_output_dir = 'projects/autogen/'+buildstring+'/keil_project'
#use in xml text
aos_relative_path = '../../../../'
projectPath = proj_output_dir+'/'+buildstring+'.uvprojx'
opt_dir = 'opts/'
print 'Making keil project '+buildstring
gen_main(projectPath, Projects)
print 'keil project: '+ projectPath + ' has generated over'

View file

@ -0,0 +1,104 @@
#!/usr/bin/python
import sys
import re
def get_mem_info(map_file):
total_ram = 0
total_rom = 0
map_lines = []
with open(map_file, 'r') as f:
s = f.read()
# find the memory configuration
mem_config_list = re.findall('Memory Configuration\r?\n\r?\nName Origin Length Attributes\r?\n([\s\S]+)\r?\nLinker script and memory map', s)
mem_config_text = '' if not mem_config_list else mem_config_list[0]
if not mem_config_text:
print 'Can\'t parse memory configure, memory info get fail!'
return
# find the ROM configuration
rom_config_text = re.findall('\w+\s+(0x\w+)\s+(0x\w+)\s+(?:xr|r)\r?\n',mem_config_text)
# get every ROM configuration's start - end address
rom_config = []
for rom in rom_config_text:
rom_config += [{'start':int(rom[0], 16), 'end':int(rom[0], 16) + int(rom[1], 16)}]
# find the RAM configuration
ram_config_text = re.findall('\w+\s+(0x\w+)\s+(0x\w+)\s+(?:xrw|rw)\r?\n',mem_config_text)
if (len(ram_config_text)+len(rom_config_text)) == 0:
ram_config_text = re.findall('\*default\*\s+(0x\w+)\s+(0x\w+)\r?\n',mem_config_text)
print ('no definite address hint,using default mem configuration')
# get every RAM configuration's start - end address
ram_config = []
for ram in ram_config_text:
ram_config += [{'start':int(ram[0], 16), 'end':int(ram[0], 16) + int(ram[1], 16)}]
# find memory map (without discard and debug sections)
mem_map_list = re.findall('Linker script and memory map([\s\S]+?)OUTPUT\('+map_file.replace('.map','.elf'), s)
mem_map = '' if not mem_map_list else mem_map_list[0]
if not mem_map:
print 'Can\'t parse memory info, memory info get fail!'
return
mem_map = mem_map.replace('\r', '')
modules = []
for l in mem_map.split('\n'):
m = re.search('0x\w+\s+0x\w+\s+.+?([^/\\\]+\.[ao])\((.+\.o)\)', l)
if m == None:
continue
modules.append(m.groups()[0])
modules = list(set(modules))
# find sections address - length in memory map
# modules = list(set(item[0] for item in re.findall('0x\w+\s+0x\w+\s+.+?([^/\\\]+\.[ao])(\(.+\.o\))?\r?\n', mem_map)))
modules.sort(key = lambda x : x.upper())
modules += ['*fill*']
for module in modules:
rom_size = 0
ram_size = 0
module = module.replace('+', '\+')
# get module's sections's address and size
if(module == '*fill*'):
sections = map(lambda arg : {'address':int(arg[0], 16), 'size':int(arg[1], 16)}, re.findall('\*fill\*[ \t]+(0x\w+)[ \t]+(0x\w+)[ \t]+\r?\n', mem_map))
else:
sections = map(lambda arg : {'address':int(arg[0], 16), 'size':int(arg[1], 16)}, re.findall('(0x\w+)[ \t]+(0x\w+)[ \t]+.+[/\\\]'+module+'(\(.+\.o\))?\r?\n', mem_map))
if(not sections):
continue
def ram_size_def(arg):
for ram_info in ram_config:
if(ram_info['start'] <= arg['address'] < ram_info['end']):
return arg['size']
return 0
def rom_size_def(arg):
for rom_info in rom_config:
if(rom_info['start'] <= arg['address'] < rom_info['end']):
return arg['size']
return 0
ram_size = reduce(lambda x,y:x+y, map(ram_size_def, sections))
rom_size = reduce(lambda x,y:x+y, map(rom_size_def, sections))
total_ram += ram_size
total_rom += rom_size
map_lines.append('| %-40s | %-8d | %-8d |'%(re.sub('\.[ao]','',module)[:40],rom_size,ram_size))
print '\n AOS MEMORY MAP '
print '|=================================================================|'
print '| %-40s | %-8s | %-8s |'%('MODULE','ROM','RAM')
print '|=================================================================|'
for line in map_lines:
print line
print '|=================================================================|'
print '| %-40s | %-8d | %-8d |'%('TOTAL (bytes)', total_rom, total_ram)
print '|=================================================================|'
def main():
get_mem_info(sys.argv[1])
if __name__ == "__main__":
main()

View file

@ -0,0 +1,84 @@
#! /usr/bin/env python
import os, sys, re, struct, platform, getopt, subprocess
from sys import platform as _platform
import array,hashlib,struct
def crc16A(dat):
crc=0xFFFF #65535
index=0
for j in dat:
crc=crc^j
print("crc=%x"%crc)
for i in range(8):
if (crc & 1)==1:
crc =crc >> 1
crc =crc ^ 0xA001 #40961
else:
crc=crc>>1
return crc
def print_usage():
print ""
print "Usage: Merge a bin file into an exist bin file, create one if target is not exist"
print sys.argv[0]
print "Optional Usage:"
print " [-o] <target binary file>"
print " [-h | --help] Display usage"
print " [<input binary file>]"
sys.stdout.flush()
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], 'o:h')
except getopt.GetoptError as err:
print str(err)
print_usage()
sys.exit(2)
OUTPUT_FILE = 0
if not len(args) == 1:
print_usage()
sys.exit(2)
else:
INPUT_FILE = args[0]
if not os.path.exists(INPUT_FILE):
print "Please input a binary file"
sys.exit(2)
for opt, arg in opts:
if opt == "-o":
OUTPUT_FILE = arg
elif opt == "-h":
print_usage()
sys.exit()
if OUTPUT_FILE == 0:
OUTPUT_FILE = re.sub(r'.bin$', '.md5.bin', INPUT_FILE)
fin = open(INPUT_FILE, 'rb')
fout = open(OUTPUT_FILE, 'wb')
data = fin.read()
fout.write(data)
magic = bytearray([0xef,0xef,0xef,0xef])
size = os.path.getsize(INPUT_FILE)
print size
fout.write(magic)
fout.write(struct.pack('<I', size))
fout.write(hashlib.md5(data).digest())
print(hashlib.md5(data).hexdigest())
reserve = bytearray([0xFF,0xFF])
fout.write(reserve)
fout.write(reserve)
fin.close()
fout.close()
os.remove(INPUT_FILE)
os.rename(OUTPUT_FILE,INPUT_FILE)
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
pass

View file

@ -0,0 +1,194 @@
1 0 ali_aes_finish "ali_crypto_result" " const uint8_t *, size_t, uint8_t *, size_t *, sym_padding_t, void *"
1 1 ali_aes_get_ctx_size "ali_crypto_result" " aes_type_t, size_t *"
1 2 ali_aes_init "ali_crypto_result" " aes_type_t, bool, const uint8_t *, const uint8_t *, size_t, const uint8_t *, void *"
1 3 alink_enable_daily_mode "int" " const char *, int"
1 4 alink_enable_sandbox_mode "int" " void"
1 5 alink_end "int" " void"
1 6 alink_factory_reset "int" " void"
1 7 alink_register_callback "int" " unsigned char, void *"
1 8 alink_report_async "int" " const char *, const char *, void *(*)(void *), void *"
1 9 alink_start "int" " void"
1 10 aos_alloc_trace "void" " void *, size_t"
1 11 aos_cancel_delayed_action "void" " int, aos_call_t, void *"
1 12 aos_cancel_poll_read_fd "void" " int, aos_poll_call_t, void *"
1 13 aos_cancel_work "void" " void *, aos_call_t, void *"
1 14 aos_cli_get_tag "const char *" " void"
1 15 aos_cli_init "int" " void"
1 16 aos_cli_register_command "int" " const struct cli_command *"
1 17 aos_cli_register_commands "int" " const struct cli_command *, int"
1 18 aos_cli_stop "int" " void"
1 19 aos_cli_unregister_command "int" " const struct cli_command *"
1 20 aos_cli_unregister_commands "int" " const struct cli_command *, int"
1 21 aos_close "int" " int"
1 22 aos_closedir "int" " aos_dir_t *"
1 23 aos_cloud_register_backend "void" " int (*)(const char *, const char *)"
1 24 aos_cloud_register_callback "int" " int, aos_cloud_cb_t"
1 25 aos_cloud_report "int" " const char *, const char *, void (*)(void *), void *"
1 26 aos_cloud_trigger "void" " int, const char *"
1 27 aos_current_loop "aos_loop_t" " void"
1 28 aos_fcntl "int" " int, int, int"
1 29 aos_free "void" " void *"
1 30 aos_get_hz "int" " void"
1 31 aos_ioctl "int" " int, int, unsigned long"
1 32 aos_kv_del "int" " const char *"
1 33 aos_kv_get "int" "const char *, void *, int *"
1 34 aos_kv_set "int" " const char *, const void *, int, int"
1 35 aos_loop_destroy "void" " void"
1 36 aos_loop_exit "void" " void"
1 37 aos_loop_init "aos_loop_t" " void"
1 38 aos_loop_run "void" " void"
1 39 aos_loop_schedule_call "int" " aos_loop_t *, aos_call_t, void *"
1 40 aos_loop_schedule_work "void *" " int, aos_call_t, void *, aos_call_t, void *"
1 41 aos_lseek "off_t" " int, off_t, int"
1 42 aos_mkdir "int" " const char *"
1 43 aos_msleep "void" " int"
1 44 aos_mutex_free "void" " aos_mutex_t *"
1 45 aos_mutex_lock "int" " aos_mutex_t *, unsigned int"
1 46 aos_mutex_new "int" " aos_mutex_t *"
1 47 aos_mutex_unlock "int" " aos_mutex_t *"
1 48 aos_now "long long" " void"
1 49 aos_now_ms "long long" " void"
1 50 aos_open "int" " const char *, int"
1 51 aos_opendir "aos_dir_t *" " const char *"
1 52 aos_poll "int" " struct pollfd *, int, int"
1 53 aos_poll_read_fd "int" " int, aos_poll_call_t, void *"
1 54 aos_post_delayed_action "int" " int, aos_call_t, void *"
1 55 aos_post_event "int" " uint16_t, uint16_t, unsigned long"
1 56 aos_queue_free "void" " aos_queue_t *"
1 57 aos_queue_new "int" " aos_queue_t *, void *, unsigned int, int"
1 58 aos_queue_recv "int" " aos_queue_t *, unsigned int, void *, unsigned int *"
1 59 aos_queue_send "int" " aos_queue_t *, void *, unsigned int"
1 60 aos_read "ssize_t" " int, void *, size_t"
1 61 aos_readdir "aos_dirent_t *" " aos_dir_t *"
1 62 aos_reboot "void" " void"
1 63 aos_register_event_filter "int" " uint16_t, aos_event_cb, void *"
1 64 aos_rename "int" " const char *, const char *"
1 65 aos_schedule_call "int" " aos_call_t, void *"
1 66 aos_sem_free "void" " aos_sem_t *"
1 67 aos_sem_new "int" " aos_sem_t *, int"
1 68 aos_sem_signal "void" " aos_sem_t *"
1 69 aos_sem_wait "int" " aos_sem_t *, unsigned int"
1 70 aos_stat "int" " const char *, struct stat *"
1 71 aos_sync "int" " int"
1 72 aos_task_exit "void" " int"
1 73 aos_task_getspecific "void *" " aos_task_key_t"
1 74 aos_task_key_create "int" " aos_task_key_t *"
1 75 aos_task_key_delete "void" " aos_task_key_t"
1 76 aos_task_name "const char *" " void"
1 77 aos_task_new "int" " const char *, void (*)(void *), void *, int"
1 78 aos_task_new_ext "int" " aos_task_t *, const char *, void (*)(void *), void *, int, int"
1 79 aos_task_setspecific "int" " aos_task_key_t, void *"
1 80 aos_timer_change "int" " aos_timer_t *, int"
1 81 aos_timer_free "void" " aos_timer_t *"
1 82 aos_timer_new "int" " aos_timer_t *, void (*)(void *, void *), void *, int, int"
1 83 aos_timer_new_ext "int" " aos_timer_t *, void (*)(void *, void *), void *, int, int, unsigned char"
1 84 aos_timer_start "int" " aos_timer_t *"
1 85 aos_timer_stop "int" " aos_timer_t *"
1 86 aos_uart_send "int32_t" " void *, uint32_t, uint32_t"
1 87 aos_unlink "int" " const char *"
1 88 aos_unregister_event_filter "int" " uint16_t, aos_event_cb, void *"
1 89 aos_version_get "const char *" " void"
1 90 aos_work_cancel "int" " aos_work_t *"
1 91 aos_work_destroy "void" " aos_work_t *"
1 92 aos_work_init "int" " aos_work_t *, void (*)(void *), void *, int"
1 93 aos_work_run "int" " aos_workqueue_t *, aos_work_t *"
1 94 aos_work_sched "int" " aos_work_t *"
1 95 aos_workqueue_create "int" " aos_workqueue_t *, int, int"
1 96 aos_workqueue_del "void" " aos_workqueue_t *"
1 97 aos_write "ssize_t" " int, const void *, size_t"
1 98 awss_register_callback "int" " unsigned char, void *"
1 99 awss_registrar_init "void" " void"
1 100 cloud_is_connected "int" " void"
1 101 config_get_main_uuid "char *" " void"
1 102 gateway_get_uuid "const char *" " void"
1 103 gateway_is_connected "bool" " void"
1 104 get_errno "int" " void"
1 105 hal_ota_get_default_module "hal_ota_module_t *" " void"
1 106 hal_ota_init "hal_stat_t" " void *"
1 107 hal_ota_read "hal_stat_t" " hal_ota_module_t *, volatile uint32_t *, uint8_t *, uint32_t"
1 108 hal_ota_register_module "void" " hal_ota_module_t *"
1 109 hal_ota_set_boot "hal_stat_t" " hal_ota_module_t *, void *"
1 110 hal_ota_write "hal_stat_t" " hal_ota_module_t *, volatile uint32_t *, uint8_t * , uint32_t"
1 111 hal_wifi_get_default_module "hal_wifi_module_t *" " void"
1 112 hal_wifi_get_ip_stat "int" " hal_wifi_module_t *, hal_wifi_ip_stat_t *, hal_wifi_type_t"
1 113 hal_wifi_get_link_stat "int" " hal_wifi_module_t *, hal_wifi_link_stat_t *"
1 114 hal_wifi_get_mac_addr "int" " hal_wifi_module_t *, uint8_t *"
1 115 hal_wifi_init "int" " void"
1 116 hal_wifi_install_event "void" " hal_wifi_module_t *, const hal_wifi_event_cb_t *"
1 117 hal_wifi_power_off "int" " hal_wifi_module_t *"
1 118 hal_wifi_power_on "int" " hal_wifi_module_t *"
1 119 hal_wifi_register_module "void" " hal_wifi_module_t *"
1 120 hal_wifi_register_monitor_cb "void" " hal_wifi_module_t *, monitor_data_cb_t"
1 121 hal_wifi_set_channel "int" " hal_wifi_module_t *, int"
1 122 hal_wifi_set_mac_addr "int" " hal_wifi_module_t *, const uint8_t *"
1 123 hal_wifi_start "int" " hal_wifi_module_t *, hal_wifi_init_type_t *"
1 124 hal_wifi_start_adv "int" " hal_wifi_module_t *, hal_wifi_init_type_adv_t *"
1 125 hal_wifi_start_scan "void" " hal_wifi_module_t *"
1 126 hal_wifi_start_scan_adv "void" " hal_wifi_module_t *"
1 127 hal_wifi_start_wifi_monitor "void" " hal_wifi_module_t *"
1 128 hal_wifi_stop_wifi_monitor "void" " hal_wifi_module_t *"
1 129 hal_wifi_suspend "int" " hal_wifi_module_t *"
1 130 hal_wifi_suspend_soft_ap "int" " hal_wifi_module_t *"
1 131 hal_wifi_suspend_station "int" " hal_wifi_module_t *"
1 132 hal_wlan_register_mgnt_monitor_cb "void" " hal_wifi_module_t *, monitor_data_cb_t"
1 133 hal_wlan_send_80211_raw_frame "int" " hal_wifi_module_t *, uint8_t *, int"
1 134 ip4addr_aton "int" " const char *, ip4_addr_t *"
1 135 ip4addr_ntoa "char *" " const ip4_addr_t *"
1 136 ipaddr_addr "u32_t" " const char *"
1 137 json_get_value_by_name "char *" " char *, int, char *, int *, int *"
1 138 lwip_accept "int" " int, struct sockaddr *, socklen_t *"
1 139 lwip_bind "int" " int, const struct sockaddr *, socklen_t"
1 140 lwip_close "int" " int"
1 141 lwip_connect "int" " int, const struct sockaddr *, socklen_t"
1 142 lwip_eventfd "int" " unsigned int, int"
1 143 lwip_fcntl "int" " int, int, int"
1 144 lwip_freeaddrinfo "void" " struct addrinfo *"
1 145 lwip_getaddrinfo "int" " const char *, const char *, const struct addrinfo *, struct addrinfo **"
1 146 lwip_gethostbyname "struct hostent *" " const char *"
1 147 lwip_getpeername "int" " int, struct sockaddr *, socklen_t *"
1 148 lwip_getsockname "int" " int, struct sockaddr *, socklen_t *"
1 149 lwip_getsockopt "int" " int, int, int, void *, socklen_t *"
1 150 lwip_htonl "u32_t" " u32_t"
1 151 lwip_htons "u16_t" " u16_t"
1 152 lwip_ioctl "int" " int, long, void *"
1 153 lwip_listen "int" " int, int"
1 154 lwip_read "int" " int, void *, size_t"
1 155 lwip_recv "int" " int, void *, size_t, int"
1 156 lwip_recvfrom "int" " int, void *, size_t, int, struct sockaddr *, socklen_t *"
1 157 lwip_select "int" " int, fd_set *, fd_set *, fd_set *, struct timeval *"
1 158 lwip_send "int" " int, const void *, size_t, int"
1 159 lwip_sendmsg "int" " int, const struct msghdr *, int"
1 160 lwip_sendto "int" " int, const void *, size_t, int, const struct sockaddr *, socklen_t"
1 161 lwip_setsockopt "int" " int, int, int, const void *, socklen_t"
1 162 lwip_shutdown "int" " int, int"
1 163 lwip_socket "int" " int, int, int"
1 164 lwip_write "int" " int, const void *, size_t"
1 165 lwip_writev "int" " int, const struct iovec *, int"
1 166 mbedtls_ssl_close "int" " void *"
1 167 mbedtls_ssl_connect "void *" " void *, const char *, int"
1 168 mbedtls_ssl_recv "int" " void *, char *, int"
1 169 mbedtls_ssl_send "int" " void *, const char *, int"
1 170 netmgr_clear_ap_config "void" " void"
1 171 netmgr_init "int" " void"
1 172 netmgr_start "int" " bool"
1 173 set_errno "void" " int"
1 174 sys_aos_malloc "void *" " unsigned int, size_t"
1 175 sys_aos_realloc "void *" " void *, unsigned int, size_t"
1 176 sys_aos_zalloc "void *" " unsigned int, size_t"
1 177 umesh_get_device_state "uint8_t" " void"
1 178 umesh_get_mac_address "const mac_address_t *" " media_type_t"
1 179 umesh_get_mode "uint8_t" " void"
1 180 umesh_init "ur_error_t" " node_mode_t"
1 181 umesh_set_mode "ur_error_t" " uint8_t"
1 182 umesh_start "ur_error_t" " void"
1 183 umesh_stop "ur_error_t" " void"
1 184 ur_adapter_get_default_ipaddr "const void *" " void"
1 185 ur_adapter_get_mcast_ipaddr "const void *" " void"
1 186 aos_fflush "int" " FILE *"
1 187 aos_vprintf "int" " char *, va_list"
1 188 tcp_init "void" " void"
1 189 udp_init "void" " void"
1 190 hal_wifi_get_channel "int" " hal_wifi_module_t *"
1 191 hal_wifi_get_channel_list "int" " hal_wifi_module_t *, const uint8_t **"
1 192 uData_report_publish "int" " void *"
1 193 uData_subscribe "int" " udata_type_e"

View file

@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Extensions>
<cExt>*.c</cExt>
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
</Extensions>
<DaveTm>
<dwLowDateTime>0</dwLowDateTime>
<dwHighDateTime>0</dwHighDateTime>
</DaveTm>
<Target>
<TargetName>B-L475E-IOT01</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<CLKADS>12000000</CLKADS>
<OPTTT>
<gFlags>1</gFlags>
<BeepAtEnd>1</BeepAtEnd>
<RunSim>0</RunSim>
<RunTarget>1</RunTarget>
<RunAbUc>0</RunAbUc>
</OPTTT>
<OPTHX>
<HexSelection>1</HexSelection>
<FlashByte>65535</FlashByte>
<HexRangeLowAddress>0</HexRangeLowAddress>
<HexRangeHighAddress>0</HexRangeHighAddress>
<HexOffset>0</HexOffset>
</OPTHX>
<OPTLEX>
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath>.\Listings\</ListingPath>
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
<CreateAListing>1</CreateAListing>
<CreateLListing>1</CreateLListing>
<CreateIListing>0</CreateIListing>
<AsmCond>1</AsmCond>
<AsmSymb>1</AsmSymb>
<AsmXref>0</AsmXref>
<CCond>1</CCond>
<CCode>0</CCode>
<CListInc>0</CListInc>
<CSymb>0</CSymb>
<LinkerCodeListing>0</LinkerCodeListing>
</ListingPage>
<OPTXL>
<LMap>1</LMap>
<LComments>1</LComments>
<LGenerateSymbols>1</LGenerateSymbols>
<LLibSym>1</LLibSym>
<LLines>1</LLines>
<LLocSym>1</LLocSym>
<LPubSym>1</LPubSym>
<LXref>0</LXref>
<LExpSel>0</LExpSel>
</OPTXL>
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<DebugOpt>
<uSim>0</uSim>
<uTrg>1</uTrg>
<sLdApp>1</sLdApp>
<sGomain>1</sGomain>
<sRbreak>1</sRbreak>
<sRwatch>1</sRwatch>
<sRmem>1</sRmem>
<sRfunc>1</sRfunc>
<sRbox>1</sRbox>
<tLdApp>1</tLdApp>
<tGomain>1</tGomain>
<tRbreak>1</tRbreak>
<tRwatch>1</tRwatch>
<tRmem>1</tRmem>
<tRfunc>0</tRfunc>
<tRbox>1</tRbox>
<tRtrace>1</tRtrace>
<sRSysVw>1</sRSysVw>
<tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime>
<nTsel>5</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
<sDlgPa></sDlgPa>
<sIfile></sIfile>
<tDll></tDll>
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMRTXEVENTFLAGS</Key>
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMDBGFLAGS</Key>
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
<Name>(105=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key>
<Name>-U066EFF323535474B43132235 -O206 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32L475VGTx$CMSIS\Flash\STM32L4xx_1024.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L475VGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
<periodic>0</periodic>
<aLwin>1</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
<aSer2>0</aSer2>
<aPa>0</aPa>
<viewmode>1</viewmode>
<vrSel>0</vrSel>
<aSym>0</aSym>
<aTbox>0</aTbox>
<AscS1>0</AscS1>
<AscS2>0</AscS2>
<AscS3>0</AscS3>
<aSer3>0</aSer3>
<eProf>0</eProf>
<aLa>0</aLa>
<aPa1>0</aPa1>
<AscS4>0</AscS4>
<aSer4>0</aSer4>
<StkLoc>0</StkLoc>
<TrcWin>0</TrcWin>
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto>
<Lin2Executable></Lin2Executable>
<Lin2ConfigFile></Lin2ConfigFile>
<bLin2Auto>0</bLin2Auto>
</TargetOption>
</Target>
</ProjectOpt>

View file

@ -0,0 +1,379 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
<SchemaVersion>2.1</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Targets>
<Target>
<TargetName>B-L475E-IOT01</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060300::V5.06 update 3 (build 300)::ARMCC</pCCUsed>
<TargetOption>
<TargetCommonOption>
<Device>STM32L475VGTx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32L4xx_DFP.2.0.0</PackID>
<PackURL>http://www.keil.com/pack</PackURL>
<Cpu>IRAM(0x20000000,0x00018000) IRAM2(0x10000000,0x00008000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L475VGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</FlashDriverDll>
<DeviceId>0</DeviceId>
<RegisterFile>$$Device:STM32L475VGTx$Drivers\CMSIS\Device\ST\STM32L4xx\Include\stm32l4xx.h</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
<Linker></Linker>
<OHString></OHString>
<InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile>$$Device:STM32L475VGTx$CMSIS\SVD\STM32L4x5.svd</SFDFile>
<bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv>
<BinPath></BinPath>
<IncludePath></IncludePath>
<LibPath></LibPath>
<RegisterFilePath></RegisterFilePath>
<DBRegisterFilePath></DBRegisterFilePath>
<TargetStatus>
<Error>0</Error>
<ExitCodeStop>0</ExitCodeStop>
<ButtonStop>0</ButtonStop>
<NotGenerated>0</NotGenerated>
<InvalidFlash>1</InvalidFlash>
</TargetStatus>
<OutputDirectory>.\Objects\</OutputDirectory>
<OutputName>B-L475E-IOT01</OutputName>
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>0</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath>.\Listings\</ListingPath>
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
<BeforeCompile>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopU1X>0</nStopU1X>
<nStopU2X>0</nStopU2X>
</BeforeCompile>
<BeforeMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X>
</BeforeMake>
<AfterMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name>fromelf.exe --bin -o "$L@L.bin" "#L"</UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopA1X>0</nStopA1X>
<nStopA2X>0</nStopA2X>
</AfterMake>
<SelectedForBatchBuild>0</SelectedForBatchBuild>
<SVCSIdString></SVCSIdString>
</TargetCommonOption>
<CommonProperty>
<UseCPPCompiler>0</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>1</IncludeInBuild>
<AlwaysBuild>0</AlwaysBuild>
<GenerateAssemblyFile>0</GenerateAssemblyFile>
<AssembleAssemblyFile>0</AssembleAssemblyFile>
<PublicsOnly>0</PublicsOnly>
<StopOnExitCode>3</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<DllOption>
<SimDllName>SARMCM3.DLL</SimDllName>
<SimDllArguments> -REMAP -MPU</SimDllArguments>
<SimDlgDll>DCM.DLL</SimDlgDll>
<SimDlgDllArguments>-pCM4</SimDlgDllArguments>
<TargetDllName>SARMCM3.DLL</TargetDllName>
<TargetDllArguments> -MPU</TargetDllArguments>
<TargetDlgDll>TCM.DLL</TargetDlgDll>
<TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
</DllOption>
<DebugOption>
<OPTHX>
<HexSelection>1</HexSelection>
<HexRangeLowAddress>0</HexRangeLowAddress>
<HexRangeHighAddress>0</HexRangeHighAddress>
<HexOffset>0</HexOffset>
<Oh166RecLen>16</Oh166RecLen>
</OPTHX>
</DebugOption>
<Utilities>
<Flash1>
<UseTargetDll>1</UseTargetDll>
<UseExternalTool>0</UseExternalTool>
<RunIndependent>0</RunIndependent>
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
<Capability>1</Capability>
<DriverSelection>4096</DriverSelection>
</Flash1>
<bUseTDR>1</bUseTDR>
<Flash2>BIN\UL2CM3.DLL</Flash2>
<Flash3>"" ()</Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
<pFcArmRoot></pFcArmRoot>
<FcArmLst>0</FcArmLst>
</Utilities>
<TargetArmAds>
<ArmAdsMisc>
<GenerateListings>0</GenerateListings>
<asHll>1</asHll>
<asAsm>1</asAsm>
<asMacX>1</asMacX>
<asSyms>1</asSyms>
<asFals>1</asFals>
<asDbgD>1</asDbgD>
<asForm>1</asForm>
<ldLst>0</ldLst>
<ldmm>1</ldmm>
<ldXref>1</ldXref>
<BigEnd>0</BigEnd>
<AdsALst>1</AdsALst>
<AdsACrf>1</AdsACrf>
<AdsANop>0</AdsANop>
<AdsANot>0</AdsANot>
<AdsLLst>1</AdsLLst>
<AdsLmap>1</AdsLmap>
<AdsLcgr>1</AdsLcgr>
<AdsLsym>1</AdsLsym>
<AdsLszi>1</AdsLszi>
<AdsLtoi>1</AdsLtoi>
<AdsLsun>1</AdsLsun>
<AdsLven>1</AdsLven>
<AdsLsxf>1</AdsLsxf>
<RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M4"</AdsCpuType>
<RvctDeviceName></RvctDeviceName>
<mOS>0</mOS>
<uocRom>0</uocRom>
<uocRam>0</uocRam>
<hadIROM>1</hadIROM>
<hadIRAM>1</hadIRAM>
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<hadIRAM2>1</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
<useUlib>1</useUlib>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
<nSecure>0</nSecure>
<RoSelD>3</RoSelD>
<RwSelD>4</RwSelD>
<CodeSel>0</CodeSel>
<OptFeed>0</OptFeed>
<NoZi1>0</NoZi1>
<NoZi2>0</NoZi2>
<NoZi3>0</NoZi3>
<NoZi4>0</NoZi4>
<NoZi5>0</NoZi5>
<Ro1Chk>0</Ro1Chk>
<Ro2Chk>0</Ro2Chk>
<Ro3Chk>0</Ro3Chk>
<Ir1Chk>1</Ir1Chk>
<Ir2Chk>0</Ir2Chk>
<Ra1Chk>0</Ra1Chk>
<Ra2Chk>0</Ra2Chk>
<Ra3Chk>0</Ra3Chk>
<Im1Chk>1</Im1Chk>
<Im2Chk>0</Im2Chk>
<OnChipMemories>
<Ocm1>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm1>
<Ocm2>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm2>
<Ocm3>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm3>
<Ocm4>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm4>
<Ocm5>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm5>
<Ocm6>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm6>
<IRAM>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x18000</Size>
</IRAM>
<IROM>
<Type>1</Type>
<StartAddress>0x8000000</StartAddress>
<Size>0x100000</Size>
</IROM>
<XRAM>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</XRAM>
<OCR_RVCT1>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT1>
<OCR_RVCT2>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT2>
<OCR_RVCT3>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x8000000</StartAddress>
<Size>0x100000</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT5>
<OCR_RVCT6>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT6>
<OCR_RVCT7>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT7>
<OCR_RVCT8>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT8>
<OCR_RVCT9>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x18000</Size>
</OCR_RVCT9>
<OCR_RVCT10>
<Type>0</Type>
<StartAddress>0x10000000</StartAddress>
<Size>0x8000</Size>
</OCR_RVCT10>
</OnChipMemories>
<RvctStartVector></RvctStartVector>
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>1</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>1</OneElfS>
<Strict>0</Strict>
<EnumInt>0</EnumInt>
<PlainCh>0</PlainCh>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<wLevel>2</wLevel>
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
<useXO>0</useXO>
<v6Lang>1</v6Lang>
<v6LangP>1</v6LangP>
<vShortEn>1</vShortEn>
<vShortWch>1</vShortWch>
<v6Lto>0</v6Lto>
<v6WtE>0</v6WtE>
<v6Rtti>0</v6Rtti>
<VariousControls>
</VariousControls>
</Cads>
<Aads>
<interw>1</interw>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<thumb>0</thumb>
<SplitLS>0</SplitLS>
<SwStkChk>0</SwStkChk>
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Aads>
<LDads>
<umfTarg>0</umfTarg>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<noStLib>0</noStLib>
<RepFail>1</RepFail>
<useFile>0</useFile>
<TextAddressRange>0x08000000</TextAddressRange>
<DataAddressRange>0x20000000</DataAddressRange>
<pXoBase></pXoBase>
<ScatterFile>..\..\..\..\platform\mcu\stm32l475\B-L475E-IOT01.sct</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc></Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
</TargetArmAds>
</TargetOption>
<Groups>
</Groups>
</Target>
</Targets>
</Project>

View file

@ -0,0 +1,117 @@
# arg mk_path: path to mk file
include $(mk_path)
ifeq ($(mk_path),)
$(error argument 'mk_path' is not set)
endif
exist = $(shell if [ -f $(mk_path) ]; then echo "exist"; else echo "notexist"; fi;)
ifeq ($(exist),notexist)
$(error $(mk_path) is not exist)
endif
py_path := $(dir $(mk_path) )/ucube.py
ECHO = echo
QUIET =@
#WRITE_FILE_CREATE =$(ECHO) '$(2)' > $(1);
#WRITE_FILE_APPEND =$(ECHO) '$(2)' >> $(1);
WRITE_FILE_CREATE =$(file >$(1),$(2))
WRITE_FILE_APPEND =$(file >>$(1),$(2))
empty =
tab_space =$(empty)
colon =:
split_start =Split('''
split_end = ''')
component_construct = aos_component('$(NAME)', src)
COMPONENT_DIRECTORIES := . \
example \
board \
kernel \
platform \
utility \
framework \
tools \
test \
device \
security
#$1 is the component dir path and mk file name
FIND_COMP_DIR =$(wildcard $(foreach dir, $(COMPONENT_DIRECTORIES), $(dir)/$(subst .,/,$1)))
all:
#NAME := board_b_l433
#$(NAME)_SOURCES += board.c
$(call WRITE_FILE_CREATE, $(py_path) ,src =$(split_start))
$(foreach src, $($(NAME)_SOURCES), $(call WRITE_FILE_APPEND, $(py_path),$(tab_space)$(src)) )
$(call WRITE_FILE_APPEND, $(py_path),$(split_end))
$(call WRITE_FILE_APPEND, $(py_path),component =$(component_construct))
#$(NAME)_COMPONENTS += sal
$(call WRITE_FILE_APPEND, $(py_path),)
ifneq ($($(NAME)_COMPONENTS),)
$(call WRITE_FILE_APPEND, $(py_path) ,dependencis =$(split_start))
$(foreach dep, $($(NAME)_COMPONENTS), $(call WRITE_FILE_APPEND, $(py_path),$(tab_space)$(call FIND_COMP_DIR,$(dep))))
$(call WRITE_FILE_APPEND, $(py_path),$(split_end))
$(call WRITE_FILE_APPEND, $(py_path),for i in dependencis$(colon))
$(call WRITE_FILE_APPEND, $(py_path),$(tab_space)component.add_comp_deps(i))
endif
#GLOBAL_INCLUDES += .
$(call WRITE_FILE_APPEND, $(py_path),)
ifneq ($(GLOBAL_INCLUDES),)
$(call WRITE_FILE_APPEND, $(py_path) ,global_includes =$(split_start))
$(foreach inc, $(GLOBAL_INCLUDES), $(call WRITE_FILE_APPEND, $(py_path),$(tab_space)$(inc)) )
$(call WRITE_FILE_APPEND, $(py_path),$(split_end))
$(call WRITE_FILE_APPEND, $(py_path),for i in global_includes$(colon))
$(call WRITE_FILE_APPEND, $(py_path),$(tab_space)component.add_global_includes(i))
endif
#GLOBAL_DEFINES += STDIO_UART=0
$(call WRITE_FILE_APPEND, $(py_path),)
ifneq ($(GLOBAL_DEFINES),)
$(call WRITE_FILE_APPEND, $(py_path) ,global_macros =$(split_start))
$(foreach macro, $(GLOBAL_DEFINES), $(call WRITE_FILE_APPEND, $(py_path),$(tab_space)$(macro)) )
$(call WRITE_FILE_APPEND, $(py_path),$(split_end))
$(call WRITE_FILE_APPEND, $(py_path),for i in global_macros$(colon))
$(call WRITE_FILE_APPEND, $(py_path),$(tab_space)component.add_global_macros(i))
endif
#$(NAME)_INCLUDES
$(call WRITE_FILE_APPEND, $(py_path),)
ifneq ($($(NAME)_INCLUDES),)
$(call WRITE_FILE_APPEND, $(py_path) ,includes =$(split_start))
$(foreach inc, $($(NAME)_INCLUDES), $(call WRITE_FILE_APPEND, $(py_path),$(tab_space)$(inc)) )
$(call WRITE_FILE_APPEND, $(py_path),$(split_end))
$(call WRITE_FILE_APPEND, $(py_path),for i in includes$(colon))
$(call WRITE_FILE_APPEND, $(py_path),$(tab_space)component.add_includes(i))
endif
#$(NAME)_DEFINES
$(call WRITE_FILE_APPEND, $(py_path),)
ifneq ($($(NAME)_DEFINES),)
$(call WRITE_FILE_APPEND, $(py_path) ,macros =$(split_start))
$(foreach macro, $($(NAME)_DEFINES), $(call WRITE_FILE_APPEND, $(py_path),$(tab_space)$(macro)) )
$(call WRITE_FILE_APPEND, $(py_path),$(split_end))
$(call WRITE_FILE_APPEND, $(py_path),for i in macros$(colon))
$(call WRITE_FILE_APPEND, $(py_path),$(tab_space)component.add_macros(i))
endif
#$(NAME)_CFLAGS
$(call WRITE_FILE_APPEND, $(py_path),)
ifneq ($($(NAME)_CFLAGS),)
$(call WRITE_FILE_APPEND, $(py_path) ,cflags =$(split_start))
$(foreach cflag, $($(NAME)_CFLAGS), $(call WRITE_FILE_APPEND, $(py_path),$(tab_space)$(cflag)) )
$(call WRITE_FILE_APPEND, $(py_path),$(split_end))
$(call WRITE_FILE_APPEND, $(py_path),for i in cflags$(colon))
$(call WRITE_FILE_APPEND, $(py_path),$(tab_space)component.add_cflags(i))
endif

View file

@ -0,0 +1,19 @@
cd `dirname $0`/../..
pwd
mk_paths=$(find . -type d \( -path ./build -o -path ./platform -o -path ./board \) -prune -o -name *.mk -a -print)
make_path="build/cmd/win32/make"
count=0
echo creating py_files:
for mk_path in ${mk_paths}; do
py_path=$(dirname $mk_path)"/ucube.py"
if [ ! -f $py_path ]; then
echo $py_path
((count=$count+1))
$make_path -f build/scripts/trans_mk2py.mk mk_path=$mk_path
fi
done
echo count: $count

View file

@ -0,0 +1,17 @@
import sys
import os
def gen_indent(elem, level=0):
i = "\n" + level*" "
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + " "
if not elem.tail or not elem.tail.strip():
elem.tail = i
for elem in elem:
gen_indent(elem, level+1)
if not elem.tail or not elem.tail.strip():
elem.tail = i
else:
if level and (not elem.tail or not elem.tail.strip()):
elem.tail = i