Jump to content
43oh

Is there an Energia matrix math library for the msp430 and Stellaris


Recommended Posts

So I was under the impression that you we running this on the StellarPad? Can you confirm on which platform you are running? StellarPad or LaunchPad?

 

If you are running on the LaunchPad then you could very well be running out of RAM.

 

The Serial lib takes up about 142 bytes. An empty Sketch takes about 32. So a Sketch using Serial is around 174 bytes of RAM. The 2553 has 512 bytes of RAM.

That leaves you very little for the Matrix itself taking in account that you need enough RAM to accommodate a call stack. If you are indeed running on the MSP430 then you are probably running into the case where the stack grows more then RAM left and causes a stack overflow into working RAM.

 

I compiled the MatrixMath_main example Sketch and examined it with msp430-size -A MatrixMath_main.cpp.elf.

That gives the following output. Note the .bss section is close to 512 bytes.

 

MatrixMath_main.cpp.elf  :
section            size    addr
.text              8976   49152
.rodata             482   58128
.data                 8     512
.bss                478     520
.noinit               2     998
.vectors             32   65504
.debug_aranges     1712       0
.debug_info       50231       0
.debug_abbrev     14137       0
.debug_line       17269       0
.debug_frame       5014       0
.debug_str         9925       0
.debug_loc        16438       0
.debug_ranges       884       0
Total            125588

Compile the same Sketch for a 2452 (that only has 256 bytes of RAM) and the linker will warn you that you overflowed.

 

Edit: Changed 128 -> 256

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...