Discovery_STM32F746 Linking Problem

OP #4783776
Lesenswert?

Hallo STM32Fxxx Experten,

ich möchte zu dem o.g. Board unter Linux auf CLI Ebene
ein Binary kompilieren aus der Beispielsammlung von ST.

Als Compiler wird der

make -f Makefile.mw gcc-version
# the build will be done using
arm-none-eabi-gcc (openSUSE 5.4.0_20160622-3.19) 5.4.1 20160609 
(release) [ARM/embedded-5-branch revision 237715]

verwendet.

Das Bauen wird mit dem u.g. Kommando gestartet.

make -f Makefile.mw all


Ich habe mein Makefile soweit anpassen können, dass
alle Sourcen, so mein Eindruck, compiliert werden.
Beim Linken gibt es aber einen Linkerfehler.

make: *** [stm32f746mw.bin] Error 1

weil das .elf File nicht generiert wird und daraus
kein .bin File zum Flashen erzeugt werden kann.

Wäre jemand von Euch so nett und könnte mir aus den
angehängten Files die Richtung weisen wo der Fehler
liegt oder liegen könnte.

Die angehängten Files sind im UNIX-Format.

Ist das etwas gefrikkelte Einbinden des Startup-Codes
in Assembler Notation "./System/startup_stm32f746xx.s"
so weit richtig?

Das Makefile ist natürlich durch die vielen Trail and Error
Versuche etwas verunstaltet, also bitte um Nachsicht.

Danke für Eure Hilfe und Hinweise und entschuldigt die
vielen Files, aber ich wollte alles Relevante zusammen-
tragen.

Markus
DL8MBY

PS.: Der komplette Compilerdurchlauf nach einem make clean
ist noch zur Sicherheit im letzten File angehängt.
#4784054
Lesenswert?

Aber ein .bin File hast Du nach dem compilieren ?
Ev. macht dir das Makefile aus dem .elf File automatisch ein .bin File
Auszug aus dem Makefile:
1
$(PRJ).bin:  $(LPRJ).elf
2
  $(ECHO) "  [OBJC] $@"
3
  $(OS) $<
4
  $(OC) -v -O binary $< $(PRJ).bin

Dann findet arm-none-eabi-size das .elf File nicht mehr.
OP #4784236
Lesenswert?

Hallo Daniel,
hallo hp-freund,
und Forum!

Dass ein .bin File automatisch aus dem .elf File
erzeugt wird ist mir klar, steht ja so im Makefile.
Leider kommt es nicht dazu, da kein elf File erzeugt
wird.

Ich habe schon make mit --debug=vij aufgerufen, erhalte
leider aber keine Hinweise zum Problem.
Was mich etwas verunsichert, sind die vielen Meldungen
im Map-File, das Symbole mehrfach definiert sind.

z.B.:

first defined here
audio_play.o: In function `AUDIO_Start':
audio_play.c:(.text.AUDIO_Start+0x0): multiple definition of


Ich habe um sicher zu gehen, einen find auf .elf laufen lassen,
aber kein solches File gefunden.

Andere Projekte compilieren aber z.B. auf der Discovery_STM32F429
ohne Probleme, so dass ich mir nicht erklären kann, wo das
Problem liegt.

Natürlich bin ich kein ARM und GCC Spezialist habe gehofft aber
mit den rudimentären Kenntnissen, die ich besitze, so ein Beispiel
erfolgreich Compilieren zu können.

Ich habe des Projekt aus einer Eclipse Umgebung heruntergeladen
und auf den arm-none-eabi-gcc für cli Ebene angepasst, in der Hoffnung
mit dem 746-Disco spielen zu können.

Scheinbar gestaltet sich das schwieriger als anfangs gedacht.

Hat jemand von Euch noch eine Idee zu dem Thema?

Gruß
Markus
DL8MBY
OP #4784356
Lesenswert?

Ja.

Eclipse habe ich nicht Installiert, zumal man da
auch einiges wissen muss um ARM cross compilieren
zu können.

Ich bin mehr für Editor + CLI.

In die jeweiligen IDE's muss man sich auch erst
einarbeiten und versteht nicht immer was intern
beim Build vor sich geht.

Ist schon kompliziert genug die richtigen Compiler
und Linker Parameter herauszufinden.

Wie gesagt ich bin kein professioneller ARM Programmierer
und betreibe diese Dinge mehr als Hobby und um die
Technik besser begreifen zu können, die sich dahinter
verbirgt.

Markus
DL8MBY
Gast #4784366
Lesenswert?

"Früher" wollte ich auch mit Makefile genau wissen was passiert.

Inzwischen bin ich allerdings auf eclipse mit AC6 Plugin umgestiegen.
Ist wesentlich komfortabler und nach Einarbeitung auch einfacher.

Vor einiger Zeit habe ich diesen Beitrag geschrieben:
Beitrag "STM32F7-Discovery -> eclipse Projekt -> instabil :-("

 macload1 hat dann auch die Lösung gefunden: -Os

Mal sehen ob das mit der aktuellen lib noch funktioniert.
Das Schöne ist das dabei auch die Makefiles erstellt werden um ohne 
eclipse compilieren zu können.

Markus W. schrieb:
> Ist schon kompliziert genug die richtigen Compiler
> und Linker Parameter herauszufinden.

Dafür gibt es CubeMX.
OP #4784390
Lesenswert?

Hallo Daniel,
hallo hp-freund,


anbei der gewünschte Output als Anhang.

ich habe im Makefile (Makefile.mw), dass ich mit -f
an make übergebe, extra die ECHO Sequenz

$(ECHO) "  $(CXX) $(LDFLAGS) -TSystem/STM32F746NGHx_FLASH.ld -Xlinker 
--gc-sections -Llibs -Wl,-Map,${LPRJ}.map -o ${LPRJ}.elf $(OBJS) $(LIBS) 
System/startup_stm32f746xx.o"

eingebaut um zu sehen was make macht und um den Aufruf
manuell an die Kommandozeile übergeben zu können.

$(CXX) $(LDFLAGS) -TSystem/STM32F746NGHx_FLASH.ld -Xlinker --gc-sections 
-Llibs -Wl,-Map,${LPRJ}.map -o ${LPRJ}.elf $(OBJS) $(LIBS) 
System/startup_stm32f746xx.o

Leider hat mir das noch nicht den Fehler gezeigt.

Den Teil "System/startup_stm32f746xx.o" Habe ich händisch hinzugefügt,
um den Startcode aus dem startup_stm32f746xx.s File als Object-File dem
Linker zu übergeben.

Was mich noch etwas verwirrt, ist das der arm-none-eabi-g++ und nicht
der arm-none-eabi-ld zum Linken verwendet wird.

Das Makefile ist nicht mein eigenes, wurde aber von mir für meine
ersten Versuche übernommen und angepasst.

Möglicherweise steckt da noch ein logischer Fehler drin.
Syntaktisch scheint es ok zu sein.

Danke für Deine und Eure Mühe.

Markus
DL8MBY
Angehängte Dateien:
OP #4784410
Lesenswert?

Hi,

keine Ahnung, habe nur die c,h,s Files aus dem Projekt
übernommen und in meine Verzeichnisstruktur eingebettet.

Der Linker mosert noch an weiteren Stellen, nicht nur wegen
audio_play.c

siehe Output:

Markus

PS.: habe mal die main.c und main.h aus dem Beispiel dran gehängt,
Vielleicht hilft das.


 Src/lcd.o: In function `LCD_demo':
lcd.c:(.text.LCD_demo+0x0): multiple definition of `LCD_demo'
lcd.o:lcd.c:(.text.LCD_demo+0x0): first defined here
Src/audio_rec.o: In function `AudioRec_demo':
audio_rec.c:(.text.AudioRec_demo+0x0): multiple definition of 
`AudioRec_demo'
audio_rec.o:audio_rec.c:(.text.AudioRec_demo+0x0): first defined here
Src/audio_rec.o: In function `BSP_AUDIO_IN_TransferComplete_CallBack':
audio_rec.c:(.text.BSP_AUDIO_IN_TransferComplete_CallBack+0x0): multiple 
definition of `BSP_AUDIO_IN_TransferComplete_CallBack'
audio_rec.o:audio_rec.c:(.text.BSP_AUDIO_IN_TransferComplete_CallBack+0x 
0):  first defined here
Src/audio_rec.o: In function `BSP_AUDIO_IN_HalfTransfer_CallBack':
audio_rec.c:(.text.BSP_AUDIO_IN_HalfTransfer_CallBack+0x0): multiple 
definition of `BSP_AUDIO_IN_HalfTransfer_CallBack'
audio_rec.o:audio_rec.c:(.text.BSP_AUDIO_IN_HalfTransfer_CallBack+0x0): 
first defined here
Src/audio_rec.o: In function `BSP_AUDIO_IN_Error_CallBack':
audio_rec.c:(.text.BSP_AUDIO_IN_Error_CallBack+0x0): multiple definition 
of `BSP_AUDIO_IN_Error_CallBack'
audio_rec.o:audio_rec.c:(.text.BSP_AUDIO_IN_Error_CallBack+0x0): first 
defined here
Src/main.o: In function `main':
main.c:(.text.startup.main+0x0): multiple definition of `main'
main.o:main.c:(.text.startup.main+0x0): first defined here
Src/main.o: In function `CheckForUserInput':
main.c:(.text.CheckForUserInput+0x0): multiple definition of 
`CheckForUserInput'
main.o:main.c:(.text.CheckForUserInput+0x0): first defined here
Src/main.o: In function `Toggle_Leds':
main.c:(.text.Toggle_Leds+0x0): multiple definition of `Toggle_Leds'
main.o:main.c:(.text.Toggle_Leds+0x0): first defined here
Src/main.o: In function `HAL_GPIO_EXTI_Callback':
main.c:(.text.HAL_GPIO_EXTI_Callback+0x0): multiple definition of 
`HAL_GPIO_EXTI_Callback'
main.o:main.c:(.text.HAL_GPIO_EXTI_Callback+0x0): first defined here
Src/main.o:(.data.BSP_examples+0x0): multiple definition of 
`BSP_examples'
main.o:(.data.BSP_examples+0x0): first defined here
Src/main.o:(.bss.ErrorCounter+0x0): multiple definition of 
`ErrorCounter'
main.o:(.bss.ErrorCounter+0x0): first defined here
Src/main.o:(.data.NbLoop+0x0): multiple definition of `NbLoop'
main.o:(.data.NbLoop+0x0): first defined here
Src/main.o:(.rodata.stlogo+0x0): multiple definition of `stlogo'
main.o:(.rodata.stlogo+0x0): first defined here
camera.o: In function `Camera_demo':
camera.c:(.text.Camera_demo+0x0): multiple definition of `Camera_demo'
Src/camera.o:camera.c:(.text.Camera_demo+0x0): first defined here
camera.o: In function `BSP_CAMERA_LineEventCallback':
camera.c:(.text.BSP_CAMERA_LineEventCallback+0x0): multiple definition 
of `BSP_CAMERA_LineEventCallback'
Src/camera.o:camera.c:(.text.BSP_CAMERA_LineEventCallback+0x0): first 
defined here
camera.o: In function `BSP_LCD_DMA2D_IRQHandler':
camera.c:(.text.BSP_LCD_DMA2D_IRQHandler+0x0): multiple definition of 
`BSP_LCD_DMA2D_IRQHandler'
Src/camera.o:camera.c:(.text.BSP_LCD_DMA2D_IRQHandler+0x0): first 
defined here
camera.o: In function `HAL_DMA2D_MspInit':
camera.c:(.text.HAL_DMA2D_MspInit+0x0): multiple definition of 
`HAL_DMA2D_MspInit'
Src/camera.o:camera.c:(.text.HAL_DMA2D_MspInit+0x0): first defined here
touchscreen.o: In function `Touchscreen_demo':
touchscreen.c:(.text.Touchscreen_demo+0x0): multiple definition of 
`Touchscreen_demo'
Src/touchscreen.o:touchscreen.c:(.text.Touchscreen_demo+0x0): first 
defined here
sdram.o: In function `SDRAM_demo':
sdram.c:(.text.SDRAM_demo+0x0): multiple definition of `SDRAM_demo'
Src/sdram.o:sdram.c:(.text.SDRAM_demo+0x0): first defined here
sdram_dma.o: In function `SDRAM_DMA_demo':
sdram_dma.c:(.text.SDRAM_DMA_demo+0x0): multiple definition of 
`SDRAM_DMA_demo'
Src/sdram_dma.o:sdram_dma.c:(.text.SDRAM_DMA_demo+0x0): first defined 
here
sdram_dma.o: In function `HAL_SDRAM_DMA_XferCpltCallback':
sdram_dma.c:(.text.HAL_SDRAM_DMA_XferCpltCallback+0x0): multiple 
definition of `HAL_SDRAM_DMA_XferCpltCallback'
Src/sdram_dma.o:sdram_dma.c:(.text.HAL_SDRAM_DMA_XferCpltCallback+0x0): 
first defined here
sdram_dma.o: In function `HAL_SDRAM_DMA_XferErrorCallback':
sdram_dma.c:(.text.HAL_SDRAM_DMA_XferErrorCallback+0x0): multiple 
definition of `HAL_SDRAM_DMA_XferErrorCallback'
Src/sdram_dma.o:sdram_dma.c:(.text.HAL_SDRAM_DMA_XferErrorCallback+0x0): 
first defined here
sdram_dma.o:(.bss.uwDMA_Transfer_Complete+0x0): multiple definition of 
`uwDMA_Transfer_Complete'
Src/sdram_dma.o:(.bss.uwDMA_Transfer_Complete+0x0): first defined here
log.o: In function `Log_demo':
log.c:(.text.Log_demo+0x0): multiple definition of `Log_demo'
Src/log.o:log.c:(.text.Log_demo+0x0): first defined here
system_stm32f7xx.o: In function `SystemInit':
system_stm32f7xx.c:(.text.SystemInit+0x0): multiple definition of 
`SystemInit'
Src/system_stm32f7xx.o:system_stm32f7xx.c:(.text.SystemInit+0x0): first 
defined here
system_stm32f7xx.o: In function `SystemCoreClockUpdate':
system_stm32f7xx.c:(.text.SystemCoreClockUpdate+0x0): multiple 
definition of `SystemCoreClockUpdate'
Src/system_stm32f7xx.o:system_stm32f7xx.c:(.text.SystemCoreClockUpdate+0 
x0):  first defined here
system_stm32f7xx.o:(.data.AHBPrescTable+0x0): multiple definition of 
`AHBPrescTable'
Src/system_stm32f7xx.o:(.data.AHBPrescTable+0x0): first defined here
system_stm32f7xx.o:(.data.SystemCoreClock+0x0): multiple definition of 
`SystemCoreClock'
Src/system_stm32f7xx.o:(.data.SystemCoreClock+0x0): first defined here
qspi.o: In function `QSPI_demo':
qspi.c:(.text.QSPI_demo+0x0): multiple definition of `QSPI_demo'
Src/qspi.o:qspi.c:(.text.QSPI_demo+0x0): first defined here
eeprom.o: In function `EEPROM_demo':
eeprom.c:(.text.EEPROM_demo+0x0): multiple definition of `EEPROM_demo'
Src/eeprom.o:eeprom.c:(.text.EEPROM_demo+0x0): first defined here
eeprom.o: In function `BSP_EEPROM_TIMEOUT_UserCallback':
eeprom.c:(.text.BSP_EEPROM_TIMEOUT_UserCallback+0x0): multiple 
definition of `BSP_EEPROM_TIMEOUT_UserCallback'
Src/eeprom.o:eeprom.c:(.text.BSP_EEPROM_TIMEOUT_UserCallback+0x0): first 
defined here
eeprom.o:(.bss.Tx2Buffer+0x0): multiple definition of `Tx2Buffer'
Src/eeprom.o:(.bss.Tx2Buffer+0x0): first defined here
eeprom.o:(.bss.Rx1Buffer+0x0): multiple definition of `Rx1Buffer'
Src/eeprom.o:(.bss.Rx1Buffer+0x0): first defined here
eeprom.o:(.data.Tx1Buffer+0x0): multiple definition of `Tx1Buffer'
Src/eeprom.o:(.data.Tx1Buffer+0x0): first defined here
eeprom.o:(.data.EEPROMConnected+0x0): multiple definition of 
`EEPROMConnected'
Src/eeprom.o:(.data.EEPROMConnected+0x0): first defined here
stm32f7xx_it.o: In function `NMI_Handler':
stm32f7xx_it.c:(.text.NMI_Handler+0x0): multiple definition of 
`NMI_Handler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.NMI_Handler+0x0): first defined 
here
stm32f7xx_it.o: In function `HardFault_Handler':
stm32f7xx_it.c:(.text.HardFault_Handler+0x0): multiple definition of 
`HardFault_Handler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.HardFault_Handler+0x0): first 
defined here
stm32f7xx_it.o: In function `MemManage_Handler':
stm32f7xx_it.c:(.text.MemManage_Handler+0x0): multiple definition of 
`MemManage_Handler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.MemManage_Handler+0x0): first 
defined here
stm32f7xx_it.o: In function `BusFault_Handler':
stm32f7xx_it.c:(.text.BusFault_Handler+0x0): multiple definition of 
`BusFault_Handler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.BusFault_Handler+0x0): first 
defined here
stm32f7xx_it.o: In function `UsageFault_Handler':
stm32f7xx_it.c:(.text.UsageFault_Handler+0x0): multiple definition of 
`UsageFault_Handler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.UsageFault_Handler+0x0): first 
defined here
stm32f7xx_it.o: In function `SVC_Handler':
stm32f7xx_it.c:(.text.SVC_Handler+0x0): multiple definition of 
`SVC_Handler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.SVC_Handler+0x0): first defined 
here
stm32f7xx_it.o: In function `DebugMon_Handler':
stm32f7xx_it.c:(.text.DebugMon_Handler+0x0): multiple definition of 
`DebugMon_Handler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.DebugMon_Handler+0x0): first 
defined here
stm32f7xx_it.o: In function `PendSV_Handler':
stm32f7xx_it.c:(.text.PendSV_Handler+0x0): multiple definition of 
`PendSV_Handler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.PendSV_Handler+0x0): first 
defined here
stm32f7xx_it.o: In function `SysTick_Handler':
stm32f7xx_it.c:(.text.SysTick_Handler+0x0): multiple definition of 
`SysTick_Handler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.SysTick_Handler+0x0): first 
defined here
stm32f7xx_it.o: In function `EXTI0_IRQHandler':
stm32f7xx_it.c:(.text.EXTI0_IRQHandler+0x0): multiple definition of 
`EXTI0_IRQHandler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.EXTI0_IRQHandler+0x0): first 
defined here
stm32f7xx_it.o: In function `EXTI2_IRQHandler':
stm32f7xx_it.c:(.text.EXTI2_IRQHandler+0x0): multiple definition of 
`EXTI2_IRQHandler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.EXTI2_IRQHandler+0x0): first 
defined here
stm32f7xx_it.o: In function `EXTI15_10_IRQHandler':
stm32f7xx_it.c:(.text.EXTI15_10_IRQHandler+0x0): multiple definition of 
`EXTI15_10_IRQHandler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.EXTI15_10_IRQHandler+0x0): 
first defined here
stm32f7xx_it.o: In function `DMA2_Stream7_IRQHandler':
stm32f7xx_it.c:(.text.DMA2_Stream7_IRQHandler+0x0): multiple definition 
of `DMA2_Stream7_IRQHandler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.DMA2_Stream7_IRQHandler+0x0): 
first defined here
stm32f7xx_it.o: In function `DMA2_Stream0_IRQHandler':
stm32f7xx_it.c:(.text.DMA2_Stream0_IRQHandler+0x0): multiple definition 
of `DMA2_Stream0_IRQHandler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.DMA2_Stream0_IRQHandler+0x0): 
first defined here
stm32f7xx_it.o: In function `DMA2_Stream1_IRQHandler':
stm32f7xx_it.c:(.text.DMA2_Stream1_IRQHandler+0x0): multiple definition 
of `DMA2_Stream1_IRQHandler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.DMA2_Stream1_IRQHandler+0x0): 
first defined here
stm32f7xx_it.o: In function `DMA2_Stream4_IRQHandler':
stm32f7xx_it.c:(.text.DMA2_Stream4_IRQHandler+0x0): multiple definition 
of `DMA2_Stream4_IRQHandler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.DMA2_Stream4_IRQHandler+0x0): 
first defined here
stm32f7xx_it.o: In function `DCMI_IRQHandler':
stm32f7xx_it.c:(.text.DCMI_IRQHandler+0x0): multiple definition of 
`DCMI_IRQHandler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.DCMI_IRQHandler+0x0): first 
defined here
stm32f7xx_it.o: In function `DMA2D_IRQHandler':
stm32f7xx_it.c:(.text.DMA2D_IRQHandler+0x0): multiple definition of 
`DMA2D_IRQHandler'
Src/stm32f7xx_it.o:stm32f7xx_it.c:(.text.DMA2D_IRQHandler+0x0): first 
defined here
sd.o: In function `SD_demo':
sd.c:(.text.SD_demo+0x0): multiple definition of `SD_demo'
Src/sd.o:sd.c:(.text.SD_demo+0x0): first defined here
audio_play.o: In function `AUDIO_Start':
audio_play.c:(.text.AUDIO_Start+0x0): multiple definition of 
`AUDIO_Start'
Src/audio_play.o:audio_play.c:(.text.AUDIO_Start+0x0): first defined 
here
audio_play.o: In function `AudioPlay_demo':
audio_play.c:(.text.AudioPlay_demo+0x0): multiple definition of 
`AudioPlay_demo'
Src/audio_play.o:audio_play.c:(.text.AudioPlay_demo+0x0): first defined 
here
audio_play.o: In function `AUDIO_Process':
audio_play.c:(.text.AUDIO_Process+0x0): multiple definition of 
`AUDIO_Process'
Src/audio_play.o:audio_play.c:(.text.AUDIO_Process+0x0): first defined 
here
audio_play.o: In function `BSP_AUDIO_OUT_TransferComplete_CallBack':
audio_play.c:(.text.BSP_AUDIO_OUT_TransferComplete_CallBack+0x0): 
multiple definition of `BSP_AUDIO_OUT_TransferComplete_CallBack'
Src/audio_play.o:audio_play.c:(.text.BSP_AUDIO_OUT_TransferComplete_Call 
Back+0x0):  first defined here
audio_play.o: In function `BSP_AUDIO_OUT_HalfTransfer_CallBack':
audio_play.c:(.text.BSP_AUDIO_OUT_HalfTransfer_CallBack+0x0): multiple 
definition of `BSP_AUDIO_OUT_HalfTransfer_CallBack'
Src/audio_play.o:audio_play.c:(.text.BSP_AUDIO_OUT_HalfTransfer_CallBack 
+0x0):  first defined here
audio_play.o: In function `BSP_AUDIO_OUT_Error_CallBack':
audio_play.c:(.text.BSP_AUDIO_OUT_Error_CallBack+0x0): multiple 
definition of `BSP_AUDIO_OUT_Error_CallBack'
Src/audio_play.o:audio_play.c:(.text.BSP_AUDIO_OUT_Error_CallBack+0x0): 
first defined here
audio_play.o:(.bss.uwPauseEnabledStatus+0x0): multiple definition of 
`uwPauseEnabledStatus'
Src/audio_play.o:(.bss.uwPauseEnabledStatus+0x0): first defined here
audio_play.o:(.data.uwVolume+0x0): multiple definition of `uwVolume'
Src/audio_play.o:(.data.uwVolume+0x0): first defined here
audio_loopback.o: In function `AudioLoopback_demo':
audio_loopback.c:(.text.AudioLoopback_demo+0x0): multiple definition of 
`AudioLoopback_demo'
Src/audio_loopback.o:audio_loopback.c:(.text.AudioLoopback_demo+0x0): 
first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.data.Font8+0x0): 
multiple definition of `Font8'
Utilities/Fonts/font8.o:(.data.Font8+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.rodata.Font8_Table+0 
x0):  multiple definition of `Font8_Table'
Utilities/Fonts/font8.o:(.rodata.Font8_Table+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.data.Font12+0x0): 
multiple definition of `Font12'
Utilities/Fonts/font12.o:(.data.Font12+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.rodata.Font12_Table+ 
0x0):  multiple definition of `Font12_Table'
Utilities/Fonts/font12.o:(.rodata.Font12_Table+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.data.Font16+0x0): 
multiple definition of `Font16'
Utilities/Fonts/font16.o:(.data.Font16+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.rodata.Font16_Table+ 
0x0):  multiple definition of `Font16_Table'
Utilities/Fonts/font16.o:(.rodata.Font16_Table+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.data.Font20+0x0): 
multiple definition of `Font20'
Utilities/Fonts/font20.o:(.data.Font20+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.rodata.Font20_Table+ 
0x0):  multiple definition of `Font20_Table'
Utilities/Fonts/font20.o:(.rodata.Font20_Table+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.data.Font24+0x0): 
multiple definition of `Font24'
Utilities/Fonts/font24.o:(.data.Font24+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.rodata.Font24_Table+ 
0x0):  multiple definition of `Font24_Table'
Utilities/Fonts/font24.o:(.rodata.Font24_Table+0x0): first defined here
System/startup_stm32f746xx.o:(.isr_vector+0x0): multiple definition of 
`g_pfnVectors'
System/startup_stm32f746xx.o:(.isr_vector+0x0): first defined here
System/startup_stm32f746xx.o: In function `SPDIF_RX_IRQHandler':
(.text.Default_Handler+0x0): multiple definition of `Default_Handler'
System/startup_stm32f746xx.o:(.text.Default_Handler+0x0): first defined 
here
collect2: error: ld returned 1 exit status
Makefile.mw:214: recipe for target 'stm32f746mw.elf' failed
make: *** [stm32f746mw.elf] Error 1
Angehängte Dateien:
Gast #4784416
Lesenswert?

Oder hier:

Src/main.o: In function `main':
main.c:(.text.startup.main+0x0): multiple definition of `main'
main.o:main.c:(.text.startup.main+0x0): first defined here

Der Linker hat zweimal main() gefunden.
Was hast du denn da alles zusammengewürfelt?
OP #4784433
Lesenswert?

Hallo Holger,

jetzt hat es klick gemacht,

ich habe alle Projektbezogenen .c und .h Dateien
im mein Hauptverzeichnis kopiert aber die Verzeichnisse
Src und Inc weiterhin im Hauptverzeichnis belassen, so
dass die main.c zweimal vorhanden ist.

Manchmal sieht man vor lauter Bäumen den Wald nicht mehr.
Mia Culpa!

Werde dass sofort anpassen und Scr und Inc aus dem Ordner
entfernen.

Danke dass Du mir die Augen geöffnet hast.

Markus
DL8MBY
Angehängte Dateien:
OP #4784450
Lesenswert?

Hallo

Nach der Bereinigung des Project-Hauptverzeichnisses
bekomme ich leider immer noch Meldungen zu Mehrfach-
definitionen von Symbolen.

Muss noch genauer Suchen, nicht dass ich noch so einen
Schnitzer irgendwo habe. Sorry!

Markus

BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.data.Font8+0x0): 
multiple definition of `Font8'
Utilities/Fonts/font8.o:(.data.Font8+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.rodata.Font8_Table+0 
x0):  multiple definition of `Font8_Table'
Utilities/Fonts/font8.o:(.rodata.Font8_Table+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.data.Font12+0x0): 
multiple definition of `Font12'
Utilities/Fonts/font12.o:(.data.Font12+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.rodata.Font12_Table+ 
0x0):  multiple definition of `Font12_Table'
Utilities/Fonts/font12.o:(.rodata.Font12_Table+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.data.Font16+0x0): 
multiple definition of `Font16'
Utilities/Fonts/font16.o:(.data.Font16+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.rodata.Font16_Table+ 
0x0):  multiple definition of `Font16_Table'
Utilities/Fonts/font16.o:(.rodata.Font16_Table+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.data.Font20+0x0): 
multiple definition of `Font20'
Utilities/Fonts/font20.o:(.data.Font20+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.rodata.Font20_Table+ 
0x0):  multiple definition of `Font20_Table'
Utilities/Fonts/font20.o:(.rodata.Font20_Table+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.data.Font24+0x0): 
multiple definition of `Font24'
Utilities/Fonts/font24.o:(.data.Font24+0x0): first defined here
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o:(.rodata.Font24_Table+ 
0x0):  multiple definition of `Font24_Table'
Utilities/Fonts/font24.o:(.rodata.Font24_Table+0x0): first defined here
System/startup_stm32f746xx.o:(.isr_vector+0x0): multiple definition of 
`g_pfnVectors'
System/startup_stm32f746xx.o:(.isr_vector+0x0): first defined here
System/startup_stm32f746xx.o: In function `SPDIF_RX_IRQHandler':
(.text.Default_Handler+0x0): multiple definition of `Default_Handler'
System/startup_stm32f746xx.o:(.text.Default_Handler+0x0): first defined 
here
collect2: error: ld returned 1 exit status
Makefile.mw:198: recipe for target 'stm32f746mw.elf' failed
make: *** [stm32f746mw.elf] Error 1
Gast #4784461
Lesenswert?

Hier hast du jetzt tatsächlich mehrere includes von *.c
Dateien in stm32746g_discovery_lcd.c.
Mach den Kram da weg oder nimm die fontxx.c aus deinem
makefile raus.

#include "../../../Utilities/Fonts/font24.c"
#include "../../../Utilities/Fonts/font20.c"
#include "../../../Utilities/Fonts/font16.c"
#include "../../../Utilities/Fonts/font12.c"
#include "../../../Utilities/Fonts/font8.c"
Gast #4784468
Lesenswert?

Markus W. schrieb:

>
> Was mich noch etwas verwirrt, ist das der arm-none-eabi-g++ und nicht
> der arm-none-eabi-ld zum Linken verwendet wird.
>

Das hat schon seine Richtigkeit.

arm-none-eabi-gcc/arm-none-eabi-g++ ist NICHT der Compiler, sondern nur 
ein Treiber, der u.a den Linker aufrufen kann.

Im Fall von C/C++ sind bestimmte Link-Optionen voreingestellt und zu 
linkende Libs/C-Runtime vordefiniert, die man bei Verwendung von 
arm-none-eabi-ld manuell spezifizieren müsste.

Also: Ausser in Spezialfällen für C/C++ immer *-gcc/*-g++ zum Linken 
nehmen.
OP #4784476
Lesenswert?

Hallo Holger,

Congratulations

Volltreffer.

Bin gespannt, ob nach dem Flashen was am Display zu sehen ist.

Herzlichen Dank an alle Beteiligten für Ihre Hilfe und Mühe.

Bis zum nächsten Problem ;-)

Markus

make -f Makefile.mw all
  [LD] stm32f746mw.elf
  @/usr/bin/arm-none-eabi-g++ -mcpu=cortex-m7 -mthumb -Os 
-TSystem/STM32F746NGHx_FLASH.ld -Xlinker --gc-sections -Llibs 
-Wl,-Map,stm32f746mw.map -o stm32f746mw.elf  main.o lcd.o audio_rec.o 
camera.o touchscreen.o sdram.o sdram_dma.o log.o system_stm32f7xx.o 
qspi.o eeprom.o stm32f7xx_it.o sd.o audio_play.o audio_loopback.o 
BSP/STM32746G-Discovery/stm32746g_discovery_audio.o 
BSP/STM32746G-Discovery/stm32746g_discovery_ts.o 
BSP/STM32746G-Discovery/stm32746g_discovery_lcd.o 
BSP/STM32746G-Discovery/stm32746g_discovery.o 
BSP/STM32746G-Discovery/stm32746g_discovery_qspi.o 
BSP/STM32746G-Discovery/stm32746g_discovery_camera.o 
BSP/STM32746G-Discovery/stm32746g_discovery_sd.o 
BSP/STM32746G-Discovery/stm32746g_discovery_eeprom.o 
BSP/STM32746G-Discovery/stm32746g_discovery_sdram.o 
BSP/Components/ft5336/ft5336.o BSP/Components/ov9655/ov9655.o 
BSP/Components/wm8994/wm8994.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_ltdc.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_sd.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_usb.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_smartcard.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_cryp_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_smartcard_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_nor.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rng.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_iwdg.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_nand.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_gpio.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_pwr.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_usart.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_hcd.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_can.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_flash.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_fmc.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_i2c_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_eth.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_sai.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_spdifrx.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_sai_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_sdram.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_pcd.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dcmi.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dac_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_adc.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_wwdg.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_tim_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rcc.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_cortex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_lptim.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_i2s.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dcmi_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rtc_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_hash.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_sram.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_tim.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_sdmmc.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma2d.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dac.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_flash_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_spi.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_hash_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_cec.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_qspi.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rcc_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_irda.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_crc.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_pcd_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_crc_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_cryp.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_pwr_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rtc.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_msp_template.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_adc_ex.o 
STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_i2c.o Utilities/Log/lcd_log.o 
System/startup_stm32f746xx.o  -lm
  [OBJC] stm32f746mw.bin
   text     data      bss      dec      hex  filename
 115864     3620   163460   282944    45140  stm32f746mw.elf
copy from `stm32f746mw.elf' [elf32-littlearm] to `stm32f746mw.bin' 
[binary]
# compile the ARM-executables .bin and .elf  and generate .map and .dmp
using \c
arm-none-eabi-gcc (openSUSE 5.4.0_20160622-3.19) 5.4.1 20160609 
(release) [ARM/embedded-5-branch revision 237715]

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren