Skip to main content
Visitor II
August 21, 2020
Question

STM32F767zi - MX_LWIP_Process()

  • August 21, 2020
  • 4 replies
  • 1826 views

Hello,

I just started working with STM32f767zi board. I'm doing TCP Ethernet communication using lwip RAW API. I could be able to start the communication with the host. But the problem is, in my forever loop I put MX_LWIP_Process() function. If I put a 2 second delay in the while loop, then communication did not happen within that time period. Is there any solution for this matter? I want to do this in RAW API (without RTOS)

Thank you.

    This topic has been closed for replies.

    4 replies

    Super User
    August 21, 2020

    > If I put a 2 second delay in the while loop, then communication did not happen within that time period. Is there any solution for this matter?

    One solution is not putting in a 2 second delay. Perhaps you can explain why you're putting it there.

    KMale.1Author
    Visitor II
    August 21, 2020

    Sorry for not explaining about delay. I'm communicating with the touch panel via Ethernet. So from the value which is obtain from the touch panel, I want to rotate a servo motor. So while rotating the servo I cannot communicate with the touch panel.

    Super User
    August 21, 2020

    Without using an RTOS, you can either :

    1) I'm not sure if MX_LWIP_Process() can be called within an interrupt or not. If it can, you could move it to an interrupt which is called with some regular frequency.

    2) Make the server motor processing non-blocking by implementing it with an interrupt or using DMA or similar. How you do that will depend on what sort of signal you need to send. If it's just a PWM at some frequency for some duration, the timers can take care of that without needing the CPU. Motion controllers often have an interrupt which is called at a very high rate and handles server/motor communications. Your main loop would then tell the motion control scheme what to do and the high-rate interrupt would execute the motion.

    I don't particular like programming with an RTOS but it does make these sorts of problems trivial to solve.

    KMale.1Author
    Visitor II
    August 22, 2020

    Thank you for the reply. I tried with interrupt but it not worked. Don't know whether my method is write or wrong. I tried with global Ethernet interrupts.

    Visitor II
    August 21, 2020

    i am stuck in this loop

     if(((heth->RxDesc->Status & ETH_DMARXDESC_OWN) == (uint32_t)RESET))

    status never changed here