This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Runtime programming FLASH with data

I use the MCB-STR9 eval board.

I use Flash Bank 0 for program and Flash Bank 1 for my Parameter. Do write some Parameters I have to clear the first sector of this Bank while runtime.
But I got a timeout or an Prefetch Interrupt.

I have a short demo programm. (you can find under http://www.gds-sw.de/keil the complett demo programm for the eval board)

Whats wrong?

Rainer Fuchs
GDS GmbH
Karl-Götz-Str.5
97424 Schweinfurt
Germany

Parents
  • Hi,

    If you want to correctly write on the flash bank1 when you execute code from bank0, you have at least to put the content of this function in RAM :

    FMI_Config(FMI_READ_WAIT_STATE_3, FMI_WRITE_WAIT_STATE_1, FMI_PWD_DISABLE,\ 
                 FMI_LVD_DISABLE, FMI_FREQ_LOW); /* FMI Waite States */
    

    The fmi controller doesn't reconize this init if the code is executed from flash. You can locate the CONTENT (the two writes to FMI_BANK1) of this small function in a dedicated source file named INRAM.C, and next add inram.o in your linker setup file (blinky.sct)

    RW_IRAM1 0x04000000 0x00018000
    {  ; RW data
       * (+RW +ZI)
       inram.o
      }
    

    if you have futher problem you can also replace inram.o by directly 91x_fmi.c in the linker file to locate all flash routine in RAM at the execution. with this, everything must be good.

    I hope that can help you.

    Chris.

Reply
  • Hi,

    If you want to correctly write on the flash bank1 when you execute code from bank0, you have at least to put the content of this function in RAM :

    FMI_Config(FMI_READ_WAIT_STATE_3, FMI_WRITE_WAIT_STATE_1, FMI_PWD_DISABLE,\ 
                 FMI_LVD_DISABLE, FMI_FREQ_LOW); /* FMI Waite States */
    

    The fmi controller doesn't reconize this init if the code is executed from flash. You can locate the CONTENT (the two writes to FMI_BANK1) of this small function in a dedicated source file named INRAM.C, and next add inram.o in your linker setup file (blinky.sct)

    RW_IRAM1 0x04000000 0x00018000
    {  ; RW data
       * (+RW +ZI)
       inram.o
      }
    

    if you have futher problem you can also replace inram.o by directly 91x_fmi.c in the linker file to locate all flash routine in RAM at the execution. with this, everything must be good.

    I hope that can help you.

    Chris.

Children
No data