Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
libnxembeddedtools.remoteapi.abstract.Interface
libnxembeddedtools.remoteapi.abstract.Interface
class libnxembeddedtools.remoteapi.abstract.Interface

Bases: ABC

Interface thatdescribes the hardware interface between the PC and the board.

Info

Object implementing this class should be construct via the get() method.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.dumpMemory
libnxembeddedtools.remoteapi.abstract.Interface.dumpMemory
dumpMemory(memType, address, count, outFile, append=False)

Dump memory into a file.

Parameters:
  • memType (MemoryType) – Access type to perform.

  • address (int) – First address to be read.

  • outFile (str) – Path of the file where to dump the memory.

  • count (int) – Number of word to read.

  • append (Boolean) – Open the filed in append mode.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.halt
libnxembeddedtools.remoteapi.abstract.Interface.halt
abstract halt(core)

Halt the specified core.

Parameters:

core (int) – Core to halt

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.loadELF
libnxembeddedtools.remoteapi.abstract.Interface.loadELF
abstract loadELF(image, core)

Load an ELF on the selected core.

Parameters:
  • image (str) – Path of the ELF to load.

  • core (int) – Core where to load the ELF file.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.loadImage
libnxembeddedtools.remoteapi.abstract.Interface.loadImage
abstract loadImage(image, core, address)

Load a binary on the specified core.

Parameters:
  • image (str) – Path of the binary to load.

  • core (int) – Core where to load the binary file.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.readMemory
libnxembeddedtools.remoteapi.abstract.Interface.readMemory
abstract readMemory(memType, address, count=1, wordLen=32)

Read some memory from the target.

Parameters:
  • memType (MemoryType) – Access type to perform.

  • address (int) – First address to be read.

  • count (int) – Number of word to read.

  • wordLen (int) – Word length in bits.

Returns:

Memory read from the target.

Return type:

list(int)

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.readRegister
libnxembeddedtools.remoteapi.abstract.Interface.readRegister
abstract readRegister(core, name)

Read a register from the selected core.

Parameters:
  • core (int) – Core from which to want to read the register

  • name (str) – Name of the register you want to read.

Returns:

The value of the register

Return type:

int

Raises:

Exception – if the register can’t be found.

Warning

Selected core should be halted before reading a register. You should call halt() method before this.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.removeBreakpoint
libnxembeddedtools.remoteapi.abstract.Interface.removeBreakpoint
abstract removeBreakpoint(core, address)

Remove a breakpoint from the specified core.

Parameters:
  • core (int) – Core where the breakpoint is placed.

  • address (int) – Address of the breakpoint.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.resume
libnxembeddedtools.remoteapi.abstract.Interface.resume
abstract resume(core)

Resume the specified core.

Parameters:

core (int) – Core to resume

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.sendCmd
libnxembeddedtools.remoteapi.abstract.Interface.sendCmd
abstract sendCmd(core, cmd)

Send debugger command to execute on the specified core.

Parameters:
  • core (int) – Core to send the command to.

  • cmd (str) –

    .

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.setBreakpoint
libnxembeddedtools.remoteapi.abstract.Interface.setBreakpoint
abstract setBreakpoint(core, address, length)

Set a breakpoint on the core at the specified address.

Parameters:
  • core (int) – Core where to place the breakpoint.

  • address (int) – Address of the breakpoint.

  • length (int) – Length of the access in bytes.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.setThumbMode
libnxembeddedtools.remoteapi.abstract.Interface.setThumbMode
setThumbMode(core)

Set the current core on Thumb execution mode.

Parameters:

core (int) – Core you want to switch execution.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.step
libnxembeddedtools.remoteapi.abstract.Interface.step
abstract step(core)

Perform a step (single instruction) on the specified core.

Parameters:

core (int) – Core to resume

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.waitHalt
libnxembeddedtools.remoteapi.abstract.Interface.waitHalt
abstract waitHalt(core, timeout)

Wait for the halt state on the specified core.

Parameters:
  • core (int) – Core to halt.

  • timeout (int) – Timeout in ms.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.wakeupCore
libnxembeddedtools.remoteapi.abstract.Interface.wakeupCore
abstract wakeupCore(core)

Wake up the specified core.

Parameters:

core (int) – Core to wake up.

Info

Core 0 is always waked up.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.writeFile
libnxembeddedtools.remoteapi.abstract.Interface.writeFile
writeFile(memType, address, inputFile, byteorder='little', offset=0, size=-1)

Write memory on the whith values from the source file.

Parameters:
  • memType (MemoryType) – Access type to perform.

  • address (int) – First address to be read.

  • inputFile (str) – File path.

  • byteorder (str) – Byteorder of the file (‘big’ or ‘little’).

  • offset (int) – Offset in the file where to begin.

  • size (int) – Size to read from the file.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.writeMemory
libnxembeddedtools.remoteapi.abstract.Interface.writeMemory
abstract writeMemory(memType, address, data, wordLen=32)

Write memory on the target.

Parameters:
  • memType (MemoryType) – Access type to perform.

  • address (int) – First address to be read.

  • data (list) – Data to write.

  • wordLen (int) – Word length in bits.

Anchor
libnxembeddedtools.remoteapi.abstract.Interface.writeRegister
libnxembeddedtools.remoteapi.abstract.Interface.writeRegister
abstract writeRegister(core, name, value)

Write a register from the selected core.

Parameters:
  • core (int) – Core from which to want to write the register

  • name (str) – Name of the register you want to write.

  • value (int) – Value you want to write in the register.

Raises:

Exception – if the register can’t be found.

Warning

Selected core should be halted before reading a register. You should call halt() method before this.

...

libnxembeddedtools.remoteapi.factory module

This module is dedicted dedicated to build objects that implements the Interface interface.

...

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface
libnxembeddedtools.remoteapi.lauterbach.Interface
class libnxembeddedtools.remoteapi.lauterbach.Interface(verbose=False)

Bases: Interface

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.halt
libnxembeddedtools.remoteapi.lauterbach.Interface.halt
halt(core)

Halt the specified core.

Parameters:

core (int) – Core to halt

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.loadELF
libnxembeddedtools.remoteapi.lauterbach.Interface.loadELF
loadELF(image, core)

Load an ELF on the selected core.

Parameters:
  • image (str) – Path of the ELF to load.

  • core (int) – Core where to load the ELF file.

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.loadImage
libnxembeddedtools.remoteapi.lauterbach.Interface.loadImage
loadImage(image, core, address)

Load a binary on the specified core.

Parameters:
  • image (str) – Path of the binary to load.

  • core (int) – Core where to load the binary file.

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.readMemory
libnxembeddedtools.remoteapi.lauterbach.Interface.readMemory
readMemory(memType, address, count=1, wordLen=32)

Read some memory from the target.

Parameters:
  • memType (MemoryType) – Access type to perform.

  • address (int) – First address to be read.

  • count (int) – Number of word to read.

  • wordLen (int) – Word length in bits.

Returns:

Memory read from the target.

Return type:

list(int)

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.readRegister
libnxembeddedtools.remoteapi.lauterbach.Interface.readRegister
readRegister(core, name)

Read a register from the selected core.

Parameters:
  • core (int) – Core from which to want to read the register

  • name (str) – Name of the register you want to read.

Returns:

The value of the register

Return type:

int

Raises:

Exception – if the register can’t be found.

Warning

Selected core should be halted before reading a register. You should call halt() method before this.

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.removeBreakpoint
libnxembeddedtools.remoteapi.lauterbach.Interface.removeBreakpoint
removeBreakpoint(core, address)

Remove a breakpoint from the specified core.

Parameters:
  • core (int) – Core where the breakpoint is placed.

  • address (int) – Address of the breakpoint.

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.resume
libnxembeddedtools.remoteapi.lauterbach.Interface.resume
resume(core)

Resume the specified core.

Parameters:

core (int) – Core to resume

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.resumeAll
libnxembeddedtools.remoteapi.lauterbach.Interface.resumeAll
resumeAll()
Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.sendCmd
libnxembeddedtools.remoteapi.lauterbach.Interface.sendCmd
sendCmd(core, cmd)

Send debugger command to execute on the specified core.

Parameters:
  • core (int) – Core to send the command to.

  • cmd (str) –

    .

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.setBreakpoint
libnxembeddedtools.remoteapi.lauterbach.Interface.setBreakpoint
setBreakpoint(core, address, length)

Set a breakpoint on the core at the specified address.

Parameters:
  • core (int) – Core where to place the breakpoint.

  • address (int) – Address of the breakpoint.

  • length (int) – Length of the access in bytes.

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.step
libnxembeddedtools.remoteapi.lauterbach.Interface.step
step(core)

Perform a step (single instruction) on the specified core.

Parameters:

core (int) – Core to resume

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.waitHalt
libnxembeddedtools.remoteapi.lauterbach.Interface.waitHalt
waitHalt(core, timeout)

Wait for the halt state on the specified core.

Parameters:
  • core (int) – Core to halt.

  • timeout (int) – Timeout in ms.

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.waitRun
libnxembeddedtools.remoteapi.lauterbach.Interface.waitRun
waitRun(core, timeout)
Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.wakeupCore
libnxembeddedtools.remoteapi.lauterbach.Interface.wakeupCore
wakeupCore(core)

Wake up the specified core.

Parameters:

core (int) – Core to wake up.

Info

Core 0 is always waked up.

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.writeMemory
libnxembeddedtools.remoteapi.lauterbach.Interface.writeMemory
writeMemory(memType, address, data, wordLen=32)

Write memory on the target.

Parameters:
  • memType (MemoryType) – Access type to perform.

  • address (int) – First address to be read.

  • data (list) – Data to write.

  • wordLen (int) – Word length in bits.

Anchor
libnxembeddedtools.remoteapi.lauterbach.Interface.writeRegister
libnxembeddedtools.remoteapi.lauterbach.Interface.writeRegister
writeRegister(core, name, value)

Write a register from the selected core.

Parameters:
  • core (int) – Core from which to want to write the register

  • name (str) – Name of the register you want to write.

  • value (int) – Value you want to write in the register.

Raises:

Exception – if the register can’t be found.

Warning

Selected core should be halted before reading a register. You should call halt() method before this.

...

Anchor
libnxembeddedtools.remoteapi.openocd.Interface
libnxembeddedtools.remoteapi.openocd.Interface
class libnxembeddedtools.remoteapi.openocd.Interface(verbose=False)

Bases: Interface

This class is dedicted dedicated to the communication with the openocd deamon.

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.halt
libnxembeddedtools.remoteapi.openocd.Interface.halt
halt(core)

Halt the specified core.

Parameters:

core (int) – Core to halt

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.loadELF
libnxembeddedtools.remoteapi.openocd.Interface.loadELF
loadELF(image, core)

Load an ELF on the selected core.

Parameters:
  • image (str) – Path of the ELF to load.

  • core (int) – Core where to load the ELF file.

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.loadImage
libnxembeddedtools.remoteapi.openocd.Interface.loadImage
loadImage(image, core, address)

Load a binary on the specified core.

Parameters:
  • image (str) – Path of the binary to load.

  • core (int) – Core where to load the binary file.

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.readMemory
libnxembeddedtools.remoteapi.openocd.Interface.readMemory
readMemory(memType, address, count=1, wordLen=32)

Read some memory from the target.

Parameters:
  • memType (MemoryType) – Access type to perform.

  • address (int) – First address to be read.

  • count (int) – Number of word to read.

  • wordLen (int) – Word length in bits.

Returns:

Memory read from the target.

Return type:

list(int)

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.readRegister
libnxembeddedtools.remoteapi.openocd.Interface.readRegister
readRegister(core, register)

Read a register from the selected core.

Parameters:
  • core (int) – Core from which to want to read the register

  • name (str) – Name of the register you want to read.

Returns:

The value of the register

Return type:

int

Raises:

Exception – if the register can’t be found.

Warning

Selected core should be halted before reading a register. You should call halt() method before this.

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.removeBreakpoint
libnxembeddedtools.remoteapi.openocd.Interface.removeBreakpoint
removeBreakpoint(core, address)

Remove a breakpoint from the specified core.

Parameters:
  • core (int) – Core where the breakpoint is placed.

  • address (int) – Address of the breakpoint.

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.resume
libnxembeddedtools.remoteapi.openocd.Interface.resume
resume(core)

Resume the specified core.

Parameters:

core (int) – Core to resume

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.sendCmd
libnxembeddedtools.remoteapi.openocd.Interface.sendCmd
sendCmd(core, cmd)

Send debugger command to execute on the specified core.

Parameters:
  • core (int) – Core to send the command to.

  • cmd (str) –

    .

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.setBreakpoint
libnxembeddedtools.remoteapi.openocd.Interface.setBreakpoint
setBreakpoint(core, address, length)

Set a breakpoint on the core at the specified address.

Parameters:
  • core (int) – Core where to place the breakpoint.

  • address (int) – Address of the breakpoint.

  • length (int) – Length of the access in bytes.

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.step
libnxembeddedtools.remoteapi.openocd.Interface.step
step(core)

Perform a step (single instruction) on the specified core.

Parameters:

core (int) – Core to resume

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.waitHalt
libnxembeddedtools.remoteapi.openocd.Interface.waitHalt
waitHalt(core, timeout)

Wait for the halt state on the specified core.

Parameters:
  • core (int) – Core to halt.

  • timeout (int) – Timeout in ms.

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.wakeupCore
libnxembeddedtools.remoteapi.openocd.Interface.wakeupCore
wakeupCore(core)

Wake up the specified core.

Parameters:

core (int) – Core to wake up.

Info

Core 0 is always waked up.

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.writeMemory
libnxembeddedtools.remoteapi.openocd.Interface.writeMemory
writeMemory(memType, address, data, wordLen=32)

Write memory on the target.

Parameters:
  • memType (MemoryType) – Access type to perform.

  • address (int) – First address to be read.

  • data (list) – Data to write.

  • wordLen (int) – Word length in bits.

Anchor
libnxembeddedtools.remoteapi.openocd.Interface.writeRegister
libnxembeddedtools.remoteapi.openocd.Interface.writeRegister
writeRegister(core, register, value)

Write a register from the selected core.

Parameters:
  • core (int) – Core from which to want to write the register

  • name (str) – Name of the register you want to write.

  • value (int) – Value you want to write in the register.

Raises:

Exception – if the register can’t be found.

Warning

Selected core should be halted before reading a register. You should call halt() method before this.

...