This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Execute Code in RAM for development

Other Parts Discussed in Thread: EK-TM4C123GXL

Hello,

I am using a TI EK-TM4C123GXL Launchpad dev board. During my initial development, I would like to execute all of my code from RAM to save wear and tear on the FLASH memory as I modify/change code.

The Keil IDE gives an option in the "target" tab to specify the address range of the "IROM1" memory space. I set this up to use 0x2000000 (start of SRAM) as the "IROM1" area but when I go into the debugger it just hangs.

Could someone direct me to any documentation on how to set the board up to develop code in RAM instead of ROM?

Or if anybody has any experience executing code in RAM and would like to share their knowledge, it would be appreciated.

 

Thanks for the help,

 

Brock

  • That which you seek is doable - but if your primary goal is, "saving wear/tear" upon the Flash - that effort appears misguided.  In the past - this vendor (and others) provided certain MCUs w/limited Flash life.  But - no more!

    Review the current Flash spec - our small group always develops - exclusively w/in Flash - w/ARM MCUs from 4 vendors - and have yet to experience Flash-Life issues.  (I'd estimate that - during development - we may download to flash 20-50 times per day, per board, per developer.)

    Beyond the life issues - you may achieve your objective by reviewing Keil's detailed manual and also key portions of this vendor's, "bootloader" user manual.  Another ARM vendor provides 2 external, MCU pins - which provide for a simplified HW selection of boot code location.  Yet - even in that case - one doubts that, "flash saving" ranked high in the design consideration...

    There are multiple, "hooks, changes & demands" enforced when running code exclusively w/in RAM.  (these both w/in your IDE and MCU config)   Yes it can be done - but the "time/effort" cost will be high - and the benefits questionable...

  • Seconded.  There was a time when some flash devices had only a few hundred cycles but few, if any, have that limitation any more.  The 100000 cycles for the TI devices will last a long time unless you are updating too often to put enough thought into your development.

    Robert

  • Third'ed.  (if that's possible)

    And - if in the unlikely event of Flash, "slaughter" - simply "toss" the 14 (USD) board and, "dig deep" to buy another...

    One more point of note - time/effort invested in, "learning/mastering" exclusive use of code residence w/in RAM is unlikely to, "quickly/easily" cross-over to the (far) more normal/customary (expected, even) use of Flash for program code residency...  It's reasonable to suspect that unless you "retool" both your IDE and critical MCU memory & key register settings - you'll "fail" when returning to "normal" code residency w/in Flash.  (again - for nothing...)

    Many negatives - misguided positive - you decide...

  • Point taken...

    I'm just getting back into embedded programming. My old freescale board came with a default monitor that allowed running code in RAM, probably because the EEPROM at the time was not as robust as current non-volatile memory. Then when it came to program to flash, some setting changes, including remapping the vector table, was all that was needed.

    I will just develop using flash to make life easier.

    Thanks for the quick feedback.

    Brock

  • Good for you - Robert & I do try to "save" new arrivals here from essentially, "wasted/mis-spent" time/effort.

    Years past - such was a good defensive posture - but no more.

    Suggest that you give a good read of Keil and start with a, "known good/existing" project.  The (always) unexplained penchant which users have to,"create their own" most always yields pain, delay & frustration. 

    Wise to search for an existing project closest in module use (i.e. PWM, I2C, Timer etc.) to yours - and add your code therein.  Gradually, carefully - you can comment out the existing code - with just yours then remaining.  Key advantage of proceeding in this manner is that all of the many & varied IDE "hooks" have been properly managed/emplaced for you - struggle/effort free. 

    Doing it instead - yourself, "Bonjour Monsieur Le Disaster - Entrez-vous!"  Unwise - and for what?  (Sacre bleu!)

  • You're welcome.  As I recall those monitors were built for an age of EPROM where you had to UV erase the chip.  Even at that time I wouldn't have normally used SRAM myself because of differences, not the smallest of which was available RAM.

     

    Robert

  • Hello Brock,

    It seems that you're missing a '0' - the memory space for SRAM is 0x20000000. Some of the TM4C129X chips have ROM at 0x02000000.
    I haven't tried executing from SRAM, but you should start by double-checking that you've got the right number of zeroes.
  • Perhaps it should be noted that, "poster Brock" was (last seen) - this vicinity - nearly three years past!    (he posted twice - mousing over poster's id/name reveals such)

    Is it possible that your "default" forum settings reveal, "older posts - rather than "latest/greatest?"   There is a grey box - just atop the first (highest) forum post - which enables (most usually) "ALL recent forum questions & discussions."     (note that this selection box reveals (only) when NO forum posts are "under view/open.")

  • The value of these forum topics is that new people with similar questions can hopefully find all the information they need without asking the same questions again. It is in that light that I answered such an old question, although I admit that I did not notice the date.

    I would be helpful if the OP could return and post the final solution that worked, but that clearly doesn't always happen.

    By the way, I did not find this topic at the top of the opening page. Instead, I found it by searching for topics related to a question that I have about executing Tivaware driverlib code from ROM. It's my habit to try to answer a few questions before I post my own request for answers. I consider it a way of paying forward my debt to the E2E Community.
  • Well said, understood, & agreed. With two posts (total) under his belt - poster "Brock" is unlikely to return...