5 Replies Latest reply on Dec 19, 2015 8:50 AM by userc_40679

    vsprintf() doesn't build in USB EZ Suite

      When I try to use vsprintf() in USB EZ Suite I get this error (during link) ...

      undefined reference to `_sbrk'    SlaveFifoSync        line 0    C/C++ Problem




      Here's an example function to test it with:



      #include <stdio.h>
      #include <stdarg.h>


      void myDebug(int num, const char * format, ...)
          char buffer[256];
          CyU3PReturnStatus_t apiRetStatus;
          int    res;


          va_list args;


          va_start (args, format);
          res = vsprintf(buffer, format, args);

          if (res >= 0)
              CyU3PUartTransmitBytes ((uint8_t *)&buffer, res, &apiRetStatus);
          va_end (args);




      If you comment out the vsprintf line, the error disappears, indicating that vsprintf is the culprit.