Submodules
libnxembeddedtools.ngultra.address module
This module contains all the addresses of memories of NGUltra.
...
classAnchor libnxembeddedtools.ngultra.address.NGUltraAddress libnxembeddedtools.ngultra.address.NGUltraAddress libnxembeddedtools.ngultra.address.
NGUltraAddress
Bases:
object
Anchor libnxembeddedtools.ngultra.address.NGUltraAddress.DDR_ba libnxembeddedtools.ngultra.address.NGUltraAddress.DDR_ba DDR_ba
= 2147483648
Anchor libnxembeddedtools.ngultra.address.NGUltraAddress.ERAM_ba libnxembeddedtools.ngultra.address.NGUltraAddress.ERAM_ba ERAM_ba
= 50331648
...
libnxembeddedtools.ngultra.bl1 module
This module contains all the needed to generate a BL1 descriptorused by the BL1.
classAnchor libnxembeddedtools.ngultra.bl1.DescriptorGenerator libnxembeddedtools.ngultra.bl1.DescriptorGenerator libnxembeddedtools.ngultra.bl1.
DescriptorGenerator
(desc_path, section_name)Bases:
object
This class is dedicated to the descriptor generation.
Parameters: desc_path (str) – Final path of the BL1 descriptor.
section_name (str) – Name of the section from yaml configuration file.
Anchor libnxembeddedtools.ngultra.bl1.DescriptorGenerator.alignBinarySize libnxembeddedtools.ngultra.bl1.DescriptorGenerator.alignBinarySize alignBinarySize
(binary, align_to)Add padding to binary to align it size to the need of BL1. BL1 retrieve the size of the binary in word (4 bytes) and then convert it back to bytes internally. If the size of the binary is not a multiple of 4 the final computed size will be incorrect.
Parameters: binary() – Binary we want to align the size.
align_to (int) – Value to align to.
Anchor libnxembeddedtools.ngultra.bl1.DescriptorGenerator.buildPacketHeader libnxembeddedtools.ngultra.bl1.DescriptorGenerator.generatebuildPacketHeader buildPacketHeader
(itemType, packetLength)Create the header for the spacewire packets
Parameters: itemType (int) – Type of packet
packetLength (int) – Size of the packet in bytes
Anchor libnxembeddedtools.ngultra.bl1.DescriptorGenerator.generateFlashBootDescriptor libnxembeddedtools.ngultra.bl1.DescriptorGenerator.generategenerateFlashBootDescriptor generate
generateFlashBootDescriptor
()Generate the final descriptor for boot from flash.
Anchor libnxembeddedtools.ngultra.bl1.DescriptorGenerator.generateSpwPackets libnxembeddedtools.ngultra.bl1.DescriptorGenerator.generateSpwPackets generateSpwPackets
()Generate packets according to the spacewire BL1 protocol.
Anchor libnxembeddedtools.ngultra.bl1.DescriptorGenerator.packetAsw libnxembeddedtools.ngultra.bl1.DescriptorGenerator.packetAsw packetAsw
(packets_list)Create the application software (ASW) first packet containing information about the ASW binary. The created packet is added to the packets_list passed as parameter.
Parameters: packets_list (list) – List to which to add the created packet.
Anchor libnxembeddedtools.ngultra.bl1.DescriptorGenerator.packetBitstream libnxembeddedtools.ngultra.bl1.DescriptorGenerator.packetBitstream packetBitstream
(packets_list)Create the bitstream first packet containing information about the bitstream binary. The created packet is added to the packets_list passed as parameter.
Parameters: packets_list (list) – List to which to add the created packet.
Anchor libnxembeddedtools.ngultra.bl1.DescriptorGenerator.packetData libnxembeddedtools.ngultra.bl1.DescriptorGenerator.packetData packetData
(binary)Create one or more packets containing raw binary data of the bitstream or ASW passed as parameter. The created packets are added to the packets_list passed as parameter.
Parameters: binary() – Bitstream or ASW binary.
Anchor libnxembeddedtools.ngultra.bl1.DescriptorGenerator.packetStartAddr libnxembeddedtools.ngultra.bl1.DescriptorGenerator.packetStartAddr packetStartAddr
(packets_list)
Anchor libnxembeddedtools.ngultra.bl1.DescriptorGenerator.zlibComputeCRC32 libnxembeddedtools.ngultra.bl1.DescriptorGenerator.zlibComputeCRC32 zlibComputeCRC32
(source, previousCRC)
...
libnxembeddedtools.ngultra.bsm module
This module contains everything to program the BSM of NGUltra
classAnchor libnxembeddedtools.ngultra.bsm.Loader libnxembeddedtools.ngultra.bsm.Loader libnxembeddedtools.ngultra.bsm.
Loader
(iface)Bases:
object
Class used to program the BSM.
Parameters: iface (
Interface
) – interface used to communicate with the board.Anchor libnxembeddedtools.ngultra.bsm.Loader.bsmReset libnxembeddedtools.ngultra.bsm.Loader.bsmReset bsmReset
()Reset the BSM
Info - The reset sequence is:
Assert SOFT_RSTN
Wait for 100 cycles of BSM
Deassert SOFT_RSTN
Assert HARD_RSTN
Wait for 3 us
Deassert HARD_RSTN
Wait for 128 cycles if BSM
Info Since we are using a python over USB interface (either Lauterbach or openOCD), the minimum delay is at least 1ms. So no wait is required.
Anchor libnxembeddedtools.ngultra.bsm.Loader.isReady libnxembeddedtools.ngultra.bsm.Loader.isReady isReady
()Checks if the ready flag is set
Anchor libnxembeddedtools.ngultra.bsm.Loader.program libnxembeddedtools.ngultra.bsm.Loader.program program
(nxbFile, address=None)Program the BSM with the provided nxbFile:
Parameters: nxbFile (str) – NXB to program.
address (int) – Address where the NXB is stored. If None, it uses the default loader address in the eRAM.
...
libnxembeddedtools.ngultra.fastcommands module
...
classAnchor libnxembeddedtools.ngultra.fastcommands.FastCommands libnxembeddedtools.ngultra.fastcommands.FastCommands libnxembeddedtools.ngultra.fastcommands.
FastCommands
(iface)Bases:
object
Anchor libnxembeddedtools.ngultra.fastcommands.FastCommands.ngultraInit libnxembeddedtools.ngultra.fastcommands.FastCommands.ngultraInit ngultraInit
()Initialise NGUltra (PLLs and DDR).
Anchor libnxembeddedtools.ngultra.fastcommands.FastCommands.programBSM libnxembeddedtools.ngultra.fastcommands.FastCommands.programBSM programBSM
(nxbFile, address=None)Program the BSM with a given NXB file.
Parameters: nxbFile (str) – Path of the NXB file.
address (int) – Address where the NXB is stored. If None, it uses the default loader address in the eRAM.
Anchor libnxembeddedtools.ngultra.fastcommands.FastCommands.readFlash libnxembeddedtools.ngultra.fastcommands.FastCommands.readFlash readFlash
(flashId, outputFile, base_address, size)Read the flash and write the result in a file
Parameters: flashId (int) – flash to read;
outputFile (str) – Path of the file where to write the result.
base_address (int) – Address in the flash where to read the file.
size (int) – Number of 256 bytes to read.
Anchor libnxembeddedtools.ngultra.fastcommands.FastCommands.writeFlash libnxembeddedtools.ngultra.fastcommands.FastCommands.writeFlash writeFlash
(flashId, inputFile, base_address, byteorder='little')Write the flash with the given file.
Parameters: flashId (int) – flash to write;
inputFile (str) – Path of the file to write.
base_address (int) – Address in the flash where to write the file.
byteorder (str) – Byteorder of the file. Must be “little” or “big”.
...
classAnchor libnxembeddedtools.ngultra.flash.Controller libnxembeddedtools.ngultra.flash.Controller libnxembeddedtools.ngultra.flash.
Controller
Bases:
object
This class is dedicted dedicated to the management of the flash controller.
Anchor libnxembeddedtools.ngultra.flash.Controller.erase libnxembeddedtools.ngultra.flash.Controller.erase erase
(flashId)Totally erase the specified flash.
Parameters: flashId (int) – The flash to erase.
Info Flash id goes from 0 to 3.
Anchor libnxembeddedtools.ngultra.flash.Controller.eraseSector libnxembeddedtools.ngultra.flash.Controller.eraseSector eraseSector
(flashId, address)Erase a sector of the specified flash.
Parameters: flashId (int) – The flash to erase.
address (int) – Begining of the sector to erase.
Info Flash id goes from 0 to 3.
Info Sector size depends of the flash. For the “S25FL512S” (used on the bringup board) the sector size is 256KB.
Anchor libnxembeddedtools.ngultra.flash.Controller.fastReadData libnxembeddedtools.ngultra.flash.Controller.fastReadData fastReadData
(flashId, outputFile, address, size)Dump the content of the specified flash to a file using fast commands API.
Parameters: flashId (int) – The flash to read.
outputFile (str) – Path of the file of the dump.
address (int) – Address where to write the data.
size (str) – Number of 256B block to read.
Info Flash id goes from 0 to 3.
Anchor libnxembeddedtools.ngultra.flash.Controller.fastWriteData libnxembeddedtools.ngultra.flash.Controller.fastWriteData fastWriteData
(flashId, inputFile, address, byteorder='little')Write a file to the specified flash using fast commands API.
Parameters: flashId (int) – The flash to write.
inputFile (str) – Path of the file to write
address (int) – Address where to write the data.
byteorder (str) – Byteorder of the file. Must be “big” or “little”.
Info Flash id goes from 0 to 3.
Anchor libnxembeddedtools.ngultra.flash.Controller.fastWriteDataPadded libnxembeddedtools.ngultra.flash.Controller.fastWriteDataPadded fastWriteDataPadded
(flashId, inputFile, address, byteorder='little', modulo=64)Write a file to the specified flash using fast commands API. This file will be padded before writing it.
Parameters: flashId (int) – The flash to write.
inputFile (str) – Path of the file to write
address (int) – Address where to write the data.
byteorder (str) – Byteorder of the file. Must be “big” or “little”.
modulo (int) – Used to compute the size of the padding.
Info Flash id goes from 0 to 3.
Anchor libnxembeddedtools.ngultra.flash.Controller.readToFile libnxembeddedtools.ngultra.flash.Controller.readToFile readToFile
(flashId, outputFile, address, size)Dump the content of the specified flash to a file.
Parameters: flashId (int) – The flash to read.
outputFile (str) – Path of the file of the dump.
address (int) – Address where to write the data.
size (str) – Number of 256B block to read.
Info Flash id goes from 0 to 3.
Anchor libnxembeddedtools.ngultra.flash.Controller.writeBL1 libnxembeddedtools.ngultra.flash.Controller.writeBL1 writeBL1
(flashId, inputFile, key)Write the specified file on the specified flash considering it as a BL1. This file will be signed and written at address 0.
Parameters: flashId (int) – The flash to write.
inputFile (str) – Path of the file to write.
key (str) – Path of the key needed to sign the file.
Info Flash id goes from 0 to 3.
Anchor libnxembeddedtools.ngultra.flash.Controller.writeData libnxembeddedtools.ngultra.flash.Controller.writeData writeData
(flashId, address, data)Write the specified flash with provided data.
Parameters: flashId (int) – The flash to write.
address (int) – Address where to write the data.
data (list) – Data to write;
Info Flash id goes from 0 to 3.
Anchor libnxembeddedtools.ngultra.flash.Controller.writeFromFile libnxembeddedtools.ngultra.flash.Controller.writeFromFile writeFromFile
(flashId, inputFile, address, byteorder='little')Write a file to the specified flash.
Parameters: flashId (int) – The flash to write.
inputFile (str) – Path of the file to write
address (int) – Address where to write the data.
byteorder (str) – Byteorder of the file. Must be “big” or “little”.
Info Flash id goes from 0 to 3.
...