args = docopt(__doc__, version='0.1') rc = newton.adi_newton_config(0) if rc != 0: print("ERROR: newton.adi_newton_config return an error (" + str(rc) + ").") sys.exit(rc) if args['--no_fw_load']: loadFirmware = False if args['--no_reset']: performReset = False if performReset == True: newton.adi_reset_newton(newton.PIN_MODE_HSP_DEBUG) if loadFirmware == True: cmd_file = os.path.expanduser( "./tests/dms_eval_tests/fc_asm_mscm_dll_visible_moda/fc_asm_mscm_dll_visible_moda.txt" ) cmd_file_bytes = cmd_file.encode(encoding='utf-8') newton.adi_load_command_file(cmd_file_bytes) newton.adi_write_register(0x000C, 0x00c5) # useqControlRegister newton.adi_check_register_py(0x0142, 0x0500) # pll_status newton.adi_write_register(0x0244, 0x0020) # SCRATCHPAD[34] newton.adi_write_register(0x0028, 0x0000) # systemClockControl newton.adi_write_register(0x0140, 0x0133) # pll_ctrl newton.adi_write_register(0x015e, 0x8512) # syspll_ctrl2_s1 newton.adi_write_register(0x015a, 0x7810) # syspll_ctrl0_s1
rc = newton.adi_verify_hsp(newton.EFUSE, efuse_file_bytes) if rc != 0: print("ERROR: newton_control.exe return an error (" + str(rc) + ").") sys.exit(rc) print("INFO: Loading the HSP firmware file \"" + rom_file + "\"...") rc = newton.adi_load_hsp(newton.HSP_ROM, rom_file_bytes) if rc != 0: print("ERROR: newton_control.exe return an error (" + str(rc) + ").") sys.exit(rc) print("INFO: Verifying the HSP firmware file \"" + rom_file + "\"...") rc = newton.adi_verify_hsp(newton.HSP_ROM, rom_file_bytes) if rc != 0: print("ERROR: newton_control.exe return an error (" + str(rc) + ").") sys.exit(rc) print("INFO: Resetting newton ...") # rc = newton.adi_reset_newton( newton.PIN_MODE_KEEP_CURRENT_MODE ) rc = newton.adi_reset_newton(pinModeValue) if rc != 0: print("ERROR: newton.adi_reset_newton return an error (" + str(rc) + ").") sys.exit(rc) print("INFO: Startup DONE!")