infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 7 of 7

Thread: printf in DAVE4.4.2

  1. #1
    New Member New Member jkavathia is on a distinguished road
    Join Date
    May 2018
    Posts
    8
    Points
    52.5

    printf in DAVE4.4.2

    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.

  2. #2

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    571
    Hi,

    See attached project.
    Follow these instructions:
    1. Define XMC_DEBUG_ENABLE (which uses printf)
    Click image for larger version

Name:	Define_XMC_DEBUG_ENABLE.png
Views:	31
Size:	45.1 KB
ID:	3524
    2. Linker options, enable semihosting by adding --specs=rdimon.specs in Other flags text entry
    Click image for larger version

Name:	enable_semihosting.png
Views:	37
Size:	45.7 KB
ID:	3525
    3. In the debugger configuration, enable semihosting and click on GDB client
    Click image for larger version

Name:	enable_semihosting2.png
Views:	26
Size:	46.0 KB
ID:	3526
    4. After the debugger is launched, switch to the Semihosting and SSW view
    Click image for larger version

Name:	enable_semihosting3.png
Views:	27
Size:	28.0 KB
ID:	3527

    Regards,
    Jesus
    ?????
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    New Member New Member jkavathia is on a distinguished road
    Join Date
    May 2018
    Posts
    8
    Points
    52.5
    Thanks jferreira,

    its working now.

  4. #4
    New Member New Member FlyHigh is on a distinguished road
    Join Date
    Dec 2018
    Posts
    1
    Points
    20
    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?

  5. #5

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    571
    Hi,

    You need to use in the linker settings, -specs=rdimon.specs

    Regards,
    Jesus
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  6. #6
    Intermediate Intermediate Ing99 is on a distinguished road
    Join Date
    Oct 2013
    Location
    Germany
    Posts
    72
    Points
    305.546875
    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 <xmc_common.h>
    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

  7. #7
    Intermediate Intermediate Ing99 is on a distinguished road
    Join Date
    Oct 2013
    Location
    Germany
    Posts
    72
    Points
    305.546875
    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 <xmc_common.h>
    extern "C" void initialise_monitor_handles(void);

    int main(void) {
    initialise_monitor_handles();
    XMC_DEBUG("Hello\n");
    return 0;
    }

    Best Regards
    Wolfgang

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.