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  [ 7 posts ] 
Author Message
 Post subject: SAM-BA isn't modifying values, what am I doing wrong here
PostPosted: Mon May 02, 2011 10:36 pm 
Offline

Joined: Thu Feb 17, 2011 9:23 am
Posts: 13
I have recently installed AT91-ISP v1.12, and am trying to modify memory on my AT91SAM7S256 using SAM-BA. The problem I am having is after connecting, SAM-BA doesn't modify memory values in the internal flash or ram. When I send a file, changes are not made, and similarly when I try to manually change a single memory value, the changes are not made.

I have followed the instructions for loading SAM-BA into memory, by first setting the ERASE pin high for a period of time, and then setting the TST pin high for a period of time. After that I connect to SAM-BA using a SAM-ICE JTAG under WinXP, using no_board. SAM-BA seems to connect fine, and does not give me any errors.

I have also tried running the Flash_Example.bat file provided in the AT91SAM7S256-EK materials (changing the board to no_board, of course) and this gives me the following error:
-E- Script File Flash_example.tcl returned error : can't set "FLASH::ForceUnlockBeforeWrite": parent namespace doesn't exist - can't set "FLASH::ForceUnlockBeforeWrite": parent namespace doesn't exist

Any input one what I am doing wrong would be greatly appreciated!


Top
 Profile  
 
 Post subject: Re: SAM-BA isn't modifying values, what am I doing wrong here
PostPosted: Tue May 03, 2011 2:06 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
Try some older versions of SAM-BA, perhaps one contemporaneous with the release of your EK, as well as the most current version. Consider other modes of SAM-BA attachment, Serial, and USB.

Issues with name space might occur if it can't find board files or associated TCL files. The older versions of SAM-BA were easier to create new board files for as you could duplicate directories, edit TCL files, and then add the new board to the top level TCL file.

Also consider downloading an eval version of Keil, this can compile and download into flash, and debug via a SAM-ICE. There are example projects for a number of ATMEL SAM7 boards. Certainly something worth experimenting with, and becoming familiar with several different tools so you don't get frustrated/stuck with one which isn't working. Sometime things are just flaky, and it helps to cross-check with something else.

You could also get a JFlashARM licence and use that.

The other thing with J-Link/SAM-ICE pods is to get the most current drivers and firmware from Segger, as this often resolves quirky behaviour and they are constantly updating them.


Top
 Profile  
 
 Post subject: Re: SAM-BA isn't modifying values, what am I doing wrong here
PostPosted: Tue May 03, 2011 3:12 am 
Offline

Joined: Thu Feb 17, 2011 9:23 am
Posts: 13
[quote="CptTitanic"]Try some older versions of SAM-BA, perhaps one contemporaneous with the release of your EK, as well as the most current version. Consider other modes of SAM-BA attachment, Serial, and USB.[/quote]

I actually started with a slightly older version. I noticed one slightly unusual behavior when i upgraded to the newer version: The older version had various values spread across each memory space (flash/ram) that were consistent (did not change when i reconnected). When I upgraded to the newer version of SAM-BA each of these memory spaces was entirey full of 0's.

[quote="CptTitanic"]Issues with name space might occur if it can't find board files or associated TCL files. The older versions of SAM-BA were easier to create new board files for as you could duplicate directories, edit TCL files, and then add the new board to the top level TCL file.[/quote]

I should have specifically mentioned, I am not using a development board. This is the reason i selected 'no_board' in the SAM-BA settings. I believe everything is wired correctly, as I have been successfully debugging with the JLink GDB Server in RAM, I am just unable to program this thing...

[quote="CptTitanic"]Also consider downloading an eval version of Keil, this can compile and download into flash, and debug via a SAM-ICE. There are example projects for a number of ATMEL SAM7 boards. Certainly something worth experimenting with, and becoming familiar with several different tools so you don't get frustrated/stuck with one which isn't working. Sometime things are just flaky, and it helps to cross-check with something else.[/quote]

I do have Keil installed at the moment, although I have not tried using it yet. I started with the Yagarto/JLink/Eclipse/SAM-BA approach (I am just now starting to develop with ARM7). If I absolutely cannot solve this problem of not being able to modify flash/ram values with SAM-BA I will consider using Keil (unless its extremely easy to take my compiled project and simply use Keil as a programmer...of which I have no idea)

Thanks a lot for your response, hopefully somebody will come along who might see an inherent mistake I am making! HELP!

...why are these quotes not working...


Top
 Profile  
 
 Post subject: Re: SAM-BA isn't modifying values, what am I doing wrong here
PostPosted: Tue May 03, 2011 7:34 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
I'd probably select an EK board that is close to your configuration, and then modify the details in the TCL for that EK board to more closely match your own. This is a course that works with the SAM9 family, most of the wiring is the same, perhaps 8/16 bit NAND or 16/32 bit SDRAM, different capacities, or some parts dropped from the EK BOM.


Top
 Profile  
 
 Post subject: Re: SAM-BA isn't modifying values, what am I doing wrong here
PostPosted: Wed May 04, 2011 5:20 pm 
Offline

Joined: Thu Feb 17, 2011 9:23 am
Posts: 13
Maybe I'm confused about how SAM-BA is supposed to work, so correct me if im wrong here... I don't see why I would need a board setup or script at all. I have virtually no external memories, or peripherals connected. I just have the chip itself wired up, and want to program the internal memory. Isn't SAM-BA designed for this purpose? I would imagine that it should be relatively simple to connect to the device using SAM-BA and upload/download a file into internal Flash or RAM. There's gotta be something simple that I have overlooked here and am doing incorrectly...


Top
 Profile  
 
 Post subject: Re: SAM-BA isn't modifying values, what am I doing wrong here
PostPosted: Wed May 04, 2011 7:18 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
The SAM-BA protocol provides a mechanism to read/write memory (byte, half-word, word addressable) and registers on a part, and execute code. The PC side application downloads compiled applets to the processor's SRAM to program the flash on the part, and perform basic functions. The CPU side loader is pretty dumb. Similarly the JTAG interface is just poking memory and registers, flashing requires the applet to be downloaded and run.

In the case of the AT91SAM7S512 this applet is over 2KB
\AT91-ISP v1.11\SAM-BA v2.7\lib\AT91SAM7S512-EK
isp-flash-at91sam7s512.bin 2,264 4-01-08 12:09:12

Does the serial mode SAM-BA connection work? On my 7S512-EK you have to turn the board off, short the TST jumper, turn on for several seconds for the SAM-BA loader to be copied to an erased flash, then powered off, TST jumper removed, and then powered back on, and run the PC side SAM-BA application.


Top
 Profile  
 
 Post subject: Re: SAM-BA isn't modifying values, what am I doing wrong here
PostPosted: Fri May 06, 2011 6:38 pm 
Offline

Joined: Thu Feb 17, 2011 9:23 am
Posts: 13
Ok, I see what you meant about loading a board description closest to the chip I am using. I loaded the at91sam7s256-ek board, and was able to run some of the scripts without errors. I ran the 'enable flash access' script, and was then able to modify memory values for the corresponding RAM of the chip, but am still unable to modify the flash memory (starting at 0x100000). The script file seems to have ran without any error, but when I send a file to the internal flash location, the changes are not made.

Unless I've made a mistake (which I likely have), the start of the internal flash is where I want to load my compiled bin from my project, in order to permanently load it onto the board, right?

Thanks again for the help up to this point. Although I've written quite a bit of code for this chip, as I am entirely new to the ARM environment I'm having just a bit of trouble getting started!


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


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: