Remote Program Update sample programs don't update firmware

Some of our Dynamic C RPU (Remote Program Update) sample programs do not update firmware without resetting the board.  This is not always possible if the board is in a remote location and you are attempting to update via Device Cloud.  For any of these samples one minor change to the code will fix the issue and allow a reset of the board remotely.  Here is a sample program, IDIGI_UPD_FIRMWARE.C, that should update a board connected to Device Cloud.  Lines 145 to 150:

    if (rc == -NETERR_ABORT) {
        // RCI reboot request was received.  Normally we would use this
        // to shut down cleanly and reboot the board.
        printf("Rebooting via exit(0)!\n");
        exit(0);
    }

Change the
exit(0); 
to
forceWatchdogTimeout();

as in:

    if (rc == -NETERR_ABORT) {
        // RCI reboot request was received.  Normally we would use this
        // to shut down cleanly and reboot the board.
        printf("Rebooting via exit(0)!\n");
        //exit(0);
      forceWatchdogTimeout();
    }

For our boards that have a serial boot flash, such as the RCM6700:   Note that this work around is actually what our RPU samples did in the original RPU release. Also note that the RPU must not be tested with Dynamic C running in debug mode because the debug kernel may interfere with the program restart, re-taking control of the Rabbit board before the updated firmware is loaded from the serial flash into the program RAM.
Last updated: Jan 01, 2024

Filed Under

Embedded

Recently Viewed

No recently viewed articles

Did you find this article helpful?