cancel
Showing results for 
Search instead for 
Did you mean: 

H743 USB and Ethernet conflict

DB.7
Associate II

Hi!

My problem is, that i use a H743 with Eth and USB configured.

Ethernet works fine, till i set up the usb. When i turn on the usb, than the ethernet stops working, because it didn't recognises the messages from eth. The usb is configured in usb_device mode with HID.

I tried to debug the code, the ethernet works, if i leave the initialization code of the stm32cubeide generator in and comment out the device descriptor initialization. I think it is some memory issue.

Somebody knows or can guess what the problem is?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
MWB_CHa
ST Employee

Hi @DB.7​ 

I don't know if you found a solution already, but we tried to reproduce the behavior you described and we see no issue integrating USB, ETH, LwIP and FreeRTOS together.

You can find in the attachment a very draft but functional example on STM32H723ZG. Maybe it could help you in your investigations.

The most common points to check I think are:

  • Threads and interrupts priorities: is there a thread or an interrupt that is masking other threads or corrupting their data ?
  • Memory usage: is the stack, heap, allocations set correctly between USB, LwIP and FreeRTOS ?
  • GPIOs conflict: I don't think it's your case on Nucleo-H743ZI, but maybe some configuration went wrong when setting up the project on STM32CubeMX ?

In order to better help, you can share your project (or part of it) to allow us debug it.

View solution in original post

6 REPLIES 6
Pavel A.
Evangelist III

Which board? If custom, do you have .ioc for it? any pin conflicts?

>  I think it is some memory issue.

That is possible because a lot of ETH/LwIP examples use ugly absolute addresses, so the linker cannot detect overlaps.

It is a Nucleo-H743ZI board, i did not see any pin conflicts.

Piranha
Chief II

Just a blind guess - too small stack memory.

But generally... A broken network integration code with a broken USB stack brought together by a code degenerator and you expect it to work? Also you have provided almost no useful information. Are you using RTOS?

https://community.st.com/s/question/0D50X0000BOtfhnSQB/how-to-make-ethernet-and-lwip-working-on-stm32

Yeah, i am using RTOS. I tried also to change the stack size.

The ethernet is working correctly, it stops working, when i configure the usb. If the ethernet and usb is configured and initialized, than the ethernet did not works. Whan i comment out the init value of the device descriptor(linker places it to other area) than the ethernet works(the usb not because of tge descriptor, but the full init sequence is called)

MWB_CHa
ST Employee

Hi @DB.7​ 

I don't know if you found a solution already, but we tried to reproduce the behavior you described and we see no issue integrating USB, ETH, LwIP and FreeRTOS together.

You can find in the attachment a very draft but functional example on STM32H723ZG. Maybe it could help you in your investigations.

The most common points to check I think are:

  • Threads and interrupts priorities: is there a thread or an interrupt that is masking other threads or corrupting their data ?
  • Memory usage: is the stack, heap, allocations set correctly between USB, LwIP and FreeRTOS ?
  • GPIOs conflict: I don't think it's your case on Nucleo-H743ZI, but maybe some configuration went wrong when setting up the project on STM32CubeMX ?

In order to better help, you can share your project (or part of it) to allow us debug it.

If the code is broken, the behavior is almost unpredictable.

For example, as ST USB stack runs in interrupt context, this issue could be impacted by this flaw:

https://community.st.com/s/question/0D53W00001oImr4SAC/bug-stm32-lwip-ethernet-driver-tx-deadlock

Post edited to adhere community guidelines.