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

How to setup keil uvision5 target to run code from ram not flash

hello,
first of all sorry for my bad english.

I am trying to develop some projects and need to reload all the time to flash.

How to setup target options to put code into ram and run program from ram instead of flash?
For instance blinky example (found this somewhere on keil page) have flash and ram targets and ram does not touch flash(i do not know how many times can flash be programmed).

On target options i have set irom1 to iram1 sram space(0x2000000 size 0x1000 and shrinked ram space that much) but this is not working.
I am getting error:
No Algorithm found for: 02000000H - 020006BBH
Erase skipped!
Error: Flash Download failed - "Cortex-M4"

schater file is:
LR_IROM1 0x02000000 0x00100000 { ; load region size_region ER_IROM1 0x02000000 0x00100000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x20010000 0x00010000 { ; RW data .ANY (+RW +ZI) }
}

greetings from croatia.

Parents Reply Children
  • So realistically you don't have 16MB (0x100000) of SRAM then?

    /*----------------------------------------------------------------------------
     * Name:    Dbg_RAM.ini
     * Purpose: RAM Debug Initialization File
     * Note(s):
     *----------------------------------------------------------------------------*/
    
    /*----------------------------------------------------------------------------
      Setup()  configure PC & SP for RAM Debug
     *----------------------------------------------------------------------------*/
    FUNC void Setup (void) {
      SP = _RDWORD(0x20000000);          // Setup Stack Pointer
      PC = _RDWORD(0x20000004);          // Setup Program Counter
      _WDWORD(0xE000ED08, 0x20000000);   // Setup Vector Table Offset Register
    }
    
    
    load %L incremental
    
    Setup();                             // Setup for Running
    
    g, main
    

  • one zero too much but still not working.