Cart Contact NSDSP Home

nsdsp_debug_read_rom

This function reads ROM from the target device.

Syntax

unsigned int nsdsp_debug_read_rom(
        nsdsp_session_t   session,
        unsigned int      addr,
        unsigned int      size
);

Parameters

session - a reference to the Debug Session Object obtained with nsdsp_session_program_for_debug or nsdsp_start_debug_session function

addr - the address of memory to be read. The address must be appropriately aligned:

Target Device Alignment Requirements
PIC12,PIC16none
PIC1816-bit
PIC24,dsPIC3332-bit
PIC3232-bit

size - a number of address bytes to read. Must be rounded the same as addr alignment.

Return

The function returns the number of bytes containing memory information which will be returned back, or zero in case of error. The value returned may not be equal to size.

Notes

Not all devices can read ROM while debugging. Consult the mcu_debug_cap function to find out if it is supported.

This instruction only queues a command. The command will be sent to NSDSP when you queue enough commands to fill the buffer or when you call nsdsp_session_flush.

Once the data carrying the memory content arrives, you can retrieve the data with nsdsp_debug_fetch_flash_word function. You need to call it once per every instruction. To calculate the number of times you need to call nsdsp_debug_fetch_flash_word function, divide size by the number returned by mcu_instruction_spacing.

Usually, ROM does not change. Therefore, instead of reading ROM from the device, you can simply use whatever has been programmed. You can retrieve the data programmed on the chip by calling nsdsp_debug_get_flash_word function a number of times.

 

Minimum library version - 163

Northern Software Home NSDSP Contact Us Purchase/View Cart

© 2007-2025 Northern Software Inc. All Rights Reserved.