All,
éÍÅÅÍ:
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
...
unsigned char eeVar EEMEM = 0x34; //byte unsigned int eeWord EEMEM = 0x5678; //word
const char __attribute__ ((section (".TestSec"))) str1[4] = "9753";
const UCHAR __attribute__ ((section (".platz1"))) val1 = 0x31; const char __attribute__ ((section (".platz2"))) val2 = 0x52;
É Ó ÔÁËÉÍ (ÎÁ ×ÓÑËÉÊ ÓÌÕÞÁÊ ÐÒÉ×ÏÖÕ ÅÇÏ ÐÏÌÎÏÓÔØÀ)
# Makefile for the project wms
## General Flags PROJECT = wms MCU = atmega128 TARGET = wms.elf CC = avr-gcc
CPP = avr-g++
## Options common to compile, link and assembly rules COMMON = -mmcu=$(MCU)
## Compile options common for all C compilation units. CFLAGS = $(COMMON) CFLAGS += -Wall -gdwarf-2 -std=gnu99 -DF_CPU=11059200UL -Os
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
## Assembly specific flags ASMFLAGS = $(COMMON) ASMFLAGS += $(CFLAGS) ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
## Linker flags LDFLAGS = $(COMMON) LDFLAGS += -Wl,-Map=wms.map
## Intel Hex file production flags HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature
HEX_EEPROM_FLAGS = -j .eeprom HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load" HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
## Objects that must be built in order to link OBJECTS = wms.o
## Objects explicitly added by the user LINKONLYOBJECTS =
## Build all: $(TARGET) wms.hex wms.eep wms.lss size
## Compile wms.o: ../wms.c $(CC) $(INCLUDES) $(CFLAGS) -c $<
##Link $(TARGET): $(OBJECTS) $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
%.hex: $(TARGET) avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
%.eep: $(TARGET)
-avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
%.lss: $(TARGET) avr-objdump -h -S $< > $@
size: ${TARGET} @echo @avr-size -C --mcu=${MCU} ${TARGET}
## Clean target .PHONY: clean clean:
-rm -rf $(OBJECTS) wms.elf dep/* wms.hex wms.eep wms.lss wms.map
## Other dependencies
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
===== ÐÏÌÕÞÁÅÍ
=== Begin of wms_hex.txt === :10025000FC01E199FECF06C0FFBBEEBBE09A3196F0 :100260000DB20D9241505040B8F70895F894FFCF69 :0402700039373533B2 :010274003158 :010275005236 :00000001FF === End of wms_hex.txt =====
É
=== Begin of wms_eep.txt === :03000000347856FB :00000001FF === End of wms_eep.txt =====
÷ AVR Studio 4.17 Memory Settings ÄÏÂÁ×ÌÑÅÍ: Eeprom .platz2 0x123 Flash .testSec 0x3456 Eeprom .platz1 0x357
ÐÏÌÕÞÁÅÍ
## Linker flags LDFLAGS = $(COMMON) LDFLAGS += -Wl,-Map=wms.map LDFLAGS += -Wl,-section-start=.platz2=0x810123 LDFLAGS += -Wl,-section-start=.TestSec=0x68ac LDFLAGS += -Wl,-section-start=.platz1=0x810357
## Intel Hex file production flags HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature
HEX_EEPROM_FLAGS = -j .eeprom HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load" HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings HEX_EEPROM_FLAGS += --change-section-lma .platz2=0x123 HEX_EEPROM_FLAGS += --change-section-lma .platz1=0x357
É
=== Begin of wmshex1.txt === :10025000FC01E199FECF06C0FFBBEEBBE09A3196F0 :100260000DB20D9241505040B8F70895F894FFCF69 :0468AC003937353310 :02000004008179 :010123005289 :010357003174 :00000001FF === End of wmshex1.txt =====
eep - ÏÓÔÁÌÓÑ ÂÅÚ ÉÚÍÅÎÅÎÉÑ.
HÕ É ÓÏÂÓÔ×ÅÎÎÏ ×ÏÐÒÏÓ, ÐÏÞÅÍÕ ÄÁÎÎÙÅ ÐÒÅÄÎÁÚÎÁÞÅÎÎÙÅ ÄÌÑ *.eep ÐÏÐÁÄÁÀÔ × *.hex ?
Andrey