cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGfx and LWIP Implemention on STM32H750DK

PushparajAdka
Associate II

Hey Team,

I want to make LWIP and TouchGfx to work together for our next product. I have taken reference from here:

https://community.st.com/t5/stm32-mcus/how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/49308

1. Touchgfx is working as expected

2. I am not able to ping using etherenet. I am not sure the issue here.

Please let me know what needs to be done here.

 

Thanks.

(Reposting this question as my previous post closed by mistake)

17 REPLIES 17
PushparajAdka
Associate II

Hey Team,

   I want to make LWIP and TouchGfx to work together for our next product. I have taken reference from here:

https://community.st.com/t5/stm32-mcus/how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/49308

1. Touchgfx is working as expected

2. I am not able to ping using etherenet. I am not sure the issue here. 

Please let me know what needs to be done here.

 

Thanks 

@PushparajAdka  does  you board supports Ethernet MII interface? if not then try RMII interface, and double check your CubeMx Pin mapping with yours board data sheet/ schematic.

if your board supports MII then check this ioc file. i have made some changes in yours ioc file.

 

Hello @PushparajAdka ,

Did you try the example from the STM32H7-LwIP-Examples repository for the STM32H750 Discovery Ethernet? You can find it here:
https://github.com/stm32-hotspot/STM32H7-LwIP-Examples/tree/main/STM32H750_Disco_ETH

Br

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.

Hey ,

   Yes i took this example as reference and made it work for the first time. Now I am using touchgfx and Ethernet combined and it is giving me trouble. I really do not know why it is failing,

 

 

 

I am not able to share the entire project due to size issues. Let me know if you want to verify any certain configuration.

The given examples are separate code and they do work. But my issue is combined code with touchgfx. 

Could you please provide some support? Otherwise I may have to stop using STM and move on to some other devices as I have to confirm the working of the device asap.

Hello @PushparajAdka 

What tests/investigations/debugging have you done to find out what's going on?

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.
Saket_Om

Hey Saket,

    I have made MPU configurations and Initialized LWIP as static config. Let me share all my observations.

 

  1. Code starts and reaches till LWIP Init. Inside that tcp_init does not get executed.
  2.  I have display code running and that works without any issue. 
  3. My goal is to send display slider value over a UDP message.
  4. Right now i stuck at the point that LWIP is not initialized.

 

PushparajAdka_0-1754578244963.png

MPU for LWIP heap:

*/

MPU_InitStruct.Enable = MPU_REGION_ENABLE;

MPU_InitStruct.Number = MPU_REGION_NUMBER0;

MPU_InitStruct.BaseAddress = 0x30020000;

MPU_InitStruct.Size = MPU_REGION_SIZE_128KB;

MPU_InitStruct.SubRegionDisable = 0x0;

MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;

MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;

MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;

MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;

MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;

MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;

 

HAL_MPU_ConfigRegion(&MPU_InitStruct);

 

MPU for Eth Buffers:  

/** Initializes and configures the Region and the memory to be protected

*/

MPU_InitStruct.Number = MPU_REGION_NUMBER5;

MPU_InitStruct.BaseAddress = 0x30040000;

MPU_InitStruct.Size = MPU_REGION_SIZE_32KB;

MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;

MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;

MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE;

 

HAL_MPU_ConfigRegion(&MPU_InitStruct);

/* Enables the MPU */

HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);

 

 

 
Flash:

/* Modification start */

.lwip_sec (NOLOAD) :

{

. = ABSOLUTE(0x30040000);

*(.RxDecripSection)



. = ABSOLUTE(0x30040100);

*(.TxDecripSection)



. = ABSOLUTE(0x30040200);

*(.Rx_PoolSection)

} >RAM_D2

/* Modification end */

 

 

etherenetif.c

static uint8_t RxAllocStatus;

#if defined ( __ICCARM__ ) /*!< IAR Compiler */

 

#pragma location=0x30040000

ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */

#pragma location=0x30040100

ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */

 

#elif defined ( __CC_ARM ) /* MDK ARM Compiler */

 

__attribute__((at(0x30040000))) ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */

__attribute__((at(0x30040100))) ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */

 

#elif defined ( __GNUC__ ) /* GNU Compiler */

 

ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT] __attribute__((section(".RxDecripSection"))); /* Ethernet Rx DMA Descriptors */

ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT] __attribute__((section(".TxDecripSection"))); /* Ethernet Tx DMA Descriptors */

 

#endif

 

#if defined ( __ICCARM__ ) /*!< IAR Compiler */

#pragma location = 0x30040200

extern u8_t memp_memory_RX_POOL_base[];

 

#elif defined ( __CC_ARM ) /* MDK ARM Compiler */

__attribute__((section(".Rx_PoolSection"))) extern u8_t memp_memory_RX_POOL_base[];

 

#elif defined ( __GNUC__ ) /* GNU */

__attribute__((section(".Rx_PoolSection"))) extern u8_t memp_memory_RX_POOL_base[];

#endif

 

 

 

 

/

* USER CODE END Header_StartDefaultTask */

void StartDefaultTask(void *argument)

{

/* init code for LWIP */

printf("LWIP Started!\r\n");

MX_LWIP_Init();

printf("LWIP Working !\r\n");

/* USER CODE BEGIN 5 */

/* Infinite loop */

for(;;)

{

osDelay(100);

}

/* USER CODE END 5 */

}




 

Please let me know if you need anymore details. I am not understanding why code does not initialize LWIP