AT91SAM7_Target.js
I'm trying to work my way through the evaluation. Having completed the tutorial, the next step was to build and run the FreeRTOS lwIP_Demo_Rowley_ARM7 on an Atmel AT91SAM7X256-EK development board using the Segger J-Link. Initially I kept getting "Cannot stop CPU" messages when trying to download the ARM. I tracked down the post "Debugging LPC1343 via SWD - "Cannot stop CPU" and tried the suggestions mentioned by Jon Elliott. I could read and write SRAM with the J-Link okay and making the suggested changes to function Reset() allowed the script to run further, appearing to try and program the device, but it finally ended with the message "Server terminate operation failed". In an attempt to try and figure this one out, I started carefully going through the AT91SAM7_Target.js file. In function FLASHReset() there is the following:
// Mask All interrupt pAic->AIC_IDCR = 0xFFFFFFFF;
TargetInterface.pokeWord(0xffffffff,0xFFFFF124);
TargetInterface.pokeWord(0xffffffff,0xFFFFF128);
// disable peripheral clock Peripheral Clock Disable Register
TargetInterface.pokeWord(0xffffffff,0xFFFFFC14);
Looking through the TargetInterface object member functions documentation I see that pokeWord parameters should be address first and data second. According to the comments, the second parameter matches the address of the registers. I tried changing these but it didn't make a difference with my current problem. Still, it looks to me to be a minor error in the script.
Dave
-
Hi,
That project is provided by Richard Barry and isn't one of ours. ;-) The AT91SAM7X256-EK is supported by a BSP in CrossWorks, so have you tried installing the BSP and opening the examples and trying them out to ensure that the board, J-Link, and software all work in perfect harmony?
-
Hi Paul,
Sorry about the misunderstanding - the project is indeed one of the Demo projects supplied by FreeRTOS. The reason I thought Richard got the script from you is the comment at the top - "Copyright (c) 2004 Rowley Associates Limited." It's a minor issue either way.
As for the project, I am in the process of trying to migrate away from a 5 year old Eclipse based development environment with the goal of porting previous projects to the CrossWorks environment. The AT91SAM7X256-EK board, J-Link and an Eclipse version of the software run fine on the board and produce the expected output. Under CrossWorks I do have the AT91SAM7X-EK BSP installed and configured for the project. The J-Link connects as a target okay and I can read and write SRAM on the board. However, at this point I cannot even perform an Erase All operation. The Output window shows that the operation now makes it through the FLASHReset() function in the script and the file Loader_rpc.elf is downloaded and verified on the SEGGER J-Link. The last step is "Erasing all memory" but that never appears to start (no advancement in the progress bar) and the operation eventually aborts with the error message "Server terminate operation failed". I have enabled the J-Link Log File but there is nothing in there that indicates any type of communication problem. I can see the TargetInterface peeks and pokes from the FLASHReset() operation followed by a number of other operations, finally ending with a JLINK_Close(). I have also tried reducing the JTAG speed down to 100KHz with no change in behavior. This has been tried with two different AT91SAM7X256-EK boards and two different J-Link units. With the logic analyzer on the JTAG lines, I can see the TAP controller start out with a TAP reset and then proceed to load an instruction so it is trying to do something to the CPU on the Erase All. At this point I suspect I have something in the project configured incorrectly. This is probably a good thing - it is forcing me to go through things thoroughly and I will end up with a better understanding of CrossStudio as a result.
Dave
Please sign in to leave a comment.
Comments
2 comments