Arduino Forum

Using Arduino => Microcontrollers => Topic started by: Sunspot on Mar 24, 2015, 10:55 am

Title: STM32 "for the rest of us"
Post by: Sunspot on Mar 24, 2015, 10:55 am
If like me you are a user rather than developer you might want to play with the cheap and powerful ARM boards using the STM32F103C8T6 but use the Arduino IDE

But you may not be keen to bother the developers in the other thread (http://forum.arduino.cc/index.php?topic=265904.0;nowap) in case that slows down progress.

I want to find a board that is 32bit and small enough to embed in small portable projects (the Due is too big) - there are at least two on eBay that cost less than £4

I use a Mac and have put up a draft web page to record my early progress. Blink works!

All users who mainly code C by "Google - - copy - - paste and pray" are welcome to add comments here

see  here (http://www.sunspot.co.uk/Projects/Arduino/STM32/STM32.html)
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Mar 24, 2015, 01:45 pm
Quote
But you may not be keen to bother the developers in the other thread in case that slows down progress.
In support of those wanting to get their feet wet, I have personally verified that all of my examples run on the Arduino 1.6.0 and 1.6.1 and 1.6.2 (nightly build as of 22 March.)

STM 32 Maple Mini examples (https://github.com/rogerclarkmelbourne/Arduino_STM32/tree/master/examples/MrBrunetteExamples)

Please note, as we are tweaking compiler options, the numbers you see in the heading of these examples will not match what you get - for example:
Code: [Select]
 Maple Mini port m. ray burnette: Compiled under Arduino 1.6.0rc1
    Sketch uses 13,420 bytes (12%) of program storage space. Maximum is 108,000 bytes.
    Global variables use 2,600 bytes of dynamic memory.


The above will differ on your system.

I am using Windows 8.1 64-bit and Arduino 1.6.1/2.  I have my Windows 8.1 in "test mode" so that I can utilize the unsigned drivers.  As you are utilizing a Mac, just about everything I know about the Windows environment will be useless.


The tested board is this one: STM32 32-bit Maple Mini clone (http://www.aliexpress.com/item/leaflabs-Leaf-maple-mini-ARM-STM32-compatibility/1400667476.html)  I have over 10 boards from different vendors all stenciled with "Baite" and what I have found is that the Baite board is a 2 layer design where the original Leaflabs board was a 4 layer board.  This will mess with your ADC low order bit(s) due to noise.  However, for the average user, 2^10 vs 2^12 should have little issue between AVR and STM.  Just anticipate a more noisy ADC.  Additionally, the $4 from Chinese dealers seem to be a manual rework of the Baite board... that is, one can see manual reflow efforts on the uC by a soldering iron.  My guess is Baite off-loads those boards to other sellers who correct issues in the initial reflow oven process.  However, I have both $4 and $6 boards and other than the rosin on the reworked board, they both function the same.

I also have a few Maple Mini clone projects on my project page (http://www.hackster.io/rayburne).


Here is the caveat:  The STM32 Maple core is experimental.  There is little to no support for issues you may encounter.  While I have received boards from eBay and AliExpress, you should realize that you are dealing with off-shore vendors and hosting companies with varied policies.  If you choose to play, remember that play is the objective.  If you download and install the ZIP for the Maple core, please keep a copy of the ZIP so that if future core work messes up your code, you can revert back to a core that is working until the new core is validated.  Let me repeat, the github source is constantly changing ... sometimes multiple times per day which is especially true over a weekend.

Few libraries from AVR will work as-is with the STM32 board.  The effort to "fix" these libraries is akin to what Paul does for gaining compatibility with the Teensy3.x boards or what Arduino does with the Due.  As libraries are converted and tested, we put them into the ZIP.  As an example, we have the Adafruit_GFX and Adafruit_ILI9341 libraries converted and tested---> that is, they run the Adafruit test sketch.  Nothing is exhaustively tested!

Because you must often modify libraries, in my STM32 sketch directory, I am building projects that have all of the supporting modified libraries (those not in \documents\Arduino\libraries) in the sketch directory.  This approach fully insulates the modified libraries from other sketches for my 8-bit AVR programs.  If you take this approach, then you will need to modify your #include statements from #include <library.h> to the format #include ".\library.h" in all locations where the library is specified: that is, the main sketch and any tabs and in many of the .cpp files.
Example:
Code: [Select]
#include ".\BMP085.h"                                // #include "I2Cdev.h" is pulled in also
#include ".\Adafruit_GPS.h"
#include ".\Adafruit_GFX.h"
#include ".\Adafruit_ILI9341.h"
#include ".\SoftwareSerial.h"                        // faux version only for STM32 Maple
#include ".\Utilities.h"


You may also find lots of rich support in the on-line material from the original developers, Leaflabs. (http://www.leaflabs.com/about-maple/)

Good luck and have a fun play.  Thanks for helping the STM32 team "shake-down" the core... Exhaustive testing has not been done and the only way to get great feedback is to open the door for others.


Ray
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Mar 24, 2015, 02:26 pm
Many thanks for that.

Indeed this is play. Used as a charm to fend off alzheimer's in my case (I hate Sudoku as recommended . . . )



 :-[  I should have said -

All users who mainly code C by "Google - - copy - - paste and pray"   

- and Ray
- and other kind code gods

- are welcome to add comments here
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Mar 25, 2015, 01:23 pm
So as not to mess up my Arduino setup on my Mac I am experimenting with Windows XP in a Parallels Desktop window on the Mac. You can keep images of the XP setup for easy backup.
This will just be used for STM32 sketches

Delete all traces of old Arduino in the XP image.
Downloaded and install Arduino 1.6.1 for Windows
Downloaded the ZIP of the STM32 files found bottom right on this page (https://github.com/rogerclarkmelbourne/Arduino_STM32http://)

Open My Documents . . . right click New - Folder . . . name the folder Arduino

Then insert a hardware folder with the ZIP contents  . . . . Arduino\hardware\Arduino_STM32
(remove Master in the ZIP name)

IMPORTANT
Start Arduino - go to File - Preferences and change the Sketchbook location folder to
\\psf\Home\Documents\Arduino (as used by Parallels Desktop)

Under Tools - Board all the new STM32 boards are listed

The contributed sketches are in File - Sketchbook - hardware - Arduino_STM32

On my board BOARD_LED_PIN must be changed to PC13

To import libraries select as needed from the STM32F1 subfolder
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Mar 25, 2015, 03:30 pm
Quote
So as not to mess up my Arduino setup on my Mac I am experimenting with Windows XP in a Parallels Desktop window on the Mac.
I noticed that you have a Maple Mini on order.  Would the Parallels setup manage the serial port DTR line the same as under native Windows - that is, do you anticipate that the Mini will honor the DTR, create a reset, and enter DFU mode automatically?  That would be pretty cool.

On my Windows 8.1 machine, the auto-reset signal works most of the time.  When it fails, it is because I am hung-up, or an ASSERT_FAULT has executed!


Ray
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Mar 25, 2015, 06:28 pm
Parallels (and VMWare) grab the USB serial devices from the Mac (the Mac can't use them at the same time) and in normal use the Mac certainly sets up a complete FTDI rs232 on my Chinese USB to RS232 adapter.

Sorry not sure yet what "honor the DTR, create a reset, and enter DFU mode " means   
(device firmware update?)   
but the FTDI chips work fine linked via TTL to my tiny Arduino pro minis - I think DTR tells those to run after a download so I guess that must be a reset?

I guess the free VMWare player might allow you to run XP within Windows 8 - but not sure if the driver signing would stay with you if VMWare simply uses the host drivers.


I was hoping to program the Maple Mini via the UART like I am doing now and so avoid the driver complication.
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Mar 26, 2015, 01:54 am
Quote
but the FTDI chips work fine linked via TTL to my tiny Arduino pro minis - I think DTR tells those to run after a download so I guess that must be a reset?
It is my guess that the Maple Mini (Baite version) will work correctly.  The reset mechanism just uses the DTR pluse and a capacitor to pulse reset and the bootloader enters DFU.  Simple, but generally effective.

Ray
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Mar 27, 2015, 12:26 pm

I was wrong about Windows use of Macdrivers.
My Parallels Win XP asked to load a driver when it saw my Chinese USB to serial. It found one and was happy and serial port 3 appeared in Win Arduino. But it will not yet talk to the board  - new errors after compile to sort out.
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Mar 27, 2015, 12:42 pm
Quote
My Parallels Win XP asked to load a driver when it saw my Chinese USB to serial.
This is the behavior I would have expected due to virtual abstraction.

Ray
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Mar 28, 2015, 05:56 pm
128x64 mono-OLED on the ARM Maple Mini (http://www.hackster.io/rayburne/oled-on-the-cheap)


And: my post here (http://forum.arduino.cc/index.php?topic=265904.msg2162084#msg2162084)
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Mar 30, 2015, 01:26 am
FYI to anyone using any of my Maple Mini examples: (http://www.hackster.io/rayburne)

Most standard libraries used for Arduino will not work unmodified on the STM32 platform. Therefore, rather than modifying them and renaming and adding them to the libraries in the user Arduino\libraries path, I simply keep the edited libraries in my sketch folder.

Therefore, depending on your OS you may need to change some things in my code!

Are you on Windows, Win7 or higher? 
#include can be written as
#include "./filename.h" OR #include ".\filename.h" but under Linux/iOS you most likely can use only "./filename.h"

Anyway - if you have issues with my syntax, just remove the dot-slash and specify the filename as
#include "filename.h"
and see If that works for you.  I can assure you that all of my examples compile, if they do not for you, the mostly fix is to double-check simple configuration;


I will try to check here once per day... but no promises. Everything to do with STM32 is sub-beta, consider it alpha.

Ray



Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Mar 30, 2015, 09:31 pm
For Mac users I can confirm that Ray's GLCD5110_BMP085 runs - after a few tweaks.
Some notes here (http://www.sunspot.co.uk/Projects/Arduino/STM32/generic_yellow.html)


As Ray says, all modified supporting files can be stored in the same folder as the main .ino and so you can keep old Arduino files in the libraries folder and not have the STM32 files mess up the Arduino IDE.
Very convenient.

#include "filename.h" worked on the Mac

Hey Arduino users! order that fast STM32 ARM board and come and play here!
Then consider this page (http://arduino.cc/en/Main/Donate) since we are supporting China and not Italy

Read this thread (http://forum.arduino.cc/index.php?topic=265904.0;nowap)
but comment here, not there,  if your C skills are like mine.....
Title: Re: STM32 "for the rest of us"
Post by: bigplik on Mar 31, 2015, 02:48 pm
128x64 mono-OLED on the ARM Maple Mini (http://www.hackster.io/rayburne/oled-on-the-cheap)


And: my post here (http://forum.arduino.cc/index.php?topic=265904.msg2162084#msg2162084)
any chance you would make some code for I2C for OLED displays?
I'll tried your SPI example and it is working very well ;), error was because of linux,
would like to use bigger display like 1.3" or 2"+ OLED for my maple mini
all of the I have are I2C unfortunately
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Mar 31, 2015, 06:52 pm
any chance you would make some code for I2C for OLED displays?
I'll tried your SPI example and it is working very well ;), error was because of linux,
would like to use bigger display like 1.3" or 2"+ OLED for my maple mini
all of the I have are I2C unfortunately
To some degree, we have:
I2C example (http://forum.arduino.cc/index.php?topic=265904.msg2157388#msg2157388)

I have also used I2C with the BMP180 and that works well.  So, it boils down to the display and library you intend on using.

If an Adafruit library, much of the work is already done since Adafruit uses a common GFX interface and only the display driver has to be updated.  If you are proficient, you can use the existing OLED code as a template.

If another author, it is a new effort, but should not be impossible- just a bit more difficult unless one has the exact display for testing.

Ray


Edit:

In general, here is how it all fits together using the SSD1306 as an example. 
In Adafruit_SSD1306.h you will see the prototypes for the class member functions:
Code: [Select]

class Adafruit_SSD1306 : public Adafruit_GFX {
 public:
  Adafruit_SSD1306(int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS);     // Software SPI
  Adafruit_SSD1306(int8_t DC, int8_t RST, int8_t CS);                              // Hardware SPI
  Adafruit_SSD1306(int8_t RST);                                                    // I2C
<...>



In Adafruit_SSD1306.cpp, you will see:
Code: [Select]

Adafruit_SSD1306::Adafruit_SSD1306(int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS) : Adafruit_GFX(SSD1306_LCDWIDTH, SSD1306_LCDHEIGHT) {
  cs = CS;
  rst = RST;
  dc = DC;
  sclk = SCLK;
  sid = SID;
  hwSPI = false;
}

// constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
Adafruit_SSD1306::Adafruit_SSD1306(int8_t DC, int8_t RST, int8_t CS) : Adafruit_GFX(SSD1306_LCDWIDTH, SSD1306_LCDHEIGHT) {
  dc = DC;
  rst = RST;
  cs = CS;
  hwSPI = true;
}

Adafruit_SSD1306::Adafruit_SSD1306(int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS) : Adafruit_GFX(SSD1306_LCDWIDTH, SSD1306_LCDHEIGHT) {
  cs = CS;
  rst = RST;
  dc = DC;
  sclk = SCLK;
  sid = SID;
  hwSPI = false;
}



You will notice, that the Adafruit_SSD1306::Adafruit_SSD1306 is common 3 times, but only one can be used: h/w SPI, s/w SPI, or I2C.  This methodology is called "overloading (http://www.tutorialspoint.com/cplusplus/cpp_overloading.htm)":

Quote
An overloaded declaration is a declaration that had been declared with the same name as a previously declared declaration in the same scope, except that both declarations have different arguments and obviously different definition (implementation).

When you call an overloaded function or operator, the compiler determines the most appropriate definition to use by comparing the argument types you used to call the function or operator with the parameter types specified in the definitions. The process of selecting the most appropriate overloaded function or operator is called overload resolution.
Study both my SPI and madias's I2C examples.  That should get you a head-start on making necessary changes to existing libraries.

Good luck,

Ray
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Mar 31, 2015, 09:23 pm
I have tested another generic board, this time from Shenzhen Technologies
Please see here (http://www.sunspot.co.uk/Projects/Arduino/STM32/generic_black_multipin.html)

It seems to do all that my first one did and seems to be well made - just a bit bigger but all pins well labeled.

There is a schematic on my notes page.
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Apr 03, 2015, 11:39 am
If any developers with spare time drop in here please help with PWM.

I have an Arduino speaking wav speech files from a SD card and using PWM to create audio.

Now trying to do the same on STM32.

SD reading seems OK but any Arduino PWM code fails. I do see a built in Maple PWM option
http://leaflabs.com/docs/lang/api/analogwrite.html (http://leaflabs.com/docs/lang/api/analogwrite.html)

I have yet to fully understand it.

Pulse Width Modulation -  next for the user community???  :smiley-confuse:

Title: Re: STM32 "for the rest of us"
Post by: westfw on Apr 03, 2015, 11:55 am
What Pwm support do you use on avrs?  I would not have thought that the default pwm would be high enough in frequency for speech.


Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 03, 2015, 12:40 pm
Ah

This is not going to work for you.

Use PWMWrite  (http://static.leaflabs.com/pub/leaflabs/maple-docs/latest/lang/api/pwmwrite.html#lang-pwmwrite)

To make AnalogWrite compatible with the AVR, the pin mode is set to PWM inside AnalogWrite, so its not going to be fast enough  for speech

Set the pin mode as in the leaflabs docs and then call pwmwrite

I'm pretty sure its working, as I thought the servo library uses it

However, I'm not sure how you are going to output speech on 400Hz PWM

Your code must be doing something AVR specific to change the pwm rate, and you'll need to do something different to the AVR code to change the PWM rate on the STM

The chips are just too different for the code to just work.
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Apr 04, 2015, 11:04 am
Some of the wav playing Arduino files do use PWM but (I was wrong) the one I pasted in for my system seems to just drive output pins in a "home build" PWM. I will do some work and try to ask a better informed question.

.....or just hope for ready made STM32 wav player code to appear spontaneously ........ :smiley-twist:

(I once wrote some real C code to make my router talk - :smiley-eek: - but I think I may have lost too many brain cells since then)


http://www.sunspot.co.uk/Projects/SWEEX/beeper.html (http://www.sunspot.co.uk/Projects/SWEEX/beeper.html)
Bottom of page
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 04, 2015, 12:11 pm
Hi Sunspot,

I just wrote a nice long technical repsonse but I hit a wrong keystroke and it was all gone in a flash :-(

Anyway, here goes again, but expurgated.

Here is some code I use to generate a high frequency square wave

Code: [Select]
void setup() {
  // put your setup code here, to run once:
     setupCameraClock(PA8);
     Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:

}

void setupCameraClock(int pin)
{
  #define CLOCK_COUNT 3
  timer_dev *timerDevice  = PIN_MAP[pin].timer_device;
  uint8 timerChannel         = PIN_MAP[pin].timer_channel;
  pinMode(pin,PWM);
  timer_pause(timerDevice);
  timer_set_reload(timerDevice,CLOCK_COUNT);
  timer_set_prescaler(timerDevice,timerChannel);
  timer_set_compare(timerDevice, timerChannel, CLOCK_COUNT);
  timer_resume(timerDevice);
}


I forget the precise frequiency, but its at least 8Mhz

So if you adapt that code, you can get the PWM on your audio output in running at a nice value e.g. 100Khz

Then if you look at PWM write it does this

Code: [Select]

void pwmWrite(uint8 pin, uint16 duty_cycle) {
    if (pin >= BOARD_NR_GPIO_PINS) {
        return;
    }
    timer_dev *dev = PIN_MAP[pin].timer_device;
    uint8 cc_channel = PIN_MAP[pin].timer_channel;
    ASSERT(dev && cc_channel);
    timer_set_compare(dev, cc_channel, duty_cycle);
}


And looking at what set_timer_compare does


Code: [Select]


static inline void timer_set_compare(timer_dev *dev,
                                     uint8 channel,
                                     uint16 value) {
    __io uint32 *ccr = &(dev->regs).gen->CCR1 + (channel - 1);
    *ccr = value;
}



So if you cache *ccr in to a global variable in setup, and just write new values you can adjust the PWM very quickly


So to play from SD, once Victor gets the SD DMA working, you should be able to double buffer DMA into ram, then use another timer interrupt to take the data from the double buffer and play it.

You also need a low pass audio filter, perhaps with the 3dB point at around 5kHz would probably do

However, this isn't the simplest of projects.
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Apr 04, 2015, 04:45 pm
Roger
Thanks for the response.
Low pass with solder!
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Apr 04, 2015, 05:59 pm
STM32 .WAV playing.

This is the AVR code that I was trying to convert
https://github.com/TMRh20/TMRpcm/wiki (https://github.com/TMRh20/TMRpcm/wiki)

PWM but perhaps "not as we know it"
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 04, 2015, 10:31 pm
Good luck with porting that code.

Unfortunately its full of direct register access stuff to AVR which isn't going to be the same on STM32 or any other hardware.

I hope it has enough comments, as you are going to need to go back to first principals to work out what the AVR code actually does, and then recode again in STM specific code.

It's probably doing some soft of adaptive pulse with modulation, either on a fixed or dynamic timer interrupt.

Personally, I'd just write a basic test program first using a sine wave table eg.  1k of ints. And try to get that to work, before I'd attempt all the complexity of SD card reading at the same time
Title: Potential OneWire issue
Post by: mrburnette on Apr 08, 2015, 05:01 pm
Problems w/ OneWire and DS18B20

UPDATE:
independently confirm to be an issue with Maple & Maple Mini clones - but not an issue on generic boards.  This has been placed on the issues list and will be prioritized for research and correction.  I'll report here when corrected.


Response to @turkogluky: link (http://forum.arduino.cc/index.php?topic=265904.msg2177003#msg2177003)

Summary: the current version of OneWire appears to freeze the Maple uC.


Test procedure:
I used a Nano to prove the DS18B20 was working; the 4.7K pull-up was required at 5V.

I used a new STM32 Maple Mini clone tested with my blink-count script to confirm the Maple Mini was fully functional.

When I went to the
\Documents\Arduino\hardware\STM32\STM32F1\libraries\OneWire\examples\DS18x20_Temperature
script, it would not compile on my Windows 8.1 box.  

The error was traced to the fact that for some crazy reason, the OneWire lib was being pulled from:
\Documents\Arduino\libraries\OneWire\
and not from
\Documents\Arduino\hardware\STM32\STM32F1\libraries\OneWire\

I fixed that by including the entire path:
#include "\Documents\Arduino\hardware\STM32\STM32F1\libraries\OneWire\OneWire.h"

The program compiled: (1.6.1 shipping)

Code: [Select]
Sketch uses 15,388 bytes (14%) of program storage space. Maximum is 108,000 bytes.
Global variables use 4,528 bytes of dynamic memory.



HOWEVER:
The instantiation of OneWire causes the uC to either freeze or appear to freeze.  Pressing RESET goes into DFU but when the user program starts, nothing.  Worst, the COMn port does not enumerate on Windows, so no debug output.

I changed Serial. to Serial1. and got a clean compile, but again, OneWire freezes the uC.

Ray
Title: Re: STM32 "for the rest of us"
Post by: evildave_666 on Apr 09, 2015, 04:32 am
Just a note that the Beestore Maple Mini clone (whose PCB is a different layout than the original or Baite version) also works fine with the STM32 repo. Have had a couple for a while but never got around to trying them until this week, when I made a big push to get a fresh 1.6.1 install running all of the STM32/core13/TinyCore1/esp8266 cores.
Title: OneWire - Update
Post by: rogerClark on Apr 09, 2015, 06:24 am
Just a quick update

OneWire only seems to work on generic STM32 boards

I have posted a fix to the main thread, but it involves a slight difference in the way the OneWire class is initialised - I won't bore you with the technical details
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 09, 2015, 12:07 pm
There were various issues with OneWire, so it has now been renamed to OneWireSTM

See the other thread for the technical details, or just download the relevant files and enjoy ;-)
Title: Re: STM32 "for the rest of us"
Post by: bigplik on Apr 09, 2015, 12:42 pm
hi,
is there any tutorial how to use ST-Link with arduinoIDE to program STM32?
i can do it by usb, but if want to program single STM32 chip on custom board
don't know how to set it
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 09, 2015, 12:57 pm
Stm32 to flash.   Board type had STLink option on windows

There are no tutorials for this on the arduino but there may be general tutorials for stm32 in general e.g. On YouTube
Title: Re: STM32 "for the rest of us"
Post by: bigplik on Apr 09, 2015, 01:00 pm
I've checked YT, still didn't manage, there were some programming stuff about discovery boards and different than arduinoIDE program uploaders, some ST-Link tools,
I have an option on my IDE for upload method as ST-Link, but it shown me a message that it can't connect into st-link device - however windows seen st-link in device manager
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Apr 09, 2015, 03:53 pm
I've checked YT, still didn't manage, there were some programming stuff about discovery boards and different than arduinoIDE program uploaders, some ST-Link tools,
I have an option on my IDE for upload method as ST-Link, but it shown me a message that it can't connect into st-link device - however windows seen st-link in device manager
The original implementation of the STM32 core project was directed toward the Maple and the Maple Mini clones.  The project grew to address a larger population of STM32 boards based on the STM32F103.

The project was never intended to be a "newbie" project as a replacement for the Arduino 8-bit UNO, Mini, Nano, etc.  It was intended for more experienced experimenters who for some reason had outgrown the 8-bit capacity but did not want to rush to the Due; that is, an inexpensive alternative based on easy to obtain Chinese clones of the Maple and Maple Mini.

Some of the boards (Maple Mini) support USB programming and connectivity much the same way that the ProMicro (32U4) does - it enumerates itself as a COMx port under the OS.  With Windows, this requires drivers to be installed; instructions are in the Github wiki.

Other development boards or boards that do not enumerate to a COMx port are usually programmed using ST-Link which requires that you purchase a programming device that goes into the PC USB port and connects to the ST-Link header on the board.  You can read through the long thread on the devices ordered and that worked (or did not work well.)  I use Windows can cannot recommend one.

This is very important and I am going to repeat this again: The STM32 core is not a beginner's project and while the core is working there are some serious issues documented on the github wiki.  Just as the issue with OneWire did not appear until a few days ago, I am sure there are other issues which will need work-arounds and fixes.  BUT, this is a hobby project and there is no guarantee that compatibility will occur - if you order an STM32 board and utilize the core, you need to know that you are on your own and the core is always in flux - as of this week, a few commands from LeafLabs were removed to align more toward the Arduino commands.

Many AVR 3rd party libraries will not work unchanged - consider this a warning.  If you do not understand how to hack a library or are not competent to look into a Due or Teensy3.1 library and ferret the logic - avoid the library.  You can check here on github to see if the core team has provided a replacement:  Ported-Working libraries for the STM32 (all functions may not work.) (https://github.com/rogerclarkmelbourne/Arduino_STM32/tree/master/STM32F1/libraries)

When things are found that do not work (not libraries, basic Arduino commands) someone will hopefully have the hardware to validate the issue and the issue will be placed on the github wiki.  Roger will address the priority and determine if a workaround or fix will be appropriate - OR, the issue may simply be documented and left the way it is... depending on the impact.  There are no guarantees.


Ray
My Projects (http://www.hackster.io/rayburne)
Title: OneWireSTM
Post by: rogerClark on Apr 10, 2015, 07:10 am
Just to clarify

The STM32F1/libraries folder now contains a new folder called OneWireSTM

I have removed the old OneWire folder, as it was not getting found by the IDE (and I don't have time to debug the IDE)

Examples for OneWireSTM are in the examples folder

e.g.

hardware\Arduino_STM32\STM32F1\libraries\OneWireSTM\examples\DS18x20_Temperature

The updated examples reference the new folder name and new header name OneWireSTM.h

I have compiled and tested the DS18B20 example using pin 10 on my Maple board and it worked fine. I also tested on pin 15 and it was also OK.
Title: I2C_LCD
Post by: OZ2JP on Apr 13, 2015, 11:08 pm
Hi.

I try to make a "Hello World" with STM32 and I2C_LCD, but it dont work.

Code: [Select]

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Set the LCD address to 0x20 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x20, 16, 2);

void setup()
{
// initialize the LCD
lcd.begin();
// Turn on the blacklight and print a message.
lcd.backlight();
}

void loop()
{
  lcd.print("Hello, world!");
  delay(1000);
}


(https://dl.dropboxusercontent.com/u/5062915/Duino/I2C.JPG)

The address is confirmed with BusPirate and I can se the signal with my oscilloscope.

The display works with Arduino board.

It looks like the init is going wrong, as I can see flicker every time I send the string.

STM32F103RC and IDE ver. 1.6.3
Title: Re: LCD
Post by: rogerClark on Apr 14, 2015, 01:52 am
Interesting

I've not tested this.

I think the LCD library was the one produced by LeafLabs and I'm not sure if its ever been updated :-(

If you have a github account, can you post this as an issue

Title: Updated installation video is now on YouTube
Post by: rogerClark on Apr 14, 2015, 01:54 am
Guys,

I know some people like to see things visually in a video etc.

So I"ve done an update to my previous video, which describes how to get STM32 working in IDE 1.6.2 or newer



See https://www.youtube.com/watch?v=TePglhSkghg&feature=youtu.be (https://www.youtube.com/watch?v=TePglhSkghg&feature=youtu.be)



(Moderators. Sorry for cross posting, but there are 2 different audiences for this project)
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 14, 2015, 03:26 am
Unfortunately I don't have one of those displays.

I have a parallel version but not the I2C version

This issue could be I2C speed, its defaulted to FAST in the Wire lib as this works with most things and gives better speed.

But the speed is faster than the AVR boards (i.e AVR uses 100Khz and I think the STM32 default is more like 250kbps) so this may be the issue.


Its probably worth getting hold of the I2C Scanner from the "Arduino Playground" (written by Nick Gammon) and seeing if the display ID's show up on a scan.

To see if its I2C speed issue, look in

hardware\Arduino_STM32\STM32F1\libraries\Wire\Wire.cpp on the line at the bottom that reads

Code: [Select]

TwoWire Wire(PB6, PB7, SOFT_FAST);


and change it to



Code: [Select]
TwoWire Wire(PB6, PB7, SOFT_STANDARD);

which would bring the speed down to 100khz like the AVR boards.



I'm not sure if the version that LeafLabs shipped with the IDE (I.e the one we have) is any different from the normal one.

Looking online, the current version is a lot different from the one we have e.g. the new one can be downloaded from here

http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/LiquidCrystal_I2C.zip

I'd suggest that you try using the latest version instead of the possibly old version we have in the repo


I'll also look at the price of that display, if its just a few dollars I'll order one
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 14, 2015, 03:28 am
Can you confirm if the board you have is this one ?
http://www.ebay.com.au/itm/16x2-Serial-IIC-I2C-TWI-5V-1602-LCD-Module-Display-Arduino-UNO-R3-MEGA2560-New-/261819816573?pt=LH_DefaultDomain_15&hash=item3cf5ad5a7d (http://www.ebay.com.au/itm/16x2-Serial-IIC-I2C-TWI-5V-1602-LCD-Module-Display-Arduino-UNO-R3-MEGA2560-New-/261819816573?pt=LH_DefaultDomain_15&hash=item3cf5ad5a7d)
Title: Re: STM32 "for the rest of us"
Post by: Docedison on Apr 14, 2015, 05:57 am
That board has worked for me with the FMalpartida I2C library...
There were some issues with the constructor and varying connections between the PCF8574 and the display.
There is a most comprehensive thread in the display section referring to this issue..
I have a level shifter  and a 3,3/5V boost mode switcher that I plan to assemble for a Teensy 3,1 next week.
I plan to use a 4 X 20 LCD with it.. I just need to get my desk cleared first.
It should work well as I've used that library many times before...


Doc
Title: Re: STM32 "for the rest of us"
Post by: OZ2JP on Apr 14, 2015, 10:36 am
Can you confirm if the board you have is this one ?
More like this one:
http://www.ebay.com/itm/Module-Display-Character-LCD-1602-16x2-HD44780-Controller-Yellow-Green-Backlight-/350662659597 (http://www.ebay.com/itm/Module-Display-Character-LCD-1602-16x2-HD44780-Controller-Yellow-Green-Backlight-/350662659597)

...soldered together with this one:
http://www.ebay.com/itm/Board-Module-Port-IIC-I2C-TWI-SP-I-Serial-Interface-Arduino-1602-LCD-m2-/131331658861 (http://www.ebay.com/itm/Board-Module-Port-IIC-I2C-TWI-SP-I-Serial-Interface-Arduino-1602-LCD-m2-/131331658861)

This is a 5V display - it runs fine on 3.3V but then the contrast voltage must be -0.9V so I run it on 5V with scl/sda pull-up to 3.3V
Title: Re: STM32 "for the rest of us"
Post by: OZ2JP on Apr 14, 2015, 10:58 am
To see if its I2C speed issue, look in

hardware\Arduino_STM32\STM32F1\libraries\Wire\Wire.cpp on the line at the bottom that reads

Code: [Select]

TwoWire Wire(PB6, PB7, SOFT_FAST);


and change it to



Code: [Select]
TwoWire Wire(PB6, PB7, SOFT_STANDARD);

which would bring the speed down to 100khz like the AVR boards.

No luck with this.

Quote
Looking online, the current version is a lot different from the one we have e.g. the new one can be downloaded from here

http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/LiquidCrystal_I2C.zip

I'd suggest that you try using the latest version instead of the possibly old version we have in the repo
With this library it works fine - thank you.  8)
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 14, 2015, 12:31 pm
Cool

OK. So can you confirm I should remove the LCD_I2C library that is in the current files and replace with the one I linked to ?

Thanks

Roger
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 14, 2015, 12:35 pm
@Sunspot

Re: Generic STM32F103C8 board

I have started work on the a generic STM32F103C board type, rather than internally use the "variant" code for the Maple mini

The only difference you should see if you use this, is that pin PB9 is now available. It is not available on Maple mini because its use internally to reset the USB bus

This is somewhat of a work in process, so it would be good if you could give it a try and see if it works for you.
Because although the changes I made are not technically very difficult, there is a lot of manual searching and replacing of pin names / numbers.


PS.

I presume you are using the STM32 pin names e.g PA5 - which I feel is definitely the correct way to do things.

Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Apr 14, 2015, 06:16 pm
Roger
I will try but in a couple of days - pin names e.g PA5 work.

The large generic board (http://www.sunspot.co.uk/Projects/Arduino/STM32/GenericSTM32b.png) blinks OK as delivered - it has space for a clock Xtal but none fitted - no real advantage over your small generic board - or the Mini I guess.

3 Maple Mini clones (below £4)  arrived from 3 vendors. All blink and none show rework.

Using the Maple IDE on iMac I can program them via USB.
I have loaded your USB drivers but do not see the Minis  - not sure how to activate the drivers.
Guess I can use serial like for generic but will wipe the USB boot SW?

This winter hobby is holding back spring jobs - OK in Oz!!
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 15, 2015, 01:06 am
@Sunspot.

It looks like that large generic board just as a STM32F103C8 uP on it, so I agree its pointless getting one of those

http://www.ebay.com/itm/ARM-Cortex-M3-STM32F103C8T6-Minimum-System-Development-Board-STM32-48-Pin-NEW-/111514106343?pt=LH_DefaultDomain_0&hash=item19f6c239e7 (http://www.ebay.com/itm/ARM-Cortex-M3-STM32F103C8T6-Minimum-System-Development-Board-STM32-48-Pin-NEW-/111514106343?pt=LH_DefaultDomain_0&hash=item19f6c239e7)


Boards like this

http://www.ebay.co.uk/itm/STM32F103RC-Breakout-Board-STM32-Mini-System-Core-Board-Learning-Board-l-/251691116509?pt=LH_DefaultDomain_3&hash=item3a99f5a7dd (http://www.ebay.co.uk/itm/STM32F103RC-Breakout-Board-STM32-Mini-System-Core-Board-Learning-Board-l-/251691116509?pt=LH_DefaultDomain_3&hash=item3a99f5a7dd)

Are better as they have more Flash and more Ram and also have DAC

I think one other person on this thread has one of these (I do)


This board is pricey, but interesting

http://www.ebay.co.uk/itm/STM32-STM32F103RET6-Cortex-M3-ARM-header-board-512k-JTAG-SWD-STM32F103-/350630718937?pt=LH_DefaultDomain_0&hash=item51a3382dd9 (http://www.ebay.co.uk/itm/STM32-STM32F103RET6-Cortex-M3-ARM-header-board-512k-JTAG-SWD-STM32F103-/350630718937?pt=LH_DefaultDomain_0&hash=item51a3382dd9)

As its and F103RET which is the same as used on the Maple RET6 board, and has more flash again (though the same ram)


These are also good value

Code: [Select]
http://www.ebay.co.uk/itm/1pcs-STM32F103ZET6-Minimum-System-Development-Board-ARM-STM32-Cortex-m3-M75-/291305557264?pt=LH_DefaultDomain_0&hash=item43d32a0d10

64k ram and I think 512K Flash (though it could be 256K, I'd need to double check)

They also have additional flash and eprom on the back

I have one of these, but have not had time to investigate how to make use of the external Flash and eeprom chips, but one of them is definitely connected to the I2C pins as it shows up when I run the i2C scanner
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Apr 15, 2015, 12:02 pm
Lots of users enjoy playing with pin and socket  boards and for them the larger boards - like the Mega and Uno - are fine.

"Chapter 2" users want to embed a cheap board that is hardly more than a large DIL package with serious speed and memory. They want to build useful - very often portable - devices.

Download, Google to debug, solder, USE!

The full Arduino experience but with small STM32 ARM boards is the goal I would humbly request from the developers forum.

The Maple Mini clone and your small generic are all I ask for - but as always people like me want the quick results that lots of working libraries offer - all fixed for next winter....

Go, developers, Go Go !!!
(with sincere thanks :) )
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Apr 16, 2015, 08:35 pm
<...>
The full Arduino experience but with small STM32 ARM boards is the goal I would humbly request from the developers forum.

The Maple Mini clone and your small generic are all I ask for - but as always people like me want the quick results that lots of working libraries offer - all fixed for next winter....

Go, developers, Go Go !!!
(with sincere thanks :) )
@Sunspot:  cute, but...

Anyone with some coding experience can also tackle the libraries AS these are difficult because one must have the specific sensor, display, etc.

As the ILI9341, the BMP180, Nokia 5110, etc.   (https://github.com/rogerclarkmelbourne/Arduino_STM32/tree/master/STM32F1/libraries)are working, all anyone needs to do is use Winmerge against the STM32-centric versions and the AVR versions to identify what was changed.  Then, make a few notes and go tackle your own port.

Working libs can be submitted to Roger for hosting if the author does not have a github account.  In either case, we would like to include the information that Op_xyz has a working library for device abcd.

Ray
My projects (http://www.hackster.io/rayburne)
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Apr 18, 2015, 04:14 pm
Ray,
This looks fun - new to me

- £2.05 to get a chip on-line

http://www.ebay.co.uk/itm/ESP8266-Serial-WIFI-Wireless-TransceiveR-Module-Send-Receive-LWIP-AP-STA-IG-/261813690063?pt=LH_DefaultDomain_3&hash=item3cf54fdecf

see
http://www.esp8266.com/

(insert URL stopped working - odd...)
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Apr 18, 2015, 06:35 pm
Ray,
This looks fun - new to me

- £2.05 to get a chip on-line

http://www.ebay.co.uk/itm/ESP8266-Serial-WIFI-Wireless-TransceiveR-Module-Send-Receive-LWIP-AP-STA-IG-/261813690063?pt=LH_DefaultDomain_3&hash=item3cf54fdecf

see
http://www.esp8266.com/

(insert URL stopped working - odd...)
Ah, the ESP8266 ... they are everywhere!  I have 3 (breakout version (http://www.ebay.com/itm/ESP8266-Serial-Port-WIFI-Wireless-Transceiver-Module-Send-Receive-IO-Lead-Out-/391003246162)) on the bench but have not gotten to play (yet).

Roger has been working on a port for Arduino (https://github.com/rogerclarkmelbourne/arduino-esp8266), but will shortly point to a new effort that seems to be going a bit stronger. (https://github.com/esp8266/arduino)

On another note, I have published a new STM32 Project on my Hackster.io page: Mesmerize (http://www.hackster.io/rayburne/mesmerize-on-maple-mini-stm32f103)
Title: Re: STM32 "for the rest of us"
Post by: OZ2JP on Apr 19, 2015, 01:44 am
On another note, I have published a new STM32 Project on my Hackster.io page: Mesmerize (http://www.hackster.io/rayburne/mesmerize-on-maple-mini-stm32f103)

Hey! It works  :smiley-cool:

(http://dl.dropboxusercontent.com/u/5062915/Duino/GFX.JPG)

Had to change this for my STM32F103RC:
Code: [Select]

#define TFT_CS          PC7                 
#define TFT_DC          PC6               
#define TFT_RST         PC8   
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Apr 19, 2015, 01:52 am
Jens

I'd recommend you post to the other forum, as people are actively working on super high speed access to that display using DMA (Direct Memory Access)

Actually there are various versions of the lib with different attempts at DMA, which achieve very good speeds for certain types of functions, e.g. it depends if you are just setting individual pixels or drawing text or straight lines etc.
Work is being done on writing lines to local memory buffer and then writing the buffer to the display via DMA, which is faster than the current method.

Also in the long term, DMA will be asynchronous, so that you can write to a local ram buffer in the main code, then tell the DMA to transfer this to the display in the background, while the main code can do something else

However we need to get "blocking" / synchronous DMA working well before we look at Asynchronous / non-blocking DMA.
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Apr 19, 2015, 04:03 am
Hey! It works  :smiley-cool:
...
Had to change this for my STM32F103RC:

Code: [Select]

#define TFT_CS          PC7                  
#define TFT_DC          PC6                
#define TFT_RST         PC8  



@Jens,  Great!

The info Roger was wanting documented on the main STM32 thread is the display controller model # and the pinout and any other info that you may note in your test that would relate to coding/wiring.  This is really helpful.  Posting in both threads is appropriate; have as much room here as you want and drop a summary over on the main thread.  Thanks!

There are 'nuff fingers in the libs, so except for a few changes such as faux SoftwareSerail.h, I have tried to stay out of their sandbox and concentrate to generic Sketch Code to actually make use of the ported libs Like here (https://github.com/rogerclarkmelbourne/Arduino_STM32/tree/master/examples/MrBrunetteExamples)

Having a set of simple programs that utilize various sensors and multiple libs is in my Hackster.io projects.. (http://www.hackster.io/rayburne)

Ray
Title: Re: STM32 "for the rest of us"
Post by: evildave_666 on Apr 19, 2015, 04:14 am
As the ILI9341, the BMP180, Nokia 5110, etc.   (https://github.com/rogerclarkmelbourne/Arduino_STM32/tree/master/STM32F1/libraries)are working


Which 5110 libraries are working? I didn't see anything in the repo that said 5110 or PCD8544 so I assume that one or more of the standard ones work unchanged, is that correct?
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Apr 19, 2015, 02:24 pm
Which 5110 libraries are working? I didn't see anything in the repo that said 5110 or PCD8544 so I assume that one or more of the standard ones work unchanged, is that correct?
Generic Nokia 5110:

http://www.hackster.io/rayburne/bmp180-barometer-on-arm-32-bit-under-arduino-1-6-0 (http://www.hackster.io/rayburne/bmp180-barometer-on-arm-32-bit-under-arduino-1-6-0)


Added:
I am not a really big fan of creating a library for the 5110 as functions work very well.  A library would be easy to implement but the Nokia display is so easy to implement with a few functions that I see no particular reason to increase the overhead by using a library.


Ray
Title: Re: STM32 "for the rest of us"
Post by: mrburnette on Apr 22, 2015, 06:51 pm
Quote
Which 5110 libraries are working? I didn't see anything in the repo that said 5110 or PCD8544 so I assume that one or more of the standard ones work unchanged, is that correct?
A NOKIA 5110 (PCD8544) Library has been created. (http://forum.arduino.cc/index.php?topic=265904.msg2195631#msg2195631)


Code: [Select]

/*
Nokia5510 library by Matthias Diro
settings tested on maple mini
  HW SPI and soft SPI tested
  do not use as slave (SCE) pin 7

Tested by R. Burnette 20150422
Arduino 1.7.2
  Sketch uses 17,764 bytes (16%) of program storage space. Maximum is 108,000 bytes.
  Global variables use 4,592 bytes of dynamic memory.
*/
#include "SPI.h"
#include "pcd8544.h"
#define ADMAX 4095
#define ADPIN 15
#define PROGMEM


/*    Nokia 5110          Maple Mini STM32F103
  RED board      Signal      Signal (Pin#)
  ---------      -------     ----------
  Pin 1            Rst         Reset  ( 9)
  Pin 2            CE          SCE    (10)
  Pin 3            DC          D/C    ( 8)
  Pin 4            Din         MOSI   ( 4)
  Pin 5            Clk         SCLK   ( 6)
  Pin 6            Vcc
  Pin 7            LED
  Pin 8            GND
*/

byte dc_pin = 8;    // Data/Command
byte reset_pin = 9;
byte cs_pin = 10;    // Chip Select

// Create a pcd8544 object using Hardware SPI
// (SPI1 on the Maple, add 2 as last argument for SPI2 (untested)).

pcd8544 lcd(dc_pin, reset_pin, cs_pin);

// For software SPI, any 5 pins.
// pcd8544 lcd(dc_pin, reset_pin, cs_pin, sdin_pin, sclk_pin);


// 2 rows by 16 cols smiley. First 16 bytes is first row,
// next 16 is second.
byte smile[] PROGMEM = {
0xE0,0x18,0x04,0x04,0x02,0x32,0x32,0x02,0x02,0x22,0x22,
0x02,0x04,0x04,0x18,0xE0,0x07,0x18,0x20,0x22,0x44,0x48,
0x48,0x48,0x48,0x48,0x48,0x44,0x22,0x20,0x18,0x07};


void setup(void)
{
pinMode(11, INPUT_ANALOG);

lcd.begin();  // Always call lcd.begin() first.
lcd.clear();

// Fill the screen with characters
for (char ch = '!'; ch <= 't'; ch++)
lcd.print(ch);
delay(2000);

lcd.clear();
// Set cursor to (character) column zero and row 0
lcd.setCursor(0,0);
lcd.println("Level: ");  // First line
lcd.println("Temp: ");   // println skips to second line

// Draw a double line
for (byte i = 0; i < PCD8544_WIDTH/2-2; i++)
lcd.data(0b00010100);
lcd.data(0); // A blink pixel column

// Some small numbers
for (byte i = 0; i < 11; i++)
lcd.smallNum(i);

lcd.setCursor(0, 3);
lcd.println(" PCD8544");
lcd.println("    on");
#ifdef BOARD_maple
lcd.print("the Maple");
#else
lcd.print(" Arduino");
#endif
// Draw an image.
lcd.gotoRc(4, 57);
lcd.bitmap(smile, 2, 16);
}


void loop(void)
{
byte i, val;

// Draw bar on row 0, pixel column 8*5
lcd.gotoRc(0, 8*5);
val = map(analogRead(11), 0, 4096, 8*5, 84);

        // the bar
for (i = 5*8; i < val; i++)
lcd.data(0b01111100); // Bar
lcd.clearRestOfLine();

// Write a fake temperature
lcd.gotoRc(1, 8*5);
lcd.print("22.8");
lcd.data(0);

// A degree sign
lcd.data(0b00000100); // Degree
lcd.data(0b00001010);
lcd.data(0b00000100);
lcd.data(0);
lcd.print('C');
lcd.clearRestOfLine();
delay(100);
}



Ray
Title: Re: STM32 "for the rest of us"
Post by: Sunspot on Apr 23, 2015, 04:35 pm
I have been loading Arduino_STM32 into the Arduino IDE into a fresh copy of Win XP
My experience differs from the Wiki install instructions.

Some notes here (http://www.sunspot.co.uk/Projects/Arduino/STM32/VMWareWindows.html)
Title: Re: STM32 "for the rest of us"
Post by: bigplik on Jun 17, 2015, 08:10 am
Hi, I try to use DS1307 and DS1302 RTC modules work on STM32,
I could upload code into Maple Mini 2 and Maple Rev3+ but when I'll do it COM port is not visible
on arduinoIDE. When put back "blink" code from examples then LED on board flash and COM
port is visible.
Does anyone tried to work with this modules on STM32 with success?
Or maybe is any another way to use RTC on STM32 Maple Mini or Rev3+ boards?
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Jun 17, 2015, 08:15 am
If the maple serial device doesnt appear, it means the code has crashed

A common cause of this is the library is attempting to setup or use a peripheral before the init code has run in libmaple (the core code)

I had a feeling that someone had already looked at this

You are better off posting to www.stm32duino.com in the libraries section, as there are far more people using STM32 there than here

BTW. The board has onboard RTC, but most cheap STM32 boards don't have the battery etc thats required to maintain the RTC when the power is removed.

Note. be carefull attaching a battery, read @ahulls experience on the stm32duino.com forum, and how he destroyed a button cell battery
Title: Re: STM32 "for the rest of us"
Post by: bigplik on Jun 17, 2015, 09:17 am
Tnx Roger, I'll move with this subject to stm32duino so ;)
have also few questions about sleep modes, as standard <avr/sleep.h> library do not work in my case
Title: Re: STM32 "for the rest of us"
Post by: rogerClark on Jun 17, 2015, 09:39 am
Ah yes

Sleep modes.

There are some current postings about that in the last few days

Title: Re: STM32 "for the rest of us"
Post by: urvi1995 on Mar 19, 2019, 10:25 am
I am using Nucleo 144 board with SMP32 F746ZG. I have to use IO expander PCF8574 for more GPIO pins. when i compiled code in arduino ide, it gives me error regarding PCF8574 library. Is there any other PCF8574 library available for STM32 F746GZ ?