Skip to main content
Associate II
November 22, 2024
Question

Problem with setting LWIP from TouchGFX generated project

  • November 22, 2024
  • 2 replies
  • 2363 views

Moved from Feedback Forum

 

Hi guys,

I am trying to set up LWIP project on my STMH750B-DK. I have generated this project from TouchGFX (to start off i just put a picture as a background and toggle switch with no functionality) and configured following things in .ioc:
a) Clock configuration: PLLCLK option with SYSCLK on 400 MHz

b) Timebase source: TIM6

c) ETH:

- MII mode (PA0 and PA3 pins used for ETH_CRS and ETH_COL since QSPI, which needs does pins for Bank 2, is used by default when generating project with TouchGFX)

- Ethernet global interrupt enabled

d) FREERTOS: - DefaultTask stack (where I call MX_LWIP_Init()) size 1024 words (just to be on a safe side)

- USE_NEWLIB_REENTRANT enabled

e) LWIP:

- Platform settings: Driver_PHY Found solutions to LAN 8742

- DHCP disabled (IP: 192.168.1.50, MASK: 255.255.255.0, GATEWAY: 192.168.1.1)

 

I have generated the project and ran Debug. I get 3 warnings ('MX_QUADSPI_Init' defined but not used; Project 'STM32H750B-DK' has no explicit encoding set; STM32H750B-DK.elf has a LOAD segment with RWX permissions).

When i click play, the display works fine so the display task works fine I guess, but when i try to ping IP 192.168.1.50 I don't get response. When i click pause I find that the code is stuck in some sort of handler called _exit. I am providing a photo of debugging window.

2 replies

mƎALLEm
Technical Moderator
November 22, 2024

Hello,

Need to start with step by step: try first the LWIP alone and validate the functionality.

Then create another project where you start from TouchGFX designer and add LWIP where you put the same config you validated before.

It's tricky to start with two middlewares relatively complex.

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question."
AK16Author
Associate II
December 6, 2024

I created a project without using display, so LWIP ONLY (with help of this tutorial: https://community.st.com/t5/stm32-mcus/how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/49308) and it worked just fine. The thing is that when I am creating a project from TouchGFX, all sorts of settings are already set to make the display work and I am guessing it's a sort of memory problem.

I am not sure what "disable speculative access to unused memories" setting is doing (see the picture). Wheter I used it or not in "LWIP ONLY project" it worked, but now when i use it as in the tutorial I get to MemManage Handler, but when I omit the whole setting I get to exit function. I am providing you pictures with cortex M7 configuration set by default by TouchGFX. 

GaetanGodart
Technical Moderator
December 9, 2024

Hello @AK16 ,

 

Maybe you can have a look at this post and tell me if it helped you understand MPU configuration.
Also, have a look at this document to understand the different types of cache.

Alternatively, you could try to disable cache.

For the address to check, look for the "rand()" :

GaetanGodart_0-1733737853803.png


This is most likely called when you set the range in the screen shot you shared.

 

Regards,

GaetanGodart
Technical Moderator
November 25, 2024

Hello @AK16 ,

 

It looks like a LWIP issue more than a TouchGFX issue.

Looking at your call stack, you got an assert from the rand function, can you check it, what could have caused the assert?
Can you check the address?

 

Regards,

AK16Author
Associate II
December 6, 2024

on the picture there is the part of code where rand() gets called. I am not sure I understand which address to check and how to do that