SWO on FRDM-MCXN947 Pauses Under Debug Mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SWO on FRDM-MCXN947 Pauses Under Debug Mode

117 Views
kaosad
Contributor I

I followed this useful guide: ITM vs. UART Printing on MCUXpresso IDE. At first, I thought it wasn’t working because nothing appeared on the SWO ITM Console. Soon, I realized that the SWO pauses during active debugging. I have to press Resume (F8) just to see the output. This is frustrating because I cannot view log prints in real time while stepping through code. How can I fix this limitation?

Labels (2)
Tags (1)
0 Kudos
Reply
1 Reply

51 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi  @kaosad 

With ITM/SWO, data is generated and transmitted by the running target. When you hit a breakpoint or single-step, the Cortex-M core is halted, so the application stops executing and no new printf() / ITM_SendChar() calls occur. As a result, the SWO ITM Console only receives new messages while the MCU is running.

When you press Resume, the target runs again and the ITM hardware can stream trace data over SWO in real time. MCUXpresso's SWO mechanism is designed to capture events from a running MCU without interrupting execution.

BR

Harry

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2406469%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ESWO%20on%20FRDM-MCXN947%20Pauses%20Under%20Debug%20Mode%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2406469%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EI%20followed%20this%20useful%20guide%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMCUXpresso-IDE-Knowledge-Base%2FITM-vs-UART-Printing-on-MCUXpresso-IDE%2Fta-p%2F2252735%22%20target%3D%22_blank%22%3EITM%20vs.%20UART%20Printing%20on%20MCUXpresso%20IDE%3C%2FA%3E.%20At%20first%2C%20I%20thought%20it%20wasn%E2%80%99t%20working%20because%20nothing%20appeared%20on%20the%20SWO%20ITM%20Console.%20Soon%2C%20I%20realized%20that%20the%20SWO%20pauses%20during%20active%20debugging.%20I%20have%20to%20press%20%3CSTRONG%3EResume%20(F8)%3C%2FSTRONG%3E%20just%20to%20see%20the%20output.%26nbsp%3BThis%20is%20frustrating%20because%20I%20cannot%20view%20log%20prints%20in%20real%20time%20while%20stepping%20through%20code.%20How%20can%20I%20fix%20this%20limitation%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2406469%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EDevelopment%20Board%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMCXN%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2407348%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20SWO%20on%20FRDM-MCXN947%20Pauses%20Under%20Debug%20Mode%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2407348%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F265732%22%20target%3D%22_blank%22%3E%40kaosad%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20ITM%2FSWO%2C%20data%20is%20generated%20and%20transmitted%20by%20the%20running%20target.%20When%20you%20hit%20a%20breakpoint%20or%20single-step%2C%20the%20Cortex-M%20core%20is%20halted%2C%20so%20the%20application%20stops%20executing%20and%20no%20new%20printf()%20%2F%20ITM_SendChar()%20calls%20occur.%20As%20a%20result%2C%20the%20SWO%20ITM%20Console%20only%20receives%20new%20messages%20while%20the%20MCU%20is%20running.%3C%2FP%3E%0A%3CP%3EWhen%20you%20press%20Resume%2C%20the%20target%20runs%20again%20and%20the%20ITM%20hardware%20can%20stream%20trace%20data%20over%20SWO%20in%20real%20time.%20MCUXpresso's%20SWO%20mechanism%20is%20designed%20to%20capture%20events%20from%20a%20running%20MCU%20without%20interrupting%20execution.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E