0
\$\begingroup\$

I'm using the mbed TCP/IP Socket library to receive incoming messages via ethernet. Currently, the incoming data is read in an infinite while(1) loop (i.e. as fast as possible).

I will also be adding several timer interrupt functions which run periodically (1000/sec). Should an interrupt occur while a message is being received, would the incoming message be discarded and have to be re-sent from the client?

How are packets processed in the LPC1768? If I process incoming packages in a separate timer interrupt function (say, 20/sec), can I still guarantee that packets won't be missed?

\$\endgroup\$
1
\$\begingroup\$

Once the TCP stack has handed off the data to your infinite loop, the data is in that specific memory location. An interrupt will not cause any issues with that. The TCP stack itself should also be interrupt driven (if it's not get one that is, it's not worth it). The C compiler takes care of saving variables between interrupts and restoring them when the interrupt is done. As long as your interrupts are short and sweet, then you shouldn't have any issues with data loss, or requiring the sender to re-send, as you have described it.

\$\endgroup\$
  • \$\begingroup\$ do you know if the mbed's TCP/IP class is interrupt driven? And which priority is it? Ultimately, my timer interrupt must take priority. \$\endgroup\$ – 19172281 Nov 15 '18 at 17:56
  • \$\begingroup\$ It's not clear. os.mbed.com/forum/mbed/topic/2073 says that there are multiple versions floating around. Some polled, some interrupt driven. Guess you need to know which one you are using. \$\endgroup\$ – Aaron Nov 16 '18 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.