Get string from user.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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?

0 Likes
1 Solution
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

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

View solution in original post

5 Replies
Anonymous
Not applicable

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?

0 Likes
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

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

Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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.

0 Likes