AnsweredAssumed Answered

The problem with ReBooting on BF561

Question asked by Joshua on Nov 22, 2010
Latest reply on Dec 16, 2010 by CraigG

      We now are using BF561.And coreA is as MCU, CoreB is as DSP.

     The OS(uc/os-ii) is running in CoreA. When new version of software is developed by us, We must use Internet to update the software runned in system.

 

     So I have take a try on BF561-EZKIT.

 

     Hardware platform: BF561-EZKIT

     Software platform : VDSP5.0(update 8)

                                 uc/os-ii(v2.86)

 

     The flow of chat is:

     1) Kill all the other tasks,except the UART Rx Task.

     2) The ldr file is transmitted by UART,and then saved to SDRAM.

     3) The context of SDRAM is written into SPI flash.

     4) Software reset.and new bootflow is in running.

 

     And 1),2),3) is running OK,but the 4) is in problem. I have used watchdogA as resetting.but it is sometime work-well, the new version of software is running, sometime it is work-fail, only the boot is done form flash( viewed by waveform!),And the new software is not in practice.

 

     Here is my main code:

 

// Function :  SpiOperation()

// Parameters: p_arg;

// Returns:None

// Description:

//    1) Check Flash IDs

//    2) Erasing the needed sectors

//    3) Writting & Comparing the context by bytes

//    4) Set mbox.

 

void  SpiOperationTask(void *p_arg)

{

     .....

    while(1)

     {

          m25p16_Open( );                    // Open flash

          .....                                        // Other operation with spi flash.

          m25p16_Close( );                   // Close flash,all Spi flash operation is done.

         

          OSMboxPost(pmailbox_bootdone, msg);      // Set the mbox, ReBootTask will be started.

     }

 

}

 

 

// Function  :  ReBootTask( )

// Parameters  : p_arg

// Returns :  None

// Description:  Reseting!

 

void ReBoot(void *p_arg)

{

     .........

     while(1)

     {

          OSMboxpend(pmailbox_bootend, timeout, (INT8U *)&err);      // ReBootTask is running.

          if(OS_ERR_NONE == err)   // There is message.

          {

               OSTaskSuspend(SPIOPERATION_PRIO);                   // The SpiOperationTask() is killed.

               ReBoot( );

               OSTaskSuspend(OS_PRIO_SELF);                            // Kill this task. 

          }

     }

 

}

 

//Function : ReBoot( )

//Parameters : None

//Returns :  None

//Description :  Watchdog is used. => Reseting.

 

void  ReBoot(void)

{

     *pWDOGA = 60,000,000;   // 1s timer

     *pWDOGA = 0;                 //  Enabled & Generating software reset.

}

 

 

 

    If someone give me some usefull information, I will be very glad.

Outcomes