STM32L4 Core

Cores are the underlying magic that make the Arduino API possible
User avatar
GrumpyOldPizza
Posts: 184
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Thu Nov 24, 2016 12:36 pm

RogerClark wrote:Did you just unzip all the files directly into the hardware folder. If so you need to make a folder called STM32L4 and move the files into that folder then restart your IDE. (as the IDE supports multiple third party cores and each needs to be in their own folder under the hardware folder)
Create a ~/Arduino/hardware/grumpyoldpizza/STM32L4 and put all the files from github in there. Also install the SAMD core to pull in the compiler and such.

There is an official json file where all of this is automated, but because we are in the middle of adding 2 new cpus, so the code is in flux.

User avatar
GrumpyOldPizza
Posts: 184
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Wed Dec 21, 2016 3:37 pm

GrumpyOldPizza wrote:
RogerClark wrote:Did you just unzip all the files directly into the hardware folder. If so you need to make a folder called STM32L4 and move the files into that folder then restart your IDE. (as the IDE supports multiple third party cores and each needs to be in their own folder under the hardware folder)
Create a ~/Arduino/hardware/grumpyoldpizza/STM32L4 and put all the files from github in there. Also install the SAMD core to pull in the compiler and such.

There is an official json file where all of this is automated, but because we are in the middle of adding 2 new cpus, so the code is in flux.
Haven't updated that here in a while. There is now a kickstarters for a pair of L432 and L433 boards (https://www.kickstarter.com/projects/21 ... ent-boards). They are nicely supported in via the code on github (https://github.com/GrumpyOldPizza/arduino-STM32L4), but there are some features/details still missing that I'd like to add before updating the installable image (via json file).

New is some experimental power management code:

Code: Select all

    uint32_t STM32.resetCause();
    uint32_t STM32.wakeupReason();

    void  STM32.sleep();
    bool  STM32.stop(uint32_t timeout = 0);
    void  STM32.standby(uint32_t timeout = 0);
    void  STM32.standby(uint32_t pin, uint32_t mode, uint32_t timeout = 0);
    void  STM32.shutdown(uint32_t timeout = 0);
    void  STM32.shutdown(uint32_t pin, uint32_t mode, uint32_t timeout = 0);
    void  STM32.reset();
Experimental because not all the internal locks have been added to avoid entering for example "STOP" mode, while an active peripheral still was ... well, active. But nice to play with.

A new keyword has been added "retained". If you add that to a variable declaration, then it will be treated like a normal initialized data element (".data" section). Except if you return from "STANDBY" mode. In that case it will keep the value it had before entering "STANDBY" mode. So kind of battery backed RAM. L476 has 32k, L432/L433 have 16k of that.

There is now also a "I2S" class, API wise same as has been added to Arduino Zero for their MKRZERO product lately. Figured it would be a waste pusblishing an API that does the same, but is different. N.b there is also a ArduinoSound library (https://www.arduino.cc/en/Reference/ArduinoSound) that is layered ontop of this I2S class. Hence lots of bits to play with, although the current code is the first pass, so expect some bugs.

User avatar
GrumpyOldPizza
Posts: 184
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Sat Jan 14, 2017 5:20 am

Quick update. Added SDCARD support via SDIO and SPI for Ladybug/Butterfly/Dragonfly.

Also for NUCLEO-L476RG SDIO is exposed on the PC8/PC9/PC10/PC11/PC12/PD2 pins, and SDCARD via SPI on PC10/PC11/PC12/PD2.

The code will work with most breakout boards that have no pullups on CS/DAT3. SDIO is a tad fiddely, as cabling can have an adverse effect.

SPI gets around 2.3MB/sec, SDIO with default speed (read 24MHz) is at roughly 11MB/sec, and SDIO with high speed (read 48MHz) get about 22MB/sec. Write rates differ from card to card though. A class 10 card will not get more than 10MB/sec ...

USB support is now configurable, so that either CDC or CDC+MSC (or none) can be selected.

- Thomas

jucelyn
Posts: 1
Joined: Tue Jan 17, 2017 12:45 pm

Re: STM32L4 Core

Post by jucelyn » Tue Jan 17, 2017 1:08 pm

Hi I'm new to stm32duino

First, thanks for yours jobs, It makes the stm32 comes in Arduino world!

here is the problem that i face:

Serial.print() is working well but Serial.read() did not return any response while i send out data

anyone can help pls, sorry for the stupid question

Guidoted
Posts: 4
Joined: Tue Jan 17, 2017 11:01 pm

Re: STM32L4 Core

Post by Guidoted » Tue Jan 17, 2017 11:07 pm

Sorry but I can't find the json file to install the package.
Could you, please, give the correct path to be added on Arduino Preferences?
Thanks a lot and ciao from Italy

User avatar
GrumpyOldPizza
Posts: 184
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Wed Jan 18, 2017 10:26 pm

Guidoted wrote:Sorry but I can't find the json file to install the package.
Could you, please, give the correct path to be added on Arduino Preferences?
Thanks a lot and ciao from Italy
Sorry for the delay. Got to clean up a few things for Ladybug/Butterfly and then there will be a new *.json file. Sorry for the inconveniance.

If you'd like you can simply download the github and install that directly.

Guidoted
Posts: 4
Joined: Tue Jan 17, 2017 11:01 pm

Re: STM32L4 Core

Post by Guidoted » Wed Jan 18, 2017 11:42 pm

Thanks for the quick answer!
I've tried manual installation but no luck... (Arduino 1.8.0 on W10-64)
Best regards
Guido

User avatar
GrumpyOldPizza
Posts: 184
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Thu Jan 19, 2017 12:22 am

Guidoted wrote:Thanks for the quick answer!
I've tried manual installation but no luck... (Arduino 1.8.0 on W10-64)
Best regards
Guido
What was the problem ? Normally using the json file is simpler, but does the very same thing.

Guidoted
Posts: 4
Joined: Tue Jan 17, 2017 11:01 pm

Re: STM32L4 Core

Post by Guidoted » Sat Jan 21, 2017 1:06 am

I extracted your files into C:\Users\Guido\AppData\Local\Arduino15\packages (where other packages like ESP8266, ATTinyCore, etc. reside), but no STM32L4 boards are shown on Arduino menu...
In which folder I have to extract your files?
Thanks
Guido

User avatar
GrumpyOldPizza
Posts: 184
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Sat Jan 21, 2017 4:20 pm

GrumpyOldPizza wrote:
Guidoted wrote:Thanks for the quick answer!
I've tried manual installation but no luck... (Arduino 1.8.0 on W10-64)
Best regards
Guido
What was the problem ? Normally using the json file is simpler, but does the very same thing.
Sorry for the delay. Here the path to the json file.

https://grumpyoldpizza.github.io/arduin ... index.json

- Thomas

Post Reply