Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Flash download with JLink / ARM / IAR EW 5.30

Posted by Jon Newcomb on March 10, 2009
Hi all, My setup is as follows:
Processor: AT91SAM7S
Compiler: IAR Electronics Workbench V5.30
Debugger: Jlink (using jlinkARM.dll supplied in IAR bin directory)
FreeRTOS: 5.1.2 (rtosdemo.eww project)

Has anyone ran into 'flash download problems' with this setup when running rtosdemo.eww
The project compiles fine, but just before downloading to flash the following message box appears..
" The debugging session could not be started.
Either the debugger initalization failed, or else the file "C:\FreeRTOS\Demo\ARM7_AT91SAM7S64_IAR\Flash Bin\Exe\rtosdemo.out" was corrupt or of an unsupported format. "
...

The process finishes with the following text in the debug log..
Tue Mar 10 16:05:19 2009: Loaded macro file: C:\Program Files\IAR Systems\Embedded Workbench 5.4\arm\config\flashloader\ATMEL\resources\FlashAT91SAM7Sxx.mac
Tue Mar 10 16:05:23 2009: DLL version: V4.2|, compiled Jan 13 2009 20:12:45
Tue Mar 10 16:05:23 2009: Firmware: J-Link compiled Jul 30 2008 11:24:37 ARM Rev.5
Tue Mar 10 16:05:23 2009: JTAG speed is initially set to: 32 kHz
Tue Mar 10 16:05:23 2009: Initial reset was performed
Tue Mar 10 16:05:23 2009: TotalIRLen = 4, IRPrint = 0x01
Tue Mar 10 16:05:23 2009: J-Link found 1 JTAG device(s). ARM core Id: 3F0F0F0F ARM7
Tue Mar 10 16:05:23 2009: Device at TAP0 selected
Tue Mar 10 16:05:23 2009: JLINK command: ProjectFile = C:\Firmware\FreeRTOS\Demo\ARM7_AT91SAM7S64_IAR\settings\rtosdemo_Flash Bin.jlink, return = 0
Tue Mar 10 16:05:23 2009: JLINK command: device = AT91SAM7S64, return = 0
Tue Mar 10 16:05:23 2009: ---------------------------------------- FLASH Download V1.3
Tue Mar 10 16:05:23 2009: ---------------------------------------- 14/November/2005
Tue Mar 10 16:05:23 2009: TotalIRLen = 4, IRPrint = 0x01
Tue Mar 10 16:05:23 2009: ---------------------------------------- PLL Enable
Tue Mar 10 16:05:23 2009: -------------------------------Set CPSR ----------------------------------
Tue Mar 10 16:05:23 2009: CPSR 000000D3
Tue Mar 10 16:05:24 2009: ---------------------------------------- PLL Enable
Tue Mar 10 16:05:24 2009: ------------------------------- The Remap is done ----------------------------------------
Tue Mar 10 16:05:24 2009: ---------------------------------------- Chip ID 0x270D0940
Tue Mar 10 16:05:24 2009: ---------------------------------------- Extention 0x00000000
Tue Mar 10 16:05:24 2009: ---------------------------------------- Flash Version 0x00000112
Tue Mar 10 16:05:24 2009: -------------------------------Set PC ----------------------------------------
Tue Mar 10 16:05:24 2009: RTCK is not connected
Tue Mar 10 16:05:24 2009: Auto JTAG speed: 8000 kHz
Tue Mar 10 16:05:25 2009: 5632 bytes downloaded and verified (9.77 Kbytes/sec)
Tue Mar 10 16:05:25 2009: Loaded debugee: C:\Program Files\IAR Systems\Embedded Workbench 5.4\arm\config\flashloader\ATMEL\AT91SAM7S64-EK\internalflash-sam7s64.out
Tue Mar 10 16:05:25 2009: Target reset
Tue Mar 10 16:05:25 2009: The flash loader program reported an error.

BTW, this is a fresh install of IAR EW 5.30 and unmodified rtosdemo.eww demo.
My guess is you have the same problem with the KS version.
(Aside.. Why it defaults to 5.4 for the install directory, only IAR will know!?!...)

Whats really odd, is that we have one (precious) RDI licence for the JLINK, and it downloads to flash fine (after project options are modified to use the RDI DLL) Here is the output from the debug log:
Tue Mar 10 17:09:41 2009: Loaded macro file: C:\Firmware\FreeRTOS\Demo\ARM7_AT91SAM7S64_IAR\resource\SAM7.mac
Tue Mar 10 17:09:42 2009: Sign on message from :
Segger JLink ARM JTAG
Tue Mar 10 17:09:42 2009: ------------------------------- The Remap is NOT -----------------------------------------
Tue Mar 10 17:09:42 2009: ---------------------------------------- Chip ID 0x270D0940
Tue Mar 10 17:09:42 2009: ---------------------------------------- Extention 0x00000000
Tue Mar 10 17:09:42 2009: ------------------------------- AIC INIT ---------------------------------------------
Tue Mar 10 17:09:42 2009: ------------------------------- Watchdog Disable ----------------------------------------
Tue Mar 10 17:09:42 2009: 13792 bytes downloaded (20.04 Kbytes/sec)
Tue Mar 10 17:09:42 2009: Loaded debugee: C:\Firmware\FreeRTOS\Demo\ARM7_AT91SAM7S64_IAR\Flash_Debug\Exe\rtosdemo.out
Tue Mar 10 17:09:43 2009: Target reset
Tue Mar 10 17:09:43 2009: -------------------------------Set PC ----------------------------------------
(After this the debugger waits at main for you to hit the 'Go' button.. and all works well)

So, anyone solved this for JLink then please post solution here.. Thanks in advance. Jon.

RE: Flash download with JLink / ARM / IAR EW

Posted by Richard on March 10, 2009
Having just re-built my machine I don't currently have the compiler installed to try this out, but from memory things to check are:

1) That the build generates a C-Spy compatible file.
2) The way the device is reset is compatible with your hardware.
3) The J-Link is not running too fast.

Try one of the IAR example projects for the same hardware and if that works compare the debugger and J-Link configuration with that in the RTOSDemo.eww project.

I'm pretty sure I ran the SAM7X version just last week without any problems.

Regards.

RE: Flash download with JLink / ARM / IAR EW 5.30

Posted by Jon Newcomb on March 11, 2009
Good suggestion.
There is a difference between the demo and IAR 'getting started' demo that seems to make a difference. You need to enter where and how to download the .out file.

In Project->Options->Debugger->Download tab
You should also see three check boxes. That last of which is checked - 'Use flash loader(s)'
Then there is a gray text box with an edit button next to it.
It contains the factory default setting of:
,,,,(default),
This is what needs filling in. You need to specify the addresses and a flag.

This is how:
Click Edit
Select the (default) entry in the list box
Click Delete.

Click New...
A 'Flash Loader Configuration' dialog box appears.
Select 'Start' radio button.
In 'start address' text box enter 0x0
In 'end address' text box enter 0x3FFFF
Check the 'Relocate' Checkbox
Select the 'Offset' radio button
In 'offset' text box enter 0x100000
'Override def..' checkbox should remain unchecked
In 'Extra Parameters' text box enter --flash
Click OK

This seemed to download the .out file to the flash without generating an unhelpful error message.

For others you may need to modify the 'end address' to suit the limits of your flash. I currently use the AT91SAM7S256, so have 0x3FFFF.

This seems a solution.. please say if this helped or suggest a better way if you find one... Thanks. Jon.

RE: Flash download with JLink / ARM / IAR EW 5.30

Posted by Jon Newcomb on March 11, 2009
For those with AT91SAM7S256 devices, you also need to modify the processor type under 'general options' from AT91SAM7S64 to AT91SAM7S256 otherwise you get the same cryptic error message.
If you are using the 'Eval kit' with AT91SAM7S64, then you should set the end address to '0xFFFF', not '0x3FFFF' as I have done here. Hope this helps. Jon.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS