前提・実現したいこと
現在MPLAB harmony v3 を用いて加速度センサーからの値をUARTを用いて受信するプログラムを書いています。
発生している問題・エラーメッセージ
c:\program files\microchip\xc32\v3.01\bin\bin\gcc\pic32mx\8.3.1........\bin/pic32m-ld.exe: build/angleanduart/production/_ext/1360937237/main.o:c:/users/name/harmonyprojects/myproject_7/firmware/src/main.c:17: multiple definition of queue_data'; build/angleanduart/production/_ext/633535977/plib_uart1.o:c:/users/tsuku/harmonyprojects/myproject_7/firmware/src/config/angleanduart/peripheral/uart/plib_uart1.c:51: first defined here c:\program files\microchip\xc32\v3.01\bin\bin\gcc\pic32mx\8.3.1........\bin/pic32m-ld.exe: build/angleanduart/production/_ext/1360937237/main.o:c:/users/name/harmonyprojects/myproject_7/firmware/src/main.c:20: multiple definition of
enqeue'; build/angleanduart/production/_ext/633535977/plib_uart1.o:c:/users/tsuku/harmonyprojects/myproject_7/firmware/src/config/angleanduart/peripheral/uart/plib_uart1.c:54: first defined here
c:\program files\microchip\xc32\v3.01\bin\bin\gcc\pic32mx\8.3.1........\bin/pic32m-ld.exe: build/angleanduart/production/_ext/1360937237/main.o:c:/users/tsuku/harmonyprojects/myproject_7/firmware/src/main.c:19: multiple definition of queue_num'; build/angleanduart/production/_ext/633535977/plib_uart1.o:c:/users/tsuku/harmonyprojects/myproject_7/firmware/src/config/angleanduart/peripheral/uart/plib_uart1.c:53: first defined here c:\program files\microchip\xc32\v3.01\bin\bin\gcc\pic32mx\8.3.1........\bin/pic32m-ld.exe: build/angleanduart/production/_ext/1360937237/main.o:c:/users/tsuku/harmonyprojects/myproject_7/firmware/src/main.c:18: multiple definition of
queue_head'; build/angleanduart/production/_ext/633535977/plib_uart1.o:c:/users/tsuku/harmonyprojects/myproject_7/firmware/src/config/angleanduart/peripheral/uart/plib_uart1.c:52: first defined here
c:\program files\microchip\xc32\v3.01\bin\bin\gcc\pic32mx\8.3.1........\bin/pic32m-ld.exe: Link terminated due to previous error(s).
Info: Loading file: ./..\src\config\angleanduart\p32MK0512MCJ064.ld
collect2.exe: error: ld returned 255 exit status
make[2]: *** [dist/angleanduart/production/angletest.X.production.hex] Error 255
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-angleanduart.mk:260: recipe for target 'dist/angleanduart/production/angletest.X.production.hex' failed
make[2]: Leaving directory 'C:/Users/name/HarmonyProjects/MyProject_7/firmware/angletest.X'
nbproject/Makefile-angleanduart.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/name/HarmonyProjects/MyProject_7/firmware/angletest.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
BUILD FAILED (exit value 2, total time: 1s)
該当のソースコード
Makefile-impl.mkの内容
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a pre- and a post- target defined where you can add customization code.
#
# This makefile implements macros and targets common to all configurations.
#
# NOCDDL
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
# and .clean-reqprojects-conf unless SUB has the value 'no'
SUB_no=NO
SUBPROJECTS=${SUB_${SUB}}
BUILD_SUBPROJECTS_=.build-subprojects
BUILD_SUBPROJECTS_NO=
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
CLEAN_SUBPROJECTS_=.clean-subprojects
CLEAN_SUBPROJECTS_NO=
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
PROJECTNAME=angletest.X
# Active Configuration
DEFAULTCONF=angleanduart
CONF=${DEFAULTCONF}
# All Configurations
ALLCONFS=angleanduart
# build
.build-impl: .build-pre
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
# clean
.clean-impl: .clean-pre
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
# clobber
.clobber-impl: .clobber-pre .depcheck-impl
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=angleanduart clean
# all
.all-impl: .all-pre .depcheck-impl
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=angleanduart build
# dependency checking support
.depcheck-impl:
# @echo "# This code depends on make tool being used" >.dep.inc
# @if [ -n "${MAKE_VERSION}" ]; then
# echo "DEPFILES=$$(wildcard $$(addsuffix .d, $${OBJECTFILES}))" >>.dep.inc;
# echo "ifneq ($${DEPFILES},)" >>.dep.inc;
# echo "include $${DEPFILES}" >>.dep.inc;
# echo "endif" >>.dep.inc;
# else
# echo ".KEEP_STATE:" >>.dep.inc;
# echo ".KEEP_STATE_FILE:.make.state.$${CONF}" >>.dep.inc;
# fi
Makefile-angleanduart.mkの内容
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a pre- and a post- target defined where you can add customization code.
#
# This makefile implements macros and targets common to all configurations.
#
# NOCDDL
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
# and .clean-reqprojects-conf unless SUB has the value 'no'
SUB_no=NO
SUBPROJECTS=${SUB_${SUB}}
BUILD_SUBPROJECTS_=.build-subprojects
BUILD_SUBPROJECTS_NO=
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
CLEAN_SUBPROJECTS_=.clean-subprojects
CLEAN_SUBPROJECTS_NO=
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
PROJECTNAME=angletest.X
# Active Configuration
DEFAULTCONF=angleanduart
CONF=${DEFAULTCONF}
# All Configurations
ALLCONFS=angleanduart
# build
.build-impl: .build-pre
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
# clean
.clean-impl: .clean-pre
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
# clobber
.clobber-impl: .clobber-pre .depcheck-impl
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=angleanduart clean
# all
.all-impl: .all-pre .depcheck-impl
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=angleanduart build
# dependency checking support
.depcheck-impl:
# @echo "# This code depends on make tool being used" >.dep.inc
# @if [ -n "${MAKE_VERSION}" ]; then
# echo "DEPFILES=$$(wildcard $$(addsuffix .d, $${OBJECTFILES}))" >>.dep.inc;
# echo "ifneq ($${DEPFILES},)" >>.dep.inc;
# echo "include $${DEPFILES}" >>.dep.inc;
# echo "endif" >>.dep.inc;
# else
# echo ".KEEP_STATE:" >>.dep.inc;
# echo ".KEEP_STATE_FILE:.make.state.$${CONF}" >>.dep.inc;
# fi
#ってかいてあるのはコメントです。これは自動生成されたプログラムです。
試したこと
UARTの通信を行うコードはuart.cでそれはuart.hにしてあったのでそれに新たに自作のリングバッファーの処理を行う関数を記述し、その関数はmain.cで使用するのでmain.cでも変数を使えるためにuart.hに変数を格納してmain.cでuart.hをincludeしてたのをuart.hも格納してあるdefinitions.hに書いてみました。意味ありませんでした。ほかにもヘッダーに変数を書くのではなくuart1.cで変数を宣言し、main.cで関数をプロトタイプ宣言してみたりしました。
ヘッダーの名前とかは実際にはちがうけどほとんど同じです。
補足情報(FW/ツールのバージョンなど)
xc32 3.01
harmony 最新
mplab 5.50
ここにより詳細な情報を記載してください。
https://17.gigafile.nu/1230-dfeedc2df2a26d004f7b45990e44a5dba
一応書いたソースコードをギガファイル便にまとめました。
長く残らないのですが.....
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/12/23 14:49