Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Where the binary program code is stored? SAM7X
PostPosted: Mon Aug 10, 2009 2:08 pm 
Offline

Joined: Fri Jul 10, 2009 8:16 pm
Posts: 15
I'm using SAM7X256. This device has, as it's name implies, 256KB of FLASH memory.

I need the most of the 256KB to store some data.

But I don't know if the binary program code is stored in that space, which may reduce significantly the total free space, or elsewhere.

If the binary program code is stored elsewhere, then where is it?
How can I know if my program isn't too large to fit in the available space?

Thank you.

Regards,
Dor.


Top
 Profile  
 
 Post subject: Re: Where the binary program code is stored? SAM7X
PostPosted: Mon Aug 10, 2009 11:49 pm 
Offline

Joined: Thu Mar 02, 2006 1:32 pm
Posts: 127
Location: Switzerland
Hi Dor

The SAM7X256 can only run from code in internal FLASH (or limited in internal SRAM). This means that your data needs to share space with the code.
You can usually see the code size when you have compiled the project in the IDE that you are using, or by using the GCC "size" to show the size from your ELF file.

If you need larger data storage space it is common to use an SPI FLASH chip via one of the SPIs - these are fast, cheap and give much larger data storage possibilities than using internal FLASH (alone).

Regards

Mark

http://www.uTasker.com


Top
 Profile  
 
 Post subject: Re: Where the binary program code is stored? SAM7X
PostPosted: Sat Aug 15, 2009 12:36 pm 
Offline

Joined: Tue Feb 08, 2005 1:56 pm
Posts: 48
Hi,

The SAM7X exists also in 512 kbytes (SAM7X512).

Regards,
bdenis


Top
 Profile  
 
 Post subject: Re: Where the binary program code is stored? SAM7X
PostPosted: Tue Aug 18, 2009 1:54 pm 
Offline

Joined: Fri Jul 10, 2009 8:16 pm
Posts: 15
Thank you both!

I think that when I transfer data from the PC to the uC via JTAG, the program code is stored in the SRAM, because that when I unplug the power cable and then plug it, the uC doesn't run from the beginning (address 0x0 I assume).

What should I do in order to make the uC to execute the initial code from the beginning?
Even the reset button doesn't help here.

I'm using the Evaluation Kit.

Thanks and sorry for my newbie questions.

Best regards,
Dor.


Top
 Profile  
 
 Post subject: Re: Where the binary program code is stored? SAM7X
PostPosted: Tue Aug 18, 2009 5:00 pm 
Offline

Joined: Thu Mar 02, 2006 1:32 pm
Posts: 127
Location: Switzerland
Hi Dor

Projects often have multiple targets (for SRAM and for FLASH). The SRAM is often called "debug" and the FLASH one "release", although debugging in FLASH is also possible.
How you work with the two depends on the debugger environment that you use.
Often the ATMEL SAMBA program is used to program to FLASH, whereby a non-volatile FLASH bit also needs to be set so that it boots from the application rather than the internal boot loader. Therefore you may also find that your code is running from FLASH when the debugger is starting it, but after a manual reset the internal boot loader starts instead because the NV bit has not be set.

See chapter 5 of the following for some more details: http://www.utasker.com/docs/SAM7X/uTaskerV1-4_SAM7X.PDF

Since the SRAM space is much more limited compared to the FLASH it is a good idea to be become proficient with debugging in FLASH as this is often the only way to debug complete project code.

Regards

Mark

http://www.uTasker.com


Top
 Profile  
 
 Post subject: Re: Where the binary program code is stored? SAM7X
PostPosted: Tue Aug 18, 2009 9:07 pm 
Offline

Joined: Fri Jul 10, 2009 8:16 pm
Posts: 15
Hi mjbcswitzerland,

Thanks for that quick tutorial!
I'll try that in the future when I'll be need to download the program code to FLASH.

I'm using EDGE ( http://www.mentor.com/products/embedded ... dev-suite/ ) as my IDE.
Is it capable of downloading the program code to FLASH? Instead of SRAM like it did always.

Best regards,
Dor.


Top
 Profile  
 
 Post subject: Re: Where the binary program code is stored? SAM7X
PostPosted: Tue Aug 18, 2009 9:41 pm 
Offline

Joined: Thu Mar 02, 2006 1:32 pm
Posts: 127
Location: Switzerland
Hi Dor

I never used the Mentor IDE (on the SAM7X I work with GCC, IAR4, IAR5, uVision and Rowley Crossworks).
However it will almost certainly allow loading to FLASH (I believe it is a rather high end solution so you must be working for a big company). I would ask Mentor Graphics support directly in order to save time.

Regards

Mark

PS Do you use the EDGE SimTest? Can it simulate a SAM7X in a system? (Compare the uTasker SAM7X simulator as described in the previous linked document).


Top
 Profile  
 
 Post subject: Re: Where the binary program code is stored? SAM7X
PostPosted: Sat Aug 22, 2009 3:54 pm 
Offline

Joined: Fri Jul 10, 2009 8:16 pm
Posts: 15
OK, I'll try that. :)
Quote:
PS Do you use the EDGE SimTest?

I don't have it.

Thank you!

Regards,
Dor.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: