Issues porting the Nokia 5110 to support bluepill

The official STMicroelectronics Arduino core
hierophect
Posts: 14
Joined: Tue Mar 12, 2019 10:17 pm

Issues porting the Nokia 5110 to support bluepill

Post by hierophect » Sat Mar 16, 2019 9:00 pm

I'm having trouble with another SPI device, this time the Nokia 5110 as supported by a library from Adafruit.
https://github.com/adafruit/Adafruit-PC ... CD-library

I followed the instructions on a previous thread, and the code compiles cleanly.
https://www.stm32duino.com/viewtopic.php?f=13&t=424

I've attempted to set the clock rate lower, and I can verify that the same code works when using MBED or a regular Arduino board. However, when using this core, the screen will not turn on in any way. I'm wondering whether this is another esoteric SPI-related core change, and it's getting pretty frustrating. Was wondering if others had some experience in getting SPI devices (software and hardware SPI) to work with the bluepill using STM32duino. Am I missing essential steps that didn't used to exist?
OS IDE Core Board
[ ] Windows
[ ] Linux
[x] Mac OS
[x] Arduino 1.8.8
[ ] PlatformIO
[ ] Sloeber
[ ] Roger's
[x] STM
[ ] Else
[x] Blue pill
[x] Custom F103
[ ] Black pill

hierophect
Posts: 14
Joined: Tue Mar 12, 2019 10:17 pm

Re: Issues porting the Nokia 5110 to support bluepill

Post by hierophect » Sat Mar 16, 2019 9:02 pm

Also, I've noticed that the compiler does not flag instances of PROGMEM at all. Should I expect this to cause problems, if I accidentally miss one?
OS IDE Core Board
[ ] Windows
[ ] Linux
[x] Mac OS
[x] Arduino 1.8.8
[ ] PlatformIO
[ ] Sloeber
[ ] Roger's
[x] STM
[ ] Else
[x] Blue pill
[x] Custom F103
[ ] Black pill

hierophect
Posts: 14
Joined: Tue Mar 12, 2019 10:17 pm

Re: Issues porting the Nokia 5110 to support bluepill

Post by hierophect » Sat Mar 16, 2019 9:16 pm

I can also confirm that the recommended ported library also fails:
https://github.com/KenjutsuGH/Adafruit- ... CD-library
OS IDE Core Board
[ ] Windows
[ ] Linux
[x] Mac OS
[x] Arduino 1.8.8
[ ] PlatformIO
[ ] Sloeber
[ ] Roger's
[x] STM
[ ] Else
[x] Blue pill
[x] Custom F103
[ ] Black pill

stevestrong
Posts: 60
Joined: Tue Mar 05, 2019 7:49 am
Location: Munich
OS: Win7 & 10
IDE: Arduino 1.8.8, Sloeber
Core: Libmaple
Board: Bluepill, Generic F4VET6 black & mini
Contact:

Re: Issues porting the Nokia 5110 to support bluepill

Post by stevestrong » Sun Mar 17, 2019 11:03 am

Which "core" do you use?
Without seeing any specific example is hard to guess.

User avatar
Rick Kimball
Posts: 71
Joined: Thu Mar 14, 2019 6:27 pm
Location: Eastern NC, US
OS: Linux
IDE: Arduino 1.8.9, vscode+make, eclipse, vi, emacs
Core: libmaple, STM official, fabooh, none
Board: Bluepill, Nucleos, Discovery
Contact:

Re: Issues porting the Nokia 5110 to support bluepill

Post by Rick Kimball » Sun Mar 17, 2019 4:14 pm

If you are using Roger's core, you might look at Ray Burnette's hackster.io projects. He uses a maple mini most of the time but often uses Nokia 5100 lcd. I would expect the downloadable code associated with those projects to work.
-rick

User avatar
BennehBoy
Posts: 67
Joined: Tue Mar 05, 2019 7:43 pm
Location: Yorkshire
OS: Windows 10
IDE: 1.8.9, Sloeber
Core: Roger's & STM
Board: Blue/Blackpill, MM, HYTiny, Black407Z/VET6, DiyMroe, FK407M1
Contact:

Re: Issues porting the Nokia 5110 to support bluepill

Post by BennehBoy » Sun Mar 17, 2019 5:32 pm

Rick Kimball wrote:
Sun Mar 17, 2019 4:14 pm
If you are using Roger's core, you might look at Ray Burnette's hackster.io projects. He uses a maple mini most of the time but often uses Nokia 5100 lcd. I would expect the downloadable code associated with those projects to work.
Ray normally includes all the libs directly in his projects too, so they should always have everything required.
-Ben

User avatar
Vassilis
Posts: 149
Joined: Wed Feb 27, 2019 5:09 pm
Answers: 2
Location: Thessaloniki, Greece
OS: Linux, Win10, MacOS
IDE: Arduino 1.8.9
Core: Roger, STM official
Board: Bluepill, Maple mini, STM32F4xx
Contact:

Re: Issues porting the Nokia 5110 to support bluepill

Post by Vassilis » Sun Mar 17, 2019 8:17 pm

This setup works ok for me


Library: Adafruit-PCD8544-Nokia-5110-LCD-library

Code: Select all

Adafruit_PCD8544 display = Adafruit_PCD8544(PA6, PA4, PA3); //    D/C, SCE, RST 
LCDSTM32F103
MOSIPA7
SCLKPA5
D/CPA6
SCEPA4
RSTPA3
-Vassilis Serasidis

hierophect
Posts: 14
Joined: Tue Mar 12, 2019 10:17 pm

Re: Issues porting the Nokia 5110 to support bluepill

Post by hierophect » Mon Mar 18, 2019 2:48 pm

I am not using Roger's core, I'm on the new ST one. Perhaps, at this point, I should not be?

Vassalis, are you using Roger's core for your working example? I tried that exact setup as one of my tests, and it failed. I'm hoping to figure out what the differences are between porting Adafruit code to Roger's core vs the ST one, so that I can fix issues like this.
OS IDE Core Board
[ ] Windows
[ ] Linux
[x] Mac OS
[x] Arduino 1.8.8
[ ] PlatformIO
[ ] Sloeber
[ ] Roger's
[x] STM
[ ] Else
[x] Blue pill
[x] Custom F103
[ ] Black pill

User avatar
BennehBoy
Posts: 67
Joined: Tue Mar 05, 2019 7:43 pm
Location: Yorkshire
OS: Windows 10
IDE: 1.8.9, Sloeber
Core: Roger's & STM
Board: Blue/Blackpill, MM, HYTiny, Black407Z/VET6, DiyMroe, FK407M1
Contact:

Re: Issues porting the Nokia 5110 to support bluepill

Post by BennehBoy » Mon Mar 18, 2019 4:08 pm

hierophect wrote:
Mon Mar 18, 2019 2:48 pm
I am not using Roger's core, I'm on the new ST one. Perhaps, at this point, I should not be?

Vassalis, are you using Roger's core for your working example? I tried that exact setup as one of my tests, and it failed. I'm hoping to figure out what the differences are between porting Adafruit code to Roger's core vs the ST one, so that I can fix issues like this.
I've not had any issues yet with adafruit display drivers and the STM core (only with spi bus sharing I hasten to add) - are you sure the default library doesn't work out of the box? Often case you just have to alter the spi divider.
-Ben

hierophect
Posts: 14
Joined: Tue Mar 12, 2019 10:17 pm

Re: Issues porting the Nokia 5110 to support bluepill

Post by hierophect » Mon Mar 18, 2019 4:51 pm

BennehBoy wrote:
Mon Mar 18, 2019 4:08 pm
I've not had any issues yet with adafruit display drivers and the STM core (only with spi bus sharing I hasten to add) - are you sure the default library doesn't work out of the box? Often case you just have to alter the spi divider.
Do you mean you've had issues when attempting to SPI bus share, or that you've taken extra steps regarding SPI bus sharing?

In any case, I am having these issues with the out of box library, both with no changes made, and with modifications made to 1) the SPI clock divider and 2) the incompatible PortReg typedef. I entirely understand the clock division but I'm not so sure what the deal is with PortReg. The code compiles cleanly, but just doesn't do anything in contrast to the same examples working off mbed and arduino.
OS IDE Core Board
[ ] Windows
[ ] Linux
[x] Mac OS
[x] Arduino 1.8.8
[ ] PlatformIO
[ ] Sloeber
[ ] Roger's
[x] STM
[ ] Else
[x] Blue pill
[x] Custom F103
[ ] Black pill

Post Reply