Jump to content

Heap / Stack pointer

Recommended Posts

This may work for getting the stack pointer...


unsigned * get_sp(void) { unsigned n; return &n; }


Egads. Yes, I suppose it may work.


The standard "intrinsic" in CCS is _get_SP_register() and msp430-elf-gcc should provide the same. mspgcc provides __read_stack_register() (it might not have the alias, in which case energia should probably add it).


Any toolchain should have something that does this for you without having to introduce undefined behavior.

Link to post
Share on other sites

Sorry, can't post the sketch, im using the webduino webserver.h library which is using string.h and streaming.h, i suspect the problem is somewhere deep in there. Im also using fatfs, adafruits cc300_mdns, rtclib, WiFi and WiFiUDP libraries.

The sketch worked well until i added the fatfs wrapper, had to use soft spi for the fatfs because somehow a second hardware spi crashes the cc3000.

The extra memory the fatfs uses seem to make the webduino code unstable. i suspect the heap is hitting the stack and then the code crashes somewhere in webserver.h.

I've read the CCS6 beta can import energia sketches, i should give it a try.

Sorry i can't get more specific or post a sketch, i'm working on a device i plan to get patented, but this is quite complicated and expensive.


Oh i nearly forgot, im using the Tiva-C Launchpad + CC3000 Booster pack + SD Card breakoutboard from ITead Studio.


regards, Thorvard

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.

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...