mkdir fs
cd fs
touch index.html
cp ~/STM32Cube/Repository/STM32Cube_FW_F4_V1.16.0/Middlewares/Third_Party/LwIP/src/apps/httpd/makefsdata/makefsdata .perl makefsdata
cp fsdata.c Middlewares/Third_Party/LwIP/src/apps/httpd/fsdata_custom.c
make
/usr/bin/arm-none-eabi-size build/Nucleo144_LwIP.elf
text data bss dec hex filename
40980 124 44572 85676 14eac build/Nucleo144_LwIP.elf
/usr/bin/arm-none-eabi-objcopy -O ihex build/Nucleo144_LwIP.elf build/Nucleo144_LwIP.hex
/usr/bin/arm-none-eabi-objcopy -O binary -S build/Nucleo144_LwIP.elf build/Nucleo144_LwIP.bin
#include "stm32f4xx_hal.h"Además añadimos el siguiente código en la tarea defaultHAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
osDelay(100);
$ ping 192.168.3.2
PING 192.168.3.2 (192.168.3.2) 56(84) bytes of data.
64 bytes from 192.168.3.2: icmp_seq=1 ttl=255 time=70.9 ms
64 bytes from 192.168.3.2: icmp_seq=2 ttl=255 time=4.52 ms
64 bytes from 192.168.3.2: icmp_seq=3 ttl=255 time=1.38 ms
64 bytes from 192.168.3.2: icmp_seq=4 ttl=255 time=1.43 ms
64 bytes from 192.168.3.2: icmp_seq=5 ttl=255 time=24.1 ms
64 bytes from 192.168.3.2: icmp_seq=6 ttl=255 time=1.26 ms
64 bytes from 192.168.3.2: icmp_seq=7 ttl=255 time=1.35 ms
64 bytes from 192.168.3.2: icmp_seq=8 ttl=255 time=1.29 ms
64 bytes from 192.168.3.2: icmp_seq=9 ttl=255 time=1.40 ms
64 bytes from 192.168.3.2: icmp_seq=10 ttl=255 time=1.38 ms
^C
--- 192.168.3.2 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9012ms
rtt min/avg/max/mdev = 1.265/10.905/70.900/21.101 ms
HAL_NVIC_SetPriority(ETH_IRQn, 5, 0);mkdir app
cd app
touch cgi.c
touch cgi.h
<!--#etiqueta-->
perl makefsdata
cp fsdata.c Middlewares/Third_Party/LwIP/src/apps/httpd/fsdata_custom.c
touch app/ssi.h
touch app/ssi.c
python udp_socket_server.py#include "ssi.h"
#include <string.h>
#include "cmsis_os.h"
uint16_t SSI_Handler(int32_t Idx, char *pcInsert, int32_t InsertLen)
{
if(Idx == 0){
sprintf(pcInsert,"Hola Mundo");
return strlen(pcInsert);
} else if(Idx == 1){
osThreadList(pcInsert);
return strlen(pcInsert);
}
return 0;
Dato 1: <!--#data1-->Hola Mundo<br>
Dato 2: <!--#data2-->tcpip_thread R 6 808 3
IDLE R 0 115 2
UDP_Test B 4 868 5
defaultTask B 3 38 1
EthIf S 6 299 4
<br>Dato 1: <!--#data1-->tcpip_thread 93 <1%
IDLE 19715 86%
UDP_Test 0 <1%
defaultTask 3004 13%
EthIf 27 <1%
<br>
Dato 2: <!--#data2-->tcpip_thread R 6 858 3
IDLE R 0 115 2
defaultTask B 3 29 1
UDP_Test B 4 868 5
EthIf S 6 302 4
<br>
Dato 1: <!--#data1-->tcpip_thread 100 <1%
IDLE 111998 97%
UDP_Test 0 <1%
defaultTask 3004 2%
EthIf 28 <1%
<br>
Dato 2: <!--#data2-->tcpip_thread R 6 858 3
IDLE R 0 115 2
defaultTask B 3 29 1
UDP_Test B 4 868 5
EthIf S 6 302 4
<br>