Skip to main content
Visitor II
December 29, 2022
Solved

H743 USB and Ethernet conflict

  • December 29, 2022
  • 3 replies
  • 1571 views

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

    This topic has been closed for replies.
    Best answer by MWB_CHa

    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.

    3 replies

    Super User
    December 29, 2022

    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.

    DB.7Author
    Visitor II
    December 29, 2022

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

    Graduate II
    December 29, 2022

    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

    DB.7Author
    Visitor II
    December 30, 2022

    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_CHaAnswer
    ST Employee
    February 17, 2023

    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.

    Graduate II
    February 18, 2023

    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.