nsdsp_debug_read_rom
nsdsp_debug_read_reg nsdsp_debug_read_bp_state nsdsp_debug_read_cp0 nsdsp_debug_read_stack nsdsp_debug_check_for_data nsdsp_debug_wait_for_data nsdsp_debug_fetch_data nsdsp_debug_fetch_data_nb nsdsp_debug_fetch_word nsdsp_debug_fetch_flash_word nsdsp_debug_fetch_float nsdsp_debug_fetch_double nsdsp_debug_fetch_stack nsdsp_debug_fetch_bp_state nsdsp_debug_write_ram nsdsp_debug_write_reg nsdsp_debug_write_float_reg nsdsp_debug_write_double_regnsdsp_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,PIC16 | none |
PIC18 | 16-bit |
PIC24,dsPIC33 | 32-bit |
PIC32 | 32-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
© 2007-2025 Northern Software Inc. All Rights Reserved.