Skip to content

STM32G030 with u8g2 library problem #2115

@sunnyguhz

Description

@sunnyguhz

Describe the bug
Hi I have an ST7567 LCD panel that has a 4-pin SPI connection, and I use U8g2 library.

The panel works fine with Arduino(ESP8266 or STM32F103C8T6) under Hardware and Software SPI mode.

It displays okay in Software SPI mode with STM32G030.

#include <U8g2lib.h>
#include <SPI.h>

//U8G2_ST7567_OS12864_1_4W_HW_SPI u8g2(U8G2_R2,  /* cs=*/ PA4, /* dc=*/ PA6, /* reset=*/ PB1);  
U8G2_ST7567_OS12864_1_4W_SW_SPI u8g2(U8G2_R2, /* clock=*/PA1, /* data=*/ PA2, /* cs=*/ PA4, /* dc=*/ PA6, /* reset=*/ PB1); 

void setup(void) {
  u8g2.begin(); 
}

void loop(void) {
  u8g2.firstPage();
  do {
    u8g2.setFont(u8g2_font_ncenB10_tr);
    u8g2.drawStr(0,24,"Hello World!");
  } while ( u8g2.nextPage() );
  delay(1000);
}

But it it just won't show anything in hardware SPI mode.

#include <U8g2lib.h>
#include <SPI.h>

U8G2_ST7567_OS12864_1_4W_HW_SPI u8g2(U8G2_R2,  /* cs=*/ PA4, /* dc=*/ PA6, /* reset=*/ PB1);  
//U8G2_ST7567_OS12864_1_4W_SW_SPI u8g2(U8G2_R2, /* clock=*/PA1, /* data=*/ PA2, /* cs=*/ PA4, /* dc=*/ PA6, /* reset=*/ PB1); 

void setup(void) {
  u8g2.begin(); 
}

void loop(void) {
  u8g2.firstPage();
  do {
    u8g2.setFont(u8g2_font_ncenB10_tr);
    u8g2.drawStr(0,24,"Hello World!");
  } while ( u8g2.nextPage() );
  delay(1000);
}

Desktop (please complete the following information):

  • OS: [ Windows10]
  • Arduino IDE version: [2.2.0]
  • STM32 core version: [2.6.0]
  • Tools menu settings if not the default: [Debug:None, Optimize:Smallest(-Os) with LTO, USB:None, U(S)ART:Disable]
  • Upload method: [SWD]

Board (please complete the following information):

  • Name: [Generic G030C8Tx]
  • Hardware Revision: [I don't know]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions