This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

not able to jump passed Fapi_setActiveFlashBank()

John,

I am not able to jump passed Fapi_setActiveFlashBank(). I looked at the MAP file and could not find _Fapi_setupFlashStateMachine(). 

I am using F021 Flash API 2.00.01 and the example UART bootloader software provided on the WIKI site. I am able to get a clean compile, so I am fairly certain I included the correct File Search Paths and Includes. I am using the file bl_link.cmd as provided by the WIKI bootloader software. 

The following is included in this other gentlemen's MAP file and is not in mine: 

F021_API_CortexR4_BE_v3D16.lib : FlashStateMachine.obj (.text:_Fapi_setupFlashStateMachine).

This is my flashAPI section:

flashAPI 0

00001200 00000980 RUN ADDR = 08002000
00001200 00000008 Fapi_UserDefinedFunctions.obj (.text)
00001208 000007a4 bl_flash.obj (.text)
000019ac 00000174 F021_API_CortexR4_BE_V3D16.lib : Program.obj (.text:Fapi_issueProgrammingCommand)
00001b20 0000000a : Utilities.CalculateEcc.obj (.tramp.Fapi_calculateEcc.1)
00001b2a 00000002 --HOLE-- [fill = 0]
00001b2c 0000000a : FlashStateMachine.IssueFsmCommand.obj (.tramp._Fapi_issueFsmCommand.1)
00001b36 00000002 --HOLE-- [fill = 0]
00001b38 0000000c : Read.MarginByByte.obj (.tramp.Fapi_doMarginReadByByte.1)
00001b44 0000000c : Async.WithAddress.obj (.tramp.Fapi_issueAsyncCommandWithAddress.1)
00001b50 0000000c : FlashStateMachine.EnableMainSectors.obj (.tramp.Fapi_enableMainBankSectors.1)
00001b5c 0000000c : FlashStateMachine.SetActiveBank.obj (.tramp.Fapi_setActiveFlashBank.1)
00001b68 0000000c : FlashStateMachine.InitializeFlashBanks.obj (.tramp.Fapi_initializeFlashBanks.1)
00001b74 0000000c sci_common.obj (.tramp.UART_putString.1)

Do you have any idea why this isn't being loaded into RAM as expected?

Do you know how I could manually map this to load?

Thanks,

Phillip

  • Hello Phillip,

    When you state you cannot jump past Fapi_setActiveFlashBank() what is actually occurring?  It would also be helpful to look and the linker command file you are using for your project.

  • John,

    As I reach Fapi_setActiveFlashBank((Fapi_FlashBankType)ucBank),The software jumps to this interrupt vector, which I assume to be a Hard Disable.

    ;-------------------------------------------------------------------------------
    ; interrupt vectors

             b _c_int00 ;0x00
    >>>>b #0x1FFF8 ;0x04
             b #0x1FFF8 ;0x08, Software interrupt
             b #0x1FFF8 ;0x0C, Abort (prefetch)
             b #0x1FFF8 ;0x10, Abort (data)

    In addition to the information in my previous post, do you have any ideas?

    Thanks,Phillip

    4667.bl_link_cmd.txt

  • John,

    I am now able to flash software into memory using the uart bootloader using F021 v2.00.1. I believe I was having an issue when copying the .flashapi section into RAM. I started with the example software on the wiki site and added a "load" function into main(), not unlike one you had posted on another thread. Now all flashapi commands respond as intended.

    However, I am still having an issue. I can see that the new program is in the flash memory, but when the bootloader application jumps to address 0x00020000, I get a software abort 0x10, Abort (data). I am still working on finding out what is causing the issue and will post more when I get deeper into it.

    Some initial concerns I had are:

    1. Do the bootloader and application software need to have the same sys_clk settings on application startup?

    2. Do I have to remap any vector addresses from the application code?

    For the sake of others, the function I added in main() to the boot_uart software is as follows:

    /******************************************************************
    * This function added to test out new way to copy flash to RAM.
    */
    #define FlashApi_LoadStart 0x00001200
    #define FlashApi_RunStart 0x08002000
    #define FlashApi_LoadSize 0xf80

    void load(char *load,char *start, unsigned int size)
    { do
    {
    *start = *load;
    start++;
    load++;
    } while (--size);
    }

    void main(void)
    {

    load((char *)FlashApi_LoadStart, //FlashApi_LoadStart
    (char *)FlashApi_RunStart, //FlashApi_RunStart
    (unsigned int)FlashApi_LoadSize); //FlashApi_LoadSize

    ....

    g_ulTransferAddress = (uint32_t)APP_START_ADDRESS;
    ((void (*)(void))g_ulTransferAddress)();

    ...

    }