tbottest.machineinit
¶
A module containing various additional machine initializers. These are:
UsbSdpLoad
- loading bootloader with imx_usb_loader.LauterbachLoad
- loading bootloader with `Lauterbach debugger trace32`_.
- class tbottest.machineinit.UsbSdpLoad[source]¶
Bases:
Initializer
Machine-initializer for loading SPL/U-Boot image into RAM with imx_usb_loader tool from NXP and using Serial Download over USB
source: https://github.com/boundarydevices/imx_usb_loader
installation of tool: https://github.com/boundarydevices/imx_usb_loader/blob/master/README.md#installation
Example: (board config)
from tbot.machine import board from tbottest.powercontrol import SispmControl from tbottest.machineinit import UsbSdpLoad class MyControl(SispmControl, board.Board): sispmctl_device = "01:01:5c:29:39" sispmctl_port = "2" class MyControlLoadUB(MyControl, UsbSdpLoad): def get_imx_usb_loader(self): p = self.host.toolsdir() return p / "imx_usb_loader" def usb_loader_bins(self): p = self.host.yocto_result_dir() return [ p / "SPL.signed", p / "u-boot-ivt.img.signed"]
This class sets also a tbot flag “usbloader”
if passed to tbot, this class is active, if not passed this class does nothing.
- class tbottest.machineinit.UUULoad[source]¶
Bases:
Initializer
Machine-initializer for loading SPL/U-Boot image into RAM with uuu tool from NXP and using Serial Download over USB
source: https://github.com/NXPmicro/mfgtools.git
installation: https://github.com/NXPmicro/mfgtools#how-to-build
We may can check if tool is installed and if not install it automagically…
Example: (board config)
from tbot.machine import board from tbottest.powercontrol import SispmControl from tbottest.machineinit import UUULoad class MyControl(SispmControl, board.Board): sispmctl_device = "01:01:5c:29:39" sispmctl_port = "2" class MyControlLoadUB(MyControl, UUULoad): def get_uuu_tool(self): return self.host.toolsdir() def uuu_loader_steps(self): p = self.host.yocto_result_dir() return [linux.Raw(f"SDP: boot -f /srv/tftpboot/SPL"), linux.Raw(f"SDPV: delay 100"), linux.Raw(f"SDPV: write -f /srv/tftpboot/u-boot-dtb.img -addr 0x877fffc0 -skipfhdr"), linux.Raw(f"SDPV: jump -addr 0x877fffc0"), ]
This class sets also a tbot flag “uuuloader”
if passed to tbot, this class is active, if not passed this class does nothing.
- abstract get_uuu_tool() Path[H] [source]¶
- def get_uuu_tool(self) -> linux.Path:
return lh.workdir / “tools”
- Return type:
linux.Path
- Returns:
Path to the uuu directory on your LabHost
- abstract uuu_loader_steps() List[str] [source]¶
return list of steps to do for uuu tool
- def uuu_loader_steps(self):
p = self.host.yocto_result_dir() return [linux.Raw(f”SDP: boot -f /srv/tftpboot/SPL”),
linux.Raw(f”SDPV: delay 100”), linux.Raw(f”SDPV: write -f /srv/tftpboot/u-boot-dtb.img -addr 0x877fffc0 -skipfhdr”), linux.Raw(f”SDPV: jump -addr 0x877fffc0”), ]
This property is required.
- class tbottest.machineinit.LauterbachLoad[source]¶
Bases:
Initializer
BIG FAT WARNING:
I do not longer own a Lauterbach debugger, so may this class is broken
TRACE32’s configuration file “config.t32” has to contain these lines: RCL=NETASSIST PORT=20000 The port value may be changed but has to match with the port number used with this python script.
currently we use t32apicmd.py, but we used code from t32remotedo.py which does not work … so need more rework!
Also add in config.t32 the line
CONNECTIONMODE=AUTOCONNECT
so if you start trace32 and there is another running (or crashed) instance running, it get killed.