[SOLVED] OLED_I2C example - compile problems

kes
Posts: 3
Joined: Sun Dec 03, 2017 11:50 pm

Re: OLED_I2C example - compile problems

Post by kes » Mon Dec 04, 2017 12:02 am

Hi,

I am running Arduino 1.8.5 on Linux (Linux 4.4.0-101-generic Fri Nov 10 18:31:34 UTC 2017 i686 GNU/Linux).

I also have this problem with compilation for the I2C 0.96" OLED.

The error is:

Code: Select all

/home/kes/arduino_sketchbook_BACKUP_COPY_24.10.2017/2017.12.03_OLED_TEST_ssd1306_128x64_i2c_STM32/2017.12.03_OLED_TEST_ssd1306_128x64_i2c_STM32.ino:25:22: fatal error: Hardwire.h: No such file or directory
 #include <Hardwire.h>
                      ^
compilation terminated.
exit status 1
Error compiling for board Generic STM32F103C series.
I installed the STM_32 files only last week and have just got round to having a go.

I have looked inside this file
/home/kes/Desktop/arduino-1.8.5/hardware/Arduino_STM32/STM32F1/libraries/OLED_I2C/hardware/arm/HW_STM32.h
and it already has
#include "Wire.h"
on the first line and no references to hardwire.h anywhere inside it.

I git cloned libmaple into my libraries folder and that did not help. I have now removed it.

Anyone ideas?

User avatar
RogerClark
Posts: 7538
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: OLED_I2C example - compile problems

Post by RogerClark » Mon Dec 04, 2017 12:34 am

Have you tried getting the latest version

I fixed a one issue with this yesterday after it was reported to me.

kes
Posts: 3
Joined: Sun Dec 03, 2017 11:50 pm

Re: OLED_I2C example - compile problems

Post by kes » Mon Dec 04, 2017 12:51 am

Hi Roger,

Downloading the latest version of the STM_32 software fixed this.

The 0.96" OLED display now working just fine.

Thanks very much

openitx
Posts: 1
Joined: Fri Aug 18, 2017 6:54 am

Re: [SOLVED] OLED_I2C example - compile problems

Post by openitx » Wed Dec 06, 2017 3:30 am

Downloading the latest version of the STM_32 software, i2c OLED_I2C work, but Serial not, and, lib https://github.com/DFRobot/DFRobot_QMC5883
work in Arduino_STM32-R20170323 not work in latest version of the STM_32 software on github

User avatar
mrburnette
Posts: 2013
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: OLED_I2C example - compile problems

Post by mrburnette » Wed Dec 06, 2017 1:59 pm

be80be wrote:
Wed Sep 27, 2017 3:13 pm
Not much to say I just like to program. I use picchips more but the stm32 looked fun I had it working till I updated arduino to the new ide
Project is lighting . I'm a electrician
I'm more of a hardware guy. And a hacker lol
I can read code better then write it lol .
You will learn quickly that Arduino IDE updates are vicious and will bite off an extremity quickly. Many a Mr. programmer now uses Ms.

You can install multiple versions of Arduino. I recommend you install a new version separate (do not attempt an upgrade) and run a few tests - everyone should identify a few programs to use as a "test suite" for sanity testing. If all goes well, ZIP or TAR your old Arduino system files and delete same. Always work with a safety net ... the ZIP/TAR is your friend.

Ray

zmemw16
Posts: 1578
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: [SOLVED] OLED_I2C example - compile problems

Post by zmemw16 » Wed Dec 06, 2017 2:21 pm

make sure you grab the hidden dot arduino15 directory as well.

on linux, it's an edit 2 files and compile to customize or versionize that hidden directory name
e.g. arduino1.8.5
stephen

democles9308
Posts: 12
Joined: Fri Oct 13, 2017 6:57 pm

Re: [SOLVED] OLED_I2C example - compile problems

Post by democles9308 » Sun Dec 31, 2017 2:55 pm

Hi all,

I'm trying to compile the OLED_2IC_scrolling text example using a bluepill with the STM32F1/2017.12.19 files.
I've got the following compile error: opt/sloeber/arduinoPlugin/packages/stm32duino/hardware/STM32F1/2017.12.29/libraries/OLED_I2C/hardware/arm/HW_STM32.h:23:7: error: 'HWIRE' was not declared in this scope
This has to do with line2 where the HWIRE.write is defined by #define WIRE_WRITE HWRITE.write.

Did I miss something here ? Many thanks ! Happy 2018 to you all.

User avatar
mrburnette
Posts: 2013
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: [SOLVED] OLED_I2C example - compile problems

Post by mrburnette » Sun Dec 31, 2017 3:09 pm

democles9308 wrote:
Sun Dec 31, 2017 2:55 pm
...
I've got the following compile error: opt/sloeber/arduinoPlugin/packages/stm32duino/hardware/STM32F1/2017.12.29/libraries/OLED_I2C/hardware/arm/HW_STM32.h:23:7: error: 'HWIRE' was not declared in this scope
This has to do with line2 where the HWIRE.write is defined by #define WIRE_WRITE HWRITE.write.
...
Maybe refer to this post viewtopic.php?t=2571 to determine if it is relevant. You may be a victim of recent core changes.

Ray

democles9308
Posts: 12
Joined: Fri Oct 13, 2017 6:57 pm

Re: [SOLVED] OLED_I2C example - compile problems

Post by democles9308 » Sun Dec 31, 2017 6:16 pm

Hi Ray,
Not sure as this was already mentioned in previous answers... The last version includes wire.h... I will try by commenting out the #define HWIRE.write and replace all the hwire.write by wire.write.. A job for next year :D
Happy 2018
D

democles9308
Posts: 12
Joined: Fri Oct 13, 2017 6:57 pm

Re: [SOLVED] OLED_I2C example - compile problems

Post by democles9308 » Tue Jan 02, 2018 1:51 pm

Hello Ray (and others)

I did the modifications and replaced all HWIRE.write by WIRE.write and then code compiled.... but the size of the program was too big. To solve this, I found the answer on the forum... ;) : in the file HW_STM32.h I had to modify a declaration of static byte aa=scrbuf; to a non-static in the OLED::update() function line 112. Doing this the code compiled with acceptable size and I could upload it to my BP.
Thanks for your hint!
Last edited by democles9308 on Tue Jan 02, 2018 5:37 pm, edited 2 times in total.

Post Reply