[SOLVED] Extend SystemView tartget printf interfaces with vprintf APIs

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Extend SystemView tartget printf interfaces with vprintf APIs

    Hi Segger Team,

    it would be very nice to add APIs for the printf functions with va_list* pParamList instead of ... for target so upper layer software can pass on parameters passed to them via ....

    We currently do this by patching the files to directly exposing _VPrintTarget to the header (making this function global).


    As this solution isn't the right manner and we like to have this in the original release i propose following changes to SystemView:

    C Source Code: SEGGER_SYSVIEW.h

    1. /*********************************************************************
    2. *
    3. * printf-Style functions
    4. */
    5. #ifndef SEGGER_SYSVIEW_EXCLUDE_PRINTF // Define in project to avoid warnings about variable parameter list
    6. void SEGGER_SYSVIEW_PrintfHostEx (const char* s, U32 Options, ...);
    7. void SEGGER_SYSVIEW_PrintfTargetEx (const char* s, U32 Options, ...);
    8. void SEGGER_SYSVIEW_VPrintfTargetEx (const char* s, U32 Options, va_list* pParamList);
    9. void SEGGER_SYSVIEW_PrintfHost (const char* s, ...);
    10. void SEGGER_SYSVIEW_PrintfTarget (const char* s, ...);
    11. void SEGGER_SYSVIEW_VPrintfTarget (const char* s, va_list* pParamList);
    12. void SEGGER_SYSVIEW_WarnfHost (const char* s, ...);
    13. void SEGGER_SYSVIEW_WarnfTarget (const char* s, ...);
    14. void SEGGER_SYSVIEW_VWarnfTarget (const char* s, va_list* pParamList);
    15. void SEGGER_SYSVIEW_ErrorfHost (const char* s, ...);
    16. void SEGGER_SYSVIEW_ErrorfTarget (const char* s, ...);
    17. void SEGGER_SYSVIEW_VErrorfTarget (const char* s, va_list* pParamList);
    18. #endif
    Display All

    Source Code: SEGGER_SYSVIEW.c

    1. /*********************************************************************
    2. *
    3. * SEGGER_SYSVIEW_VPrintfTargetEx()
    4. *
    5. * Function description
    6. * Print a string which is formatted on the target before sent to
    7. * the host with Additional information.
    8. *
    9. * Parameters
    10. * s - String to be formatted.
    11. * Options - Options for the string. i.e. Log level.
    12. * pParamList - Pointer to the list of arguments for the format string
    13. */
    14. void SEGGER_SYSVIEW_VPrintfTargetEx(const char* s, U32 Options, va_list *pParamList) {
    15. _VPrintTarget(s, Options, pParamList);
    16. }
    Display All

    Source Code: SEGGER_SYSVIEW.c

    1. /*********************************************************************
    2. *
    3. * SEGGER_SYSVIEW_VPrintfTarget()
    4. *
    5. * Function description
    6. * Print a string which is formatted on the target before sent to
    7. * the host.
    8. *
    9. * Parameters
    10. * s - String to be formatted.
    11. * pParamList - Pointer to the list of arguments for the format string
    12. */
    13. void SEGGER_SYSVIEW_VPrintfTarget(const char* s, va_list* pParamList) {
    14. _VPrintTarget(s, SEGGER_SYSVIEW_LOG, pParamList);
    15. }
    Display All
    and so on


    I can provide proper patch files if you like?

    Best regards
    Philipp Häfele
  • Hello Phillip,

    Thank you for your inquiry.
    Sounds reasonable to me.

    Could you provide the patch files via our support channel as explained in my signature so we can take a look?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Nino,

    no problem, will create a ticket with the patch files for it.

    Just found this forum better for discussion, as the Segger GitHub repo is somehow abandoned.

    May take a little bit, as i haven't prepared the patch right now and i'm out of office for some time soon.

    Best regards

    Philipp
  • Hi Phillip,

    You can also share the patches here of course.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.