Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

EthernetWebServer_STM32 Support and Test Results #1

Closed
andy-hopkins opened this issue Feb 28, 2020 · 9 comments
Closed

EthernetWebServer_STM32 Support and Test Results #1

andy-hopkins opened this issue Feb 28, 2020 · 9 comments

Comments

@andy-hopkins
Copy link

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)

@khoih-prog
Copy link
Owner

khoih-prog commented Feb 28, 2020

Many of the examples are pre-defined for Nucleo-144 or Discovery with built-in Ethernet.
You also have to use the examples of this lib and select to use external Ethernet as follows:

#define USE_BUILTIN_ETHERNET   false    //true

#include <EthernetWebServer_STM32.h>

Built-in Ethernet is only for:

  • Nucleo-144 (F429ZI, F767ZI)
  • Discovery (STM32F746G-DISCOVERY)

This is the result of compiling PostServer for Black F407VE

...
   24 | #warning "You can configure LogObject and ACTLOGLEVEL in 'utility/logging.h'. More verbosity more memory usage."
      |  ^~~~~~~
Sketch uses 49576 bytes (9%) of program storage space. Maximum is 524288 bytes.
Global variables use 4428 bytes (3%) of dynamic memory, leaving 126644 bytes for local variables. Maximum is 131072 bytes.

@andy-hopkins
Copy link
Author

@khoih-prog

Apologies. I was a little confused. I think I understand now, to use the F4VET6 Black Board I need to compile with "#define USE_BUILTIN_ETHERNET false" and use an ENC28J60

Do you intend to support the Black Board with builtin in Ethernet at any time?

thanks for the great work

Regards

@khoih-prog
Copy link
Owner

khoih-prog commented Feb 28, 2020

Currently, the STM32Ethernet library is only supporting Nucleo-144 and Discovery STM32 with built-in Ethernet.
This lib is using STM32Ethernet library and inherits all its limitations.

(With an STM32 board with Ethernet compatibility, this library allows a STM32 board (NUCLEO, DISCOVERY, ...) to connect to the internet.)

What lib and Ethernet shield you're using now for F4VET6 Black Board with built-in Ethernet? Is that Wiznet W5x00 or DP83848?
If I know, I can use it and provide support for the board.

@khoih-prog
Copy link
Owner

khoih-prog commented Feb 28, 2020

Hi @andy-hopkins
I find out the reason and think now this lib can support all the board with built-in Ethernet (including BlackBoard).
You have to modify the corresponding variant.h to add the line

#define HAL_ETH_MODULE_ENABLED

so that HAL modules will be defined

/* Extra HAL modules */
#define HAL_DAC_MODULE_ENABLED
#define HAL_SD_MODULE_ENABLED
// Add for Ethernet
#define HAL_ETH_MODULE_ENABLED
////

Note
This file is shared between many F407XX boards. Remember to comment it out for boards without built-in Ethernet, or the pin will be used / assigned for Ethernet purpose.

For example, for Black Board F407XX with Ethernet built-in, you have to modify the file

./hardware/stm32/1.8.0/variants/BLACK_F407XX/variant.h

In Ubuntu, the location can be
~/arduino1X/packages/STM32//hardware/stm32/1.8.0/variants/BLACK_F407XX/variant.h

I tried and compiled OK with Black F407VE, VZ, ZE, ZG. Please give this a try.

Regards,
KH

khoih-prog added a commit that referenced this issue Feb 28, 2020
This library currently supports
1. STM32 boards with built-in Ethernet such as :
  - ***Nucleo-144 (F429ZI, F767ZI)***
  - ***Discovery (STM32F746G-DISCOVERY)***
  - ***All STM32 Boards with Built-in Ethernet***, See [How To Use Built-in Ethernet](#1)
2. ***STM32 boards (with 64+K Flash) running EMC28J60 shields***
3. See [EthernetWebServer Library Issue 1](khoih-prog/EthernetWebServer#1) for reason to create this separate library from [EthernetWebServer library](https://github.com/khoih-prog/EthernetWebServer)
@khoih-prog
Copy link
Owner

Hi @andy-hopkins

Just released v1.0.1 to add support to popular W5x00 Ethernet shields to all STM32 boards with enough Flash (64K). You're very welcome to give it a try.

Regards,
KH

@andy-hopkins
Copy link
Author

Hi @khoih-prog

I made the change to variants.h and the code compiles and uploads Ok, but I can neither ping the IP or access the webpage.

I'll keep playing to make sure I've not done anything stupid :) and let you know how I get on

Best Regards

Hi @andy-hopkins
I find out the reason and think now this lib can support all the board with built-in Ethernet (including BlackBoard).
You have to modify the corresponding variant.h to add the line

#define HAL_ETH_MODULE_ENABLED

so that HAL modules will be defined

/* Extra HAL modules */
#define HAL_DAC_MODULE_ENABLED
#define HAL_SD_MODULE_ENABLED
// Add for Ethernet
#define HAL_ETH_MODULE_ENABLED
////

Note
This file is shared between many F407XX boards. Remember to comment it out for boards without built-in Ethernet, or the pin will be used / assigned for Ethernet purpose.

For example, for Black Board F407XX with Ethernet built-in, you have to modify the file

./hardware/stm32/1.8.0/variants/BLACK_F407XX/variant.h

In Ubuntu, the location can be
~/arduino1X/packages/STM32//hardware/stm32/1.8.0/variants/BLACK_F407XX/variant.h

I tried and compiled OK with Black F407VE, VZ, ZE, ZG. Please give this a try.

Regards,
KH

@andy-hopkins
Copy link
Author

I'll try and find the time to check it out sometime this weekend

Best

Hi @andy-hopkins

Just released v1.0.1 to add support to popular W5x00 Ethernet shields to all STM32 boards with enough Flash (64K). You're very welcome to give it a try.

Regards,
KH

@khoih-prog
Copy link
Owner

I'm testing on Nucleo-144 STM32F767ZI with built-in Ethernet without any issue even with more complicated sketches.

I'm trying to make a library similar to WiFiManager for all STM32, to configure and store WiFi/Server/Data Credentials. I'm finding a working EEPROM/FlashStorage library to stored persistent data. Do you come across one working OK?
Tried many w/o a working one.
STM32 has the worst support here.

@khoih-prog
Copy link
Owner

For the record, I finally make a new library for this purpose

  1. FlashStorage_STM32
  2. Ethernet_Manager_STM32

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants