embeded/Cortex-M4 Ti2017. 12. 28. 11:33

ICDI로 설정하고 일단은

부트로더 올리고

LM Flash 통해서 0x1000 에 시작 주소가 0x1000으로 바꾼 qs-rgb를 올리니

(Erase Method를 아무생각없이 Entire로 해서 몇번 고생..)

부트로더 안멈추고 바로 qs-rgb로 시작하는데..

부트로더에서 몇 초 기다리게는 못하려나?


올리고 나서 검증을 위해 Flash Utilties에서 부분 삭제를 해보니

부트로더에서 LED 흰색으로 켜지게 해준거 나오는거 봐서..

부팅이 진행가능하면 바로 qs-rgb로 넘어 가는거 같네...

수정한 내용

0x00000000 -> 0x00001000

;******************************************************************************

;

; qs-rgb.sct - Linker configuration file for qs-rgb.

;

; Copyright (c) 2012-2016 Texas Instruments Incorporated.  All rights reserved.

; Software License Agreement

; Texas Instruments (TI) is supplying this software for use solely and

; exclusively on TI's microcontroller products. The software is owned by

; TI and/or its suppliers, and is protected under applicable copyright

; laws. You may not combine this software with "viral" open-source

; software in order to form a larger program.

; THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.

; NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT

; NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

; A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY

; CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL

; DAMAGES, FOR ANY REASON WHATSOEVER.

; This is part of revision 2.1.3.156 of the EK-TM4C123GXL Firmware Package.

;

;******************************************************************************


LR_IROM 0x00001000 0x00040000

{

    ;

    ; Specify the Execution Address of the code and the size.

    ;

    ER_IROM 0x00001000 0x00040000

    {

        *.o (RESET, +First)

        * (InRoot$$Sections, +RO)

    }


    ;

    ; Specify the Execution Address of the data area.

    ;

    RW_IRAM 0x20000000 0x00008000

    {

        ;

        ; Uncomment the following line in order to use IntRegister().

        ;

        ;* (vtable, +First)

        * (+RW, +ZI)

    }


+

//*****************************************************************************

//

// Allows an application to perform in-place data decryption during download.

//

// If hooked, this function will be called on receipt of any new block of

// downloaded firmware image data.  The application must decrypt this data

// in place then return at which point the boot loader will write the data to

// flash.

//

// void MyDecryptionFunc(unsigned char *pucBuffer, unsigned long ulSize);

//

// where:

//

// - pucBuffer points to the first byte of data to be decrypted.

// - ulSize indicates the number of bytes of data at pucBuffer.

//

//*****************************************************************************

//#define BL_DECRYPT_FN_HOOK      MyDecryptionFunc 


bl_check.c 소스에서

사용자 함수 확인 부분과 시작 어드레스(기본값은 0x00001000) 에서

바이너리가 존재할 경우 확인하는 부분

uint32_t

CheckForceUpdate(void)

{

#ifdef CHECK_CRC

    uint32_t ui32Retcode;

#endif


#ifdef BL_CHECK_UPDATE_FN_HOOK

    //

    // If the update check function is hooked, call the application to determine

    // how to proceed.

    //

    return(BL_CHECK_UPDATE_FN_HOOK());

#else

    uint32_t *pui32App;


#ifdef ENABLE_UPDATE_CHECK

    g_ui32Forced = 0;

#endif


    //

    // See if the first location is 0xfffffffff or something that does not

    // look like a stack pointer, or if the second location is 0xffffffff or

    // something that does not look like a reset vector.

    //

    pui32App = (uint32_t *)APP_START_ADDRESS;

    if((pui32App[0] == 0xffffffff) ||

       ((pui32App[0] & 0xfff00000) != 0x20000000) ||

       (pui32App[1] == 0xffffffff) ||

       ((pui32App[1] & 0xfff00001) != 0x00000001))

    {

        return(1);

    }

...


빌드된 바이너리 파일을 보면 0x20000df8 이라고 해야하나? 아무튼 이 정보를 가지고 비교하는 듯


Posted by 구차니