0

get out of memory?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

get out of memory?

by fredpet on Tue May 14, 2019 12:23 pm

hi folks,
I'm using a featherfona (https://learn.adafruit.com/adafruit-feather-32u4-fona), which has the following components connected:
now I want to make a little project to control my heating by sending SMS.
I've just started the project, have a lot of ideas, but my memory is decreasing rather fast.
with about 200 lines of source code there are already 76% of memory used (Maximum sind 28672 Bytes).
what to do, when I get out of memory??

thanks in advance
fredpet

fredpet
 
Posts: 12
Joined: Wed Feb 13, 2019 6:30 pm

Re: get out of memory?

by adafruit_support_mike on Wed May 15, 2019 12:44 am

fredpet wrote:what to do, when I get out of memory??

You'll have to make tradeoffs and design choices. That's where designers really start earning their pay.

No matter what hardware you use, there will always be some limiting resource.. memory, speed, power, physical space, cost, etc. It's easy to write wish lists when you don't have to worry about those limits, and it's appropriate to create those lists when you're brainstorming. Sooner or later though, you have to put on your designer hat and look at each item on the list thinking, "do I have enough X to add this feature?" and "am I willing to give up some other feature so I have enough X for this one?"

You'll also spend a lot of time thinking, "can I make this feature use resource X more efficiently, so I have more X to add another feature I want?"

The one thing you can't do, but is everyone's first choice, is use more X than you actually have. That's why designers come up with phrases like, "muder your darlings". You can spend a month explaining how cool a feature will be, and how great life would be if you added it, how much fun it would be to create it, etc, etc, and not one word of it will make a damn it of difference if you don't have enough X to make it happen, and aren't willing to give up anything that could give you more X.

Hardware is controlled by the laws of physics, and the laws of physics are 100% immune to social engineering. You can't cajole them, convince them, impress them, or intimidate them, but there's no physical limit to the amount of time, money, and energy you can waste trying. Many, many, many companies and professionals have learned that the hard way.

The first and best skill a designer can learn about making design tradeoffs is when and where to say "no". Sometimes saying no to an idea is extremely valuable to a project, and sometimes it's a downright awful idea. It takes practice to learn the difference, as you refine your sense of what will actually be good for the project, and what's just clutter with an enthusiastic sales pitch. Just be prepared for the day you think, "I really wanted this, I really worked hard on it, and now that I see it in action, it really kind of sucks." It will happen more than once if you're doing anything at all interesting.

One of the easier design tradeoffs, especially for personal projects, is to pay for more resources directly by adding more hardware. If you have more code than an ATmega32u4 can execute, you can get more CPU speed, RAM, and storage with a Trinket M0. You can also decide that you've taken the original platform as far as it will go, and use a standalone FONA with any microcontroller from the Feather line. The whole idea of the Feather is to make it as easy as possible to migrate a project from one microcontroller to another.

It always boils down to the same basic questions though: "do I have enough X to do this?", "am I willing to give up some other feature to get more of the X I have?" and, "do I want this feature enough to add more X to the project?"

adafruit_support_mike
 
Posts: 57131
Joined: Thu Feb 11, 2010 2:51 pm

Re: get out of memory?

by fredpet on Thu May 16, 2019 6:55 am

hi mike,
thanks a lot for your detailed answer!
so I have to deal with it...

greetings fred

fredpet
 
Posts: 12
Joined: Wed Feb 13, 2019 6:30 pm

Re: get out of memory?

by jim_lee on Thu May 16, 2019 2:52 pm

Or you could break up the workload and add more processors. That's what I tend to do.

-jim lee

jim_lee
 
Posts: 492
Joined: Thu May 24, 2012 8:24 pm

Re: get out of memory?

by fredpet on Sat May 18, 2019 9:38 am

hi jim lee,
thanks for your answer.
maybe I get my proggy in the fona...
otherwise I will think about your idea.

thanks
fred

fredpet
 
Posts: 12
Joined: Wed Feb 13, 2019 6:30 pm

Please be positive and constructive with your questions and comments.