cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with setting LWIP from TouchGFX generated project

AK16
Associate II

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.

7 REPLIES 7
SofLit
ST Employee

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.
GaetanGodart
ST Employee

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,

Gaetan Godart
Software engineer at ST (TouchGFX)

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. 

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

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,

Gaetan Godart
Software engineer at ST (TouchGFX)

So if I understand correctly, if this problem is caused by MPU configurations that are set up (the ones on the picture I sent), it would be solved by disabling the cache entirely, right (the program would just run slower)? Cause I tried that and the nothing has changed.

Hello @AK16 ,

 

Yes, this was my guess.
But it seems the issue is not related to MPU configuration even though the error changes based on the MPU settings.

So let's try to isolate the issue.
Can you create a TouchGFX project and then add one by one the modifications that you would do to the ioc file and generate and test whenever you add a change to the hardware configuration?
This way we would be able to know which setting is causing the error.
(Note that a dichotomic search might be better ;))

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)