FreeRTOS / iot-reference-esp32

MIT License
75 stars 45 forks source link

Notify other tasks that OTA is stopped when fail to activate new image. #77

Closed ActoryOu closed 5 months ago

ActoryOu commented 6 months ago

Notify other tasks that OTA is stopped when fail to activate new image.

Description

As #73 discussed (in additional question), when OTA fail to activate new image, we should notify other tasks to continue.

Test Steps

  1. Run OTA test with hacking that OTA pal fail to activate the image like below.

    OtaErr_t OTA_ActivateNewImage( void )
    {
    // skip for simplify
    
    if( ( otaAgent.pOtaInterface != NULL ) && ( otaAgent.pOtaInterface->pal.activate != NULL ) )
    {
        // comment out below line to make activation fail to test this scenario.
        // palStatus = otaAgent.pOtaInterface->pal.activate( &( otaAgent.fileContext ) );
    }
    
    // skip for simplify
    
    return ( ( palStatus >> OTA_PAL_SUB_BITS ) == ( uint32_t ) OtaPalSuccess ) ? OtaErrNone : OtaErrActivateFailed;
    }
  2. Check if publish demo is running normally.

Checklist:

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.