MOD 5234 File upload issue

Discussion to talk about software related topics only.
Post Reply
Quickdeploy
Posts: 5
Joined: Fri Sep 03, 2021 10:12 pm

MOD 5234 File upload issue

Post by Quickdeploy »

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
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: MOD 5234 File upload issue

Post by pbreed »

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;
Post Reply