[SOLVED] Discovery STM32F100RB - Trouble with timers and library structure

STM32F103 Nucleo boards e.g. STM Nucleo F103RB
hdleng
Posts: 10
Joined: Sat Sep 23, 2017 3:21 am
Location: Arizona, USA

Re: trouble with timers and library structure

Post by hdleng » Tue Sep 26, 2017 12:32 am

Roger,

One more thing. The Discovery STM32F100 board has two processors. An STM32F103C8T6 handles the USB. It can actually be used as a stand-alone ST-Link connected to other boards. The STM32F100R8T6B is for user code, but it does not need to execute USB functions itself. So, 8K of RAM is not so limiting.

Frank

User avatar
RogerClark
Posts: 7482
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: trouble with timers and library structure

Post by RogerClark » Tue Sep 26, 2017 2:53 am

Hi Frank

I'd like to claim all the credit, but about 90% of the core comes from the original code that LeafLabs wrote for their Maple products in 2012.

Leaflabs abandoned it around 2015 and I picked it up after @bobc did some work to make it compatible with Arduino 1.5

Since then, I've changed / enhanced a lot of things, but there have been numerous contributions by various other people, so now its very much a community driven thing.

BTW. I also maintain the bootloader... But as your board probably has an STLink on it, you won't be using that

zmemw16
Posts: 1489
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: trouble with timers and library structure

Post by zmemw16 » Tue Sep 26, 2017 4:50 am

is this a DiscoveryVL ?
if yes, two thoughts
1. do the ST cores support it directly ?
2. do a search for "Geoff Brown Discovering the STM32 Microcontroller"
helpful link to the pdf :D
https://www.google.co.uk/url?sa=t&rct=j ... nCPLiIB-dQ
admittedly it's using the classical 'C' approach, but it does provide a great amount of information. :lol:

adding a definitive 3. :lol: :lol:
3. http://stm32duino.com/viewtopic.php?t=1741#p22876
stephen

User avatar
RogerClark
Posts: 7482
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: trouble with timers and library structure

Post by RogerClark » Tue Sep 26, 2017 5:45 am

It had crossed my mind that Frank could look at STM's own core.

https://github.com/stm32duino/Arduino_Core_STM32

However, STM don't have a variant for his board, so he'd need to do the same thing.

Also, AFIK STM don't have any examples of how to use the hardware timers, so he would need to learn how to use STM's HAL programming API before he could do anything.

I looked at the PDF of that online book, but it days
Throughout this book we utilize the ST Standard Peripheral Library
Not the HAL, so its not necessarily that useful in terms of learning how to program using STM's core

zmemw16
Posts: 1489
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: trouble with timers and library structure

Post by zmemw16 » Tue Sep 26, 2017 6:48 am

@hdleng
something tells me i shouldn't, but does a STM32F100RB have a Timer2 ?
if yes then something is wrong in the variant files, typo ? maybe it's something mis-spelt, Timner2 ? ? ?
if no then solved :D

i'll assume you can re-apply ideas from linux based tutorials to a windows setup if needed
that's a seriously hard sentence for me to type :!:

there is a book, i got it from Amazon; not a recommendation - on the off-chance, it does use CubeMX and eclipse with the gnu arm eclipse plug-in, for £2 why not ?

Getting Started With STM32 Nucleo Development (Kindle Edition) by Agus Kurniawan

found a couple of sites/blogs/tuts, this has a bit
http://elastic-notes.blogspot.co.uk/
another with bits
http://www.scienceprog.com/driving-grap ... 2f103zet6/
and then there's ST Community
https://community.st.com/thread/15404
and this
http://scaluza.com/stm32f4/intro-in-stm32f4cubemx/

just browse around those, they're just some of my open tabs from several firefox windows
actually i should just zip up my history file or bookmarks from firefox or my mega-booklist.html file :lol:

and then of course, there's youtube :roll:
i find watching a video tutorial is more off-putting, can never hit pause fast enough and iterating back and forth to the frame ... ... and then there's the music and then it's audio is in russian or german or french

stephen

hdleng
Posts: 10
Joined: Sat Sep 23, 2017 3:21 am
Location: Arizona, USA

Re: trouble with timers and library structure

Post by hdleng » Tue Sep 26, 2017 8:14 am

Roger and Stephen,

Your advice has been helpful, and I'm now well on my way. I'll update my progress.

Prior to my foray into Arduino, I had been using linux command line and scripts to develop with gcc for ARM. I use the ST peripheral libraries. Geoff Brown's book is a good one, and I pretty much followed his methodology. I've used that development environment for most of my STM32F1 work.

Separately, I use Eclipse running on Windows for STM32F4 work. That makes the work a little more automated. And, I wanted to learn Eclipse anyway. Carmine Noviello's book, Mastering STM32, is a very good reference in setting up the tools and for doing STM32F4 specific work.

I've modified one of the STM32F103 variants to work with my STM32F100 board. I could compile and upload the timerinterrupt.ino, but it did not execute properly. As Stephen anticipated, timer2 is not implemented as called for in the program. Timer1 is the advanced timer on the processor, and by changing the code to use it, I have managed to get it working.

The work that I had done using bare metal code and the ST libraries gave me low-level familiarity with the timers; so, it wasn't very difficult to troubleshoot the problems.

Now the I'm past most of the learning curve for STM32duino, I will be able to make fast work of projects that can tolerate the software overhead that accompanies Arduino. Sometimes my work involves prototyping a design, running it once, then tearing it apart. Arduino makes good sense on those occasions. On the other hand, I get right down next to the hardware using C or even assembly when performance requires it, and volume justifies it.

Even using this ST Discovery board doesn't make very much sense except as a learning tool. I have already ordered some STM32F103-based boards; so, I can take advantage of the STM32duino configurations that are already in place.

Thank both of you gentlemen for your help. I'm sure we'll correspond again someday on other matters.

Best Regards,

Frank

User avatar
RogerClark
Posts: 7482
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [SOLVED] Discovery STM32F100RB - Trrouble with timers and library structure

Post by RogerClark » Tue Sep 26, 2017 10:24 am

Hi Frank

I'm glad you are getting to grips with things..

I've marked the thread as SOLVED and changed the title a bit to help anyone else who may be trying to use the same board.

I'll move this thread to the appropriate section (again to help anyone else with the same board - as most of the problems were related to this being a type of board no one had tried running Arduino on before)

Post Reply