juani_c 66 Posted December 6, 2014 Share Posted December 6, 2014 I'm testing Mahony's algorithms for attitude estimation and I'm using a Launchpad with a MSP430g2553. In the code I'm using there are two functions; one calculate the attitude from accelerometer and gyro data (IMU) and the other one add magnetometer data (AHRS). I tested first the IMU and worked OK. Then I tested the AHRS and I couldn't make it work. What I could find through debugging was this: In the top of the program there are four variables q0=1, q1=0, q2=0 and q3=0 and in the algorithm there is a sqrt() function, it seems that for some reason the sqrt() function overwrite the values in q0, q1, etc. As the algorithm use then those values the final values is of course wrong. I then tried the program with AHRS in a MSP-EXP430FR5739 and it worked OK. According to CCS the Memory Allocation in the MSP430G2553 is RAM=344 FLASH=12.354 and in the MSP430FR5739 is RAM=518 FLASH=13.034. It seems that the code need 518 bytes of RAM, higher than the 512 of the MSP430G2553, I asume that's the issue, correct? If is that, why CCS shows only 344 bytes used? Is there some way to know when I'm running out of RAM (other than the thing don't working...)? some way to see it in CCS? Quote 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.