예제 #1
0
def dist_do_building(BSP_ROOT, dist_dir):
    from mkdist import bsp_copy_files
    import rtconfig

    print("=> copy ch32 bsp library")
    library_dir = os.path.join(dist_dir, 'Libraries')
    library_path = os.path.join(os.path.dirname(BSP_ROOT), 'Libraries')
    bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
                   os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))

    print("=> copy bsp drivers")
    bsp_copy_files(os.path.join(library_path, 'ch32_drivers'),
                   os.path.join(library_dir, 'ch32_drivers'))
    shutil.copyfile(os.path.join(library_path, 'Kconfig'),
                    os.path.join(library_dir, 'Kconfig'))
    # change RTT_ROOT in Kconfig
    if not os.path.isfile(os.path.join(dist_dir, 'Kconfig')):
        return

    with open(os.path.join(dist_dir, 'Kconfig'), 'r') as f:
        data = f.readlines()
    with open(os.path.join(dist_dir, 'Kconfig'), 'w') as f:
        found = 0
        for line in data:
            if line.find('RTT_ROOT') != -1:
                found = 1
            if line.find('../Libraries') != -1 and found:
                position = line.find('../Libraries')
                line = line[0:position] + 'Libraries/Kconfig"\n'
                found = 0
            f.write(line)
예제 #2
0
def dist_do_building(BSP_ROOT):
    from mkdist import bsp_copy_files

    dist_dir = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT))
    print("=> copy bsp library")
    library_path = os.path.join(os.path.dirname(os.path.dirname(BSP_ROOT)),
                                'libraries')
    library_dir = os.path.join(dist_dir, 'libraries')
    bsp_copy_files(library_path, library_dir)

    print("=> copy bsp drivers")
    driver_path = os.path.join(os.path.dirname(os.path.dirname(BSP_ROOT)),
                               'drivers')
    driver_dir = os.path.join(dist_dir, 'drivers')
    bsp_copy_files(driver_path, driver_dir)

    iar_template_file = os.path.join(dist_dir, 'template.ewp')
    try:
        if os.path.isfile(iar_template_file):
            with open(iar_template_file, 'r+') as f:
                file_content = f.read()

            file_content = file_content.replace(
                '$PROJ_DIR$\..\..\drivers\linker_scripts',
                '$PROJ_DIR$\drivers\linker_scripts')

            with open(iar_template_file, 'w') as f:
                f.write(str(file_content))
    except Exception, e:
        print('e.message:%s\t' % e.message)
예제 #3
0
def dist_handle(BSP_ROOT, dist_dir):
    from mkdist import bsp_copy_files

    src = os.path.join(BSP_ROOT, '../../openmv')
    dst = os.path.join(dist_dir, 'openmv')
    bsp_copy_files(src, dst)

    src = os.path.join(BSP_ROOT, '../../extmods')
    dst = os.path.join(dist_dir, 'extmods')
    bsp_copy_files(src, dst)
예제 #4
0
def dist_do_building(BSP_ROOT, dist_dir):
    from mkdist import bsp_copy_files
    import rtconfig

    library_dir = os.path.join(dist_dir, 'libraries')

    print("=> copy nrf52 bsp libraries")
    library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')

    bsp_copy_files(library_path, library_dir)
예제 #5
0
def dist_handle(BSP_ROOT, dist_dir):
    from mkdist import bsp_copy_files

    src = os.path.join(BSP_ROOT, '../omv-kd233/driver')
    dst = os.path.join(dist_dir, 'driver')
    bsp_copy_files(src, dst)

    src = os.path.join(BSP_ROOT, '../omv-kd233/kendryte-sdk')
    dst = os.path.join(dist_dir, 'kendryte-sdk')
    bsp_copy_files(src, dst)
예제 #6
0
def dist_do_building(BSP_ROOT):
    from mkdist import bsp_copy_files
    import rtconfig

    dist_dir  = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT))
    library_dir  = os.path.join(dist_dir, 'libraries')

    print("=> copy nuclei bsp library")
    library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
    library_dir  = os.path.join(dist_dir, 'libraries')
    bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
예제 #7
0
def dist_do_building(BSP_ROOT):
    from mkdist import bsp_copy_files
    import rtconfig
    
    dist_dir  = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT))
    library_path = os.path.join(os.path.dirname(BSP_ROOT), 'Libraries')
    library_dir  = os.path.join(dist_dir, 'Libraries')
    print("=> copy bsp drivers")
    bsp_copy_files(os.path.join(library_path, 'drivers'), os.path.join(library_dir, 'drivers'))
    print("=> copy bsp library")
    bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
    shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
예제 #8
0
def dist_do_building(BSP_ROOT, dist_dir):
    from mkdist import bsp_copy_files
    import rtconfig

    print("=> copy renesas bsp hal_drivers")
    library_dir = os.path.join(dist_dir, 'libraries')
    library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')

    print("=> copy bsp drivers")
    bsp_copy_files(os.path.join(library_path, 'HAL_Drivers'),
                   os.path.join(library_dir, 'HAL_Drivers'))
    shutil.copyfile(os.path.join(library_path, 'Kconfig'),
                    os.path.join(library_dir, 'Kconfig'))
예제 #9
0
def dist_do_building(BSP_ROOT, dist_dir):
    from mkdist import bsp_copy_files
    import rtconfig

    print("=> copy maxim bsp library")
    library_dir = os.path.join(dist_dir, 'libraries')
    library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')

    print("=> copy bsp drivers")
    bsp_copy_files(os.path.join(library_path, 'HAL_Drivers'),
                   os.path.join(library_dir, 'HAL_Drivers'))
    bsp_copy_files(os.path.join(library_path, 'MAX32660PeriphDriver'),
                   os.path.join(library_dir, 'MAX32660PeriphDriver'))
예제 #10
0
def dist_do_building(BSP_ROOT, dist_dir):
    from mkdist import bsp_copy_files
    import rtconfig

    print("=> copy at32 bsp library")
    library_dir = os.path.join(dist_dir, 'libraries')
    library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
    bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
                   os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))

    print("=> copy bsp drivers")
    bsp_copy_files(os.path.join(library_path, 'rt_drivers'), os.path.join(library_dir, 'rt_drivers'))
    shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
    bsp_update_kconfig_library(dist_dir)
예제 #11
0
def dist_do_building(BSP_ROOT, dist_dir):
    from mkdist import bsp_copy_files
    import rtconfig

    library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
    library_dir = os.path.join(dist_dir, 'libraries')

    print('=> copy nuvoton bsp drivers')
    bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
                   os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))

    print('=> copy nu_packages')
    bsp_copy_files(os.path.join(library_path, 'nu_packages'),
                   os.path.join(library_dir, 'nu_packages'))

    print('=> copy Kconfig')
    shutil.copyfile(os.path.join(library_path, 'Kconfig'),
                    os.path.join(library_dir, 'Kconfig'))

    print('=> Modify libraries relative path in board/Kconfig ')
    dist_modify_relative_path(os.path.join(dist_dir, 'board', 'Kconfig'))
예제 #12
0
def dist_do_building(BSP_ROOT):
    from mkdist import bsp_copy_files

    dist_dir = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT))
    print("=> copy bsp library")
    library_path = os.path.join(os.path.dirname(os.path.dirname(BSP_ROOT)),
                                'libraries')
    library_dir = os.path.join(dist_dir, 'libraries')
    bsp_copy_files(library_path, library_dir)

    print("=> copy bsp drivers")
    driver_path = os.path.join(os.path.dirname(os.path.dirname(BSP_ROOT)),
                               'drivers')
    driver_dir = os.path.join(dist_dir, 'drivers')
    bsp_copy_files(driver_path, driver_dir)

    print("=> copy tools")
    tools_path = os.path.join(os.path.dirname(os.path.dirname(BSP_ROOT)),
                              'tools')
    tools_dir = os.path.join(dist_dir, 'tools')
    bsp_copy_files(tools_path, tools_dir)

    iar_template_file = os.path.join(dist_dir, 'template.ewp')
    bsp_update_template(iar_template_file, '$PROJ_DIR$\drivers\linker_scripts',
                        '$PROJ_DIR$\..\..\drivers\linker_scripts')

    mdk_template_file = os.path.join(dist_dir, 'template.uvprojx')
    bsp_update_template(
        mdk_template_file,
        '<ScatterFile>.\drivers\linker_scripts\link.sct</ScatterFile>',
        '<ScatterFile>..\..\drivers\linker_scripts\link.sct</ScatterFile>')

    bsp_update_driver_kconfig(dist_dir)
    bsp_update_library_kconfig(dist_dir)
예제 #13
0
def dist_do_building(BSP_ROOT, dist_dir):
    from mkdist import bsp_copy_files
    import rtconfig

    library_dir = os.path.join(dist_dir, 'libraries')

    print("=> copy bluetrum bsp library")
    library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
    library_dir = os.path.join(dist_dir, 'libraries')
    bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
                   os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))

    print("=> copy bsp drivers")
    bsp_copy_files(os.path.join(library_path, 'hal_drivers'),
                   os.path.join(library_dir, 'hal_drivers'))
    # shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))

    print("=> copy libcpu")
    bsp_copy_files(os.path.join(os.path.dirname(BSP_ROOT), 'libcpu'),
                   os.path.join(dist_dir, 'libcpu'))