Does anybody know how to make the u8glib libary work with an STM32f103c8t6 board? I would really like to drive my 128×64 OLED display via SPI. It works with an Arduino board, but fails with my STM32f103c8t6 boad (giving compiler errors).
The constructor is the following:
U8GLIB_SH1106_128X64 u8g(PA5, PA7, PA4, PB0, PB1);
The compiler error is as follows:
In file included from /Users/admin/Documents/Arduino/libraries/U8glib/U8glib.h:41:0,
from /Users/admin/Documents/Arduino/ReadAnalogVoltage_test/ReadAnalogVoltage_test.ino:1:
/Users/admin/Documents/Arduino/hardware/Arduino_STM32-master/STM32F1/cores/maple/Print.h:26:37: fatal error: libmaple/libmaple_types.h: No such file or directory
#include <libmaple/libmaple_types.h>
I tried copying libmaple_types.h from another board in the STM32 master file, but that resulted in a host of other errors.
Your help is much appreciated.
Can you turn verbose ON, and provide the complete compiler call to see if and include path “-I” is missing ?
The compiler call is as follows:
/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware “/Applications/Arduino.app/Contents/Java/hardware” -hardware “/Users/admin/Library/Arduino15/packages” -hardware “/Users/admin/Documents/Arduino/hardware” -tools “/Applications/Arduino.app/Contents/Java/tools-builder” -tools “/Applications/Arduino.app/Contents/Java/hardware/tools/avr” -tools “/Users/admin/Library/Arduino15/packages” -built-in-libraries “/Applications/Arduino.app/Contents/Java/libraries” -libraries “/Users/admin/Documents/Arduino/libraries” -fqbn=Arduino_STM32-master:STM32F1:genericSTM32F103C:device_variant=STM32F103C8,upload_method=STLinkMethod -ide-version=10606 -build-path “/var/folders/ln/l00c0q_s43jd160vtw2xjlrr0000gn/T/build6481d8de931d720dbd87fb9550f397a8.tmp” -warnings=all -prefs=build.warn_data_percentage=75 -verbose “/Users/admin/Documents/Arduino/ReadAnalogVoltage_test/ReadAnalogVoltage_test.ino”
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware “/Applications/Arduino.app/Contents/Java/hardware” -hardware “/Users/admin/Library/Arduino15/packages” -hardware “/Users/admin/Documents/Arduino/hardware” -tools “/Applications/Arduino.app/Contents/Java/tools-builder” -tools “/Applications/Arduino.app/Contents/Java/hardware/tools/avr” -tools “/Users/admin/Library/Arduino15/packages” -built-in-libraries “/Applications/Arduino.app/Contents/Java/libraries” -libraries “/Users/admin/Documents/Arduino/libraries” -fqbn=Arduino_STM32-master:STM32F1:genericSTM32F103C:device_variant=STM32F103C8,upload_method=STLinkMethod -ide-version=10606 -build-path “/var/folders/ln/l00c0q_s43jd160vtw2xjlrr0000gn/T/build6481d8de931d720dbd87fb9550f397a8.tmp” -warnings=all -prefs=build.warn_data_percentage=75 -verbose “/Users/admin/Documents/Arduino/ReadAnalogVoltage_test/ReadAnalogVoltage_test.ino”
It looks like and include path “-I” is indeed missing. If this causes the fact that the compiler can’t find libmaple_types.h, how can I set up the compiler call to include and include path “-I” ?
Which version of IDE are you using ?
With 1.6.5, you should get the gcc called like that (in my case under F4) and you can see all the -I paths :
/home/martin/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_discovery_f407 -DVECT_TAB_BASE -DERROR_LED_PORT=GPIOD -DERROR_LED_PIN=14 -mcpu=cortex-m4 -DF_CPU=168000000L -DARDUINO=10605 -DARDUINO_STM32F4_STM32F4STAMP -DARDUINO_ARCH_STM32F4 -DMCU_STM32F406VG -mthumb -DSTM32_HIGH_DENSITY -DSTM32F2 -DSTM32F4 -DBOARD_discovery_f4 -mthumb -D__STM32F4__ -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/cores/maple/libmaple -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/cores/maple/libmaple/usbF4 -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/cores/maple/libmaple/usbF4/STM32_USB_Device_Library/Core/inc -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/cores/maple/libmaple/usbF4/STM32_USB_Device_Library/Class/cdc/inc -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/cores/maple/libmaple/usbF4/STM32_USB_OTG_Driver/inc -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/cores/maple/libmaple/usbF4/VCP -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/cores/maple -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/variants/discovery_f407 -I/home/martin/arduino/arduino-1.6.5/libraries/Time -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/libraries/Wire -I/home/martin/arduino/arduino-1.6.5/libraries/Adafruit-MCP23017 -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/libraries/SPI/src -I/home/martin/arduino/arduino-1.6.5/libraries/SdFat -I/home/martin/arduino/arduino-1.6.5/libraries/SPIFlash -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/libraries/arduino_uip -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/libraries/FreeRTOS821 -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/libraries/OneWireSTM/src -I/home/martin/arduino/arduino-1.6.5/hardware/Arduino_STM32/STM32F4/libraries/RTClock/src /tmp/build5228696498941298136.tmp/MySketch.cpp -o /tmp/build5228696498941298136.tmp/iCondo-MySketch.cpp.o
The forum is not supporting 1.6.6 final.
Ray
Honestly.. I think that even if Arduino.cc stopped distributing older versions, Im sure someone else could host them.
Github now has a website type feature where they allow people to store binaries for releases, so I could also easily do this at the moment on the stm32duino github account.
HW-SPI doesn’t seem to work, but SW-SPI! this is my code (if anyone else is having the same problem):
#include <Arduino.h>
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
U8G2_SSD1306_64X48_ER_2_4W_SW_SPI u8g2(U8G2_R0, PB13, PB15, PB12, PB11 , PB10);
void setup(void) {
u8g2.begin();
}
void loop(void) {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(0,10,"Hellooooo"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
u8g2.clearBuffer(); // clear the internal memory
u8g2.drawStr(0,10,"World"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
}
In file included from C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\system/libmaple/include/libmaple/i2c.h:68:0,
from C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/WireBase.h:45,
from C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\Wire/Wire.h:43,
from D:\MYPC\3003\MYDATA\libraries\U8g2\src\U8x8lib.cpp:45:
C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\system/libmaple/stm32f1/include/series/i2c.h:62:22: warning: unused parameter 'dev' [-Wunused-parameter]
static inline uint32 _i2c_bus_clk(i2c_dev *dev) {
^
D:\MYPC\3003\MYDATA\libraries\U8g2\src\U8x8lib.cpp: In function 'uint8_t u8x8_byte_arduino_hw_i2c(u8x8_t*, uint8_t, uint8_t, void*)':
D:\MYPC\3003\MYDATA\libraries\U8g2\src\U8x8lib.cpp:996:7: error: 'class TwoWire' has no member named 'setClock'
Wire.setClock(400000L);
^
[kvazi – Mon Jul 30, 2018 9:41 am] –
D:\MYPC\3003\MYDATA\libraries\U8g2\src\U8x8lib.cpp:996:7: error: 'class TwoWire' has no member named 'setClock'


