Jump to content
43oh

[Energia Library] Bosch BMP085 Template Library


Recommended Posts

 
  • Launchpad 1.5 msp430G2
  • 2553
  • Bosch BMP085 from sparkfun
  • (no links provided since this is Energia lib problem I think
  • using latest Energia 0101E0011 
  • Windows 7
  • code provided by OP
  • I tried searching for this error and nothing came up.  Did I miss something?  I downloaded the files, uploaded them to the Energia folder "libraries" folder I created, copied the libraries from the Arduino software, and uploaded the example file.  This is the error code I get:

 

c:/users/pat/desktop/rocket stuff/energia-0101e0011-windows/energia-0101e0011/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe: cannot open linker script file memory.x: No such file or directory
collect2: ld returned 1 exit status

 

Link to post
Share on other sites
  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

I finished up my first Energia project, a template library for the Bosch BMP085 temperature and pressure sensor. It uses I2C and supports temperature in Celsius and pressure in Pascal.   https://githu

Now tested on StellarPad and Arduino.

@@abecedarian From a quick glance at the source, Energia does only check whether USCI is present and then uses UCB0, which is wired to the same pins for G2553 and F5529. 4.2/4.1 would be UCB1.   IMO

Posted Images

Hmm, I haven't tried my library with the latest Energia yet. The error message doesn't ring a bell either.

 

Can you post some code to show how you use the library?

 

I used the ReadSensor.ino file included in the github zip file for this library. 

/*
 ReadSensor - Basic example of using I2C-based template library for Bosch BMP085 digital pressure sensor.
   Created by Adrian Studer, April 2013.
   Distributed under MIT License, see license.txt for details.   
*/

#include <Wire.h>          // required by BMP085 library
#include <C:/Users/Pat\Desktop/rocket stuff/energia-0101E0011-windows/energia-0101E0011/libraries/BMP085_t.h>      // import BMP085 template library

BMP085<0> PSensor;         // instantiate sensor, 0 = low precision pressure reading

void setup()
{
  Serial.begin(9600);      // initialize serial, used to display readings in Serial Monitor
  Wire.begin();            // initialize I2C that connects to sensor
  PSensor.begin();         // initalize pressure sensor
}

void loop()
{
  PSensor.refresh();                    // read current sensor data
  PSensor.calculate();                  // run calculations for temperature and pressure
  Serial.print("Temperature: ");         
  Serial.print(PSensor.temperature/10);  // display temperature in Celsius
  Serial.print(".");
  Serial.print(PSensor.temperature%10);  // display temperature in Celsius
  Serial.println("C");
  Serial.print("Pressure:    ");
  Serial.print((PSensor.pressure+50)/100);   // display pressure in hPa
  Serial.println("hPa");

  delay(5000);                          // wait a while before next loop
}

Link to post
Share on other sites

Ok, I get the same error with Energia E0011.

 

For what it's worth, even the Blink sketch throws a similar error. E0010 works just fine.

 

here the last line of the detailed compile output and the error:

 

C:\Other Programs\energia-0101E0011\hardware\tools\msp430\bin\msp430-gcc -Os
-Wl,-gc-sections,-u,main -mmcu=msp430f5529 -o
C:\Users\Adrian2\AppData\Local\Temp\build9069550804598847055.tmp\Blink.cpp.elf
C:\Users\Adrian2\AppData\Local\Temp\build9069550804598847055.tmp\Blink.cpp.o
C:\Users\Adrian2\AppData\Local\Temp\build9069550804598847055.tmp\core.a
-LC:\Users\Adrian2\AppData\Local\Temp\build9069550804598847055.tmp -lm 

c:/other programs/energia-0101e0011/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe:
cannot open linker script file memory.x: No such file or directory
collect2: ld returned 1 exit status
And for what it's worth, here the same command that works in E0010:

C:\Other Programs\energia-0101E0010\hardware\tools\msp430\bin\msp430-gcc -Os
-Wl,-gc-sections,-u,main -mmcu=msp430f5529 -o
C:\Users\Adrian2\AppData\Local\Temp\build1899634374725368843.tmp\Blink.cpp.elf
C:\Users\Adrian2\AppData\Local\Temp\build1899634374725368843.tmp\Blink.cpp.o
C:\Users\Adrian2\AppData\Local\Temp\build1899634374725368843.tmp\core.a
-LC:\Users\Adrian2\AppData\Local\Temp\build1899634374725368843.tmp -lm
Maybe someone familiar with the Energia build system can spot the issue.
Link to post
Share on other sites
  • 4 weeks later...

I finished up my first Energia project, a template library for the Bosch BMP085 temperature and pressure sensor. It uses I2C and supports temperature in Celsius and pressure in Pascal.

 

https://github.com/astuder/BMP085-template-library-Energia

 

Hi @@chicken

 

Thank you very much for your BMP085 library. It works nicely also with the Software I2C Master Library for MSP430G2553 written by Rei Vilo. I tested with MSP430G2 Launchpad and a BMP180 breakout module (bought from Ebay). In the attached screenshot the final value of the pressure was corrected for altitude (that's why the dumped value of p and the pressure are different).

 

Istvan Cserny

 

post-699-0-88936700-1391194560_thumb.png

Link to post
Share on other sites

It works nicely also with the Software I2C Master Library for MSP430G2553 written by Rei Vilo. I tested with MSP430G2 Launchpad and a BMP180 breakout module (bought from Ebay).

Thanks for the report. I'm happy to see that the library works with the newer BMP180 and software I2C. I will add this to the readme.

Link to post
Share on other sites
  • 8 months later...

I discovered a very strange behaviour of my BMP180 module. When it gets direct sunlight it immediately (within 1sec) reports higher altitude, and the reported temperature is also continuously increasing (the device becomes hot in reality, too). When I put it in the shadow(indirect sunlight) or cover it with a paper, it immediately sends the correct altitude, and the temperature starts decreasing. In the house (artificial light) or in darkness it works correctly.

Example:

altitude in shadow: 106m / temp: 18

Link to post
Share on other sites
  • 2 months later...

When I use the libary the reponse back from my BMP085 is alway 12.8C and 1000hPa. Did I fry my sensor ??

 

 

 

 

 

/*
 ReadSensor - Basic example of using I2C-based template library for Bosch BMP085 digital pressure sensor.
   Created by Adrian Studer, April 2013.
   Distributed under MIT License, see license.txt for details.   
*/

#include <Wire.h>          // required by BMP085 library
#include <BMP085_t.h>      // import BMP085 template library

BMP085<3> PSensor;         // instantiate sensor, 3 = high precision pressure reading

void setup()
{
  Serial.begin(9600);      // initialize serial, used to display readings in Serial Monitor
  Wire.begin();            // initialize I2C that connects to sensor
  PSensor.begin();         // initalize pressure sensor
 }

void loop()
{

  PSensor.refresh();                    // read current sensor data
  PSensor.calculate();                  // run calculations for temperature and pressure
  Serial.print("Temperature: ");         
  Serial.print(PSensor.temperature/10);  // display temperature in Celsius
  Serial.print(".");
  Serial.print(PSensor.temperature%10);  // display temperature in Celsius
  Serial.println("C");
  Serial.print("Pressure:    ");
  Serial.print((PSensor.pressure+50)/100);   // display pressure in hPa
  Serial.println("hPa");

  delay(5000);                          // wait a while before next loop
}
 

Link to post
Share on other sites
  • 3 months later...

OK, I'm getting confuseder and confuseder. I had the BMP085 working with an older Windows version of Energia and your library. I've updated to Energia 15 for Ubuntu and presumably have the latest version of BMP085_t.h (dated April 2013).

 

Now my program (on the MSP430F5529) apparently no longer sees the sensor!

 

IIRC I had to patch the earlier library to work with the F5529, but that shouldn't be necessary with this later one, right? I'm using the same "legacy" pin connections as before: SDA to P3.0 and SCL to P3.1.

 

I did notice this in your comments at the top of your driver:

MSP430
------

Tested with Energia 0101E0009
LaunchPad Rev1.5, TI MSP430G2553

Connections
* P1_6 => I2C SCL
* P1_7 => I2C SDA

If I understand, these pin assignments are used somewhere in the Wire library, and I've even read about a method

Wire.setModule()

that seemingly lets you choose from different I2C interfaces (defaulting to #3?). But I can't find any documentation of this.

Can you help clear up the confusion?

Link to post
Share on other sites

Make sure you use the latest version as available on GitHub, it was tested with the MSP430F5529 launchpad.

https://github.com/astuder/BMP085-template-library-Energia

 

Make sure to call Wire.begin and optionally Wire.setModule before using the library.

 

That being said, I haven't touched Energia in a while, so it's possible that my code needs to be adjusted for newer versions.

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