Coldfire debugging but do not erase all memory before writing code..

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Coldfire debugging but do not erase all memory before writing code..

652 Views
ssinfod
Contributor IV

Hello,

 

I'm using the Coldfire 52233 MCU with uTasker RTOS and CodeWarrior 10.5.

This MCU has 256K of Flash. I'm using the first 128K for code and the other 128K for webpages and data.

 

Right now, every time I start the debugger in CodeWarrior all the 256K of Flash is erased and I have to reload my webpages separately since they are not part of the code.

 

Is there a way to erase and load only the first 128K of Flash when I use the debugger in CodeWarrior ?

I think I have to change the "MCF52233_utasker.lcf" file but I am not sure how to change it.

 

Here is the content of my file:

MCF52233_utasker.lcf #/* # * File:       M52235EVB_FLASH.lcf # * Purpose:    Linker file for the M52235EVB # * #  NOTE: The debugger uses the Illegal Instruction Vector to stop. #  A small subroutine is written at the location VBR+0x408-VBR+0x40B #  to handle the exception.  The Illegal Instruction Vector in #  the the vector table at VBR+0x10 is then pointed to it.  When the #  debugger encounters an illegal instruction, it jumps to this  #  subroutine, which ends with an RTE, then exits. #  Do not overwrite this area of memory otherwise the debugger may not  #  exit properly. # */   MEMORY {     flash1  (RX)   : ORIGIN = 0x00000000, LENGTH = 0x000400     flashconfig   (RX)   : ORIGIN = 0x00000400, LENGTH = 0x00000018       flash2  (RX)   : ORIGIN = 0x00000420, LENGTH = 0x003FBE0   vectorram(RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400   sram (RWX)  : ORIGIN = 0x20000400, LENGTH = 0x00007C00   ipsbar  (RWX)  : ORIGIN = 0x40000000, LENGTH = 0x0 }   SECTIONS  {   .ipsbar : {} > ipsbar        .flash1 :   {   startup_s.obj (.text)   .   = ALIGN(0x10);       } > flash1        .flashconfig :   {   flash_config_s.obj (.text)     } > flashconfig             .flash2 :   {   .   = ALIGN(0x10);   *(.text)   .   = ALIGN(0x10);     *(.rodata)   ___DATA_ROM   = .;     } > flash2                 .data : AT(___DATA_ROM)    {   ___DATA_RAM    = . ;           *(.exception)   .              = ALIGN(0x10);   __exception_table_start__ = .;      EXCEPTION   __exception_table_end__   = .;     ___sinit__     = .;      STATICINIT           *(.data)   .              = ALIGN (0x10);   ___DATA_END    = .;     __START_SDATA  = .;         *(.sdata)   .              = ALIGN (0x10);   __END_SDATA    = .;     __SDA_BASE     = .;   .              = ALIGN(0x10);   } > sram     .bss :   {   . = ALIGN(0x10);   __START_SBSS = .;   *(.sbss)   *(SCOMMON)   __END_SBSS   = .;     . = ALIGN(0x10);   __START_BSS  = .;   *(.bss)   *(COMMON)   __END_BSS    = .;         ___BSS_START = __START_SBSS;         ___BSS_END   = __END_BSS;         . = ALIGN(0x10);     } >> sram     ___FLASH = ADDR(.flash1);   ___FLASH_SIZE = 0x00040000;   ___SRAM = 0x20000000;   ___SRAM_SIZE = 0x00008000;     ___VECTOR_RAM = ___SRAM;   ___IPSBAR = ADDR(.ipsbar);       __S_romp        = 0;        ___SP_SIZE      = 0x1000;   ___HEAP_START = .;   ___HEAP_END = ___SRAM + ___SRAM_SIZE - ___SP_SIZE;   ___SP_END = ___HEAP_END;   ___SP_INIT = ___SP_END + ___SP_SIZE;   ___PC_INIT      = ___FLASH + 0x8;     ___heap_addr = ___HEAP_START;   ___heap_size = ___HEAP_END - ___HEAP_START ;   __SP_INIT = ___SP_INIT; }

 

Thanks for your time,

ssinfod

Labels (1)
0 Kudos
2 Replies

415 Views
ssinfod
Contributor IV

Any help ?

0 Kudos

415 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi ssinfod,

I think that the following post created by our colleague Erich Styger might be helpful for you, it explains how to preserve a range of memory using the P&E advanced programming options:

Programming part of flash | MCU on Eclipse

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos