I’m working with Microchip’s free TCP/IP (version 4.55) stack on an 8-bit micro-controller.
I’m trying to reset the stack without doing a full board reset with asm(‘RESET’).
Any ideas on how to restart this Stack.
UPDATE
I reset the stack with the following steps
- Toggle the reset pin to on the Microchip Ethernet chip
- Call StackInit();
- Manually reset the UDP announce state machine
This seems to recover from the fatal SPI errors I encountered.
Call StackInit(). That function reinitializes all the sub-modules (TCP, UDP, SMTP, etc.). It will also clobber all of the TCP and UDP socket you have open, so you will have to re-open the sockets you want to use.
As a side note: I followed the thread on the Microchip forum. I was also getting strange resets in my TCP stack. It ended up being a stack overflow. Put some variables at the top of your stack.
Initialize these variables at the beginning of main() and put a breakpoint at the beginning. See if these variables are being overwritten.