The start address of the block of memory
The number of values to fill in the block
The value to use to fill memory
Optional
bitSize: numberThe bit width of the value. Defaults to the word size. Valid values are 8, 16, 24, 32, 40, 48, and 64.
Get a list of the supported formats to be used for Memory.saveData.
Optional
page: PageThe memory page. If not provided, assumes the default data access page.
A list of supported formats.
Load a block of memory from a binary file, like the ones created with Memory.saveBinary.
The start address of the block of memory
The full path to the file to be loaded
Unlike loadBinaryProgram, this is not considered a program load. That is, this cannot program flash memory, and the target will not be halted automatically. However, it can load to memory pages other than the program page.
session.memory.saveBinary(0x2400n, 256, "C:/loadBinaryExample.bin");
// Load the binary file at a different address
session.memory.loadBinary(0x3200n, "C:/loadBinaryExample.bin");
Load a binary program file to the target.
Full path to the file
The address at which the program should be loaded. On targets with memory pages, this address is assumed to be in the program memory page.
This can be used to program flash memory.
The target will be halted prior to the load.
Unlike Memory.loadProgram, this will not clear previously loaded debug symbols.
// Load a binary program
session.memory.loadBinaryProgram("C:/workspace/example.bin", 0x2400n);
Load a block of memory from a file created using Memory.saveData.
The start address of the block of memory.
The number of words to be loaded form the file.
The full path to the data file.
This command cannot be used to program flash. If you want to save and load data from and to flash, consider using Memory.saveBinary and Memory.loadBinaryProgram.
session.memory.saveData(0x2400n, 5, "C:/loadDataExample.dat", "32-Bit Hex - TI Style");
// Load the saved memory at a different location
session.memory.loadData(0x3200n, 5, "C:/loadDataExample.dat");
Load a program file to the target, and load debug symbols (if any) for debugging. Accepts programs in ELF, COFF, and multiple hex formats.
Full path to the file
Loading a program will clear any previously loaded debug symbols.
This returns once the program has been loaded to the target, the debugger is finished loading debug symbols, and the target is halted. By default, the debugger will run to the start of main. This behavior can be configured in the debugger settings.
Will throw if the program load fails.
// Load a program
session.memory.loadProgram("C:/my_project/Debug/example.out");
Read a block of values from the target's memory. The memory contents are interpreted as unsigned integers of the specified bit size.
The starting location to read from
The number of values to read
Optional
bitSize: numberThe bit width of the values to be read. Defaults to the word size. Valid values are 8, 16, 24, 32, 40, 48, and 64.
An array of the values read
Like Memory.read but reads and returns a single value instead of an array.
Optional
bitSize: numberSave a block of target memory to a binary file that can be loaded with Memory.loadBinary or Memory.loadBinaryProgram (see the descriptions of these commands for the differences in their behavior).
The start address of the block of memory
The number of words in the block of memory
The full path of the file to be created
Save a block of target memory to a file in a human-readable format.
The start address of the block of memory
The number of words in the block of memory
The full path of the file to be created
The format in which the contents of memory should be written. A list of allowed formats for the target can be obtained from Memory.getSupportedFormats.
Optional
append: booleanA flag indicating if the data should be appended to the file, if it already exists. Different data formats should not be mixed in the same file. If not provided, defaults to false.
Verifies a binary program file against what is in the target's memory. An error is thrown if the verification fails.
Full path to the file
The address at which the binary program is expected to be loaded in memory. On targets with memory pages, this address is assumed to lie in the program memory page.
Write a block of values to the target's memory.
Negative values can be provided and will be written as a signed integer of the specified size. Values provided will be truncated to fit in an integer of the specified size and appropriate signedness.
The starting location to write to
The values to write. Can be a single value, or an array of values. Each value must be a bigint, or an integer represented as a string or a javascript number
Optional
bitSize: numberThe bit width of the values to be written. Defaults to the word size. Valid values are 8, 16, 24, 32, 40, 48, and 64.
Will throw if any part of the memory write encounters an error.
// Write 6 words starting at 0x2400
// values can be specified as numbers, bigints, or strings
session.memory.write(0x2400n, [0, 1n, -500, 0x4, "5", "-0x3"]);
// Write one 64 bit value at 0x2400
session.memory.write(0x2400n, 0x8765432187654312n, 64);
// equivalently
session.memory.write(0x2400n, [0x8765432187654312n], 64);
Fill a block of memory with a specified value.