Coder Social home page Coder Social logo

khoih-prog / ethernetwebserver_stm32 Goto Github PK

View Code? Open in Web Editor NEW
81.0 8.0 21.0 1.51 MB

This is simple yet complete WebServer library for STM32 boards running built-in Ethernet LAN8742A (Nucleo-144, Discovery), ENC28J60 or W5x00 Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Ethernet_Generic library is used as default for W5x00. Now W5x00 can use any custom hardware / software SPI

License: MIT License

C 37.33% C++ 62.64% Shell 0.03%
ethernet ethernetwebserver stm32 nucleo-144 webserver stm32f4 stm32f7 http-server http-client udp-server

ethernetwebserver_stm32's People

Contributors

aaron-neal avatar khoih-prog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ethernetwebserver_stm32's Issues

Sending raw ethernet frame with the lan8742a?

Is there a possibility to send raw ethernet frame (IP_RAW) with the lan8742a?
I see that this is possible with the w5xxx already, but would like to do it through the builtin phy on f767.

LAN8720

Thư viện này có giao tiếp được với LAN8720 không ạ.

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

EthernetWebServer_STM32 Support and Test Results

Hi @khoih-prog

I attempted to compile for the VET6 Black Board, simply selecting the "Generic STM32F4 Series" as board and board part number "Black F407VE" but the compile failed .. see attached

F407VET6_BLACK.zip

Regards
Andy

Hi @andy-hopkins

Good news that you're successful with BluePill and ECN28J60.

Please try the following new library and let us know the result for F407VET6 and all remaining STM32. BTW, I'm planning to port W5x00, etc. Ethernet shield to this new lib.

EthernetWebServer_STM32

All the STM32 boards with more than 64K Flash are supported by that lib, including all F407VET.
Don't use this library anymore if you're using STM32 as it's not as efficient as the new one (larger code size, not standard core from STMicro).

Boards supported by EthernetWebServer_STM32

  1. STM32 boards with built-in Ethernet such as :
  • Nucleo-144 (F429ZI, F767ZI)
  • Discovery (STM32F746G-DISCOVERY)
  1. STM32 boards (with 64+K Flash) running EMC28J60 shields
  • Nucleo-144
  • Nucleo-64
  • Discovery
  • STM32MP1
  • Generic STM32F1 (with 64+K Flash): C8 and up
  • Generic STM32F4
  • STM32L0
  • LoRa boards
  • 3-D printer boards
  • Generic Flight Controllers
  • Midatronics boards
  1. and these boards are not supported:
  • Nucleo-32 (small Flash/memory)
  • Eval (no Serial, just need to redefine in sketch, library and UIPEthernet)
  • Generic STM32F0 (small Flash/memory)
  • Generic STM32F1 (with <64K Flash): C6
  • Generic STM32F3 : no HardwareSPI.h
  • Electronics Speed Controllers (small Flash/memory)

Cheers,
KH

Originally posted by @khoih-prog in khoih-prog/EthernetWebServer#1 (comment)

Sending GZIP HTML ~ 120kb+ (suggested enhancement)

Before I start out, would just like to say thanks for this library it has helped me very quickly port a lot of work from the ESP to the STM32 platform where I can keep both systems fairly in sync!

I also do not know if this is a generic enhancment for both this repo and the non STM32 repo, that's up to you.

I have a HTML build process using GULP which Inlines, uglifies, minifies all of my HTML, CSS and JS . The output file is a single header file that puts the entire thing into PROGMEM.

#define index_html_gz_len 129855

const char PROGMEM index_html_gz[] = {
    0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,....

In both the ESP32 / 8266 the following is used to send this as the index:

server.on(String(F("/index.html")).c_str(), HTTP_GET, [](AsyncWebServerRequest *request){
        if(authenticate(request)){
            return request->requestAuthentication();
        }
        
         //webPage setup
        char lastModified[50]; // Variable to hold the last modification datetime of website
        sprintf_P(lastModified, PSTR("%s %s GMT"), __DATE__, __TIME__); // Populate the last modification date based on build datetime
    
        if (request->header(F("If-Modified-Since")).equals(lastModified)) {
            request->send(304);
        } else {
            // Dump the byte array in PROGMEM with a 200 HTTP code (OK)
            AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html"), index_html_gz, index_html_gz_len);
            // Tell the browswer the contemnt is Gzipped
            response->addHeader(F("Content-Encoding"), F("gzip"));
            // And set the last-modified datetime so we can check if we need to send it again next time or not
            response->addHeader(F("Last-Modified"), lastModified);
            request->send(response);
        }
        WiFi.scanNetworks(true); //they might request wifi networks at some point
    });

Unforunately, this did not work with this library using the send_P command as I expected, the headers were send but no content. I have finally come up with a solution, I doubt that it is optimal, but for me it is working.

void EthernetWebServer::sendContent_P(PGM_P content, size_t size) 
{
  const char * footer = "\r\n";
  
  if (_chunked) 
  {
    char * chunkSize = (char *) malloc(11);
    
    if (chunkSize) 
    {
      sprintf(chunkSize, "%x%s", size, footer);
      _currentClient.write(chunkSize, strlen(chunkSize));
      free(chunkSize);
    }
  }

  uint16_t bufSize = 4096;
  uint8_t buffer[bufSize];
  uint16_t count = size / bufSize;
  uint16_t remainder = size % bufSize;
  uint16_t i = 0;

  for (i = 0; i < count; i++) {
    /* code */
    memcpy_P(buffer, &content[i*bufSize], bufSize);
    _currentClient.write(buffer, bufSize);
  }
  
  memcpy_P(buffer, &content[i*bufSize], remainder);
  _currentClient.write(buffer, remainder);
  
  if (_chunked) 
  {
    _currentClient.write(footer, 2);
  }
}

If there is a better way of doing this I would love to know, but for now I can carry on with my development, happy to offer a PR for something to work from if needed?

Now I can have my fully bootstrapped web interface that I use with my ESP devices. 👍

image

EthernetWebserver fails with big files (>50kB) on STM32NUCLEO using builtin ethernet

Describe the bug

I use the ethernet library with large files from program memory on Nucleo F767. I tried with Nucleo F207 too. In both cases, I experienced that the server stops after a few (1...4) attempts. (no answer for ping). The smaller F207 board makes the error sooner. I also tried the EthernetWebServer_SSL_STM32 directory, but I am experiencing the same error. The error occurs on Windows and OSX too.

Steps to Reproduce

Sample code:

#define USE_BUILTIN_ETHERNET    true
#include <EthernetWebServer_STM32.h>
EthernetWebServer server(80);
byte macc[6] =  {0x00,0x80,0xE1,0x00,0x00,0x00};
/* this pizza.jpg is 540kB size */
static const unsigned char pizza_jpg[]  = {255,216,255,224,0,16,74,70,  ... ... ... .. 134,181,110,149,29,70,222,162};

void setup(void)
{
    Ethernet.begin(macc);
    server.on("/pizza.jpg", []() {
         server.send_P(200, "image/jpeg", (PGM_P)pizza_jpg, sizeof(pizza_jpg));
     });

   server.onNotFound([]() {
    server.send(404, "text/plain", "Not found file");
  });
  server.begin();
  Serial.println(Ethernet.localIP());
}

void loop(void)
{
  server.handleClient();
}

Expected behavior

The program does not freeze in the browser even after repeated requests for large files

Actual behavior

After 1...4 GET requests in the browser, the program and board freezes (ping is not answered) and the image does not load.

Debug and AT-command log (if applicable)

N/A

Screenshots

Information

Please ensure to specify the following:

  • Arduino version is:1.8.13
  • Board: STM nucleo-144 (32F207, and 32F767)
  • OS: osx Mojave
  • dhcp configuration
  • mikrotik routerboard - default config.

Compilation error

Hello,
I use this hardware : Nucleo-32 F303K8 with 64Kof Flash and ENC28J60 shield.
If I try to compile with #define USE_UIP_ETHERNET false; directive. It compiling fine.

I try to compile AdvancedWebServer exemple but I have theses errors :

In file included from D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/EthernetWebServer_STM32.h:208,
from C:\Users\Stef\AppData\Local\Temp\arduino_modified_sketch_13315\AdvancedWebServer.ino:100:
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/EthernetWebServer_STM32-impl.h: In member function 'void EthernetWebServer::handleClient()':
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/EthernetWebServer_STM32-impl.h:175:20: error: 'class UIPClient' has no member named 'setTimeout'
175 | _currentClient.setTimeout(HTTP_MAX_SEND_WAIT);
| ^~~~~~~~~~
In file included from D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/EthernetWebServer_STM32.h:209,
from C:\Users\Stef\AppData\Local\Temp\arduino_modified_sketch_13315\AdvancedWebServer.ino:100:
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h: In function 'char* readBytesWithTimeout(UIPClient&, size_t, size_t&, int)':
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:54:12: error: 'class UIPClient' has no member named 'readBytes'
54 | client.readBytes(buf + dataLength, newLength);
| ^~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h: In member function 'bool EthernetWebServer::_parseRequest(UIPClient&)':
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:63:23: error: 'class UIPClient' has no member named 'readStringUntil'
63 | String req = client.readStringUntil('\r');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:64:10: error: 'class UIPClient' has no member named 'readStringUntil'
64 | client.readStringUntil('\n');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:149:20: error: 'class UIPClient' has no member named 'readStringUntil'
149 | req = client.readStringUntil('\r');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:150:14: error: 'class UIPClient' has no member named 'readStringUntil'
150 | client.readStringUntil('\n');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:226:20: error: 'class UIPClient' has no member named 'readStringUntil'
226 | req = client.readStringUntil('\r');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:227:14: error: 'class UIPClient' has no member named 'readStringUntil'
227 | client.readStringUntil('\n');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h: In member function 'bool EthernetWebServer::_parseForm(UIPClient&, String, uint32_t)':
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:355:19: error: 'class UIPClient' has no member named 'readStringUntil'
355 | line = client.readStringUntil('\r');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:359:10: error: 'class UIPClient' has no member named 'readStringUntil'
359 | client.readStringUntil('\n');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:371:21: error: 'class UIPClient' has no member named 'readStringUntil'
371 | line = client.readStringUntil('\r');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:372:14: error: 'class UIPClient' has no member named 'readStringUntil'
372 | client.readStringUntil('\n');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:394:25: error: 'class UIPClient' has no member named 'readStringUntil'
394 | line = client.readStringUntil('\r');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:395:18: error: 'class UIPClient' has no member named 'readStringUntil'
395 | client.readStringUntil('\n');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:399:20: error: 'class UIPClient' has no member named 'readStringUntil'
399 | client.readStringUntil('\r');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:400:20: error: 'class UIPClient' has no member named 'readStringUntil'
400 | client.readStringUntil('\n');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:407:29: error: 'class UIPClient' has no member named 'readStringUntil'
407 | line = client.readStringUntil('\r');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:408:22: error: 'class UIPClient' has no member named 'readStringUntil'
408 | client.readStringUntil('\n');
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:471:22: error: 'class UIPClient' has no member named 'readBytes'
471 | client.readBytes(endBuf, boundary.length());
| ^~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:485:31: error: 'class UIPClient' has no member named 'readStringUntil'
485 | line = client.readStringUntil(0x0D);
| ^~~~~~~~~~~~~~~
D:\Users\Stef\Documents\Arduino\libraries\EthernetWebServer_STM32\src/Parsing_STM32-impl.h:486:24: error: 'class UIPClient' has no member named 'readStringUntil'
486 | client.readStringUntil(0x0A);
| ^~~~~~~~~~~~~~~

Have you got any idea ?

Best regards

EthernetWebServer_STM32 build broken on STM32F103C8T6

Describe the bug

Its impossible to build because of build is broken. Build log is full of errors like

.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:80:15: error: 'ETH_DMADescTypeDef' does not name a type
80 | __ALIGN_BEGIN ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB] __ALIGN_END;/* Ethernet Rx MA Descriptor /
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:85:15: error: 'ETH_DMADescTypeDef' does not name a type
85 | __ALIGN_BEGIN ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB] __ALIGN_END;/
Ethernet Tx DMA Descriptor */

Looking into ehternetif.cpp => Its almost completly red

Steps to Reproduce

Set up Visual Code as described, use this ini and build.

[platformio]
default_envs = STM32

[env]
upload_speed = 921600

lib_compat_mode = strict
lib_ldf_mode = chain+
;lib_ldf_mode = deep+

lib_deps =
stm32duino/STM32duino LwIP@~2.1.2
stm32duino/STM32Ethernet@~1.3.0
khoih-prog/Functional-Vlpp@~1.0.2
khoih-prog/Ethernet_Generic@~2.2.0
uipethernet/UIPEthernet@~2.0.11
jandrassy/EthernetENC@~2.0.2

[env:STM32]
platform = ststm32
framework = arduino
board = bluepill_f103c8

Expected behavior

Build should be possible and all is running fine again :)

Actual behavior

Its dead jim.

Debug and AT-command log (if applicable)

Compiling .pio\build\STM32\lib3c6\STM32Ethernet\utility\stm32_eth.cpp.o
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:80:15: error: 'ETH_DMADescTypeDef' does not name a type
80 | __ALIGN_BEGIN ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB] __ALIGN_END;/* Ethernet Rx MA Descriptor /
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:85:15: error: 'ETH_DMADescTypeDef' does not name a type
85 | __ALIGN_BEGIN ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB] __ALIGN_END;/
Ethernet Tx DMA Descriptor /
| ^~~~~~~~~~~~~~~~~~
In file included from C:\Users\matrixxx.platformio\packages\framework-arduinoststm32\system\STM32F1xx/stm32f1xx_hal_conf.h:13,
from C:\Users\matrixxx.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F1xx_HAL_Driver\Inc/stm32f1xx_hal.h:30,
from C:\Users\matrixxx.platformio\packages\framework-arduinoststm32\system\Drivers\CMSIS\Device\ST\STM32F1xx\Include/stm32f1xx.h:255,
from C:\Users\matrixxx.platformio\packages\framework-arduinoststm32\cores\arduino\stm32/stm32_def.h:28,
from .pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:48:
C:\Users\matrixxx.platformio\packages\framework-arduinoststm32\system\STM32F1xx/stm32f1xx_hal_conf_default.h:187:40: error: 'ETH_MAX_PACKET_SIZE' was not declared in this scope
187 | #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /
buffer size for receive /
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:90:44: note: in expansion of macro 'ETH_RX_BUF_SIZE'
90 | __ALIGN_BEGIN uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __ALIGN_END; /
Ethernet Receive Buffer /
| ^~~~~~~~~~~~~~~
C:\Users\matrixxx.platformio\packages\framework-arduinoststm32\system\STM32F1xx/stm32f1xx_hal_conf_default.h:188:40: error: 'ETH_MAX_PACKET_SIZE' was not declared in this scope
188 | #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /
buffer size for transmit /
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:95:44: note: in expansion of macro 'ETH_TX_BUF_SIZE'
95 | __ALIGN_BEGIN uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __ALIGN_END; /
Ethernet Transmit Buffer */
| ^~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:97:8: error: 'ETH_HandleTypeDef' does not name a type; did you mean 'RTC_HandleTypeDef'?
97 | static ETH_HandleTypeDef EthHandle;
| ^~~~~~~~~~~~~~~~~
| RTC_HandleTypeDef
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:116:22: error: variable or field 'HAL_ETH_MspInit' declared void
116 | void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
| ^~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:116:22: error: 'ETH_HandleTypeDef' was not declared in this scope; did you mean 'RTC_HandleTypeDef'?
116 | void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
| ^~~~~~~~~~~~~~~~~
| RTC_HandleTypeDef
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:116:41: error: 'heth' was not declared in this scope
116 | void HAL_ETH_MspInit(ETH_HandleTypeDef heth)
| ^~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\stm32_eth.cpp:67:4: warning: #warning "Default timer used to call ethernet scheduler
at regular interval: TIM14" [-Wcpp]
67 | #warning "Default timer used to call ethernet scheduler at regular interval: TIM14"
| ^~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp: In function 'void low_level_init(netif
)':
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:168:3: error: 'EthHandle' was not declared in this scope
168 | EthHandle.Instance = ETH;
| ^~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:168:24: error: 'ETH' was not declared in this scope
168 | EthHandle.Instance = ETH;
| ^~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:170:36: error: 'ETH_AUTONEGOTIATION_ENABLE' was not declared in this scope
170 | EthHandle.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:171:26: error: 'ETH_SPEED_100M' was not declared in this scope
171 | EthHandle.Init.Speed = ETH_SPEED_100M;
| ^~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:172:31: error: 'ETH_MODE_FULLDUPLEX' was not declared in this scope
172 | EthHandle.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
| ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:174:35: error: 'ETH_MEDIA_INTERFACE_RMII' was not declared in this scope
174 | EthHandle.Init.MediaInterface = ETH_MEDIA_INTERFACE_RMII;
| ^~~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:181:27: error: 'ETH_RXPOLLING_MODE' was not declared in this scope
181 | EthHandle.Init.RxMode = ETH_RXPOLLING_MODE;
| ^~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:183:33: error: 'ETH_CHECKSUM_BY_HARDWARE' was not declared in this scope; did you mean 'CHECKSUM_BY_HARDWARE'?
183 | EthHandle.Init.ChecksumMode = ETH_CHECKSUM_BY_HARDWARE;
| ^~~~~~~~~~~~~~~~~~~~~~~~
| CHECKSUM_BY_HARDWARE
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:184:31: error: 'LAN8742A_PHY_ADDRESS' was not declared in this scope
184 | EthHandle.Init.PhyAddress = LAN8742A_PHY_ADDRESS;
| ^~~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:187:7: error: 'HAL_ETH_Init' was not declared in this scope; did you mean 'HAL_RTC_Init'?
187 | if (HAL_ETH_Init(&EthHandle) == HAL_OK) {
| ^~~~~~~~~~~~
| HAL_RTC_Init
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:193:41: error: 'DMATxDscrTab' was not declared in this scope
Compiling .pio\build\STM32\src\main.cpp.o
193 | HAL_ETH_DMATxDescListInit(&EthHandle, DMATxDscrTab, &Tx_Buff[0][0], ETH_TXBUFNB);
| ^~~~~Compiling .pio\build\STM32\libc4e\STM32duino LwIP\api\api_lib.c.o

.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:193:56: error: 'Tx_Buff' was not declared in this scope
  193 |   HAL_ETH_DMATxDescListInit(&EthHandle, DMATxDscrTab, &Tx_Buff[0][0], ETH_TXBUFNB);
      |                                                        ^~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:193:3: error: 'HAL_ETH_DMATxDescListInit' was not declared in this scope
  193 |   HAL_ETH_DMATxDescListInit(&EthHandle, DMATxDscrTab, &Tx_Buff[0][0], ETH_TXBUFNB);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:196:41: error: 'DMARxDscrTab' was not declared in this scope
  196 |   HAL_ETH_DMARxDescListInit(&EthHandle, DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB);
      |                                         ^~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:196:56: error: 'Rx_Buff' was not declared in this scope
  196 |   HAL_ETH_DMARxDescListInit(&EthHandle, DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB);
      |                                                        ^~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\stm32_eth.cpp: In function 'void TIM_scheduler_Config()':
.pio\libdeps\STM32\STM32Ethernet\src\utility\stm32_eth.cpp:66:35: error: 'TIM14' was not declared in this scope; did you mean 'TIM1'?
   66 |   #define DEFAULT_ETHERNET_TIMER  TIM14
      |                                   ^~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\stm32_eth.cpp:184:30: note: in expansion of macro 'DEFAULT_ETHERNET_TIMER'
  184 |   EthTim = new HardwareTimer(DEFAULT_ETHERNET_TIMER);
      |                              ^~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:196:3: error: 'HAL_ETH_DMARxDescListInit' was not declared in this scope
  196 |   HAL_ETH_DMARxDescListInit(&EthHandle, DMARxDscrTab, &Rx_Buff[0][0], ETH_RXBUFNB);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:217:3: error: 'HAL_ETH_Start' was not declared in this scope; did you 
mean 'HAL_ADC_Start'?
  217 |   HAL_ETH_Start(&EthHandle);
      |   ^~~~~~~~~~~~~
      |   HAL_ADC_Start
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:223:39: error: 'PHY_IMR' was not declared in this scope; did you mean 
'PHY_MISR'?
  223 |   HAL_ETH_ReadPHYRegister(&EthHandle, PHY_IMR, &regvalue);
      |                                       ^~~~~~~
      |                                       PHY_MISR
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:223:3: error: 'HAL_ETH_ReadPHYRegister' was not declared in this scope  223 |   HAL_ETH_ReadPHYRegister(&EthHandle, PHY_IMR, &regvalue);
      |   ^~~~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:225:15: error: 'PHY_ISFR_INT4' was not declared in this scope
  225 |   regvalue |= PHY_ISFR_INT4;
      |               ^~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:228:3: error: 'HAL_ETH_WritePHYRegister' was not declared in this scope
  228 |   HAL_ETH_WritePHYRegister(&EthHandle, PHY_IMR, regvalue);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~
*** [.pio\build\STM32\lib3c6\STM32Ethernet\utility\stm32_eth.cpp.o] Error 1
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp: In function 'err_t low_level_output(netif*, pbuf*)':
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:254:33: error: 'EthHandle' was not declared in this scope
  254 |   uint8_t *buffer = (uint8_t *)(EthHandle.TxDesc->Buffer1Addr);
      |                                 ^~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:255:8: error: 'ETH_DMADescTypeDef' does not name a type
  255 |   __IO ETH_DMADescTypeDef *DmaTxDesc;
      |        ^~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:263:3: error: 'DmaTxDesc' was not declared in this scope
  263 |   DmaTxDesc = EthHandle.TxDesc;
      |   ^~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:269:30: error: 'ETH_DMATXDESC_OWN' was not declared in this scope     
  269 |     if ((DmaTxDesc->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET) {
      |                              ^~~~~~~~~~~~~~~~~
In file included from C:\Users\matrixxx\.platformio\packages\framework-arduinoststm32\system\STM32F1xx/stm32f1xx_hal_conf.h:13,   
                 from C:\Users\matrixxx\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F1xx_HAL_Driver\Inc/stm32f1xx_hal.h:30,
                 from C:\Users\matrixxx\.platformio\packages\framework-arduinoststm32\system\Drivers\CMSIS\Device\ST\STM32F1xx\Include/stm32f1xx.h:255,
                 from C:\Users\matrixxx\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32/stm32_def.h:28,
                 from .pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:48:
C:\Users\matrixxx\.platformio\packages\framework-arduinoststm32\system\STM32F1xx/stm32f1xx_hal_conf_default.h:188:40: error: 'ETH_MAX_PACKET_SIZE' was not declared in this scope
  188 | #define ETH_TX_BUF_SIZE                ETH_MAX_PACKET_SIZE /* buffer size for transmit              */
      |                                        ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\STM32\STM32Ethernet\src\utility\ethernetif.cpp:279:47: note: in expansion of macro 'ETH_TX_BUF_SIZE'
  279 |     while ((byteslefttocopy + bufferoffset) > ETH_TX_BUF_SIZE) {
      |                                               ^~~~~~~~~~~~~~~
In file included from src\main.cpp:22:
src\defines.h:64:4: warning: #warning Using W5x00 & Ethernet_Generic lib [-Wcpp]
   64 |   #warning Using W5x00 & Ethernet_Generic lib
      |    ^~~~~~~
src\defines.h:89:12: fatal error: SPI.h: No such file or directory

### Information

Visual Code newest.

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/bluepill_f103c8.html
PLATFORM: ST STM32 (15.0.0) > BluePill F103C8
HARDWARE: STM32F103C8T6 72MHz, 20KB RAM, 64KB Flash
DEBUG: Current (stlink) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES: 
 - framework-arduinoststm32 @ 4.20100.211028 (2.1.0) 
 - framework-cmsis @ 2.50700.210515 (5.7.0) 
 - toolchain-gccarmnoneeabi @ 1.90201.191206 (9.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain+, Compatibility ~ strict
Found 19 compatible libraries
Scanning dependencies...
Dependency Graph
|-- STM32duino LwIP @ 2.1.2
|   |-- STM32Ethernet @ 1.3.0
|-- STM32Ethernet @ 1.3.0
|-- Functional-Vlpp @ 1.0.2
|-- Ethernet_Generic @ 2.2.0
|-- UIPEthernet @ 2.0.12
|-- EthernetENC @ 2.0.3
|-- EthernetWebServer_STM32 @ 1.5.0
|   |-- STM32duino LwIP @ 2.1.2
|   |   |-- STM32Ethernet @ 1.3.0
|   |-- STM32Ethernet @ 1.3.0
|   |-- Functional-Vlpp @ 1.0.2
|   |-- Ethernet_Generic @ 2.2.0
  
### Additional context

Maybe same problem because of this: https://community.st.com/s/question/0D53W00001RKeRZSA1/stm32f4-hal-eth-broken

Hi Khoih! Thanks for all your hard work! Hope you can help here too :) Mike.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.