The microcontroller I'm using is RM48L952, debugger is XDS110 and CCS version is 7.3.0.00019
When I press debug button in CCS to load program to cpu and resume debugging session, debugging window shows (Suspended - Cross-triggering) and no longer able to manipulate cpu.
I successfully narrowed down where the problem is:
void Copy(uint8_t *src, uint8_t *dst, uint32_t length) { uint32_t i; for(i = 0; i < length; ++i) { dst[i] = src[i]; } } static void LowPwmInit() { static const hetINSTRUCTION_t hetProgram[34] = { ... }; hetREG1->GCR &= 0xfffffffe; Copy((uint8_t *)hetProgram, (uint8_t *)hetRam, sizeof(hetProgram)); // (void)memcpy((void *)hetRam, (const void *)hetProgram, sizeof(hetProgram)); hetREG1->GCR |= 0x00000001; }
The problem occurs when I called Copy function in LowPwmInit function. Copy function stops proceeding when loop(i) reaches 0x20(32). But it's just copy function, nothing fancy. The program runs fine when I use memcpy instead of Copy.
What's even more weird is that when I'm not debugging, for example when I turn off and turn on the power, machine operates just as expected. My functions doesn't seem to have obvious bugs and I think it's somehow related to debugging.
What can be the problem?