Compiling error with "Wire" library

The official STMicroelectronics Arduino core
Post Reply
User avatar
Sil
Posts: 1
Joined: Mon Apr 15, 2019 11:55 am
OS: Windows, Linux
IDE: Arduino
Core: STM Official
Board: Nucleo L432KC
Contact:

Compiling error with "Wire" library

Post by Sil » Mon Apr 15, 2019 12:14 pm

Dear all,

I am working with the board STM Nucleo L432KC and I have some problems with the library "Wire". Actually I suppose the problem are only in the compiling.
I installed the core for that board as well as the proper library in the proper way (I think, at least...). If I run the specific examples for Wire they compile perfectly and they run perfectly on the board.
Then I used a SHT31 temperature/humidity sensor with the provided library. If I compile and run their examples they work perfectly on my Nucleo 32 board.
Them finally I have my software, where I intergrated all the libraries. If I compile the software I get the following error

Code: Select all

In file included from c:\users\skunkw~1\appdata\local\temp\arduino_build_841577\sketch\base.h:3:0,

                 from c:\users\skunkw~1\appdata\local\temp\arduino_build_841577\sketch\src\fan\fan.h:16,

                 from C:\Users\SKUNKW~1\AppData\Local\Temp\arduino_build_841577\sketch\src\dryer\dryer.h:20,

                 from C:\Users\SKUNKW~1\AppData\Local\Temp\arduino_build_841577\sketch\src\dryer\dryer.cpp:1:

C:\Users\skunkworks2\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0\libraries\Wire\src/Wire.h:54:5: error: 'i2c_t' does not name a type

     i2c_t _i2c;

     ^~~~~

C:\Users\skunkworks2\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0\libraries\Wire\src/Wire.h: In member function 'void TwoWire::setSCL(uint32_t)':

C:\Users\skunkworks2\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0\libraries\Wire\src/Wire.h:71:33: error: '_i2c' was not declared in this scope

     void setSCL(uint32_t scl) { _i2c.scl = digitalPinToPinName(scl); };

                                 ^~~~

C:\Users\skunkworks2\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0\libraries\Wire\src/Wire.h: In member function 'void TwoWire::setSDA(uint32_t)':

C:\Users\skunkworks2\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0\libraries\Wire\src/Wire.h:72:33: error: '_i2c' was not declared in this scope

     void setSDA(uint32_t sda) { _i2c.sda = digitalPinToPinName(sda); };

                                 ^~~~

C:\Users\skunkworks2\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0\libraries\Wire\src/Wire.h: In member function 'void TwoWire::setSCL(PinName)':

C:\Users\skunkworks2\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0\libraries\Wire\src/Wire.h:73:32: error: '_i2c' was not declared in this scope

     void setSCL(PinName scl) { _i2c.scl = scl; };

                                ^~~~

C:\Users\skunkworks2\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0\libraries\Wire\src/Wire.h: In member function 'void TwoWire::setSDA(PinName)':

C:\Users\skunkworks2\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0\libraries\Wire\src/Wire.h:74:32: error: '_i2c' was not declared in this scope

     void setSDA(PinName sda) { _i2c.sda = sda; };

                                ^~~~

Uso la libreria Wire alla versione 1.0 nella cartella: C:\Users\skunkworks2\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.5.0\libraries\Wire 
Uso la libreria arduino-sht-master alla versione 1.1.0 nella cartella: C:\Users\skunkworks2\Documents\Arduino\libraries\arduino-sht-master 
exit status 1
Errore durante la compilazione per la scheda Nucleo-32.
I cannot find out why and what could be a possible solution of my problem.
Attached you can also find a compressed file with inside a txt file containing the whole output of the compiler.
If someone can help me I would be very grateful.

Thanks in advance.

Silvano
Attachments
Error.zip
(3.02 KiB) Downloaded 22 times
Eng. Silvano Bertoldo, PhD

User avatar
MoDu
Posts: 65
Joined: Tue Mar 05, 2019 1:56 pm
Location: Lisbon
OS: Windows
IDE: Visual Studio
Core: Roger's
Board: Maple mini

Re: Compiling error with "Wire" library

Post by MoDu » Wed Apr 17, 2019 10:31 am

'i2c_t' does not name a type
Is this a HAL thing? I've never seen that type, at least not on any Arduino compatible core.

Post Reply