Skip to main content
Visitor II
May 6, 2008
Question

AN 2078 - IAP

  • May 6, 2008
  • 4 replies
  • 1155 views
Posted on May 06, 2008 at 11:19

AN 2078 - IAP

    This topic has been closed for replies.

    4 replies

    Visitor II
    January 31, 2007
    Posted on January 31, 2007 at 19:13

    The code for AN2078 (In Application Programming) runs from address 0x40000000, flash Bank 0 Sector 0. It can load programs into addresses starting at 0x40002000, flash Bank 0 Sector 1, and up through the rest of the Sectors in flash Bank 0.

    How can the code located in Bank 0 Sector 0 write to other Sectors in the same flash Bank?? I do not see anywhere in the code where functions are copied to RAM, nor is this mentioned in section 1 of the App note. I am cunfused. =(

    Thanks,

    Erik

    Visitor II
    February 1, 2007
    Posted on February 01, 2007 at 07:19

    Hello EHHoney,

    In fact, the 7xx_flash.c source file is copied into and executed from the internal RAM.

    This is done by using some IAR features:

    Right click on the 7xx_flash.c and select Options --> Override inherited settings --> output --> Segment base name --> CODE1 is written instead of CODE.

    CODE1 is defined in the start-up file 'init_table.s'included in the project files allowing the copy of a code from a segment in the flash into a segment in the RAM. It is used also in the IAR linker file 'lnkarm_flash.xcl'.

    In the application note, it was noticed in section 4. STR7xx IAP implementation Summary, page 7 that program/erase operations are performed from RAM. More details about how this was performed were not given because our purpose was to give guidelines independantly of the used toolchain.

    P.S: Today, the used toolchain is IAR but we plan to port the IAP driver to other toolchains.

    Best regards,

    Najoua.

    Visitor II
    February 1, 2007
    Posted on February 01, 2007 at 13:23

    Ahhhh, secret IAR stuff... =) I am using the GCC toolchain. Now I know what this does:

    (from 71x_init.s)

    IMPORT __main

    ; --- Now branches to a C lib function that copies RO data from their

    ; load region to their execute region, create the RW and ZI regions

    ; then jumps to user C main program.

    B __main ; Note : use B not BL, because an application will

    ; never return this way

    Thanks for clearing this up!

    -Erik

    Visitor II
    May 6, 2008
    Posted on May 06, 2008 at 11:19

    Hi,

    I am using Keil. I am caught in the loop because of code above.

    After I download blinky.bin to STR71. If I don't press P1.8 the blinky application will execute. If I press P1.8 I don't get IAP_main.

    Could you give me some advice,

    r,Alex