Hey Adam,
Thanks for the reply. I seem to have fixed the issue by moving StartProfiler() under EnableGlobalIRQ(). I am a little uncomfortable about this because I am unsure as to why moving the Profiler under the IRQ enable would resolve this issue, as you do not run this sequence of events in your KMS project.
This is the sequence of events in which the profiler was hanging each time without the debugger connected:
/* Init Platform Independent Motor Commander Core */
DRV_init(&flashSysParams);
/* Enable the Profile to be free running */
StartProfiler();
/* Enable UART ISRs */
NVIC_EnableIRQ(UART1_RX_TX_IRQn);
NVIC_SetPriority(UART1_RX_TX_IRQn, 14);
NVIC_EnableIRQ(UART1_ERR_IRQn);
NVIC_SetPriority(UART1_ERR_IRQn, 14);
focPwmDecimation = flashSysParamsHeader.FocPwmDecimation; /*!< PWM to Fast ISR Decimation */
fastTicksPerSlowTick = flashSysParamsHeader.fastTicksPerSlowTick; /*!< Fast to Slow ISR Decimation */
/* Enable Global interrupts */
EnableGlobalIRQ(ui32PrimaskReg);
/* Install handler for ADC1 (conversion complete) interrupt */
NVIC_EnableIRQ(ADC1_IRQn); /* enable ADC1 interrupt */
NVIC_SetPriority(ADC1_IRQn, 12);
/* Enable PDB0 ISR */
NVIC_EnableIRQ(PDB0_IRQn);
NVIC_SetPriority(PDB0_IRQn, 13);
/* Use the SWI IRQ to trigger the slow tick routine */
NVIC_EnableIRQ(SWI_IRQn);
NVIC_SetPriority(SWI_IRQn, 15);
I changed this to the following, and not the profiler starts every time without a problem:
/* Init Platform Independent Motor Commander Core */
DRV_init(&flashSysParams);
/* Enable UART ISRs */
NVIC_EnableIRQ(UART1_RX_TX_IRQn);
NVIC_SetPriority(UART1_RX_TX_IRQn, 14);
NVIC_EnableIRQ(UART1_ERR_IRQn);
NVIC_SetPriority(UART1_ERR_IRQn, 14);
focPwmDecimation = flashSysParamsHeader.FocPwmDecimation; /*!< PWM to Fast ISR Decimation */
fastTicksPerSlowTick = flashSysParamsHeader.fastTicksPerSlowTick; /*!< Fast to Slow ISR Decimation */
/* Enable Global interrupts */
EnableGlobalIRQ(ui32PrimaskReg);
/* Enable the Profile to be free running */
StartProfiler();
/* Install handler for ADC1 (conversion complete) interrupt */
NVIC_EnableIRQ(ADC1_IRQn); /* enable ADC1 interrupt */
NVIC_SetPriority(ADC1_IRQn, 12);
/* Enable PDB0 ISR */
NVIC_EnableIRQ(PDB0_IRQn);
NVIC_SetPriority(PDB0_IRQn, 13);
/* Use the SWI IRQ to trigger the slow tick routine */
NVIC_EnableIRQ(SWI_IRQn);
NVIC_SetPriority(SWI_IRQn, 15);