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

Trouble when booting the SoC from internal RAM - the memory always reset

Hi,

I have some issues when booting our SOC based on a Cortex M3, with Internal RAM starting @0x10000000

there's no internal ROM, and no internal Flash.

I'm using Keil, uVision version 5.3.3, with 2 methods.

1. Using the configuration without the optionsfor Target Debug --> Initialization File option

with this method, the log file shows that the debugger loads the application code to the RAM, but when reading back, the returned values are 00000001, at all the RAM range.

2. Using the configuration with the options for Target Debug --> Initialization File option and use lhe Debug_RAM.ini file

=======================  Debug_RAM.ini file ======================

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

memset(0x10000000,0x10000,0xAA)
memset(0x10010000,0x20000,0x55)

LOAD %L CLEAR INCREMENTAL               //0x10000000                    // Download to RAM

Setup();

g, main

================================================

Step 1: if I remove the last command "g, main", I can see the application code in the target memory region

Step 2: as soon as I run the last command "g, main", the  target memory region is reset to the values 00000001, 

I have tested with different "connect & Reset Options" and the behaviour is the same.

Have you seen this kind of behaviour in your experiences ? have you an idea ?

Regards,

Karimh

  • Hi KarimH, have faced this a lot of time at my end too. But didn't get any way out to this yet.

    Regards,

    Kevin J. Hodge Showbox Tutuapp Kodi

  • You can check your memory map file after you build your project to see if your application really starts from the RAM start address 0x10000000. 

    If not, very likely you have the wrong settings in Options for Target - Target - Read/Only Memory Areas in uVision.

    As an example, you can take the CMSIS-RTOS Blinky example project for MCBSTM32F400 in Pack Installer. This example has a project target called "Debug RAM". You can take it as a reference how to set up everything.