mpc5634m bootloader init function

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mpc5634m bootloader init function

515 Views
roganchoi
Contributor II

hello ,  i have Q which is about flash init and unlock function in reference...

 /*====== Unlock all blocks in low address space (bootloader excluded) ======*/
  returnCode = pSetLock( &ssdConfig, LOCK_LOW_PRIMARY, (0xFFFFFC07), FLASH_LMLR_PASSWORD);
  if ( C90FL_OK != returnCode )
  {
       return(FlashInitError);
  }

  returnCode = pSetLock( &ssdConfig, LOCK_LOW_SECONDARY, (0xFFFFFC07), FLASH_SLMLR_PASSWORD);
  if ( C90FL_OK != returnCode )
  {
       return(FlashInitError);
  }


  /*====== Unlock all blocks in mid address space ======*/
  returnCode = pSetLock( &ssdConfig, LOCK_MID_PRIMARY, (0xFFFFFFFC), FLASH_LMLR_PASSWORD);
  if ( C90FL_OK != returnCode )
  {
       return(FlashInitError);
  }

    returnCode = pSetLock( &ssdConfig, LOCK_MID_SECONDARY, (0xFFFFFFFC), FLASH_SLMLR_PASSWORD);
  if ( C90FL_OK != returnCode )
  {
       return(FlashInitError);
  }
 

=====================================================================================

and lcf file setting is

MEMORY
{
    resetvector:           org = 0x00000000,   len = 0x00000008
    init:                  org = 0x00000020,   len = 0x00000FE0    
    /* exception_handlers:    org = 0x00001000,   len = 0x00001000 */
    internal_flash:        org = 0x00001000,   len = 0x0000F000    //use 64KB only

    internal_ram:          org = 0x40000000,   len = 0x00012000
    code_ram:                org = 0x40012000,   len = 0x00001000
    exception_handlers:    org = 0x40013000,   len = 0x00001000
    heap  :                org = 0x40014000,   len = 0x00002000
    stack :                org = 0x40016000,   len = 0x00001800

}

========================================================================================

i wonder in setlock function parameters ( 0xFFFFFC07 and 0xFFFFFFFC) ..

how parameter can be a 0xFFFFFC07 ?

is there a some like a formular or equation ?

Tags (2)
0 Kudos
0 Replies