2013-03-28 05:40 AM
hello ,
i am using stm32f3 discovery kit which has inbulit accelerometer sensor.i need a code to read the accelerometer data.please help . #rtfm2013-03-28 06:03 AM
So why don't you look at the examples provided for the Discovery board?
Or the examples included in the Standard Peripheral Library?2013-03-28 10:14 AM
yes i check all example but not able to find any example related to I2C prtocol using to capture accelerometer data.
2013-03-31 06:43 AM
Download the firmware examples
http://www.st.com/web/en/catalog/tools/PF258154 Unpack the file and go to the folder STM32F3-Discovery_FW_V1.1.0\Project\Demonstration\ Open the correct project with your IDE. It is the demo firmware that ships with the board, it has all the code you need.2013-04-02 04:03 AM
2013-04-03 11:07 AM
If you use the demonstration project file on another project, first verify that both projects use the same libraries. Different versions of ST standard peripheral libraries and CMSIS libraries have some changes that may be the source of your problem.
The next step is to open side by side two instances of your IDE, one with your project and one with the demonstration project. Then open the project configurations options and verify that the options are the same or compatible. The best option for me is to avoid importing another file to my projects. When I find another project that has some functionality I want, I just go through its' code until I understand how it works (right click->go to definition really helps). Then I implement the same functionality on my project from ground up.2013-04-03 11:49 AM
Sounds like you need to learn how to use your IDE, and create projects properly.
May be you can clone a working project, but you should consider all the metadata stored in the options, be it compiler settings, defines, FPU enabled, etc. If your code ends up in an infinite loop, probably a Hard Fault, you really need to learn how to debug things. Are you using FPU instructions, is the FPU enabled, is that faulting. Is it stuck in one of the I2C waiting loops. These are obviously poorly constructed, but still you could figure out which one it's stuck in. Learn how to use your tools, or you'll be wasting hours fighting these problems.