Keil Logo

µVISION DEBUGGER: Argument Invalid When Using Debugger Function


Information in this article applies to:

  • µVision Version 2.05 and later

QUESTION

I'm having trouble using debugger functions with printf. In my C program, I create a global string:

char tststring[25] ={"Test string\0"};

In the debugger, I create a debug function to print this string:

FUNC void string(void)
{
printf (" %s\n",tststring);
}

The debugger gives me the following error message:

printf: argument 2 invalid

What's wrong with my debug function?

ANSWER

You cannot use variables from your C program in debug functions that way. Additionally, debug functions do not support structures, arrays, or pointers. A C string is an array of characters, so it isn't supported.

MORE INFORMATION

Last Reviewed: Wednesday, January 27, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.