AnsweredAssumed Answered

Interrupts are not triggered during firmware-in-SRAM debugging using ST-Link

Question asked by Stanley Lin on Nov 27, 2017
Latest reply on Dec 29, 2017 by Clive One



I have implemented my application firmware on STM32F746G discovery board and it worked fine while the code was located in embedded flash (just like most examples in cube).


Now I am trying to migrate code to SRAM using ST-Link, to evaluate the execution time between code in flash and RAM.

Current status is that the break points in main() could be reached, but the program was stalled in HAL_Delay() since the interrupt SysTick_Handler() was never triggered. I've spent all day long without finding any useful hint...


My environment is Keil uVision 5, and here is what I did to configure ST-Link debugging in SRAM:

  1. Change memory areas in Target tab
        IROM1: 0x20000000, 0x10000
        IRAM1: 0x20010000, 0x40000
  2. Add a define in C/C++ tab: VECT_TAB_SRAM
  3. Add debug init file (RAM.ini) and uncheck "Load Application at Startup" in Debug tab

    FUNC void Setup (void) {
      SP = _RDWORD(0x20000000); // Setup Stack Pointer
      PC = _RDWORD(0x20000004); // Setup Program Counter
      XPSR = 0x01000000; // Set Thumb Bit
      _WDWORD(0xE000ED08, 0x20000000); // Setup Vector Table Offset Register

    LOAD %L INCREMENTAL // Download to RAM

    // g, main

  4. Uncheck "Update Target before Debugging" in Utilities tab
  5. Press Settings button in Utilities tab, In Flash Download tab
    1. Download function: Do not erase
    2. RAM for Algorithm: 0x20010000, 0x1000
    3. Programming Algorithm: 20000000H - 2000FFFFH


Enclosed is a sample to describe my problem. Note that it's based on cube so it should be placed into the cube directory.


Thanks in advance.