AT32UC3C0256C flashing problem

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, I have already searched the forum for similar posts, but i haven't been able to find a complete answer to my problem.

 

I have been working so far with device AT32UC3C0256C in debug mode on a custom board, using IAR EW IDE for building my application and JTAGICE debugger (JTAG connection).
I have now a 1st release of the application and I would need to flash the chip. 

1) can I use Atmel AVR Studio 6.2 to flash a release version? (this is the sw i was using before with ATMega128).

I tried it with AT32UC3C0256C and I am able to read and program fuses with the JTAGICE programmer (via JTAG ), I can also erase the chip, but I don't seem to be able to program the hex file to flash... 

I get the following error:
[ERROR] Unable to parse objectfile C:\Users\...\SPV_MU_AT32\master\Release\Exe\SPV_MU_AT32.hex: Unsupported format., ModuleName: TCF command: Modules:add failed.
linker script attached

2) is the chip bootloader mandatory or can I just flash the application? (like I used to do with Atmega128). I'm reading the application (doc32131-AVR32760-USB DFU Bootloader Protocol on 32-bit AVR UC3) but I don't find it very clear...for now...

 

thank you for your attention
lisa

 

/************************************************************************
 * XLINK command file for the IAR C/C++ Compiler for AVR32.
 *
 * This file is configured for the UC3C0256C device.
 * It can be used directly, or as a template.
 *
 * Although the file can be used in any IAR Embedded Workbench project
 * for AVR32, this file is specifically suited for projects using the
 * IAR C/C++ Compiler for AVR32, as the file includes directives for
 * placing segments created by the compiler.
 *
 * This file can be used as a template for your own application-specific
 * XLINK command file.
 *
 * The assumed memory layout is:
 *
 *   Start	Stop		Name	Type
 *   ----------	----------	-------	--------------
 *   0x00000000	0x0000FFFF	CPU_RAM	RAM
 *   0x80000000	0x8003FFFF	FLASH	FLASH
 *   0xA0000000	0xA0000FFF	HRAMC0	RAM
 *
 * Usage:  xlink  your_file(s)  -f xcl-file  libraries
 *
 * Copyright 2013 IAR Systems AB.
 *
 * $Revision:$
 *
 ************************************************************************/

/************************************************************************/
/*      The following segments are defined in this template link file:  */
/*                                                                      */
/*      Code segments                                                   */
/*      CODE21    -- Program code used by __code21 functions.           */
/*      CODE32    -- Program code used by __code32 functions.           */
/*      RESET     -- Reset code.                                        */
/*      EVSEG     -- Exception vector handlers.                         */
/*                                                                      */
/*      Constant segments                                               */
/*      INITTAB   -- Segment initializer table segment.                 */
/*      DIFUNCT   -- Dynamic initialization vector used by C++.         */
/*      SWITCH    -- Switch tables.                                     */
/*      ACTAB     -- Table of pointers to acall functions.              */
/*      SCTAB     -- Table of pointers to scall functions.              */
/*                                                                      */
/*      DATA21_ID -- Initialization data for DATA21_I.                  */
/*      DATA32_ID -- Initialization data for DATA32_I.                  */
/*      DATA21_C  -- Constant __data21 data.                            */
/*      DATA32_C  -- Constant __data32 data.                            */
/*                                                                      */
/*      CHECKSUM  -- Checksum segment.                                  */
/*                                                                      */
/*      Data segments                                                   */
/*      DATA21_I  -- Initialized __data21 data with non-zero            */
/*                   initial value.                                     */
/*      DATA32_I  -- Initialized __data32 data with non-zero            */
/*                   initial value.                                     */
/*      DATA21_Z  -- Initialized __data21 data with zero initial value. */
/*      DATA32_Z  -- Initialized __data32 data with zero initial value. */
/*      DATA21_N  -- Non-initialized __data21.                          */
/*      DATA32_N  -- Non-initialized __data32.                          */
/*      SSTACK    -- The system stack.                                  */
/*      CSTACK    -- The application stack.                             */
/*      HEAP      -- The heap used by malloc and free.                  */
/*                                                                      */
/************************************************************************/

/************************************************************************/
/*      Define CPU                                                      */
/************************************************************************/

-cavr32

// Declare the IPR0 memory location
-DIPR0=FFFF0000

/************************************************************************/
/*      Reset code is located at address 0x80000000 and up.             */
/************************************************************************/

-Z(CODE)RESET=80000000-800003FF

/************************************************************************/
/*      Size of the stacks and the heap.                                */
/*                                                                      */
/*      The size is specified in hexadecimal numbers.                   */
/*                                                                      */
/*      We assume that the supervisor stack is rather small (1K),       */
/*      that the application stack is larger (8K) and that the heap     */
/*      is rather small (2K). You will need to adjust these values      */
/*      to fit the needs of your application.                           */
/*                                                                      */
/*      Uncomment if used from the command line.                        */
/************************************************************************/

//-D_SSTACK_SIZE=400
//-D_CSTACK_SIZE=2000
//-D_HEAP_SIZE=800

/************************************************************************/
/*      The exception handler code is located at address 0x80000000     */
/*      and up. Make sure that the exception table gets properly        */
/*      allocated. By using the special -Z@ allocation primitive, the   */
/*      placement is guaranteed to be at _EVBASE and onwards.           */
/************************************************************************/

-Z@(CODE)EVTAB=80004000-80007FFF
//-Z@(CODE)EV100=80004100-80007FFF
-Z@(CODE)EV100=80004200-80007FFF
-P(CODE)EVSEG=80004000-80007FFF

/************************************************************************/
/*      Allocate code and const segments.                               */
/************************************************************************/

-P(CODE)CODE32=80000000-8003FFFF
-P(CONST)DATA32_C=80000000-8003FFFF

// initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8003FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8003FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8003FFFF
-Z(CONST)RAMCODE21_ID,RAMCODE32_ID=80000000-8003FFFF

-Z(CONST)ACTAB,HTAB=80000000-8003FFFF

/************************************************************************/
/*      Allocate the read/write segments that are mapped to RAM.        */
/*                                                                      */
/*      To reflect the absence of DATA21 RAM, these segments are        */
/*      not declared. You will get a linker error if you by mistake     */
/*      have declared a __data21 variable.                              */
/*                                                                      */
/************************************************************************/

-Z(CODE)RAMCODE21=00000001-0000FFFF
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000001-0000FFFF
-Z(CODE)RAMCODE32=00000001-0000FFFF,A0000000-A0000FFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000001-0000FFFF,A0000000-A0000FFF
-Z(DATA)TRACEBUFFER=00000001-0000FFFF,A0000000-A0000FFF

-Z(DATA)SSTACK+_SSTACK_SIZE#00000001-0000FFFF,A0000000-A0000FFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000001-0000FFFF,A0000000-A0000FFF
-Z(DATA)HEAP+_HEAP_SIZE=00000001-0000FFFF,A0000000-A0000FFF

/* FW_ID */
-Z(CODE)FW_ID=0000DE00-0000DE02                                                 //DE00-DE02

/* External data memory */
-Z(DATA)MYXDATA=C0000000-C001FFFF                                               //user segment in XRAM (16M adressable, memory=128k*16bit) 

/************************************************************************/
/*      Copy the RAMCODE bytes to the initializer segments              */
/************************************************************************/

-QRAMCODE21=RAMCODE21_ID
-QRAMCODE32=RAMCODE32_ID

/************************************************************************/
/*      End of File                                                     */
/************************************************************************/

 

Last Edited: Tue. Feb 28, 2017 - 08:46 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just a guess, but I note that your hex file contains a suspicious entry right at the top: 2 bytes of data at address 0x0000DE00. Your linker script suggests it is for something called "FW_ID".

 

In the UC3 architecture, addresses 0x00000000 through 0x7FFFFFFF are typically reserved for built-in volatile RAM <edit>and local-bus mappings of I/O registers</edit>. As such, it would be meaningless to attempt to use a production programmer to store anything in those addresses - whatever you put there would necessarily disappear every time you power-cycle the device.

 

Do you know what this "FW_ID" item is supposed to do? Are you sure you want to be storing it in volatile RAM?

Last Edited: Thu. Jan 26, 2017 - 02:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 lfmorrison thanks a lot for your reply.

good that you pointed that out, i don't know how i missed that.

I had forgotten about adding the FW_ID item to the xcl file...that was taken from another project without changing the address properly... it should be a location defined to place some constant values in flash (not in volatile RAM!), using the #pragma location directive...or at least that's the way it was done in the other project...i cannot yet figure out how and where to place it in UC3 memory..

 

I removed that for now in order to test the rest, now the programmer gives no error, but the board doesn't work (like it correctly does in debug mode) so i figure there must be something else to fix. If you have other ideas to share they will be more than welcome, while i review it again myself.

 

Thanks a lot for your kind support,

lisa