Studio5 Simulator "Writing to signature field not suppo

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

Trying an atmega1284p .elf file on the Studio 5 simulator, but the simulator never starts up. The .elf file simulates fine on Studio 4 (but the buggy wdt simulation resets it after 500 msec). Vista 32 bit.
1) CPU speed seems to always be zero, how to change it?
2)

18:32:21.230: [ERROR] TCF command: Processes:launch failed:  Code:131103 ,Service: ,Message from peer:SimulatorMemoryContext: writing to signature field is not supported
# Signature overridden: 1e 97 05SimulatorMemoryContext: writing to signature field is not supported
# ProcessesService::launch() failed. End session controlled: Catched exception -> endSession -> throw
# SimulatorMemoryContext: writing to signature field is not supported
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We need more information to be able to reproduce this. We are not aware of any specific problems with the simulator in Vista 32-bit.

* Does it work to create a new ATmega1284P C project from scratch in AS5, compile it, and start debugging it with simulator?
* If it does, we will probably need a copy of your ELF file, or at least information about which GCC version it was created with.

- roland

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah, it is objecting to the .signature section in the elf file, using either my avr-gcc version 4.3.3 (WinAVR 20100110) or your 4.5.1 (using external makefile)

 5 .signature    00000003  00840000  00840000  0000d509  2**0
                 CONTENTS, ALLOC, LOAD, DATA

Probably that should not have the LOAD attribute. It is generated by

typedef struct {unsigned char B2;unsigned char B1;unsigned char B0;} __signature_t;
#define SIGNATURE __signature_t __signature __attribute__((section (".signature")))
#if 0
SIGNATURE = {
/* Older AVR-GCCs may not define the SIGNATURE_n bytes so use explicit 1284p values */
  .B2 = 0x05,//SIGNATURE_2,
  .B1 = 0x97,//SIGNATURE_1,
  .B0 = 0x1E,//SIGNATURE_0,
};
#endif
FUSES ={.low = 0xe2, .high = 0x99, .extended = 0xff,};

Under simulation the wdt still seems not to reset the mcu?

I don't suppose there is any way to see the UART outputs, as with studio 4 and hapsim?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Update:
Defining the signature bytes const as done in avr-gcc signature.h, or defining the signature using signature.h with

#if 0
SIGNATURE = {
/* Older AVR-GCCs may not define the SIGNATURE_n bytes so use explicit 1284p values */
  .B2 = 0x05,//SIGNATURE_2,
  .B1 = 0x97,//SIGNATURE_1,
  .B0 = 0x1E,//SIGNATURE_0,
};
#elif 0
const unsigned char __signature[3] __attribute__((section (".signature"))) = {0x05,0x97,0x1E};
#else
#define SIGNATURE_2 0x05
#define SIGNATURE_1 0x97
#define SIGNATURE_0 0x1E
#include  //allocates the signature bytes
#endif

makes the .signature section READONLY, but does not clear the error since it still has the LOAD attribute. Can't figure out how to turn this off. All the loader scripts define that section rw but avr-gcc doesn't seem to be using any of those scripts (the build still works when they are all temporarily moved away). Where does a section get the LOAD attribute?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dak664 wrote:
Ah, it is objecting to the .signature section in the elf file, using either my avr-gcc version 4.3.3 (WinAVR 20100110) or your 4.5.1 (using external makefile)
 5 .signature    00000003  00840000  00840000  0000d509  2**0
                 CONTENTS, ALLOC, LOAD, DATA

Probably that should not have the LOAD attribute. It is generated by

typedef struct {unsigned char B2;unsigned char B1;unsigned char B0;} __signature_t;
#define SIGNATURE __signature_t __signature __attribute__((section (".signature")))
#if 0
SIGNATURE = {
/* Older AVR-GCCs may not define the SIGNATURE_n bytes so use explicit 1284p values */
  .B2 = 0x05,//SIGNATURE_2,
  .B1 = 0x97,//SIGNATURE_1,
  .B0 = 0x1E,//SIGNATURE_0,
};
#endif
FUSES ={.low = 0xe2, .high = 0x99, .extended = 0xff,};


OK, I will post a bug on this. The AS5 simulator rejects attempts to write to the signature memory, while AS4 most likely ignores it totally.
Quote:

Under simulation the wdt still seems not to reset the mcu?

I tried the watchdog (by means of enabling it via the I/O view) and it seems to work OK.
Quote:

I don't suppose there is any way to see the UART outputs, as with studio 4 and hapsim?

AS5 has an I/O view similar to AS4, it has to be opened manually, with Debug->Windows->I/O Wiew

- roland

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, wdt seems working, apparently with the same behaviour as Studio 4 simulator - it assumes a clock rate of 1 MHz so WDTO_2S reboots after an emulated 250 msec when you set the clock to 8MHz.

Hapsim can show (among other things) the actual UART I/O in a virtual terminal window, by using hooks(?) to the simulator. The Studio 4 simulator runs much slower when it is enabled, and especially slow emulating the atmega128rfa1, but the diagnostic printfs can be worth the wait:

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

same here:

TCF command: Processes:launch failed:  Code:131103 ,Service: ,Message from peer:SimulatorMemoryContext: writing to signature field is not supported

My Signature Code:

/******************************************************************************/
/** \file h_fuse.c
 * \brief Hardware Abstraction File: Include fuse- and lock-bit information
 *        into the program
 ******************************************************************************/
#include 
#include 
#include 
#include 

#include "autoconf.h"

#if (defined CONFIG_INCLUDE_FUSE_SETTINGS)

// lock mode 3, no verify & write possible
// bootloader has full access to application section
// application has no access to the bootloader section
LOCKBITS __attribute__((used)) = (LB_MODE_3 & BLB0_MODE_1 & BLB1_MODE_3);

// Brown out Detection: 2.7V
// Internal RC Oscillator - 0 ms startup time
FUSES __attribute__((used)) = {
    .low = (FUSE_CKSEL0 & FUSE_CKSEL2 & FUSE_CKSEL3 & FUSE_SUT0 & FUSE_SUT1),
    .high = (FUSE_BOOTRST & FUSE_JTAGEN & FUSE_BOOTSZ0),
    .extended = (FUSE_BODLEVEL1),
};

// Bind elf to ATMEGA645
#define SIGNATURE_0 0x1E
#define SIGNATURE_1 0x96
#define SIGNATURE_2 0x05

#endif

would love to use the simulator!