B@tto 51 Posted August 4, 2017 Share Posted August 4, 2017 Hi, I just noticed an excessive consumption of ram by Wire on G2553 (I did not test on other µC) : 400 bytes !! I took a look at Wire.h but can't find where this memory is used. If anyone can confirm this and/or have an idea about this issue ? Regards Quote Link to post Share on other sites
B@tto 51 Posted August 26, 2017 Author Share Posted August 26, 2017 Up Quote Link to post Share on other sites
Rei Vilo 692 Posted August 26, 2017 Share Posted August 26, 2017 Which framework? I presume you're using Energia. Which release of Energia? Which release of the MSP430 boards package? Quote Link to post Share on other sites
B@tto 51 Posted August 28, 2017 Author Share Posted August 28, 2017 Hi, Energia of course I'm using the last release : 1.0.1 Regards Quote Link to post Share on other sites
Rei Vilo 692 Posted August 28, 2017 Share Posted August 28, 2017 Latest board package is 1.0.2 for MSP430. If you dig into ~/Library/Energia15/packages/energia/hardware/msp430/1.0.2/libraries/Wire, you will see that the default I²C port on pins 9 and 10 is implemented with a software driver (twi_sw.c and twi_sw.h). There are 2 buffers TwoWire::rxBuffer and TwoWire::txBuffer with size BUFFER_LENGTH = 16 (Wire.cpp and Wire.h). For a more compact I²C library, but only on pins 15 and 16, use Energia 12. Quote Link to post Share on other sites
B@tto 51 Posted August 28, 2017 Author Share Posted August 28, 2017 I'm using hardware i2c, and buffer size are the same, but it does not explain why it take so much RAM. Even 100 bytes would be rather normal, but 400 ?! That doesn't sound normal for me and I checked everywhere I don't see where this RAM is used EDIT : I updated to 1.0.2 it's much better with around 200 bytes. I still can't explain this memory footprint with a buffer of 16 ( x 4 if I understand how the library works) so I a read the library, I would say that 100 bytes would be fare Quote Link to post Share on other sites
dubnet 238 Posted August 29, 2017 Share Posted August 29, 2017 My understanding is that Energia will consume more resources than an equivalent program written in C using, for example, CCS. Since Energia abstracts away some of the hardware details in favor of simpler programming, that abstraction consumes extra flash and ram. Trying V12 of Energia as Rei Vilo suggested or moving to CCS would perhaps get the numbers down to what you are expecting/require for your application. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.