Jul 06, 2018
06:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 06, 2018
06:25 AM
Hello Guys,
I am currently using Dave 4.4.2. and working with XMC4500 hexagon kit. I have browsed many threads regarding using SWO console
for printing debug messages.I have read and tried everything related to turning on the print functionality. But unfortunately, nothing
seems to work out.
Is anybody else facing the same problem? If not, then could anybody guide me on how to configure it correclty ?
I really beg for some help.
I am currently using Dave 4.4.2. and working with XMC4500 hexagon kit. I have browsed many threads regarding using SWO console
for printing debug messages.I have read and tried everything related to turning on the print functionality. But unfortunately, nothing
seems to work out.
Is anybody else facing the same problem? If not, then could anybody guide me on how to configure it correclty ?
I really beg for some help.
- Tags:
- IFX
11 Replies
Attachments are accessible only for community members.
Jul 09, 2018
02:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 09, 2018
02:23 AM
Hi,
See attached project.
Follow these instructions:
1. Define XMC_DEBUG_ENABLE (which uses printf)
2. Linker options, enable semihosting by adding --specs=rdimon.specs in Other flags text entry
3. In the debugger configuration, enable semihosting and click on GDB client
4. After the debugger is launched, switch to the Semihosting and SSW view
Regards,
Jesus
See attached project.
Follow these instructions:
1. Define XMC_DEBUG_ENABLE (which uses printf)
2. Linker options, enable semihosting by adding --specs=rdimon.specs in Other flags text entry
3. In the debugger configuration, enable semihosting and click on GDB client
4. After the debugger is launched, switch to the Semihosting and SSW view
Regards,
Jesus
Jul 09, 2018
05:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 09, 2018
05:47 AM
Thanks jferreira,
its working now.
its working now.
Dec 18, 2018
04:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 18, 2018
04:46 AM
Hi Jesus
I followed your steps above but it still doesn't working.
I get the following error:
Starting target CPU...
WARNING: Semihosting command SYS_FLEN failed. Handle is 0.
WARNING: Semihosting command SYS_WRITE failed. Handle is 0.
Unfortunatelly your example did also not help as the importent part (the "initialise_monitor_handles" function) seems to be missing.
Do you have an idea what I could try?
I followed your steps above but it still doesn't working.
I get the following error:
Starting target CPU...
WARNING: Semihosting command SYS_FLEN failed. Handle is 0.
WARNING: Semihosting command SYS_WRITE failed. Handle is 0.
Unfortunatelly your example did also not help as the importent part (the "initialise_monitor_handles" function) seems to be missing.
Do you have an idea what I could try?
Jan 08, 2019
03:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 08, 2019
03:57 AM
Hi,
You need to use in the linker settings, -specs=rdimon.specs
Regards,
Jesus
You need to use in the linker settings, -specs=rdimon.specs
Regards,
Jesus
Jun 11, 2019
03:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 11, 2019
03:09 AM
Hi Infineon,
it runs fine on C source files, but I have no success on C++ source files. There is no code generated of fct initialise_monitor_handles.
My source compiles without error:
#include
extern "C" void initialise_monitor_handles(void);
int main(void) {
void initialise_monitor_handles();
while (1) {
XMC_DEBUG("Hello\n");
}
return 0;
}
Settings:
C++ compiler and C compiler preprocesser XMC_DEBUG_ENABLE added
C++ linker --specs=rdimon.specs at Other flags added
Unfortunately no source of fct initialise_monitor_handles() available.
Please what's wrong?
Best Regards
Wolfgang
it runs fine on C source files, but I have no success on C++ source files. There is no code generated of fct initialise_monitor_handles.
My source compiles without error:
#include
extern "C" void initialise_monitor_handles(void);
int main(void) {
void initialise_monitor_handles();
while (1) {
XMC_DEBUG("Hello\n");
}
return 0;
}
Settings:
C++ compiler and C compiler preprocesser XMC_DEBUG_ENABLE added
C++ linker --specs=rdimon.specs at Other flags added
Unfortunately no source of fct initialise_monitor_handles() available.
Please what's wrong?
Best Regards
Wolfgang
Jun 28, 2019
06:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 28, 2019
06:20 AM
Oh, now I see the mistake, I am guilty, not C++, there is a 'void' too much in the code.
'void initialise_monitor_handles();' that's not a fct call, but a fct declaration.
This C++ code runs fine:
#include
extern "C" void initialise_monitor_handles(void);
int main(void) {
initialise_monitor_handles();
XMC_DEBUG("Hello\n");
return 0;
}
Best Regards
Wolfgang
'void initialise_monitor_handles();' that's not a fct call, but a fct declaration.
This C++ code runs fine:
#include
extern "C" void initialise_monitor_handles(void);
int main(void) {
initialise_monitor_handles();
XMC_DEBUG("Hello\n");
return 0;
}
Best Regards
Wolfgang
Sep 19, 2019
02:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 19, 2019
02:26 PM
The solution mentioned is correct.
1. enable the XMC_DEBUG flag
2. add the 'extern void initialise_monitor_handles(void);' declaration in the file where calling XMC_DEBUG
3. Call the initialise_monitor_handles() function before calling the XMC_DEBUG function,
4. In the debugger settings, enable Semihosting over GDB under 'Startup' tab.
5. Debug the program. The output should be visible under the 'Semihosting and SWV' thread.
For some older versions of DAVE some additional preprocessor symbols have been added. I did not add these for DAVE 4.4.2.
1. enable the XMC_DEBUG flag
2. add the 'extern void initialise_monitor_handles(void);' declaration in the file where calling XMC_DEBUG
3. Call the initialise_monitor_handles() function before calling the XMC_DEBUG function,
4. In the debugger settings, enable Semihosting over GDB under 'Startup' tab.
5. Debug the program. The output should be visible under the 'Semihosting and SWV' thread.
For some older versions of DAVE some additional preprocessor symbols have been added. I did not add these for DAVE 4.4.2.
Nov 23, 2019
11:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 23, 2019
11:37 AM
Hi,
there is a trap, which costed me 2 hours:
Don't forget the new line character ("\n") at the end of the string. Otherwise you will see nothing on your semihosting window.
The new line character must be part of the string:
XMC_DEBUG ("Hello\n");
This version also shows nothing on the screen:
XMC_DEBUG ("Hello");
XMC_DEBUG ("\n");
When using sprintf to display numeric values, this code runs (prints value of x in decimal number format):
char buffer[20];
sprintf (buffer, "%d \n", x);
XMC_DEBUG (buffer);
there is a trap, which costed me 2 hours:
Don't forget the new line character ("\n") at the end of the string. Otherwise you will see nothing on your semihosting window.
The new line character must be part of the string:
XMC_DEBUG ("Hello\n");
This version also shows nothing on the screen:
XMC_DEBUG ("Hello");
XMC_DEBUG ("\n");
When using sprintf to display numeric values, this code runs (prints value of x in decimal number format):
char buffer[20];
sprintf (buffer, "%d \n", x);
XMC_DEBUG (buffer);
Nov 24, 2019
11:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 24, 2019
11:35 PM
Hi,
Alternatively you can use, https://stackoverflow.com/questions/1716296/why-does-printf-not-flush-after-the-call-unless-a-newlin...
Regards,
Jesus
Alternatively you can use, https://stackoverflow.com/questions/1716296/why-does-printf-not-flush-after-the-call-unless-a-newlin...
Regards,
Jesus
Nov 27, 2019
11:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 27, 2019
11:31 AM
Hi Jesus,
you recommend to use
fprintf (stderr, "Text to display");
instead of XMC_DEBUG?
A first test was not successful, only the first character (the "T") was displayed.
Best Regards,
Wolfgang
you recommend to use
fprintf (stderr, "Text to display");
instead of XMC_DEBUG?
A first test was not successful, only the first character (the "T") was displayed.
Best Regards,
Wolfgang
Apr 02, 2022
02:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 02, 2022
02:58 AM
I hope this is helpful, I just recorded this by following the steps in this thread.