Spark Logic

4D Displays Picaso Libraries

STM32F103RBT6 LQFP64 Pinout

Hi all,

I’m having some issues using the following libraries to enable my 4D Displays Picaso-based touchscreen LCD displays:
https://github.com/4dsystems/Picaso-Ser … no-Library

I can load the libraries without any issue, but as soon as I try the first command in their example the board keels over. I don’t have a debugger so can’t provide any more info sadly. I’ve highlighted the line below that I have experimentally determined that makes the board keel over, it’s likely this is the case as it is the first call to the library.

I’ve had a look through the library but not sure where to start. Help! :cry:

//Simple Demo that demonstrates 'print' and 'println' new functionality.
#define DisplaySerial Serial
//-------Picaso DISPLAYS-------
#include <Picaso_Const4D.h>
#include <Picaso_Serial_4DLib.h>

//use Serial0 to communicate with the display.
--------->>Picaso_Serial_4DLib Display(&DisplaySerial); <<------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FIRST PROBLEMS START WITH THIS LINE

//---------END-----------------
void setup() {
//For handling errors
Display.Callback4D = mycallback ;
//5 second timeout on all commands
Display.TimeLimit4D   = 5000 ;

DisplaySerial.begin(9600) ;
........
.....
..

Replies17

Sun Jul 01, 2018 1:00 pm

I also found an mbed library here which is reasonably easy to understand. Essentially the library is just a lookup for the various screen hex commands.

https://os.mbed.com/users/Kerpower/code/4DGL/

All help appreciated here…

Sun Jul 01, 2018 1:20 pm

Have you read this: viewtopic.php?f=2&t=3111 ?

Which core?
Which IDE?
Which upload method?

Here you won’t get support for mbed i’m afraid.

Sun Jul 01, 2018 1:33 pm

[Geekshow – Sat Jun 30, 2018 9:28 pm] –
In terms of hardware, I’m using the Olimexino STM32Olimexino STM32Development and computing boards…nt to make sure whether I get it right or not. I have two boards – with STM32F103RB ( Olimexino-STM32 ) and with STM32F407ZG (STM32-E407). For the STM32F1 board I follow these ins…View in hardware catalog boards which are really nice, and based on the MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog (not mini). The board has the original (leaflabs?) bootloader on it, not sure if this is a blocker or not. I tried updating but I can’t find how to pull the BOOT0 line high as it’s not routed anywhere on the board.

The schematic seems to indicate that the pressing the User Button will pull boot0 high.

https://www.olimex.com/Products/Duino/S … -STM32.pdf

“User button with name BUT connected to STM32F103RBT6STM32F103RBT6Microcontrollers and processors…51 from the setup. I tested in loopback mode on the blue pill, and on the Olimexino ( STM32F103RBT6 ) board that I just got. Script works no problem on the that board. waits 5 sec…View in hardware catalog pin 40 (PC9/TIM3_CH4) via
R33 (1kΩ) and pin 60 (BOOT0) – signal BOOT0.”

Mon Jul 02, 2018 8:59 am

[Rick Kimball – Sun Jul 01, 2018 1:33 pm] –
[Geekshow – Sat Jun 30, 2018 9:28 pm] –
In terms of hardware, I’m using the Olimexino STM32Olimexino STM32Development and computing boards…nt to make sure whether I get it right or not. I have two boards – with STM32F103RB ( Olimexino-STM32 ) and with STM32F407ZG (STM32-E407). For the STM32F1 board I follow these ins…View in hardware catalog boards which are really nice, and based on the MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog (not mini). The board has the original (leaflabs?) bootloader on it, not sure if this is a blocker or not. I tried updating but I can’t find how to pull the BOOT0 line high as it’s not routed anywhere on the board.

The schematic seems to indicate that the pressing the User Button will pull boot0 high.

https://www.olimex.com/Products/Duino/S … -STM32.pdf

“User button with name BUT connected to STM32F103RBT6STM32F103RBT6Microcontrollers and processors…51 from the setup. I tested in loopback mode on the blue pill, and on the Olimexino ( STM32F103RBT6 ) board that I just got. Script works no problem on the that board. waits 5 sec…View in hardware catalog pin 40 (PC9/TIM3_CH4) via
R33 (1kΩ) and pin 60 (BOOT0) – signal BOOT0.”

Good spot Rick, I missed that first time round. I’ll give it a go….

Mon Jul 02, 2018 9:13 am

[stevestrong – Sun Jul 01, 2018 1:20 pm] –
Have you read this: viewtopic.php?f=2&t=3111 ?

Quickly opens link and reads….

[stevestrong – Sun Jul 01, 2018 1:20 pm] –
Which core?

Using ‘MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog ’ core on STM32F103RBT6STM32F103RBT6Microcontrollers and processors…51 from the setup. I tested in loopback mode on the blue pill, and on the Olimexino ( STM32F103RBT6 ) board that I just got. Script works no problem on the that board. waits 5 sec…View in hardware catalog (‘MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog Rev3’ board) from recent Arduino_STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog libs found on Github

[stevestrong – Sun Jul 01, 2018 1:20 pm] –
Which IDE?

Arduino v1.8.5 running on Ubuntu linux (Bionic), with Arduino_STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog libs downloaded from Github in June this year.

[stevestrong – Sun Jul 01, 2018 1:20 pm] –
Which upload method?

Using the built-in leaflabs DFU mode to download sketches to the board via on-board USB

Mon Jul 02, 2018 9:31 am

[Geekshow – Mon Jul 02, 2018 9:13 am] –
…with Arduino_STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog libs downloaded from Github.

This is not “libs”, this is the core.

Try to use Serial1, it may happen that Serial (USB serial) is not yet “prepared” at the time you declare the lib instance.

Mon Jul 02, 2018 11:21 am

I’ve been able to flash the bootloader successfully, and I’ve tried the following options:

MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog _rev3_boot20.bin – flashes successfully, however no LED activity on reboot, no USB device presented on PC after reset. Can’t seem to get into DFU mode.

MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog _rev5_boot20.bin – flashes successfully, LED activity on reboot, however no USB device presented on PC. Can’t seem to get into DFU mode.

MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog _mini_boot20.bin – flashes successfully, however no LED activity on reboot, no USB device presented on PC after reset. Can’t seem to get into DFU mode.

MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog _boot.bin (from leaflabs site) – flashes successfully, LED activity on reboot, 1eaf/0003 USB device presented to PC after reset. Can flash sketches and everything works (board ‘MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog rev3’ selected in IDE).

I’m guessing I’m best sticking with the stock MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog _boot.bin then? My board LEDs are connected to PA5/PA1, and USB connected through USB chip to pins 44,45 on the STM32F103STM32F103Microcontrollers and processors…19.html . ag123 Sat Apr 28, 2018 5:54 pm come to think of it blue pill / maple mini ( stm32f103 ) is an *ideal* keyboard controller, the scanning can be done with assistance of sh…View in hardware catalog (USBDM->44/PA11, USBDP->45/PA12)

I’m observing USB activity on linux by looking at output of ‘dmesg’ which will show all USB activity including unrecognised devices.

Thanks for the pointers guys.

Mon Jul 02, 2018 11:49 am

Just keep the working bootloader and the working board selection in IDE.

Mon Jul 02, 2018 1:43 pm

Thanks, will do.

Any tips on where to start with the 4D displays library?

Mon Jul 02, 2018 1:48 pm

[stevestrong – Mon Jul 02, 2018 9:31 am] –
Try to use Serial1, it may happen that Serial (USB serial) is not yet “prepared” at the time you declare the lib instance.

Mon Jul 02, 2018 3:11 pm

[stevestrong – Mon Jul 02, 2018 1:48 pm] –
[stevestrong – Mon Jul 02, 2018 9:31 am] –
Try to use Serial1, it may happen that Serial (USB serial) is not yet “prepared” at the time you declare the lib instance.

Yep, I’ve been using Serial1. Apologies, the code I pasted earlier is from the unmodified example and doesn’t show this. I’ve tried both Serial1 and Serial2, same result, board seems.to die before entering the main loop{}. Removing the highlighted line means the board will boot and run normally.

I’ll have a look for old posts about migrating libraries to understand what I’m looking for. Could be a slow process but hopefully worth doing.

Mon Jul 02, 2018 7:01 pm

I would usually avoid passing Serial pointer at instance declaration time, exactly because of this reasons.

A more robust solution would be to implement a begin() function called in setup which would then pass the Serial pointer to the lib.

Mon Jul 02, 2018 9:52 pm

Made some progress guys, thanks for the tips. :D

The serial port declaration seems to be okay outside the setup{} function, however removing the _virtualPort->flush();

Tue Jul 03, 2018 7:13 am

Any pics/videos how it works?
It would help other members interested in the same topic.

Tue Jul 03, 2018 8:18 am

I think also that an issue could be opened on the library github to fix Serial management.

Edit: Seems not possible as they do not accept issue only Pull request :o :shock:

Tue Jul 03, 2018 8:42 pm

[stevestrong – Tue Jul 03, 2018 7:13 am] –
Any pics/videos how it works?
It would help other members interested in the same topic.

I’ve made a crude video but it should give the idea :)

Post a reply

Optional · up to 10 MiB