0

I'm trying to interface BME680 gas sensor module with AVR controller (Atmega644p to be specific) using Atmel Studio in Windows platform. The BME680 does come with example functions multiple .h,.c files for configuration and one .a (static library). .h and .c files are calling some functions from static library as well, so we need to include all available .h, .c and .a files.

.a file was new to me and after basic web search I concluded that .a files are for Unix as .lib files are in Windows.

So can you find me a way to either:

convert my in hand .a file to .lib file? or to add .a file in Atmel studio in Windows platform?

Any help will be highly appreciated.

I did try to include .a file using following steps:

  1. In Project=>Properties
  2. click on the Toolchain tab Under XC8 Linker
  3. click on Libraries In the Libraries (-l) window
  4. click the "+" sign and add "libalgobsec" to the list In the Library search path (-L) window
  5. click on the "+" sign In the "Add Library search path (-L) dialog
  6. click on the "..." button In the file dialog, navigate to the folder that contains libalgobsec.a
  7. Click okay.
  8. Under Project Properties => XC8 Linker => Miscellaneous => Other Objects, add: -u _fstat -u _read -u _write

But it gives this error: Compilation Error.

6
  • I did try to include .a file using following steps: In Project=>Properties, click on the Toolchain tab Under XC8 Linker, click on Libraries In the Libraries (-l) window, click the "+" sign and add "libalgobsec" to the list In the Library search path (-L) window, click on the "+" sign In the "Add Library search path (-L) dialog, click on the "..." button In the file dialog, navigate to the folder that contains libalgobsec.a Click okay. Under Project Properties => XC8 Linker => Miscellaneous => Other Objects, add: -u _fstat -u _read -u _write But it doesn't work. Commented Mar 17, 2021 at 20:08
  • "doesn't work" is not a good description. You'll need to post actual error complete messages. But if they provide .c files, you probably can just compile those yourself and ignore the .a file, and that is preferable in case there are bugs in the code or you just want to understand what is going on in it. Commented Mar 18, 2021 at 3:05
  • @DavidGrayson Thank you for response, I couldn't find a way to attach image in comment so I have updated the original question. Basically .h and .c files are calling some functions from static library as well, so we need to add all .h, .c and .a files. Commented Mar 18, 2021 at 8:50
  • The error message shows that the compiler found your .a file but skipped it because it's incompatible. Where exactly did you find the file and how do you know it is compatible with AVRs? Maybe it's a Linux library or something. Commented Mar 18, 2021 at 13:41
  • So BOSCH does provide support for different controllers, as the package downloaded from its website has support for [these] (i.imgur.com/BOqf3Eu.png) controller and AVR has these sub-folders and each sub-folder has these files along with some generic configuration files (and an Arduino example) I've tried .a file from AVR8_megaAVR and AVR8_XMEGA folder but it gives same error. Commented Mar 18, 2021 at 19:24

1 Answer 1

0

After 2 months of experiments, coordination with BOSCH and everything, here is the conclusion.

Pre-compiled library is only compatible with AVR controllers having Boot Memory of 256 Kbytes, and only following 4 controllers make it to list:

  1. ATmega2561
  2. ATmega2564RFR2
  3. ATmega2560
  4. ATmega256RFR2

So if you try to compile libalgobsec.a available in BSEC software for Atmega controllers with any other controller than mentioned above (in my case Atmega644P), it simply doesn't compile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.