I am really trying to get my I2C display to work, I originally posted about using u8glib but I cannot get it to work, so I thought just to get it running I would use the two libraries that come with the STMduino cores, the OLED_I2C and adafruits lib. Whats strange is both of these compile using the examples but don’t actually run, by that I mean I have added serial statements through out and they are never seen.
Arduino IDE: 1.6.9
STM32F1 Series – ‘blue pill’
the changed example code:
#include <OLED_I2C.h>
OLED myOLED(SDA, SCL, 8);
extern uint8_t SmallFont[];
void setup()
{
myOLED.begin();
myOLED.setFont(SmallFont);
//randomSeed(analogRead(0));
Serial.begin(9600);
delay(5000);
Serial.println("STARTING!");
}
void loop()
{
int y = random(0, 56);
for (int i=128; i>=-(34*6); i--)
{
myOLED.print("OLED_I2C Scrolling Text Demo ", i, y);
myOLED.update();
Serial.println("In Loop");
delay(50);
}
}
Then be sure that you are not using the F() macro to print text.
Furthermore, be sure that you are connecting the serial monitor to the correct port, after the serial re-enumeration on the PC took place.
To wait till serial is available I would recommend the following code:
while ( !Serial.isConnected() ) ;Thanks for your reply, Serial.isConnected would not compile, and moving Serial.begin(9600) before oled.begin() hasn’t helped, I am definitely on the correct port as if a run a sample sketch with just Serial prints it works fine. This is such a strange problem nothing like anything I’ve seen before and its infuriating ![]()
It works if I write the specific constuctor:
//OLED myOLED(SDA, SCL, 8);
OLED myOLED(14, 15, 8); //Hardware I2C pin header on the Nucleo
Which core are you using , LibMaple or the new STM core.
In Libmaple, the default Wire library (bit banged soft Wire)
#define SDA PB7
#define SCL PB6
If there is an “official” STM build, it seems wise to use that rather than the legacy libmaple.
In fact, the F103 I2C works fine if you use a specific <HardWire.h> constructor and tell it to use the Alternate pins. e.g.
#if defined(ARDUINO_STM_NUCLEO_F103RB)
#include <HardWire.h>
HardWire HWire(1, I2C_REMAP | I2C_FAST_MODE); // I2c1
#define Wire HWire
#else
#include <Wire.h>
#endif
I don’t know how many Nucleo F103 boards are in circulation but only about 5% of the forum members seem to use that board.
The majority use the “Blue Pill” or other generic (no brand) STM32F103 boards, so the LibMaple will not be changed it causes any problems to the 95% of users who don’t use the Nucleo
See https://github.com/stm32duino/BoardManagerFiles for the JSON installer for the official release for Nucleo F103RB and Nucleo L476
Upload type: Serial
Arduino SAM 32 bit board definitions installed, tried on 1.6.9 and 1.6.5
Arduino: 1.6.9 (Windows 10), Board: "Generic STM32F103C series, STM32F103CB (20k RAM. 128k Flash), Serial"
C:\Users\mabez\Downloads\arduino-1.6.9-windows\arduino-1.6.9\arduino-builder -dump-prefs -logger=machine -hardware "C:\Users\mabez\Downloads\arduino-1.6.9-windows\arduino-1.6.9\hardware" -hardware "C:\Users\mabez\AppData\Local\Arduino15\packages" -hardware "C:\Users\mabez\Documents\Arduino\hardware" -tools "C:\Users\mabez\Downloads\arduino-1.6.9-windows\arduino-1.6.9\tools-builder" -tools "C:\Users\mabez\AppData\Local\Arduino15\packages" -built-in-libraries "C:\Users\mabez\Downloads\arduino-1.6.9-windows\arduino-1.6.9\libraries" -libraries "C:\Users\mabez\Documents\Arduino\libraries" -fqbn=Arduino_STM32:STM32F1:genericSTM32F103C:device_variant=STM32F103CB,upload_method=serialMethod -ide-version=10609 -build-path "C:\Users\mabez\AppData\Local\Temp\build1bba08f324dcc027ee3a42cdd38bb0cf.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Users\mabez\AppData\Local\Temp\arduino_modified_sketch_80355\OLED_I2C_Scrolling_Text.ino"
C:\Users\mabez\Downloads\arduino-1.6.9-windows\arduino-1.6.9\arduino-builder -compile -logger=machine -hardware "C:\Users\mabez\Downloads\arduino-1.6.9-windows\arduino-1.6.9\hardware" -hardware "C:\Users\mabez\AppData\Local\Arduino15\packages" -hardware "C:\Users\mabez\Documents\Arduino\hardware" -tools "C:\Users\mabez\Downloads\arduino-1.6.9-windows\arduino-1.6.9\tools-builder" -tools "C:\Users\mabez\AppData\Local\Arduino15\packages" -built-in-libraries "C:\Users\mabez\Downloads\arduino-1.6.9-windows\arduino-1.6.9\libraries" -libraries "C:\Users\mabez\Documents\Arduino\libraries" -fqbn=Arduino_STM32:STM32F1:genericSTM32F103C:device_variant=STM32F103CB,upload_method=serialMethod -ide-version=10609 -build-path "C:\Users\mabez\AppData\Local\Temp\build1bba08f324dcc027ee3a42cdd38bb0cf.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Users\mabez\AppData\Local\Temp\arduino_modified_sketch_80355\OLED_I2C_Scrolling_Text.ino"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "C:\Users\mabez\AppData\Local\Temp\build1bba08f324dcc027ee3a42cdd38bb0cf.tmp\sketch\OLED_I2C_Scrolling_Text.ino.cpp" -o "nul"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C" "C:\Users\mabez\AppData\Local\Temp\build1bba08f324dcc027ee3a42cdd38bb0cf.tmp\sketch\OLED_I2C_Scrolling_Text.ino.cpp" -o "nul"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C" "C:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C\DefaultFonts.c" -o "nul"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C" "C:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C\OLED_I2C.cpp" -o "nul"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire" "C:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C\OLED_I2C.cpp" -o "nul"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire" "C:\Users\mabez\AppData\Local\Temp\build1bba08f324dcc027ee3a42cdd38bb0cf.tmp\sketch\OLED_I2C_Scrolling_Text.ino.cpp" -o "nul"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire" "C:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire\HardWire.cpp" -o "nul"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire" "C:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire\Wire.cpp" -o "nul"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire" "C:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire\WireBase.cpp" -o "nul"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire" "C:\Users\mabez\AppData\Local\Temp\build1bba08f324dcc027ee3a42cdd38bb0cf.tmp\sketch\OLED_I2C_Scrolling_Text.ino.cpp" -o "C:\Users\mabez\AppData\Local\Temp\build1bba08f324dcc027ee3a42cdd38bb0cf.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Users\mabez\Downloads\arduino-1.6.9-windows\arduino-1.6.9\tools-builder\ctags\5.8-arduino10/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\mabez\AppData\Local\Temp\build1bba08f324dcc027ee3a42cdd38bb0cf.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Users\mabez\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10609 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -mthumb -march=armv7-m -D__STM32F1__ "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/stm32f1/include" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/stm32f1" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/usb/usb_lib" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C" "-IC:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire" "C:\Users\mabez\AppData\Local\Temp\build1bba08f324dcc027ee3a42cdd38bb0cf.tmp\sketch\OLED_I2C_Scrolling_Text.ino.cpp" -o "C:\Users\mabez\AppData\Local\Temp\build1bba08f324dcc027ee3a42cdd38bb0cf.tmp\sketch\OLED_I2C_Scrolling_Text.ino.cpp.o"
C:\Users\mabez\AppData\Local\Temp\arduino_modified_sketch_80355\OLED_I2C_Scrolling_Text.ino: In function 'void setup()':
OLED_I2C_Scrolling_Text:49: error: 'class HardwareSerial' has no member named 'isConnected'
while(!Serial.isConnected());
^
Using library OLED_I2C in folder: C:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\OLED_I2C (legacy)
Using library Wire in folder: C:\Users\mabez\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire (legacy)
exit status 1
'class HardwareSerial' has no member named 'isConnected'
There is no way for the hardware serial pins on the device to know if they are connected to anything.
isConnected only applies to Serial USB, and either way this has nothing to do with the OLED lib as it doesnt use isConnected in any of its examples as far as I can tell
Why is that?
David.
But it looks like the compiler does not have the option “-DSERIAL_USB”, as usual. That’s why it seems that the USB serial is not defined at all.
These are the compiler options at compile time in my case (maple mini):
\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -DDEBUG_LEVEL=DEBUG_NONE -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_maple_mini -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1 -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10612 -DARDUINO_MAPLE_MINI -DARDUINO_ARCH_STM32F1 -DMCU_STM32F103CB -DSERIAL_USB -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103CB -DSERIAL_USB -mthumb -march=armv7-m -D__STM32F1__However, the compiler gets this option from other place, too. Where from?
-DMCU_STM32F103CB -DSERIAL_USB
For the F103C generic there is no such an option.
But I would like to know where else is the compiler option “-DSERIAL_USB” defined?
For the F103C generic there is no such an option.
But I would like to know where else is the compiler option “-DSERIAL_USB” defined?
So, once again, I would like to know why.
EDIT
The serial USB is compiled only if the USB serial (DFU) upload method is chosen in the Arduino menu, according to this link.
So, I think that if one need the serial USB independent from the upload method, then he should change the boards.txt file and add the extra options “build.cpu_flags=-DMCU_STM32F103CB -DSERIAL_USB”.
So, once again, I would like to know why.
EDIT
The serial USB is compiled only if the USB serial (DFU) upload method is chosen in the Arduino menu, according to this link.
Funny, a search for “-DSERIAL_USB” in the guthub repo would not reveal these positions as result.
So now back to the original problem, how can this happen and what is the solution? Is it because of older Arduino version (1.6.9)?
So, once again, I would like to know why.
EDIT
The serial USB is compiled only if the USB serial (DFU) upload method is chosen in the Arduino menu, according to this link.
Instead of F103CB for blue pill you need F103C8, in which case you can still select the 128k version from Arduino menu (the C8 chips have actually 128k flash
Anyway, the serial USB should be defined in this case too.
If it is still not working, try to add to the end of this line : -DSERIAL_USB, and compile again.
I have tried both, neither make a difference
. I added the -DSERIAL_USB line and it now compiles with the Serial.isConnected() but still no output on the serial monitor :/
This is only useful if you use an extra USB to serial converter board and upload over serial 1. This method is rather appropriate for uploading the bootloader only, but not for normal sw development.
I think you should use the “STM32duino bootloader” method in the Arduino menu.
I can’t believe I missed this! Spent this afternoon flashing the bootloader and now the Adafruit library is working! OLED_I2C still doesn’t but I’m not too bothered by that. Thank you very much for your help!
Mabez
So software bitbang works .
Will see way dont hardwire dont will work.
Any one thats have it working on 1.8 anduino stm
Jonas
HWire LIb does not work! refer to my post here
http://www.stm32duino.com/viewtopic.php?f=9&t=1850
However, I am currently driving 8 SSD_1306 libraries via hardware SPI on a Maple Mini without issue.
I am _not_ using the ported Adafruit library supplied with the core. I use the standard Adafruit library.

