Beispiel #1
0
 def do_set_env(self, ub: board.UBootShell) -> bool:
     ub.env("serverip", tbot.selectable.LabHost.serverip["wandboard"])
     ub.env("netmask", "255.255.255.0")
     ub.env("ipaddr", tbot.selectable.LabHost.boardip["wandboard"])
     ta = ub.host.tftp_dir_board
     f = ta / "SPL"
     ub.env("spl_file", ge.get_path(f))
     f = ta / "u-boot.img"
     ub.env("ub_file", ge.get_path(f))
     ub.env("cmp_addr_r", "11000000")
     for env in ub_env:
         ub.env(env["name"], env["val"])
Beispiel #2
0
    def poweron(self) -> None:
        n = self._get_boardname()
        # eventuell /home/tbot/sources/remote_power
        self.host.exec0("sudo", "sispmctl", "-D", "01:01:56:a2:f1", "-o", self.pin)

        td = ge.get_path(self.host.toolsdir)
        yrd = ge.get_path(self.host.yocto_result_dir)
        if "splusbloader" in tbot.flags:
            loop = True
            while loop:
                try:
                    self.host.exec0("sudo", f"{td}/imx_usb_loader/imx_usb", f"{yrd}/SPL-spi.signed")
                    loop = False
                except:
                    time.sleep(2)
                    pass
        if "usbloader" in tbot.flags:
            loop = True
            while loop:
                try:
                    self.host.exec0("sudo", f"{td}/imx_usb_loader/imx_usb", f"{yr}/SPL-spi.signed")
                    loop = False
                except:
                    time.sleep(2)
                    pass

            loop = True
            while loop:
                try:
                    self.host.exec0("sudo", "/home/pi/tbot2go/src/imx_usb_loader/imx_usb", "/srv/tftpboot/k30rf/tbot/yocto_results/u-boot-ivt.img-spi.signed")
                    loop = False
                except:
                    time.sleep(2)
                    pass



        return
def aristainetos_ub_build(
    lab: typing.Optional[linux.LinuxShell] = None, ) -> None:
    """
    build u-boot
    """
    ge.ub_build("aristainetos2", ub_resfiles)

    # create "u-boot-dtb.imx.signed"
    f = "u-boot-dtb.imx"
    tbot.log.message(tbot.log.c(f"Creating signed {f}").green)
    # copy u-boot-dtb.imx to sign directory
    with lab or tbot.acquire_lab() as lh:
        r = lh.tftp_root_path / ge.get_path(lh.tftp_dir_board)
        s = r / f
        t = lh.sign_dir
        tbot.tc.shell.copy(s, t)
        lh.exec0("cd", t)
        lh.exec0("./cst", "--o", "u-boot-dtb_csf.bin", "--i", "u-boot-dtb.csf")
        lh.exec0(linux.Raw(f"cat {f} u-boot-dtb_csf.bin > {f}.signed"))
        lh.exec0("ls", "-al")
        s = lh.sign_dir / f"{f}.signed"
        t = lh.tftp_root_path / ge.get_path(lh.tftp_dir_board)
        tbot.tc.shell.copy(s, t)
Beispiel #4
0
    def test_full_filetype(self):
        """
        Test loading with file types specified as
        the full filename, not just extension.
        """
        file_name = g.get_path('unit_cube.STL')
        with open(file_name, 'rb') as f:
            # check `load_mesh`
            mesh = g.trimesh.load_mesh(file_obj=file_name, file_type=file_name)
            assert g.np.isclose(mesh.volume, 1.0)
            f.seek(0)
            mesh = g.trimesh.load(file_obj=file_name, file_type=file_name)
            assert g.np.isclose(mesh.volume, 1.0)

        file_name = g.get_path('2D/1002_tray_bottom.DXF')
        with open(file_name, 'rb') as f:
            # check load_path
            path = g.trimesh.load_path(file_obj=file_name, file_type=file_name)
            assert len(path.entities) == 46

            f.seek(0)
            # check `load`
            path = g.trimesh.load(file_obj=file_name, file_type=file_name)
            assert len(path.entities) == 46
Beispiel #5
0
    def test_order_kwarg(self):
        for file_name in ['ico4.obj', 'ico4uv.obj']:
            # get the location of the model file
            file_path = g.get_path(file_name)
            with open(file_path, 'r') as f:
                # get the raw ordered vertices from the file with basic string ops
                v_raw = g.np.array(
                    [line[2:].split() for line in f if line.startswith('v ')],
                    dtype=g.np.float64)

            # load them with maximal correspondence captain
            a = g.trimesh.load(file_path, process=False, maintain_order=True)
            # see if we have the same vertices
            assert g.np.allclose(a.vertices, v_raw)

            # load them without process and but without maintaining order
            a = g.trimesh.load(file_path, process=False, maintain_order=False)
            # vertex shape should not be the same
            assert a.vertices.shape != v_raw.shape