Buy Contact NSDSP Home

mcu_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 ConstantMeaning
0MCU_MEM_NONENo memory at the address
1MCU_MEM_CODECode (instruction) memory
2MCU_MEM_CONFIGConfiguration bits
3MCU_MEM_EEPROMEEPROM
4MCU_MEM_UIDUser id
5MCU_MEM_OTPOne Time Programmable memory
6MCU_MEM_SYSTEMSystem 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

Northern Software Home NSDSP Contact Us Purchase/View Cart

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