MCU Object
mcu_create mcu_get_slave_core mcu_free mcu_can_partition mcu_partition mcu_can_swap 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 Object
MCU object represents a target device. The object can be used to gather information about the device. It is also necessary to specify the target device when you do programming or debugging.
Type
typedef struct mcu *mcu_t;
mcu_t is an opaque reference to an MCU object. It is passed to all functions dealing with MCU objects.
Creation and Destruction
To create an MCU object you need to know the device name which needs to be passed to mcu_create function.
When an MCU object is no longer needed, it must be freed using mcu_free function.
Memory Information
Target devices may have different types of non-volatile memory, such as program memory, configuration memory, EEPROM, user id. These memory types may have different characteristics.
The mcu_instruction_bits, mcu_config_bits, mcu_eeprom_bits, and mcu_uid_bits functions return the word size (in bits) for different types of memory.
The mcu_instruction_spacing, mcu_config_spacing, mcu_eeprom_spacing, and mcu_uid_spacing functions return the spacing (the difference between consecutive addresses) for various memory types.
The mcu_test_memory function determines the type of memory at the specified HEX file address.
The mcu_hex_factor function returns a HEX factor. You can use the HEX factor to convert device addresses to HEX file addresses,
Programming Information
The mcu_id function returns the device id.
The mcu_can_use_method function determines if a particular programming method is suitable for the device.
The mcu_erase_page_size and mcu_write_row_size functions return information on flash paging.
Debugging Information
The mcu_can_debug function determines whether a device can be debugged with NSDSP debugger or not.
The mcu_debug_cap function enumerates debugging capabilities of the target device.
The mcu_bp_classes returns the number of different hardware breakpoint classes present in the device while the mcu_bp_class_first, mcu_bp_class_count, mcu_bp_class_cap, and mcu_bp_class_max_count functions return information about breakpoints in each of the classes.
The mcu_debug_rom_reserve and mcu_debug_ram_reserve functions determine the requirements for the NSDSP debugger.
Devices with Swappable Partitions
Some of the target devices may have swappable partitions. The mcu_can_swap function determines whether the device has partitions that can be swapped.
On some devices, the partitions exist permanently. Other devices are not partitioned but can be partitioned by altering configuration bits. The mcu_can_partition function determines if the device can be partitioned. For such devices, the MCU objects contain information about unpartitioned devices, but you can use the mcu_partition function to modify the MCU object so that it contains the information about the partitioned device.
Multi-core Devices
If the device has multiple cores, the mcu_create function will create an object for the main core. You can then call mcu_get_slave_core function to retrieve MCU objects for subordinate cores.
© 2007-2025 Northern Software Inc. All Rights Reserved.