Hi all,
LPC4078, uVision 4.74.0.22, TCPnet/Net_Config.c v4.72
I have a bug in my release code that is very occasional and disappears when I change anything so I can't debug it or add debug prints or whatever.
I have a small bootloader that optionally receives an application via Ethernet and programs it into higher ARM flash then runs it. One combination of bootloader and app show the problem - occasionally. I'm looking for something that can be set by the bootloader then persists when the app runs. Both the bootloader and the app call init_TcpNet.
1) Is it safe to call init_TcpNet a second time?
2) Is it safe to call init_TcpNet a second time from another program which may have different settings such as number of UDP sockets? There is of course no reset between them.
Thanks Ant
Thorsten, many thanks for your reply. I understand your idea of the pre function but are you saying that I should call init_TcpNet() each time it detects a connection? I assumed that I could call that once after power up and whatever the user did with cables, the library would just keep working. Have I misunderstood what you meant?
Of course you must remember if you have already set up an ethernet connection after a cable was pluged. In my project, when I detect a cable loss, I disable the ethernet connection after 1 second, and completely reinitialize it when the cable is plugged back in.
If you are sure that your device is not pluged into another (or changed) network, you can keep the connection, and it will "just run" if the cable is plugged back in.
Yes I get it. We do occasionally see that problem when we are messing with the network, that is a great idea. Thank you.