Do I need to go to properties and change some setting?
Right now I am trying to test a simple program,
uint8_t a = 6;
after couple of lines I am trying to print the value in a, by setting the dynamic breakpoint.
This is what I get in the debug console.
This is how my dynamic breakpoint looks like.
Solved! Go to Solution.
Create a new project or use the Quickstart Panel => Quick Settings shortcut. See sections 12.1 and 16.4 from User Guide.
Regards,
MCUXpresso IDE Support
My printf was working fine all of a sudden, not sure if I did something. I was using 11.5.0. But now it stopped working again. Getting the same error in debug console "No symbol "printf" in current context."
How can I have a printf() function present on the target?
can you show your context (console message, the code you are using) and the breakpoint settings?
Thank you for your quick response.
The yellow warning says "Breakpoint installation failed: suspended operation timeout"
I think the behavior is caused by an incorrect (or rather not according to your expectations) project configuration. If your work is based on an SDK example, you probably set "SDK Debug Console" to "UART" during the project creation. Thus, no "printf" available.
My assumption is also based on the usage of Redlib nohost-nf variant.
Regards,
MCUXpresso IDE Support
That's the problem, I do have SDK_DEBBUGCONSOLE selected,
Do I need to create a new project or can I some how select "DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN"?
Create a new project or use the Quickstart Panel => Quick Settings shortcut. See sections 12.1 and 16.4 from User Guide.
Regards,
MCUXpresso IDE Support
that's a good point!
In such a case the gdb can be directed to use the printf on the host using 'set dprintf-style'
how many breakpoints do you have? Try reduce the number of breakpoints (or use a SEGGER J-Link)?
I don't have a jlink. I am using ulink2(which was working few days back)Removed all the other breakpoint and just had this one but it's the same. Can't print in debug console. Got this error this time.
Is there any other way I can use printf, if I include "fsl_debug_console.h" and add this line "(void)PRINTF("g_tolBitmapBytes \" %d \n", g_tolBitmapBytes);"?
I cannot comment on the ulink2 (never used one), but I feel that could be the problem.
I would recommend to use one of the supported debug probes (P&E, SEGGER or NXP LinkServer) instead.
Sure you can use printf() in your code, but that won't stop/use the debugger, unless you are using semihosting.
Hi Erich! Thank you for your response.
I am using NXP MCUXpresso IDE 11.4.1.
I have used the dynamic printf before, but on a different windows machine, probably on MCUXpresso 11.4.0 and it worked like a charm. Not sure what's the matter this time.
Do I need to change something in here,
I can try to update my IDE to 11.5.0 and see if that helps.
Unfortunately I did run out of disk space and I had to uninstall the 11.4.x.
I think for some reasons for you it is using the printf of the application?
What does
show dprintf-style
report for you?
If not set to gdb, use
set dprintf-style gdb
to set it to gdb. Other than that: do you have the printf code in your application?
Hi @NVazquez ,
you might want to check out something I just wrote about: https://mcuoneclipse.com/2022/02/09/debugging-with-dynamic-printf-breakpoints/
What IDE are you using? I'm using the NXP MCUXpresso IDE 11.5.0 and there it uses gdb by default. Your error message indicates that your gdb is using the 'call' style with printf(), so you have to have the printf() function be present on the target.
I hope this helps,
Erich