Out of Flash space due to large size of C++ libstdc++.a library

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

We are presently developing code for the Avnet BCM4343W IoT starter Kit using the WiCED IDE.   The standard linker includes a very large GNU C++ library called "libstdc++.a" which uses up over a third of the 512K flash app space.  I would like to try to include the smaller C++ library called "libsupc++.a" which only supports basic functionality.  But I can not find in the Help documentation which option in the IDE is used to select one C++ library over another.

Is it even possible to change this library, considering that the standard WiFI and BT libraries may need the full features of the libstdc++.a library?

If anyone has any insights on this I would appreciate your feedback.

0 Likes
1 Solution
Anonymous
Not applicable

There is no example within the SDK but perhaps others on the community might have some examples to this effect

But I would caution that using C++ would be challenging on most of the MCUs on WICED since the amount of RAM these typically have is 128KB and since heap usage on C++ is might higher than C, this would be a problem.

Some MCUs are available with 256KB or higher RAM and would be more suitable to run C++ code

View solution in original post

0 Likes
7 Replies
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

Adding peter_fenn​ and andrew997

0 Likes
Anonymous
Not applicable

I just got a call from a development firm saying that they got a referral from Broadcom to contact me (apparently to contract their consultants).   He probably got my contact information from this forum (I obscured my phone number)

It seems that the answer is that the "libstdc++.a" library has hundreds of dependencies to the WICED WiFi, BT libraries and our own library, and we can not do anything to make the "libstdc++.a" library smaller.

All I was looking for is some "internal" insights on perhaps some other "non published" versions of that library that was paired down in size (e.g. by removing C++ template support).  The alternative "libsupc++.a" library seems to be simplfied a bit too much for our needs.

Rob

0 Likes

Not sure which development firm would have contacted you as it should have been someone from Avnet, our distribution partner that created the board you using. Also, when you register, you can indicate whether or not you want to be contacted or not: "Please contact me regarding product support" = yes within your profile today.

Since this is a library related question, they will most likely not be able to help. I can move it back to the WICED forum and ask either nsankar​ or vik86​ to respond.

My guess is that while it may be technically possible to swap out and use the smaller library, this has never been tested thus may not be supported as it may break other functionality.

Note that Avnet themselves also run a forum specific to this board that is located here: Avnet CloudConnectKits

andrew997

peter_fenn

0 Likes
Anonymous
Not applicable

Thank you for your response…  I'm going to close this out..  If Avnet's experience is that other customers do not have a problem with the 187K c++ library size, we will have to deal with it for now.

0 Likes
Anonymous
Not applicable

Can you please post  your build output log?

I am not sure why libstdc++ is getting pulled into your code since in general we do not use C++ in our libraries or apps. This is an embedded system and C++ is generally quite heavy for it. So there is something else pulling in this code for you.

Also libsupc++.a only supports very basic functions so won't be a replacement for stdc++ if it is really being used in your code or our code somewhere, but for now I cannot find any application in our SDK that uses this

0 Likes
Anonymous
Not applicable

I am interested in using C++ and some of the STL collection classes and string class. I do not need streams and some of the more bloated things in C++. Is there a pattern / example of using C++ with WICED?

0 Likes
Anonymous
Not applicable

There is no example within the SDK but perhaps others on the community might have some examples to this effect

But I would caution that using C++ would be challenging on most of the MCUs on WICED since the amount of RAM these typically have is 128KB and since heap usage on C++ is might higher than C, this would be a problem.

Some MCUs are available with 256KB or higher RAM and would be more suitable to run C++ code

0 Likes