nanocom2024 / nanoRelation_Device

nanoRelationのデバイス(Leafony)側
MIT License
1 stars 0 forks source link

conflicting types for 'LowPower_shutdown' #2

Closed hyouhyan closed 1 month ago

hyouhyan commented 1 month ago

以下のエラーが発生してコンパイルが通らない。

d:\Users\Hyouhyan\Documents\Arduino\libraries\STM32duino_Low_Power\src\low_power.c:573:6: error: conflicting types for 'LowPower_shutdown'
  573 | void LowPower_shutdown(bool isRTC)
      |      ^~~~~~~~~~~~~~~~~
d:\Users\Hyouhyan\Documents\Arduino\libraries\STM32duino_Low_Power\src\low_power.c:574:1: note: an argument type that has a default promotion can't match an empty parameter name list declaration
  574 | {
      | ^
In file included from C:\Users\Hyouhyan\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.1-R00\cores\arduino/board.h:15,
                 from C:\Users\Hyouhyan\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.1-R00\cores\arduino/wiring.h:41,
                 from C:\Users\Hyouhyan\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.1-R00\cores\arduino/Arduino.h:36,
                 from d:\Users\Hyouhyan\Documents\Arduino\libraries\STM32duino_Low_Power\src\low_power.c:21:
C:\Users\Hyouhyan\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.1-R00\cores\arduino/stm32/low_power.h:63:6: note: previous declaration of 'LowPower_shutdown' was here
   63 | void LowPower_shutdown();
      |      ^~~~~~~~~~~~~~~~~
d:\Users\Hyouhyan\Documents\Arduino\libraries\STM32duino_Low_Power\src\STM32LowPower.cpp: In member function 'void STM32LowPower::shutdown(uint32_t)':
d:\Users\Hyouhyan\Documents\Arduino\libraries\STM32duino_Low_Power\src\STM32LowPower.cpp:120:39: error: too many arguments to function 'void LowPower_shutdown()'
  120 |   LowPower_shutdown(rtc.isConfigured());
      |                                       ^
In file included from C:\Users\Hyouhyan\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.1-R00\cores\arduino/board.h:15,
                 from C:\Users\Hyouhyan\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.1-R00\cores\arduino/wiring.h:41,
                 from C:\Users\Hyouhyan\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.1-R00\cores\arduino/Arduino.h:36,
                 from d:\Users\Hyouhyan\Documents\Arduino\libraries\STM32duino_Low_Power\src\STM32LowPower.h:40,
                 from d:\Users\Hyouhyan\Documents\Arduino\libraries\STM32duino_Low_Power\src\STM32LowPower.cpp:37:
C:\Users\Hyouhyan\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.1-R00\cores\arduino/stm32/low_power.h:63:6: note: declared here
   63 | void LowPower_shutdown();
      |      ^~~~~~~~~~~~~~~~~

exit status 1

STM32LowPowerと、Leafonyのボードマネージャーの中にあるLowPower.hが衝突してる。

hyouhyan commented 1 month ago

ボードマネージャーのライブラリ内で定義された箇所を編集したが、下記エラーが発生

c:/users/hyouhyan/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\SrcWrapper\stm32\low_power.c.o: in function `LowPower_init':
low_power.c:(.text.LowPower_init+0x0): multiple definition of `LowPower_init'; C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\STM32duino_Low_Power\low_power.c.o:low_power.c:(.text.LowPower_init+0x0): first defined here
c:/users/hyouhyan/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\SrcWrapper\stm32\low_power.c.o: in function `LowPower_EnableWakeUpPin':
low_power.c:(.text.LowPower_EnableWakeUpPin+0x0): multiple definition of `LowPower_EnableWakeUpPin'; C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\STM32duino_Low_Power\low_power.c.o:low_power.c:(.text.LowPower_EnableWakeUpPin+0x0): first defined here
c:/users/hyouhyan/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\SrcWrapper\stm32\low_power.c.o: in function `LowPower_sleep':
low_power.c:(.text.LowPower_sleep+0x0): multiple definition of `LowPower_sleep'; C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\STM32duino_Low_Power\low_power.c.o:low_power.c:(.text.LowPower_sleep+0x0): first defined here
c:/users/hyouhyan/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\SrcWrapper\stm32\low_power.c.o: in function `LowPower_standby':
low_power.c:(.text.LowPower_standby+0x0): multiple definition of `LowPower_standby'; C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\STM32duino_Low_Power\low_power.c.o:low_power.c:(.text.LowPower_standby+0x0): first defined here
c:/users/hyouhyan/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\SrcWrapper\stm32\low_power.c.o: in function `LowPower_shutdown':
low_power.c:(.text.LowPower_shutdown+0x0): multiple definition of `LowPower_shutdown'; C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\STM32duino_Low_Power\low_power.c.o:low_power.c:(.text.LowPower_shutdown+0x0): first defined here
c:/users/hyouhyan/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\SrcWrapper\stm32\low_power.c.o: in function `LowPower_EnableWakeUpUart':
low_power.c:(.text.LowPower_EnableWakeUpUart+0x0): multiple definition of `LowPower_EnableWakeUpUart'; C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\STM32duino_Low_Power\low_power.c.o:low_power.c:(.text.LowPower_EnableWakeUpUart+0x0): first defined here
c:/users/hyouhyan/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\SrcWrapper\stm32\low_power.c.o: in function `LowPower_stop':
low_power.c:(.text.LowPower_stop+0x0): multiple definition of `LowPower_stop'; C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\STM32duino_Low_Power\low_power.c.o:low_power.c:(.text.LowPower_stop+0x0): first defined here
c:/users/hyouhyan/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\STM32duino_Low_Power\low_power.c.o: in function `SystemClock_ConfigFromStop':
low_power.c:(.text.SystemClock_ConfigFromStop+0x2): undefined reference to `configIPClock'
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

lowpower関連を全部削除するべき?

hyouhyan commented 1 month ago

low_power.c, low_power.cを全削除した

c:/users/hyouhyan/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Hyouhyan\AppData\Local\Temp\arduino\sketches\4E67942EC56764086029F1BDEC48F57B\libraries\STM32duino_Low_Power\low_power.c.o: in function `SystemClock_ConfigFromStop':
low_power.c:(.text.SystemClock_ConfigFromStop+0x2): undefined reference to `configIPClock'
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1
hyouhyan commented 1 month ago

STM32duino lowpowerのバージョンを1.1.1に下げることで解消