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  [ 9 posts ] 
Author Message
 Post subject: IAP in AT91SAM9XE
PostPosted: Thu Jun 23, 2011 3:46 am 
Offline

Joined: Thu Jun 23, 2011 2:14 am
Posts: 2
Hi, first time poster here.

Our company has been using 8bit AVR's for a long time, but now we need to upgrade to ARM ( for a variety of reasons )

We shortlisted the SAM9XE for our application but are a little confused about the function of In-Application Programming in the chip.

We see that the ROM has a built in feature for serial & usb writing of the flash.

Can we also write our own boot loader that can write the flash? We need to implement remote firmware upgrading of our devices using a wireless modem.

I'm sure we could use IAP, so long as we can put our boot loader at the correct vector.

If any one has experience doing this I would love to hear about it.

Thanks


Top
 Profile  
 
 Post subject: Re: IAP in AT91SAM9XE
PostPosted: Thu Jun 23, 2011 1:00 pm 
Offline

Joined: Thu Dec 02, 2004 2:28 pm
Posts: 454
hello dave,
to implement a bootloader at the sam9xe isn't a problem.
you can use the internal flash and write your own bootloader, which can communicate over any interface you like.
the only thing you have to do is to load your bootloader into the internal flash and set GPNVM bit 3 (internal flash is mapped to address 0x00000000).
take a look at the datasheet, chapter "Boot Strategies".

for flash writing you can use the IAP, but from my experience it's easier to write your own flash functions (or use that from the software package).

regards
gerhard


Top
 Profile  
 
 Post subject: Re: IAP in AT91SAM9XE
PostPosted: Fri Jun 24, 2011 4:17 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Plus you'd probably want to copy your flashing code to RAM (mapping it to zero also) and partition the FLASH into a BOOT area and and APPLICATION area.

Getting a wireless modem to pull a firmware via HTTP isn't that hard. Personally I'd pull it into SDRAM, using the application code, and have the loader burn it.


Top
 Profile  
 
 Post subject: Re: IAP in AT91SAM9XE
PostPosted: Fri Jun 24, 2011 9:53 am 
Offline

Joined: Fri Jun 24, 2011 9:36 am
Posts: 3
I have a similar scenario as Dave, where I need to update the application firmware remotely via a Modem.
The question is: Can you reprogram the MCU flash by running a program that also resides in the MCU itself, say in a different sector of the MCU flash, or that loader has to be in a separate memory module (RAM / SDRAM)?

Thanks.
Teddy.


Top
 Profile  
 
 Post subject: Re: IAP in AT91SAM9XE
PostPosted: Fri Jun 24, 2011 10:57 am 
Offline

Joined: Thu Dec 02, 2004 2:28 pm
Posts: 454
hello teddy,
programming the flash while running out of the same flash plane (read-while-write) isn't possible, but your bootloader has 2 possibilities:
1) execute the flash handling function from sram/sdram. copying these functions to ram will be done by the startup-code (if your are using "C"). take a look at the software packages where you can find some examples.
2) use IAP

regards
gerhard


Top
 Profile  
 
 Post subject: Re: IAP in AT91SAM9XE
PostPosted: Fri Jun 24, 2011 11:07 am 
Offline

Joined: Fri Jun 24, 2011 9:36 am
Posts: 3
Thanks for the prompt response.
I know you can not execute the function to write into flash memory from the same memory, I intend to use the IAP for that purpose.
My question is, do I have the possibility to run my "updater" which might be around 20KB from the MCU flash, to erase and then update the main application program which could be as big as 180KB?
Thanks.


Top
 Profile  
 
 Post subject: Re: IAP in AT91SAM9XE
PostPosted: Fri Jun 24, 2011 11:13 am 
Offline

Joined: Thu Dec 02, 2004 2:28 pm
Posts: 454
[quote="teddyj50"]My question is, do I have the possibility to run my "updater" which might be around 20KB from the MCU flash, to erase and then update the main application program which could be as big as 180KB?
Thanks.[/quote]
as long as you don't need more flash memory as the device you are using can offer this scould be no problem. you can define where your application code starts. the only thing you have to obtain is, that a valid vector table has to be at address 0x000000000.

regards
gerhard


Top
 Profile  
 
 Post subject: Re: IAP in AT91SAM9XE
PostPosted: Fri Jun 24, 2011 1:48 pm 
Offline

Joined: Fri Jun 24, 2011 9:36 am
Posts: 3
OK, thank you so much for your help.
Bis zum naechsten mal.
Cheers,
Teddy.


Top
 Profile  
 
 Post subject: Re: IAP in AT91SAM9XE
PostPosted: Sat Jun 25, 2011 5:07 am 
Offline

Joined: Thu Jun 23, 2011 2:14 am
Posts: 2
Thanks every one for your help. I'll do some more reading of the data sheet.


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 16 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: