5 Replies Latest reply on Jul 30, 2018 6:33 AM by dashberlin407_3612021

    Get string from user.

    jeremyhiggins_3339861

      I am attempting to create a simple command line interface for a WICED project.

       

      For now, I just need a loop in my program that continuously reads from the USB cable attached to the WICED board, then processes whatever string it pulls from it.

       

      I've tried to implement a standard "getline()" approach, but when I run the Make Target, the console complains about the function being implicitly defined.

       

      I have #included <stdio.h> and <stdlib.h>, so I don't know why the build is failing.

       

      What am I doing wrong?

        • 1. Re: Get string from user.
          jeremyhiggins_3339861

          Digging into this a bit more, it appears that since memory on the WICED board is limited, dynamic memory allocation isn't supported, thus any library that includes dynamic memory functions is rejected during compiling...I guess? I don't know why the error message doesn't just say that directly.

           

          So, I guess I should just get messages from STDIN with a static buffer?

          • 2. Re: Get string from user.
            riya

            Hello Jeremy,

            The WICED board shows the UART logs on the terminal when you build an application. You can use the same terminal to receive strings of data, basically it is receive operation from UART. Please have a look at the WICED Wi-Fi 101: Chapter 2-6 UART for accepting and sending data from/to the terminal.
            Let me know if you were able to read data

            1 of 1 people found this helpful
            • 3. Re: Get string from user.
              jeremyhiggins_3339861

              I found that example just a few hours after I posted.  : /

               

              I am in the process of editing it for my experimental needs, but for some reason, the Make Target no longer recognizes my CYW943907AEVAL1F board.

              • 4. Re: Get string from user.
                jeremyhiggins_3339861

                I managed to figure out what I was doing wrong. I've now got a working, bi-directional UART program running on a WICED board now.

                 

                However, it only Receives/Transmits data across the board's standard USB connection.

                Is it at all possible to redirect the Transmission and Receiving of UART data to the TX and RX pins on the board itself?

                 

                I have a USB-to-UART cable to work with, but when I wired it up to the TX, RX, GND, and Vin pins on the board, I could not recreate the behavior from PuTTY when the board was connected via USB.

                • 5. Re: Get string from user.
                  dashberlin407_3612021

                  The WICED board suggests the UART logs on the terminal while you build an application. You can use the identical terminal to get hold of strings of statistics, essentially it's far getting hold of operation from UART. Please have a have a look at the WICED Wi-Fi 101: Chapter 2-6 UART for accepting and sending facts from/to the terminal.