mcu_test_memory
mcu_hex_factor mcu_instruction_bits mcu_config_bits mcu_eeprom_bits mcu_uid_bits mcu_instruction_spacing mcu_config_spacing mcu_eeprom_spacing mcu_uid_spacing mcu_erase_page_size mcu_write_row_size mcu_id mcu_can_use_method mcu_can_debug mcu_debug_cap mcu_bp_classes mcu_bp_class_first mcu_bp_class_count mcu_bp_class_cap mcu_bp_class_max_count mcu_debug_rom_reserve mcu_debug_ram_reservemcu_test_memory
This function is designed to analyze memory within Hex Map objects. The function tests an address and returns the type of memory located at the address.
Syntax
int mcu_test_memory(
mcu_t mcu,
unsigned int hex_addr
);
Parameters
mcu - a reference to the MCU object returned by mcu_create or mcu_get_slave_core function.
hex_addr - The address to test. Note that this address refers to the HEX file address, not to the address in program memory.
For PIC12, PIC16, PIC24, dsPIC30, and dsPIC33 the HEX addresses are doubled. For example memory address 0x200 will be represented as 0x400 in the HEX file and in the Hex Block structure.
Return
The function returns one of the following constants:
| Value | Constant | Meaning |
|---|---|---|
| 0 | MCU_MEM_NONE | No memory at the address |
| 1 | MCU_MEM_CODE | Code (instruction) memory |
| 2 | MCU_MEM_CONFIG | Configuration bits |
| 3 | MCU_MEM_EEPROM | EEPROM |
| 4 | MCU_MEM_UID | User id |
| 5 | MCU_MEM_OTP | One Time Programmable memory |
| 6 | MCU_MEM_SYSTEM | System memory |
Notes
EEPROM may have its own address space, different from the program space. However there is always an address range in the Hex file where EEPROM addresses are mapped to. If an address falls into this range, it'll be classified
System memory refers to special address ranges which may be present in the Hex file, but cannot be programmed to the device using ordinary means. An example is FBOOT register in dsPIC33.
Minimum library version - 163
© 2007-2026 Northern Software Inc. All Rights Reserved.