Forum: Mikrocontroller und Digitale Elektronik EEP File wird nicht erzeugt


von Manuel H. (manu77)


Lesenswert?

Hallo,
ich benutze das Atmel Studio 6.2 und möchte aus meinem Projekt ein EEP 
File bekommen.
Header:
1
#define EEMEM_FIRMWARE_VERSION __attribute__((section(".1")))
2
#define EEMEM_FUNK_XTEA_KEY __attribute__((section(".2")))
3
4
uint16_t FirmwareVersion;
5
uint32_t FunkXteaKey[4];

Main.c:
1
uint16_t EEPROM_FirmwareVersion EEMEM_FIRMWARE_VERSION = 1;
2
uint32_t EEPROM_FunkXteaKey[4] EEMEM_FUNK_XTEA_KEY = {0xC38A, 0x0F9E, 0x27C6, 0xB7B2};

In den Optionen habe ich unter "Memory Settings" im EEPROM Segment die 
Sections zugefügt:
.1 = 0x00
.2 = 0x02

Des Weiteren ist unter "Output Files" EEP Generieren angeschaltet.
Leider wird kein EEP File erzeugt. Weiß jemand Rat?

von Stefan E. (sternst)


Lesenswert?

Poste mal den Biuld-Output.

von Manuel H. (manu77)


Lesenswert?

LSS:
1
Empfaenger.elf:     file format elf32-avr
2
3
Sections:
4
Idx Name          Size      VMA       LMA       File off  Algn
5
  0 .data         00000022  00800100  00001284  00001358  2**0
6
                  CONTENTS, ALLOC, LOAD, DATA
7
  1 .1            00000002  00810000  00810000  0000137a  2**0
8
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
9
  2 .2            00000010  00810002  00810002  0000137c  2**0
10
                  CONTENTS, ALLOC, LOAD, DATA
11
  3 .3            00000001  00810012  00810012  0000138c  2**0
12
                  CONTENTS, ALLOC, LOAD, DATA
13
  4 .4            00000001  00810014  00810014  0000138d  2**0
14
                  CONTENTS, ALLOC, LOAD, DATA
15
  5 .text         00001284  00000000  00000000  000000d4  2**1
16
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
17
  6 .bss          00000546  00800122  00800122  0000137a  2**0
18
                  ALLOC
19
  7 .comment      00000030  00000000  00000000  0000138e  2**0
20
                  CONTENTS, READONLY
21
  8 .debug_aranges 00000178  00000000  00000000  000013be  2**0
22
                  CONTENTS, READONLY, DEBUGGING
23
  9 .debug_info   000033e3  00000000  00000000  00001536  2**0
24
                  CONTENTS, READONLY, DEBUGGING
25
 10 .debug_abbrev 00000938  00000000  00000000  00004919  2**0
26
                  CONTENTS, READONLY, DEBUGGING
27
 11 .debug_line   00000bb5  00000000  00000000  00005251  2**0
28
                  CONTENTS, READONLY, DEBUGGING
29
 12 .debug_frame  0000041c  00000000  00000000  00005e08  2**2
30
                  CONTENTS, READONLY, DEBUGGING
31
 13 .debug_str    00000931  00000000  00000000  00006224  2**0
32
                  CONTENTS, READONLY, DEBUGGING
33
 14 .debug_loc    00001579  00000000  00000000  00006b55  2**0
34
                  CONTENTS, READONLY, DEBUGGING
35
 15 .debug_ranges 00000198  00000000  00000000  000080ce  2**0
36
                  CONTENTS, READONLY, DEBUGGING

Makefile:
1
################################################################################
2
# Automatically-generated file. Do not edit!
3
################################################################################
4
5
SHELL := cmd.exe
6
RM := rm -rf
7
8
USER_OBJS :=
9
10
LIBS := 
11
PROJ := 
12
13
O_SRCS := 
14
C_SRCS := 
15
S_SRCS := 
16
S_UPPER_SRCS := 
17
OBJ_SRCS := 
18
ASM_SRCS := 
19
PREPROCESSING_SRCS := 
20
OBJS := 
21
OBJS_AS_ARGS := 
22
C_DEPS := 
23
C_DEPS_AS_ARGS := 
24
EXECUTABLES := 
25
OUTPUT_FILE_PATH :=
26
OUTPUT_FILE_PATH_AS_ARGS :=
27
AVR_APP_PATH :=$$$AVR_APP_PATH$$$
28
QUOTE := "
29
ADDITIONAL_DEPENDENCIES:=
30
OUTPUT_FILE_DEP:=
31
LIB_DEP:=
32
33
# Every subdirectory with source files must be described here
34
SUBDIRS := 
35
36
37
# Add inputs and outputs from these tool invocations to the build variables 
38
C_SRCS +=  \
39
../main.c \
40
../rf12.c \
41
../uart.c \
42
../xtea.c
43
44
45
PREPROCESSING_SRCS += 
46
47
48
ASM_SRCS += 
49
50
51
OBJS +=  \
52
main.o \
53
rf12.o \
54
uart.o \
55
xtea.o
56
57
OBJS_AS_ARGS +=  \
58
main.o \
59
rf12.o \
60
uart.o \
61
xtea.o
62
63
C_DEPS +=  \
64
main.d \
65
rf12.d \
66
uart.d \
67
xtea.d
68
69
C_DEPS_AS_ARGS +=  \
70
main.d \
71
rf12.d \
72
uart.d \
73
xtea.d
74
75
OUTPUT_FILE_PATH +=Empfaenger.elf
76
77
OUTPUT_FILE_PATH_AS_ARGS +=Empfaenger.elf
78
79
ADDITIONAL_DEPENDENCIES:=
80
81
OUTPUT_FILE_DEP:= ./makedep.mk
82
83
LIB_DEP+= 
84
85
# AVR32/GNU C Compiler
86
87
88
89
90
91
92
93
94
95
./%.o: .././%.c
96
  @echo Building file: $<
97
  @echo Invoking: AVR/GNU C Compiler : 4.8.1
98
  $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE)  -x c -funsigned-char -funsigned-bitfields -DF_CPU=12288000UL  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"   -o "$@" "$<" 
99
  @echo Finished building: $<
100
  
101
102
103
104
# AVR32/GNU Preprocessing Assembler
105
106
107
108
# AVR32/GNU Assembler
109
110
111
112
113
ifneq ($(MAKECMDGOALS),clean)
114
ifneq ($(strip $(C_DEPS)),)
115
-include $(C_DEPS)
116
endif
117
endif
118
119
# Add inputs and outputs from these tool invocations to the build variables 
120
121
# All Target
122
all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES)
123
124
$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP)
125
  @echo Building target: $@
126
  @echo Invoking: AVR/GNU Linker : 4.8.1
127
  $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="Empfaenger.map" -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,--gc-sections -Wl,-section-start=.1=0x810000 -Wl,-section-start=.2=0x810002 -Wl,-section-start=.3=0x810012 -Wl,-section-start=.4=0x810014  -mmcu=atmega328p  
128
  @echo Finished building target: $@
129
  "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures  "Empfaenger.elf" "Empfaenger.hex"  -R .1   -R .2   -R .3   -R .4 
130
  "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom   -j .1   -j .2   -j .3   -j .4  --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0  --change-section-lma .1 = 0x0 --change-section-lma .2 = 0x2 --change-section-lma .3 = 0x12 --change-section-lma .4 = 0x14 --no-change-warnings -O ihex "Empfaenger.elf" "Empfaenger.eep" || exit 0
131
  "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "Empfaenger.elf" > "Empfaenger.lss"
132
  "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "Empfaenger.elf" "Empfaenger.srec"
133
  "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-size.exe" "Empfaenger.elf"
134
  
135
  
136
137
138
139
140
141
# Other Targets
142
clean:
143
  -$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)  
144
  -$(RM) $(C_DEPS_AS_ARGS)   
145
  rm -rf "Empfaenger.elf" "Empfaenger.a" "Empfaenger.hex" "Empfaenger.lss" "Empfaenger.eep" "Empfaenger.map" "Empfaenger.srec" "Empfaenger.usersignatures"

von Helfer (Gast)


Lesenswert?

Manuel H. schrieb:
> rm -rf "Empfaenger.elf" "Empfaenger.a" "Empfaenger.hex"
> "Empfaenger.lss" "Empfaenger.eep" "Empfaenger.map" "Empfaenger.srec"
> "Empfaenger.usersignatures"

Wenn du das .eep File damit enfernst wird das auch nix ;)

Gruß

von Stefan E. (sternst)


Lesenswert?

Ich meinte damit den Output im Build-Fenster.

von Manuel H. (manu77)


Lesenswert?

1
------ Build started: Project: Empfaenger, Configuration: Debug AVR ------
2
Build started.
3
Project "Empfaenger.cproj" (default targets):
4
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
5
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Atmel Studio 6.2\Vs\Compiler.targets" from project "E:\Meine Dateien\Arbeit\Funk\Empfaenger\Empfaenger.cproj" (target "Build" depends on it):
6
  Task "RunCompilerTask"
7
    Shell Utils Path C:\Program Files (x86)\Atmel\Atmel Studio 6.2\shellUtils
8
    C:\Program Files (x86)\Atmel\Atmel Studio 6.2\shellUtils\make.exe all 
9
    Building file: .././main.c
10
    Invoking: AVR/GNU C Compiler : 4.8.1
11
    "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DF_CPU=12288000UL  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.c" 
12
    .././main.c: In function 'UART_Tick':
13
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(55,3): warning: implicit declaration of function 'uart_putpaket_real' [-Wimplicit-function-declaration]
14
       uart_putpaket_real();  
15
       ^
16
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(105,6): warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
17
          memset(UART_Puffer_Empfang, 0x00, sizeof(UART_Puffer_Empfang));
18
          ^
19
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(105,6): warning: incompatible implicit declaration of built-in function 'memset' [enabled by default]
20
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(180,4): warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
21
        uart_putpaket(UART_ACK_INHALT, strlen(UART_ACK_INHALT), 0);
22
        ^
23
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(180,35): warning: incompatible implicit declaration of built-in function 'strlen' [enabled by default]
24
        uart_putpaket(UART_ACK_INHALT, strlen(UART_ACK_INHALT), 0);
25
                                       ^
26
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(190,5): warning: implicit declaration of function 'UARTPaketVerarbeitung' [-Wimplicit-function-declaration]
27
         UARTPaketVerarbeitung();
28
         ^
29
    .././main.c: At top level:
30
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(200,6): warning: conflicting types for 'UARTPaketVerarbeitung' [enabled by default]
31
     void UARTPaketVerarbeitung()
32
          ^
33
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(190,5): info: previous implicit declaration of 'UARTPaketVerarbeitung' was here
34
         UARTPaketVerarbeitung();
35
         ^
36
    .././main.c: In function 'main':
37
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(344,5): warning: incompatible implicit declaration of built-in function 'memset' [enabled by default]
38
         memset(txbuf, 0, sizeof(txbuf));
39
         ^
40
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(373,6): warning: incompatible implicit declaration of built-in function 'memset' [enabled by default]
41
          memset(txbuf, 0, sizeof(txbuf));
42
          ^
43
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(417,5): warning: implicit declaration of function 'xtea_crypt_cbc' [-Wimplicit-function-declaration]
44
         xtea_crypt_cbc(XTEA_ENCRYPT, tx_cnt, txbuf, &txbuf, FunkXteaKey);
45
         ^
46
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(279,6): warning: unused variable 'zu' [-Wunused-variable]
47
      int zu = 0;
48
          ^
49
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(277,16): warning: unused variable 'Bytes' [-Wunused-variable]
50
      unsigned char Bytes = 0;
51
                    ^
52
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(276,16): warning: unused variable 'out' [-Wunused-variable]
53
      unsigned char out[64];
54
                    ^
55
    .././main.c: In function 'FUNKPaketVerarbeitung':
56
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(460,4): warning: pointer targets in passing argument 1 of 'uart_putpaket' differ in signedness [-Wpointer-sign]
57
        uart_putpaket(rxbuf, rx_cnt, 1);
58
        ^
59
    In file included from .././main.h:16:0,
60
                     from .././main.c:1:
61
E:\Meine Dateien\Arbeit\Funk\Empfaenger\uart.h(191,13): info: expected 'const char *' but argument is of type 'unsigned char *'
62
     extern void uart_putpaket(const char *s, uint8_t len, uint8_t WarteAufACK);
63
                 ^
64
    .././main.c: In function 'rx_packet':
65
E:\Meine Dateien\Arbeit\Funk\Empfaenger\main.c(475,2): warning: incompatible implicit declaration of built-in function 'memset' [enabled by default]
66
      memset(rxbuf, 0, sizeof(rxbuf));
67
      ^
68
    Finished building: .././main.c
69
    Building target: Empfaenger.elf
70
    Invoking: AVR/GNU Linker : 4.8.1
71
    "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-gcc.exe" -o Empfaenger.elf  main.o rf12.o uart.o xtea.o   -Wl,-Map="Empfaenger.map" -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,--gc-sections -Wl,-section-start=.1=0x810000 -Wl,-section-start=.2=0x810002 -Wl,-section-start=.3=0x810012 -Wl,-section-start=.4=0x810014  -mmcu=atmega328p  
72
    Finished building target: Empfaenger.elf
73
    "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures  "Empfaenger.elf" "Empfaenger.hex"  -R .1   -R .2   -R .3   -R .4 
74
    "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom   -j .1   -j .2   -j .3   -j .4  --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0  --change-section-lma .1 = 0x0 --change-section-lma .2 = 0x2 --change-section-lma .3 = 0x12 --change-section-lma .4 = 0x14 --no-change-warnings -O ihex "Empfaenger.elf" "Empfaenger.eep" || exit 0
75
    C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objcopy.exe: bad format for --change-section-lma
76
    "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "Empfaenger.elf" > "Empfaenger.lss"
77
    "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "Empfaenger.elf" "Empfaenger.srec"
78
    "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-size.exe" "Empfaenger.elf"
79
       text     data      bss      dec      hex  filename
80
       4740       54     1350     6144     1800  Empfaenger.elf
81
  Done executing task "RunCompilerTask".
82
  Task "RunOutputFileVerifyTask"
83
        Program Memory Usage   :  4774 bytes   14,6 % Full
84
        Data Memory Usage     :  1384 bytes   67,6 % Full
85
  Done executing task "RunOutputFileVerifyTask".
86
Done building target "CoreBuild" in project "Empfaenger.cproj".
87
Target "PostBuildEvent" in file "C:\Program Files (x86)\Atmel\Atmel Studio 6.2\Vs\Avr.common.targets" from project "E:\Meine Dateien\Arbeit\Funk\Empfaenger\Empfaenger.cproj" (target "Build" depends on it):
88
  Task "Exec"
89
    Command:
90
    "E:\Meine Dateien\Arbeit\Funk\Empfaenger\hexjoin.bat" "E:\Meine Dateien\Arbeit\Funk\Empfaenger\Debug\Empfaenger.hex" "E:\Meine Dateien\Arbeit\Funk\Bootloader\Bootloader Empfaenger\Debug\Empfaenger Bootloader.hex"
91
  Done executing task "Exec".
92
Done building target "PostBuildEvent" in project "Empfaenger.cproj".
93
Target "Build" in file "C:\Program Files (x86)\Atmel\Atmel Studio 6.2\Vs\Avr.common.targets" from project "E:\Meine Dateien\Arbeit\Funk\Empfaenger\Empfaenger.cproj" (entry point):
94
Done building target "Build" in project "Empfaenger.cproj".
95
Done building project "Empfaenger.cproj".
96
97
Build succeeded.
98
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

von Stefan E. (sternst)


Lesenswert?

Dem Output nach wird es erzeugt.
Schaust vielleicht nur einfach nicht an der richtigen Stelle nach?

von Manuel H. (manu77)


Angehängte Dateien:

Lesenswert?

Das ist das, was erstellt wird

von Stefan E. (sternst)


Lesenswert?

Manuel H. schrieb:
> Das ist das, was erstellt wird

Wo kommt tmp.hex her? Wird das durch hexjoin.bat erstellt? Was steht da 
sonst noch drin? Wird dort vielleicht das eep-File gelöscht?

von Karl H. (kbuchegg)


Lesenswert?

Stefan Ernst schrieb:
> Dem Output nach wird es erzeugt.

Sicher?

Ich seh hier eine Fehlermeldung
1
    "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom   -j .1   -j .2   -j .3   -j .4  --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0  --change-section-lma .1 = 0x0 --change-section-lma .2 = 0x2 --change-section-lma .3 = 0x12 --change-section-lma .4 = 0x14 --no-change-warnings -O ihex "Empfaenger.elf" "Empfaenger.eep" || exit 0
2
    C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-objcopy.exe: bad format for --change-section-lma

:-)
Ich weiß allerdings nicht, ob die kritisch ist, bzw. was sie bedeutet.

von Stefan E. (sternst)


Lesenswert?

Karl Heinz schrieb:
> Stefan Ernst schrieb:
>> Dem Output nach wird es erzeugt.
>
> Sicher?
>
> Ich seh hier eine Fehlermeldung

Ups, hab ich doch glatt übersehen (peinlich). ;-)

Manuel H. schrieb:
> In den Optionen habe ich unter "Memory Settings" im EEPROM Segment die
> Sections zugefügt:
> .1 = 0x00
> .2 = 0x02

->
1
.1=0x00
2
.2=0x02

von Manuel H. (manu77)


Lesenswert?

Stefan Ernst schrieb:
> Manuel H. schrieb:
>> Das ist das, was erstellt wird
>
> Wo kommt tmp.hex her? Wird das durch hexjoin.bat erstellt? Was steht da
> sonst noch drin? Wird dort vielleicht das eep-File gelöscht?

tmp.hex ist ein zusammengefügtes HEX-File aus Bootloader und Main 
Application. Habe auch gerade gemerkt, dass es daran lag :D Beim 
Vergleich mit einem alten Projekt ist es mir aufgefallen ;)

Trotzdem vielen Dank!!

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.