Wio Lite RISC-V
Wio Lite RISC-V es una placa de desarrollo con factor de forma Feather basada en RISC-V GD32VF103, con un núcleo WiFi ESP8266 Wio Core integrado, que le otorga función WiFi.
El GD32VF103CBT6 es un núcleo Bumblebee basado en Nuclei System Technology. Soporta el conjunto de instrucciones RV32IMAC y la función de interrupción rápida ECLIC. El consumo de energía del núcleo es solo 1/3 del de un Cortex-M3 tradicional.
El núcleo WiFi ESP8266 y el circuito de carga para batería LiPo a bordo hacen de esta placa una solución ideal para IoT. Además, cuenta con una ranura micro SD en la parte trasera para ampliar recursos del sistema.
Como parte de la familia Wio Lite, el Wio Lite RISC-V es totalmente compatible con el Grove Shield para Wio Lite, que permite usar más de 200 módulos Grove. Por ejemplo, puedes usar cualquier OLED Grove para convertirlo en una placa de desarrollo visual.
Características
- MCU RISC-V GD32VF103CBT6
- Núcleo WiFi ESP8266 Wio Core
- Factor de forma Feather
- Puerto JST2.0 para batería LiPo
- Ranura SD onboard
- USB Tipo C
Vista General del Hardware
Plataformas Soportadas
PlatformIO | Arduino | Raspberry Pi | ||
---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() |
Primeros Pasos
Primeros pasos con PlatformIO
Hardware
Materiales necesarios
-
Paso 1: Conecta la placa Wio Lite y tu PC mediante el cable USB Tipo C a A para alimentación y comunicación serial.
Software
El RISC-V GD32 ya cuenta con soporte para PlatformIO IDE usando el framework Arduino, pero hasta ahora no tiene soporte para Arduino IDE directamente.
- Paso 1:
Configura PlatformIO IDE, que se basa en Visual Studio Code.
Descarga Visual Studio Code.
Haz clic en el icono "Extensiones" en el lado izquierdo.
Escribe "platformIO" en el buscador e instálalo.
- Paso 2:
Abre PlatformIO IDE y haz clic en "New project" para crear un proyecto nuevo.
Escribe el nombre del proyecto y elige la placa GD32VF103V-EVAL(Sipeed). El framework es Arduino. Haz clic en "Finish".
- Paso 3:
Edita tu código usando el framework Arduino y compílalo con el botón en la parte inferior de Visual Studio Code.
- Paso 4:
El código se compila en un archivo binario. Puedes usar la herramienta DFU para cargar el binario en la placa. Necesitas instalar el firmware DFU para permitir la descarga vía DFU, que está incluido en el mismo paquete de la herramienta DFU.
- Paso 5:
Presiona el botón reset en el Wio Lite mientras mantienes presionado el interruptor "boot" en el lado izquierdo; la herramienta DFU reconocerá la placa luego de instalar el firmware DFU.
Ahora cambia el interruptor "boot" al lado derecho, selecciona tu archivo binario compilado y cárgalo en la memoria flash de la placa. Haz clic en "Leave DFU" para desconectar la herramienta DFU y tu código estará correctamente instalado.
Demo: Controlar el LED de usuario onboard vía web
Hardware
Materiales necesarios
-
Adaptador USB a TTL, como el UartSBee V5
-
Paso 1: Conecta el adaptador USB a TTL al puerto serial del Wio Lite (pines PA9-TX y PA10-RX).
-
Paso 2: (Opcional) Usa otro adaptador USB a TTL para monitorear la comunicación del ESP8266.
-
Paso 3: Conecta la placa Wio Lite a tu PC vía cable USB Tipo C a A para alimentación y comunicación.
Código de software
#include <Arduino.h>
const bool printReply = true;
const char line[] = "-----\n\r";
int loopCount=0;
char html[50];
char command[20];
char reply[500]; // you wouldn't normally do this
char ipAddress [20];
char LED[30];
int lenHtml = 0;
char temp[5];
void getReply(int wait)
{
int tempPos = 0;
long int time = millis();
while( (time + wait) > millis())
{
while(Serial1.available()>0)
{
char c = Serial1.read();
if (tempPos < 500) { reply[tempPos] = c; tempPos++; }
}
reply[tempPos] = 0;
}
if (printReply) { Serial.println( reply ); Serial.println(line); }
}
void setup()
{
Serial.begin(115200); //serial port of GD32
Serial1.begin(115200); //serial port of ESP8266
pinMode(LED_BUILTIN, OUTPUT);
delay(3000);
Serial1.println("AT+CWQAP");
getReply(2000);
Serial1.println("AT+CWMODE=1");
getReply(2000);
Serial1.println("AT+CWJAP=\"Your WiFi SSID\",\"Password\""); // add your own wifi
getReply(5000);
Serial1.print("AT+CIFSR\r\n");
getReply(2000);
int len = strlen( reply );
bool done=false;
bool error = false;
int pos = 0;
while (!done)
{
if ( reply[pos] == 34) { done = true;}
pos++;
if (pos > len) { done = true; error = true;}
}
if (!error)
{
int buffpos = 0;
done = false;
while (!done)
{
if ( reply[pos] == 34 ) { done = true; }
else { ipAddress[buffpos] = reply[pos]; buffpos++; pos++; }
}
ipAddress[buffpos] = 0;
}
else { strcpy(ipAddress,"ERROR"); }
Serial.println(ipAddress);
Serial1.print("AT+CIPMUX=1\r\n");
getReply( 1500 );
Serial1.print("AT+CIPSERVER=1,80\r\n");
getReply( 1500 );
}
void loop()
{
if(Serial1.available()) // check if the ESO8266 is sending data
{
// this is the +IPD reply - it is quite long.
// normally you would not need to copy the whole message in to a variable you can copy up to "HOST" only
// or you can just search the data character by character as you read the serial port.
getReply( 2000 );
bool foundIPD = false;
for (int i=0; i<strlen(reply); i++)
{
if ( (reply[i]=='I') && (reply[i+1]=='P') && (reply[i+2]=='D') ) { foundIPD = true; }
}
if ( foundIPD )
{
loopCount++;
// Serial.print( "Have a request. Loop = "); Serial.println(loopCount); Serial.println("");
bool LEDstate = false;
int LEDstatepos = 0;
for (int i=0; i<strlen(reply); i++)
{
if (!LEDstate) // just get the first occurrence of name
{
if ( (reply[i]=='L') && (reply[i+1]=='E')&& (reply[i+2]=='D')&& (reply[i+3]=='='))
{
LEDstate = true;
LEDstatepos = i+4;
}
}
}
if (LEDstate)
{
int tempPos = 0;
bool finishedCopying = false;
for (int i= LEDstatepos; i<strlen(reply); i++)
{
if ( (reply[i]==' ') && !finishedCopying ) { finishedCopying = true; }
if ( !finishedCopying ) { LED[tempPos] = reply[i]; tempPos++; }
}
//LED[tempPos] = 0;
}
if (LEDstate) { Serial.print( "LED state = "); Serial.println(LED); Serial.println("");
}
else { Serial.println( "format incorrect"); Serial.println(""); }
Serial.println("111");
Serial.println(LED);
Serial.println("000");
if(strcmp(LED,"on")==0){digitalWrite(LED_BUILTIN, HIGH); }
if(strcmp(LED ,"off")==0){digitalWrite(LED_BUILTIN, LOW); }
strcpy(html,"<html><head></head><body>");
strcpy(command,"AT+CIPSEND=0,25\r\n");
Serial1.print(command);
getReply(2000);
Serial1.print(html);
getReply(2000);
strcpy(html,"<h1>LED Test</h1>");
strcpy(command,"AT+CIPSEND=0,17\r\n");
Serial1.print(command);
getReply(2000);
Serial1.print(html);
getReply(2000);
strcpy(html,"<p>LED Statment</p>");
strcpy(command,"AT+CIPSEND=0,19\r\n");
Serial1.print(command);
getReply(2000);
Serial1.print(html);
getReply(2000);
if (LEDstate)
{
// write name
strcpy(html,"<p>LED state is "); strcat(html, LED ); strcat(html,"</p>");
// need the length of html for the cipsend command
lenHtml = strlen( html );
strcpy(command,"AT+CIPSEND=0,"); __itoa( lenHtml, temp, 10); strcat(command, temp); strcat(command, "\r\n");
Serial1.print(command);
getReply( 2000 );
Serial1.print(html);
getReply( 2000 );
}
strcpy(html,"<form action=\""); strcat(html, ipAddress); strcat(html, "\" method=\"GET\">"); strcat(command, "\r\n");
lenHtml = strlen( html );
__itoa( lenHtml, temp, 10);
strcpy(command,"AT+CIPSEND=0,");
__itoa( lenHtml, temp, 10);
strcat(command, temp);
strcat(command, "\r\n");
Serial1.print(command);
getReply( 2000 );
Serial1.print(html);
getReply( 2000 );
strcpy(html,"LEDstate:<br><input type=\"text\" name=\"LED\">");
strcpy(command,"AT+CIPSEND=0,43\r\n");
Serial1.print(command);
getReply( 2000 );
Serial1.print(html);
getReply( 2000 );
strcpy(html,"<input type=\"submit\" value=\"Submit\"></form>");
strcpy(command,"AT+CIPSEND=0,43\r\n");
Serial1.print(command);
getReply( 2000 );
Serial1.print(html);
getReply( 2000 );
strcpy(html,"</body></html>");
strcpy(command,"AT+CIPSEND=0,14\r\n");
Serial1.print(command);
getReply( 2000 );
Serial1.print(html);
getReply( 2000 );
Serial1.print( "AT+CIPCLOSE=0\r\n" );
getReply( 1500 );
} // if(espSerial.find("+IPD"))
} //if(espSerial.available())
for (int i=0; i<3 ;i++)
{LED[i]=NULL;}
delay (100);
// drop to here and wait for next request.
}
-
Step 1 Crate an PlatformIO Arduino framework like above, copy this code and compile it. Use the DFU tool to download it on the board.
-
Step 2 Use an Serial assistant like Mobaxterm, set the correct bundrate and the serial port.
-
Step 3 Press reset button, you will see the "AT command" printed on the Serial assistant.
-
Step 4 After printing "AT+CIPSERVER=1,80"; Set your ip address of your ESP8266 for the website address and open it, you will see a website to control the on-board LED after the Serial prints "AT+CIPCLOSE=0".
- Step 5 Type "on" or "off" and submit, the on-board user LED will be turned on or off. And the statment of LED will be printed on the website. And your on-board LED will follow the statment.
Resourse
- [PDF] GD32VF103_Datasheet_Rev1.0
- [PDF] GD32VF103_User_Manual_EN_V1.0
- [Zip] DFU Tool
Tech Support & Product Discussion
if you have any technical issue. submit the issue into our forum. Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.