nsdsp_set_debug_magic
nsdsp_set_debug_rom nsdsp_set_debug_ram nsdsp_set_debug_cores nsdsp_start_spi_session nsdsp_start_uart_session nsdsp_start_prog_session nsdsp_start_debug_session nsdsp_end_sessionnsdsp_set_debug_magic
This function sets a magic word for assisted debugging.
Syntax
void nsdsp_set_debug_magic(
nsdsp_t nsdsp,
unsigned int magic
);
Parameters
nsdsp - a reference to the NSDSP object returned by nsdsp_connect function
magic - the new magic word
Notes
When you use assisted debugging, the NSDSP Interface library scans the HEX file to locate NSDSP_DBG_ENTRY macro. The macro contains a "magic" word. The presence of this word, along with other checks, lets the library identify NSDSP_DBG_ENTRY macros.
The "magic" word is carefully chosen and uses instruction codes that are very unlikely to be found elsewhere in the code. In the vast majority of cases, the default magic word will work. Yet there is a very small probability that the same codes occur somewhere else in your code, in which case there may be a false detection. If this happens, you can use your own "magic" word.
To replace the default magic word with your own, you must change the magic word in two places:
1. In the project being debugged, define NSDSP_DBG_ENTRY macro, for example:
#define NSDSP_DBG_MAGIC 0x1234
or in compiler's command line:
-DNSDSP_DBG_MAGIC=0x1234
2. In your debugging code, call the nsdsp_set_debug_magic function, for example:
nsdsp_set_debug_magic(nsdsp_object,0x1234)
The magic word must be the same in both cases. It must fit into an instruction word, as defined by the mcu_instruction_bits function.
Minimum library version - 163
© 2007-2025 Northern Software Inc. All Rights Reserved.