Skip to content

Commit c712200

Browse files
committed
Actualización del Cuaderno tecnico, ya a capitulos de transistores.
Ademas se actualiza BadUSB con ejemplos.
1 parent 82ad269 commit c712200

File tree

80 files changed

+49318
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+49318
-67
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Tabla particiones 0x8000, maximo 95 entradas
2+
# Ocupa un sector 4KB 0x1000 (Primera inicia en 0x9000
3+
# Name, Type, SubType, Offset, Size, Flags
4+
nvs, data, nvs, 0x9000, 0x6000,
5+
phy_init, data, phy, 0xF000, 0x1000,
6+
factory, app, factory, 0x10000, 0xf0000,
7+
datos, data, spiffs, 0x100000, 0x100000,
8+
datosWEB, data, spiffs, 0x200000, 0x1f0000,
9+
coredump, data, coredump, 0x3f0000, 0x10000,
10+
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#! /bin/sh
2+
3+
BLOQUE=4096
4+
PAGINA=256
5+
directorio=./datos
6+
imagen=Particion_datos.img
7+
DIRECCION=0x100000
8+
TAMANO=1048576
9+
10+
directorioWEB=./datosWEB
11+
imagenWEB=Particion_datosWEB.img
12+
DIRECCIONWEB=0x200000
13+
TAMANOWEB=2031616
14+
15+
echo "Creamos imagen $imagen"
16+
~/.arduino15/packages/esp32/tools/mkspiffs/0.2.3/mkspiffs -c $directorio -b $BLOQUE -p $PAGINA -s $TAMANO $imagen
17+
18+
echo "Creamos imagen $imagenWEB"
19+
~/.arduino15/packages/esp32/tools/mkspiffs/0.2.3/mkspiffs -c $directorioWEB -b $BLOQUE -p $PAGINA -s $TAMANOWEB $imagenWEB
20+
21+
#Subimos imagenes al ESP32
22+
echo "Sube imagen $imagen"
23+
~/.arduino15/packages/esp32/tools/esptool_py/4.5.1/esptool.py --chip esp32 write_flash -z $DIRECCION $imagen
24+
25+
echo "Sube imagen $imagenWEB"
26+
~/.arduino15/packages/esp32/tools/esptool_py/4.5.1/esptool.py --chip esp32 write_flash -z $DIRECCIONWEB $imagenWEB
27+
~/.arduino15/packages/esp32/hardware/esp32/2.0.9/tools/gen_esp32part.py --verify Part2SPIF.csv Particiones.img
28+
29+
30+
#Generamos particiones
31+
#~/.arduino15/packages/esp32/hardware/esp32/2.0.9/tools/gen_esp32part.py Part2SPIF.csv Particiones.img
32+
#~/.arduino15/packages/esp32/tools/esptool_py/4.5.1/esptool.py --chip esp32 write_flash 0x8000 Particiones.img
33+
34+
25.4 KB
Binary file not shown.
25.4 KB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Prueba SPIFFS
2+
Esta es la informacion que debe figurar del fichero
3+
de la particion de datos
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Prueba SPIFFS
2+
este podria ser el fichero de pagina HTML
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*******************************************************************************************
2+
* Autor: Fco. Javier Rodriguez Navarro
3+
* WEB: www.pinguytaz.net
4+
*
5+
* Descripción: Ejemplo simple del uso de SPIFFS
6+
* SPIFFS
7+
* Librerias: SPIFSS
8+
*
9+
* Cargas: Debemos cargar los ficherosTexto.txt
10+
***********************************************************************************************/
11+
#include "FS.h"
12+
#include "SPIFFS.h"
13+
14+
void listDir(fs::FS &fs)
15+
{
16+
Serial.printf("Contenido\n");
17+
18+
File root = fs.open("/");
19+
if(!root)
20+
{
21+
Serial.println("Fallo al abrir el directorio");
22+
return;
23+
}
24+
25+
File file = root.openNextFile();
26+
while(file)
27+
{
28+
Serial.print(" Fichero: ");
29+
Serial.print(file.name());
30+
Serial.print("\tTamaño: ");
31+
Serial.println(file.size());
32+
file = root.openNextFile();
33+
}
34+
}
35+
36+
void leeFichero(fs::FS &fs, const char * fichero)
37+
{
38+
File file = fs.open(fichero);
39+
if(!file)
40+
{
41+
Serial.printf("Fallo al abrie el fichero %s\n",fichero);
42+
return;
43+
}
44+
45+
Serial.printf("Leemos %s\n",fichero);
46+
while(file.available()) Serial.write(file.read());
47+
48+
file.close();
49+
}
50+
51+
void setup()
52+
{
53+
Serial.begin(115200);
54+
fs::SPIFFSFS pdatos;
55+
fs::SPIFFSFS pdatosweb;
56+
57+
// bool begin(bool formatOnFail=false, const char * basePath="/spiffs", uint8_t maxOpenFiles=10, const char * partitionLabel=NULL);
58+
if (!pdatos.begin(true,"/datos",10,"datos")) // Abre particion de datos
59+
{
60+
Serial.println("No se monta particion datos");
61+
return;
62+
}
63+
if (!pdatosweb.begin(true,"/datosweb",10,"datosWEB")) // Abre particion de datosWEB
64+
{
65+
Serial.println("No se monta particion datosWEB");
66+
return;
67+
}
68+
69+
listDir(pdatos);
70+
leeFichero(pdatos,"/Texto.txt");
71+
listDir(pdatosweb);
72+
leeFichero(pdatosweb,"/Texto.txt");
73+
}
74+
void loop()
75+
{
76+
77+
}

0 commit comments

Comments
 (0)