We currently have an application that does polling out both serial ports. We have the ability for the customer to upload new software using the example code provided. If serial 0 is very busy the software update triggers a trap and then the system re-boots. We can unplug the serial device and successful software upload.
Any suggestions?
Thanks,
David
MOD 5234 File upload issue
Re: MOD 5234 File upload issue
Are you sure its a trap, and not the busy serial port sending an 'A' to abort to the monitor on reboot?
If the device on the serial port is polled then you can stop the polling while updating using the
shutdown hook...to tell your system to stop the polling...
You can find an example of autoupdate functions at nburn\examples\standardstack\AutoUpdateFeatures
For you I think this would work:
#include <autoupdate.h>
//Really important that this next variable is declared volatile.
volatile bool bImShuttingDown; //When when this boolean is true stop your polling.
int MyShutDownHookFun()
{
bImShuttingDown=true;
return 1; //Return 1 to allow shutdown 0 to block
}
//Then some where in the initialization of the world (UserMain???)
update_shutdown_func = MyShutDownHookFun;
If the device on the serial port is polled then you can stop the polling while updating using the
shutdown hook...to tell your system to stop the polling...
You can find an example of autoupdate functions at nburn\examples\standardstack\AutoUpdateFeatures
For you I think this would work:
#include <autoupdate.h>
//Really important that this next variable is declared volatile.
volatile bool bImShuttingDown; //When when this boolean is true stop your polling.
int MyShutDownHookFun()
{
bImShuttingDown=true;
return 1; //Return 1 to allow shutdown 0 to block
}
//Then some where in the initialization of the world (UserMain???)
update_shutdown_func = MyShutDownHookFun;