[help] how to let my 5213evb work standalone? and some questions

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

[help] how to let my 5213evb work standalone? and some questions

2,829 Views
Michael_Q
Contributor I
hi dear all ,   I am a student and working on freescale's 5213EVB now , I made some programs on that and succeed on debug , and now i found that i can not program the flash now , I d like to let it work alone , it supposed to start to run automatically if i plug the power, the programs and all functions should be in flash ,and put variables in ram , how to set this? i d like to see it works alone but i do not know how to set it now ... can anybody help me please?
I saw some configurations in lcf file in my project  and I set some parameters , it does not help...
 
or anybody can give me some example to show me how to do this? (I saw 2 examples from the disk , but seems helpless)
 
btw , I d like to set heap size, I think it is same thing to set in the lcf file, and i tried , but it seems no effect... how to set heap size plz?
 
 
thanks for any help!
 
sincerely yours
Michael
Labels (1)
0 Kudos
7 Replies

724 Views
JWW
Contributor V
Michael_Q,

When you say you can't program the flash, can you be a bit more specific?  Did you lock yourself out?  Or is the flash programmer in Codewarrior just refusing to program the flash?  Make sure you erase the flash first.  Codewarrior does not do this automatically.  You must select erase, then select program.

Make sure in the flash programming tool in Codewarrior that you have used the "load settings" button and selected the configuration file for 5213EVB.

Let us know if you need additional help.
Or if you solved the problem, please share with the community.  Others may have similar problems.

Best Regards,
JWW


0 Kudos

724 Views
Michael_Q
Contributor I
o , dear Jww, thanks for your kindly help , I think i missed 2 key points,
firstly , load setting , i was tried by myself but now  i think the default setting was good , i mean load original file is good.
secondly, erase the program before program . this is important.
 
btw another question is sometime i met "bus error" when i debug  , i have to delete some function to fit its requirement,  but i think the functions are ok i need to find out what wrong with it , any suggestion plz?
 
thanks again.
0 Kudos

724 Views
mjbcswitzerland
Specialist V
Hi Michael

Check out the following tutorial, which may help.
http://www.utasker.com/docs/M5223X/uTaskerV1.3-Tutorial-M5223X_003.PDF
from page 12/34.

Also check out the uTasker project at www.uTasker.com (users' forum at http://www.uTasker.com/forum/ )
Although the project is primarily for the M5223X with integrated Ethernet controller it does run in the M5213 (without TCP/IP stack and Ethernet controller) and also suppports FlexCAN. There is a project define which can be set to _HW_M5213 and then all register differences (there are not many) are taken in to account.

The project is completely free for educational work.

Regards

Mark

PS. If you are using CodeWarrior you do not need to set up any heap size. The malloc library implementation assumes heap space from the last variable location to a couple of hundred bytes short of the stack.




Message Edited by mjbcswitzerland on 2007-09-13 02:38 PM
0 Kudos

724 Views
ianlovatt
Contributor III

Mark, 

 

interested by your PS regarding malloc. Are you referring to CW's malloc or have you implemented malloc in uTasker? In the linker file for example projects that came with M52277EVB the heap size is defined.

 

I'm having trouble with CW's malloc failing to give out memory even tho the heap size (within external DDR) is defined as 4meg (see below -wouldn't let me attach).

 

cheers

ian

 

# Sample Linker Command File for CodeWarrior for ColdFire

KEEP_SECTION {.vectortable}

# Memory ranges 

MEMORY {

   vectorrom   (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000400
# for V1.0.3 board   cfmprotrom  (RX)  : ORIGIN = 0x00020400, LENGTH = 0x00000020
# for V1.0.3 board  code        (RX)  : ORIGIN = 0x00020500, LENGTH = 0x00FDFB00
   cfmprotrom  (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000020
   code        (RX)  : ORIGIN = 0x00000500, LENGTH = 0x00FFFB00
   vectorram   (RWX) : ORIGIN = 0x80000000, LENGTH = 0x00000400
   userram     (RWX) : ORIGIN = 0x40000000, LENGTH = 0x04000000
}

SECTIONS {

# Heap and Stack sizes definition
 ___heap_size   = 0x1000;
 ___stack_size     = 0x400000;


# Board Memory map definitions from linker command files:
# __SDRAM,__SDRAM_SIZE, __FLASH, __FLASH_SIZE linker
# symbols must be defined in the linker command file.

# 64 MBytes DDR SDRAM
   ___SDRAM          = 0x40000000;
   ___SDRAM_SIZE     = 0x04000000;

# 16 MByte Internal Flash Memory
   ___FLASH       = 0x00000000;
   ___FLASH_SIZE  = 0x01000000;


# MCF52277 Derivative Memory map definitions from linker command files:
# __IPSBAR, __RAMBAR, __RAMBAR_SIZE, __FLASHBAR, __FLASHBAR_SIZE linker
# symbols must be defined in the linker command file.

# Memory Mapped Registers (IPSBAR= 0x40000000)
 ___IPSBAR         = 0x40000000;

# 128 Kbytes Internal SRAM
   ___RAMBAR         = 0x80000000;
   ___RAMBAR_SIZE    = 0x00020000;

   ___SP_AFTER_RESET = ___RAMBAR + ___RAMBAR_SIZE - 4;
  
  .userram   : {} > userram  
  .code     : {} > code  
  .vectorram : {} > vectorram   
 
 .vectors :
 {
  exceptions.c(.vectortable)
  . = ALIGN (0x4);
 } > vectorrom


 .text :
 {
  *(.text)
  . = ALIGN (0x4);
  *(.rodata)
  . = ALIGN (0x4);  
  ___ROM_AT = .;
  ___DATA_ROM = .;
 } >> code

 .data : AT(___ROM_AT)
 { 
  ___DATA_RAM = .;
  . = ALIGN(0x4);
  *(.exception) 
  . = ALIGN(0x4); 
  __exception_table_start__ = .;
  EXCEPTION
  __exception_table_end__ = .;
  
  ___sinit__ = .;
     STATICINIT
  __START_DATA = .;

  *(.data)
  . = ALIGN (0x4);
  __END_DATA = .;

  __START_SDATA = .;
  *(.sdata)
  . = ALIGN (0x4);
  __END_SDATA = .;

  ___DATA_END = .;
  __SDA_BASE = .;
  . = ALIGN (0x4);
 } >> userram

 .bss :
 {
  ___BSS_START = .;
  __START_SBSS = .;
  *(.sbss)
  . = ALIGN (0x4);
  *(SCOMMON)
  __END_SBSS = .;

  __START_BSS = .;
  *(.bss)
  . = ALIGN (0x4);
  *(COMMON)
  __END_BSS = .;
  ___BSS_END = .;

  . = ALIGN(0x4);
 } >> userram

 .custom :
 {
  ___HEAP_START = .;
  ___heap_addr = ___HEAP_START;
  ___HEAP_END  = ___HEAP_START + ___heap_size;
  ___SP_END  = ___HEAP_END;
  ___SP_INIT  = ___SP_END + ___stack_size;

  . = ALIGN (0x4);
 } >> userram
   
 ___VECTOR_RAM  = ADDR(.vectorram);
 
 __SP_INIT  = ___SP_INIT;

 _romp_at = ___ROM_AT + SIZEOF(.data);
 .romp : AT(_romp_at)
 {
  __S_romp = _romp_at;
  WRITEW(___ROM_AT);
  WRITEW(ADDR(.data));
  WRITEW(SIZEOF(.data));
  WRITEW(0);
  WRITEW(0);
  WRITEW(0);
 }

}

0 Kudos

724 Views
mjbcswitzerland
Specialist V

Hi Ian

 

I referr to the uTasker uMalloc() implementation - the malloc in the CW library needs the size to be defined in the linker script (some GCC libraries allocation heap at run-time to use up remaining RAM space and others use a define).

 

However you seem to be defining the stack size to 4M and the heap size to 4k (in your linker script). Is that your problem?

 

Regards

 

Mark

 

0 Kudos

724 Views
ianlovatt
Contributor III
whoops, thanks for spotting that! nothing like publically humiliating yourself is there? i'll try what i actually meant to do and see if it works.
0 Kudos

724 Views
ianlovatt
Contributor III

ok a heap of 4Meg works. I've think i've realised why previously it didn't work with 4k and other small values i'd tried- its the same problem with pools here:

 

http://forums.freescale.com/freescale/board/message?board.id=CWCFCOMM&thread.id=2006

0 Kudos