Cant get Arduino for STM32 Installed.

Windows XP,Vista,7,8 and 8.1 etc
srnet
Posts: 5
Joined: Tue Feb 09, 2016 8:19 pm

Re: Cant get Arduino for STM32 Installed.

Post by srnet » Wed Feb 10, 2016 7:52 pm

I was looking at using one of the low cost STM32F103C8T6 boards as a replacement for a Pro Mini I currently use for a very long distance LoRa radio tracker receiver.

I complied the working receiver code, taking out the SoftSerial stuff, and the STM code is around 2.4 times the size of the ATMEGA328 code, so even with the 64K Flash on the STM I would have less room for adding extra code, assuming that ratio.

User avatar
mrburnette
Posts: 1829
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Cant get Arduino for STM32 Installed.

Post by mrburnette » Wed Feb 10, 2016 9:50 pm

srnet wrote: ...
I complied the working receiver code, taking out the SoftSerial stuff, and the STM code is around 2.4 times the size of the ATMEGA328 code, so even with the 64K Flash on the STM I would have less room for adding extra code, assuming that ratio.
Stewart from Picaxe fame?

Dude, most likely you need to look carefully at types... an Int on Arduino is 16-bit but 32-bit on STM32F1xx. Plays hell with arrays!

The STM32 core is larger, but growth is not proportional. If you have a complex data type, use Struct.

The Maple Miniseems to have 128K flash even though spec says 64K... use Static Const to keep SRAM pruned. I think we have several posts searchable using "PROGMEM"


Ray

srnet
Posts: 5
Joined: Tue Feb 09, 2016 8:19 pm

Re: Cant get Arduino for STM32 Installed.

Post by srnet » Thu Feb 11, 2016 6:40 am

mrburnette wrote:
srnet wrote: ...
I complied the working receiver code, taking out the SoftSerial stuff, and the STM code is around 2.4 times the size of the ATMEGA328 code, so even with the 64K Flash on the STM I would have less room for adding extra code, assuming that ratio.
Stewart from Picaxe fame?

Dude, most likely you need to look carefully at types... an Int on Arduino is 16-bit but 32-bit on STM32F1xx. Plays hell with arrays!

The STM32 core is larger, but growth is not proportional. If you have a complex data type, use Struct.

The Maple Miniseems to have 128K flash even though spec says 64K... use Static Const to keep SRAM pruned. I think we have several posts searchable using "PROGMEM"


Ray
Yes thats me. After the space related project I moved onto playing with LoRa. First a PICAXE LoRa balloon tracker and laterly a Arduino Pro Mini based one that is super easy to build. The tracker is fine but the receiver is more complex and needs more features. I have it working but its at the limit of the Pro Mini memory, and I dont want to spend time developing extra features on a setup that is an effective dead end.

I would want to keep the code constant, using the same basic routines on the existing receiver as on a more sophisticated up rated one. So whilst it may be possible to optimise for the STM I would rather avoid doing it, I would end up with two sets of code.

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

Re: Cant get Arduino for STM32 Installed.

Post by RogerClark » Thu Feb 11, 2016 7:39 am

The large size of the binaries has been noted before and it was generally tracked back to something calling in a whole bunch of stuff from one of the ARM core libraries

Usual culprits, from what I recall are things that use Malloc / free etc, but I can't remember the exact details.

I just googled and found this thread

http://www.stm32duino.com/viewtopic.php?t=407

There may be others.

User avatar
mrburnette
Posts: 1829
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Cant get Arduino for STM32 Installed.

Post by mrburnette » Thu Feb 11, 2016 2:14 pm

srnet wrote: <...>
I have it working but its at the limit of the Pro Mini memory, and I dont want to spend time developing extra features on a setup that is an effective dead end.

I would want to keep the code constant, using the same basic routines on the existing receiver as on a more sophisticated up rated one. So whilst it may be possible to optimize for the STM I would rather avoid doing it, I would end up with two sets of code.
So, Roger already mentioned bloat from library calls, with ARV and STM and actually all uC's, C/C++ libraries can overwhelm the little beasts. If one can track down the offending library, options are usually available. That being said, if you avoid completely dynamic memory usage, my experience is that one can generally fit a whole lots of code into the STM32.

One thing to do, is if you use the bootloader to upload over serial, be certain to utilize Bootloader 2.0 as you will recover 3K of SRAM and have the entire 20K at your disposal. Upgrading the bootloader is as easy as running a sketch!

Another thing to consider is that if you are writing cross-platform code, 8-bit and 32-bit, you should consider avoiding general variable declarations such as Int. Rather, consider int8_t or uint8_t and similar declarations as GCC is consistent with their usage. The first 3 results from this query will give more information.

PROGMEM and Const Char work across the AVR and STM, too. Lots of discussion at Arduino.cc and in this forum too. Just search.
If you can identify a particular flash-hungry routine, let us know as the group here has a great working knowledge across the board. Several of our members have uC coding as their day jobs.

Lastly, I bolded a couple of phrases from your previous response which seem to be counter intuitive to me: if you have hit the ceiling with the 328P microcontroller, why (other than regression testing) do you wish to maintain backward compatibility with that chip? I suspect you know that the Atmega1284P has a mature core and provides nearly the same resosurces (16K SRAM) as the Maple (20K SRAM) and 128K flash. I've done several projects with the 1284P and it is a great chip... low support hardware, very easy to move code from Atmega328P. Anyway, give it some consideration.

Good luck,

Ray

srnet
Posts: 5
Joined: Tue Feb 09, 2016 8:19 pm

Re: Cant get Arduino for STM32 Installed.

Post by srnet » Thu Feb 11, 2016 5:41 pm

Why backwards compatible with a Pro Mini, a reasonable question.

The Pro Mini makes a small, light, low cost and very low parts count tracker TX to be built. You can also avoid the need for any SMT assembly and the entire thing can be built with less than 10 parts. The tracker transmitter has two way communications, if you can receive packets from a few hundred kilometers you can send them as well.

Now if tracker TX and receiver are both sending and receiving packets its a lot easier if they are using the same code.

The Pro Mini is OK for the tracker TX and handles the GPS and LoRa stuff well enough. The Pro Mini is also enough to build a simple and very portable battery operated tracker receiver, but the memory is then close to the limit, for RAM in particular.

So if you want to add more features to the receiver you need more FLASH and RAM.

Thanks for the tip on the 1284P, I will take a look. I am for this design trying to avoid the use of SMT, I had not realized the 1284P was available in
40 pin DIP.

Stuart Robinson
GW7HPW
http://www.50dollarsat.info/

jra
Posts: 7
Joined: Thu Jan 28, 2016 7:28 pm

Re: Cant get Arduino for STM32 Installed.

Post by jra » Thu Feb 18, 2016 6:48 pm

If you want to stick with a non-SMT solution, there are several 1284P designs already available on Oshpark:

https://www.oshpark.com/profiles/Firebirduino
http://www.firebirduino.com/mighty_stick/

fran52
Posts: 1
Joined: Mon Feb 08, 2016 7:49 pm

Re: Cant get Arduino for STM32 Installed.

Post by fran52 » Mon Apr 18, 2016 12:47 am

mrburnette wrote:
C_D wrote:I had this error when I did a new install the other day also. Unfortunately I cant remember what I did to fix it...
OK ...
Arduino IDE 1.6.7 should NOT be utilized As Roger states, 1.6.5 is the most recent supported version.

IF you must have version 1.6.7, then consider using the Arduino.org version 1.7.8 as it can co-exist with the 1.6.7.

Good luck,

Ray
INSTRUCTIONS STATE CURRENT IDE S/B 1.6.5 if that is the only ver supported
Ver 1.7.8 cannot co-exist as the installer un-installed the prior installation.
Several libraries are marked as invalid
The path to the maplelib fails
The path to boards.txt fails
:o

User avatar
mrburnette
Posts: 1829
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Cant get Arduino for STM32 Installed.

Post by mrburnette » Mon Apr 18, 2016 1:06 am

fran52 wrote: <...>
INSTRUCTIONS STATE CURRENT IDE S/B 1.6.5 if that is the only ver supported
Ver 1.7.8 cannot co-exist as the installer un-installed the prior installation.
Several libraries are marked as invalid
The path to the maplelib fails
The path to boards.txt fails
:o
I have Arduino.cc's 1.6.8 (for AVR & ESP8266) installed on two Linux Mint boxes: 32-bit & 64-bit.
On same boxes, I have 1.7.8 from the Arduino.org site.
They both work fine... just not at the same time because they home to ~home/.arduino15 directory.

I do not care where you got your information, but it works. The .cc and .org folks dislike each other, they may say anything. If you have personal issues with your own installation on Linux, we can discuss that. However, if you do not have personal experience then you really need to know that I strongly disagree with posts that make an iron-clad statement without validation.

Ray

msaine
Posts: 1
Joined: Sun Jun 19, 2016 1:01 am

Re: Cant get Arduino for STM32 Installed.

Post by msaine » Sun Jun 19, 2016 1:05 am

I am going to try to install this software and I want to know if the new 1.6.9 version of Arduino IDE works or should I only install 1.6.5 as stated above. At present I have nothing installed. I will be using windows 7 pro or ultimate depending on which machine I actually install it on

Post Reply