AndrewGG 0 Posted October 7, 2016 Share Posted October 7, 2016 I am using MSP432P401R in energia . I would like to see the available memory in RAM after running my program. I found a previous post related to this in http://forum.43oh.com/topic/2969-application-ram-usage/ . But i am still stuck. I am using Memory free library of arduino ( http://playground.arduino.cc/Code/AvailableMemory ) and i am getting errors like C:\DOCUME~1\James\LOCALS~1\Temp\build4403779855877337752.tmp/Flasher2.cpp:178: undefined reference to `__brkval'C:\DOCUME~1\James\LOCALS~1\Temp\build4403779855877337752.tmp/Flasher2.cpp:178: undefined reference to `__heap_start' I think __brkval , __heap_start are pointers to locations in memory (http://jon.oxer.com....duinoMemory.pdf) . What is the corresponding pointers to be used in energia. Any other way to find the availble free memory in RAm in energia (MSP432). Quote Link to post Share on other sites
Rei Vilo 695 Posted October 7, 2016 Share Posted October 7, 2016 The library is designed for the AVR MCU, not the MSP432. AndrewGG 1 Quote Link to post Share on other sites
AndrewGG 0 Posted October 7, 2016 Author Share Posted October 7, 2016 Anyother way i can see the available free memory of my program in energia (MSP432). Quote Link to post Share on other sites
energia 484 Posted October 7, 2016 Share Posted October 7, 2016 With memory free I assume you mean heap and stack usage/free. There is a nifty monitor Sketch that will exactly tell you that. You can find it in File->Examples->10.MultiTasking->Monitor. MSP432's implementation of the Wiring language is based on TI-RTOS which gives you Multi Tasking support (Hence Energia MT). You can easily integrate this monitor Sketch into your program: 1: Open up your program. 2: Create a new tab named Monitor. 3: Open up the Monitor example. 4: Copy paste the Monitor Sketch into your new Monitor tab. 5: Verify and upload. Note that the baudrate of the Monitor Sketch is set to 9600 by default. So make sure that if you are using Serial in your Sketch, that the 2 match their baudrate. Now open up the Serial monitor and the Line ending pull down in the Serial monitor to "Carriage Return". Now type help in the input window at the top of the Serial monitor and hit the Send button. For statistics on all Sketches send stats. Robert Quote Link to post Share on other sites
energia 484 Posted October 7, 2016 Share Posted October 7, 2016 It will look something like this: > help Available commands: dm dump memory wm write to memory (32 bits) wm2 write to memory (16 bits) wm1 write to memory (8 bits) dw digitalWrite to pin dr digitalRead from pin aw analogWrite to pin ar analogRead from pin pri Set task priority spi SPI transfer stats Print CPU utlization info help Get information on commands. Usage: help [command] > > stats Total CPU Load: 0.1 Task info: task: Idle/0x200004ec, pri: 0, stack usage: 336/1024, mode: READY load: 99.8 task: mon_loop/0x200023b8, pri: 2, stack usage: 668/2048, mode: RUNNING load: 0.1 Hwi stack usage: 440/1024 Heap usage: 2312/56400 AndrewGG and dubnet 2 Quote Link to post Share on other sites
AndrewGG 0 Posted October 16, 2016 Author Share Posted October 16, 2016 Thanks for pointing out. I ran my program as mentioned above and got the below results. statsTotal CPU Load: 0.6 Task info: task: Idle/0x200004f8, pri: 0, stack usage: 336/1024, mode: READY load: 99.3 task: mon_loop/0x200026b8, pri: 2, stack usage: 704/2048, mode: RUNNING load: 0.1 task: loopsketch_oct04a/0x20002f38, pri: 2, stack usage: 2048/2048, mode: BLOCKED load: 0.4 Hwi stack usage: 448/1024 Heap usage: 4488/55632 I think the stack is getting overflow. If i further increase my array size, then my program does not work. I tried in CCS it was working. I guess the stack can be set in CCS and its enough to support my program. Similarly how can i increase the stack size in energia. Thanks for the help Andrew Quote Link to post Share on other sites
energia 484 Posted October 21, 2016 Share Posted October 21, 2016 Seems indeed that you have a stack size issue with your loopsketch_oct04a. Unless you have deep calls and passing large amounts of data to those calls I doubt that you need more stack. Can you post your Sketch so that we can all have a look at it? AndrewGG 1 Quote Link to post Share on other sites
AndrewGG 0 Posted October 27, 2016 Author Share Posted October 27, 2016 I am sorry as i cant post my sketch . Yes the data i am handling is large . So i need to increase the stack. When i used CCS , My program was working good when i increased the stack size. So kindly provide me the steps in increasing the stack size in energia. Any help would be great.. Thank You Andrew Quote Link to post Share on other sites
energia 484 Posted October 31, 2016 Share Posted October 31, 2016 You can change the stack size manually by editing the main.template located in energia/tools/ino2cpp/1.0.2/templates/msp432/ The following are the paths to the root of that directory: On GNU/Linuxes: ~/.arduino15/packages/ On Windows: %APPDATA%\Arduino15\packages\ On MacOSXes: ~/Library/Arduino15/packages/ Edit the file main.template in the directory shown above + energia/tools/ino2cpp/1.0.2/templates/msp432/ Look for: taskParams.stackSize = 0x800; Then change it to the stack size you think would be appropriate. Robert 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.