Memory crash when include stdlid.h

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

I have encounter a problem when I include as I need to use atoi() and div() functions. It is ok when I build, but crash when I try to run in simulator or emulator mode (with ICE200). Appreciate any help you can give.

Error reported:
AvrStudio.exe - Application Error
The insturction at "0x004053f0" referenced memory at "0x0108f4ae". The memory could not be "read".

The insturction at "0x6c371381" referenced memory at "0x00000004". The memory could not be "read".

Whenever I remove the statement #include , there is no crash when debugging. The sample code looks like this:

// sample code.
// Avrgcc 3.53, AT90S8515, test using both ICE200 emulator and simulator mode.

#include
#include
#include "io8515.h"

int main(void)
{
// test code:
unsigned char c,d='t';

c=atoi(d);

// other codes reside here on wards.
//...............
//..............

}

//--------This is the makefile from avrgcc sample-------------------------------.

# Simple Makefile
# Volker Oth (c) 1999

########### change this lines according to your project ##################

#put the name of the target mcu here (at90s8515, at90s8535, attiny22, atmega603 etc.)
MCU = at90s8515

#put the name of the target file here (without extension)
TRG = myhome

#put your C sourcefiles here
SRC = $(TRG).c

#put additional assembler source file here
ASRC =

#additional libraries and object files to link
LIB =

#additional includes to compile
INC =

#compiler flags
CPFLAGS = -g -O2 -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst)

#linker flags
LDFLAGS = -Wl,-Map=$(TRG).map,--cref

########### you should not need to change the following line #############
include $(AVR)/avrfreaks/avr_make

###### dependecies, add any dependencies you need here ###################

$(TRG).o : $(TRG).c

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

Judging from the makefile, it looks like you're using GCC. You'll have better luck in getting more answers if you post in the AVR GCC Forum.

Eric

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

Thanks Eric.