Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


stm32f4discovery + lwip

I’m trying to build empty project for stm32f4discocery with lwip. Every time when i try to build project i get error ” lwip/opt.h no such file or directory” for different c file.

Is there any solution to this ?

France

Hi,
The System Workbench support of lwIP is still partial and you will have to make several adjustments to the generated project.

Correct the include path

You should add (in project >> Properties >> C/C++ General >> Paths and Symbols and for all languages and configurations) a workspace include path to the directory, in the library project, that includes the lwip directory header files are located, that is something like /stm32f4discovery_hal_lib/Middlewares/Third_Party/LwIP/src/include.

You must also include LwIP/src/systemand either LwIP/src/core/ipv4 or LwIP/src/core/ipv6 (but not both__, this is currently not supported by LwIP).

You must do that both in the library project itself and in the application project.

Exclude unneeded source code

You must exclude the LwIP/test and LwIP/system/OS directories (or noOS if you use FreeRTOS too) from the build of the library, by directory >> Properties >> C/C++ Build then check Exclude resource from build; also exclude LwIP/src/netif/ethernetif_template.c as this file could not compile correctly without being completed...

You must also exclude either LwIP/src/core/ipv4 or LwIP/src/core/ipv6 from the build, depending on the protocol you want to use (remember you can’t use both...)

You should also exclude either system/OS or system/noOS from the include search path

Provide the LwIP configuration file

You have to provide an lwipopts.h file, in LwIP/include, to configure which options you need in LwIP; you can get samples either from the LwIP/test/unit directory or some samples provided by ST (however these usually also include FreeRTOS, so you will have to simplyfy them if you don’t).

Provide a network interface

You can either create an ethernet interface from scratch (starting from LwIP/src/netif/ethernetif_template.c or copy an ethernetif.c file from one of the ST-provided demos for your board.

  • For example you have a FreeRTOS-based version in Projects/STM324xG_EVAL/Applications/LwIP/LwIP_HTTP_Server_Netconn_RTOS and a noOS version in Projects/STM324xG_EVAL/Applications/LwIP/LwIP_HTTP_Server_Raw; these are supporting an STM324xG-EVAL board, so you may have to correct a few interface setups (like pin multiplexing).

  • This file should be placed in your application project, as you may have to configure the interface specially for your needs.


If you want to use a PPP interface (there is no ETH port on the stm32f’discovery) you will probably have to twiddle the lwipopts.h file, look at the code in src/netif/ppp and LwIP documentation as I don’t think there is any ST-provided example of using LwIP with PPP...

Compile and debug

The result should compile cleanly but, as usual, YMMV...

Hi,

Thank you for detiled answer. I ‘ve created proj with HALdrivers, selected add low level drivers, as source in the app proj, and enabled lwip lib,
deleted include paths for ipv6, OS,ppp , test and excluded from build ipv6, os , test and ppp. I still have fatal error: lwip/opt.h: No such file or directory.

p.s. I had to change path variable to avoid Application was not properly initialized (0xc0000142). error. And i’m using CDT internal builder.

I’ve attached projet settings file.

For information, the exclude path has changed :

directory >> Properties >> C/C++ General >> Source Location (tab)


France

Hi,

In Paths and Symbols, there is two paths that you have to correct: You should eliminate the lwip last path element from Middlewares/LwIP/src/include/ipv4/lwip and Middlewares/LwIP/src/include/lwip to get the paths I asked you to add in my post (Middlewares/LwIP/src/include/ipv4 and Middlewares/LwIP/src/include); lwip/opt.h is located in Middlewares/LwIP/src/include so, if you put lwip in the include path, it will not find it...

Bernard

Hi,
I’ve forgot to correct those paths.
Everything compiles now.
Thank you for your help.

Luka


I’m also having trouble to compile the same for f429 with lwip stack.
Getting the same error fatal error: lwip/opt.h: No such file or directory but i think paths are ok.
Bellow paths for lwip.
${ProjDirPath}/Middlewares/Third_Party/LwIP/doc/doxygen
${ProjDirPath}/Middlewares/Third_Party/LwIP/src/apps/httpd
${ProjDirPath}/Middlewares/Third_Party/LwIP/src/apps/snmp
${ProjDirPath}/Middlewares/Third_Party/LwIP/src/include/lwip
${ProjDirPath}/Middlewares/Third_Party/LwIP/src/include/lwip/apps
${ProjDirPath}/Middlewares/Third_Party/LwIP/src/include/lwip/priv
${ProjDirPath}/Middlewares/Third_Party/LwIP/src/include/netif
${ProjDirPath}/Middlewares/Third_Party/LwIP/src/include/netif/ppp
${ProjDirPath}/Middlewares/Third_Party/LwIP/src/include/netif/ppp/polarssl
${ProjDirPath}/Middlewares/Third_Party/LwIP/src/include/posix
${ProjDirPath}/Middlewares/Third_Party/LwIP/src/include/posix/sys
${ProjDirPath}/Middlewares/Third_Party/LwIP/system/arch
${ProjDirPath}/Middlewares/Third_Party/LwIP/system/noOS
${ProjDirPath}/Middlewares/Third_Party/LwIP/system/OS
${ProjDirPath}/Middlewares/Third_Party/LwIP/test/unit/core
${ProjDirPath}/Middlewares/Third_Party/LwIP/test/unit/dhcp
${ProjDirPath}/Middlewares/Third_Party/LwIP/test/unit/etharp
${ProjDirPath}/Middlewares/Third_Party/LwIP/test/unit
${ProjDirPath}/Middlewares/Third_Party/LwIP/test/unit/tcp
${ProjDirPath}/Middlewares/Third_Party/LwIP/test/unit/udp

Also when i press open declaration on #include “lwip/opt.h” i get pointed succesfully to the file.

United States

I have installed/downloaded/compiled and get this error as well.

>> papadkostas on 2016-11-08 Posted almost a year ago.

Is there no soulition for this or have I missed something that is not documented.


 

Newest Forum Posts

  1. reservation car service Seattle by Jamesprede, 2025-05-01 10:06
  2. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  10. Build a project in "release" mode by tang, 2025-02-20 10:36

Last-Modified Blogs