5 years, 10 months ago.

Can't compile PAH8011 example.

Hi,

I'm working with PAH8011 low power heart rate monitor optical chip on nRF52 DK development board. I came across the library.

Link: https://os.mbed.com/users/pixus_mbed/code/PixArt_PAH8011_HeartRate_nRF52/.

I tried compiling the code using the command line interface and the cloud compiler. But both of them throws errors.

Error: "Cannot open source input file "nrf_drv_rng.h": No such file or directory in "extras/pixart_heart_rate_demo/pixart_pah8011/mbed-os.lib/targets/TARGET_NORDIC/TARGET_NRF5/trng_api.c", Line: 41, Col: 26"

I used the "build repositories" option, which failed to compile the project.

Error: "Internal error. Failed!".

Shouldn't it work out of the box? I might be missing something very obvious here, as this is the first time I am using mbed, but please help me out. May be downgrading the version is an option? I would be obliged if anyone would figure out the issue.

Platform: nRF52 DK (development board).

Sensor to interface: PAH8011

Thank you.

Allan.

1 Answer

5 years, 10 months ago.

I have no idea who put that demo together but it includes three distinct copies of Mbed OS. That's not good. In addition I had to patch some other things; such as getting rid of <cstdint> in pixart_pah8011.h, and putting another include <stdint.h> somewhere.

After that it builds fine with ARMCC5.

So...

~/repos/PixArt_PAH8011_HeartRate_nRF52 $ mbed remove mbed
[mbed] Removing library "mbed" in "/Users/janjon01/repos/PixArt_PAH8011_HeartRate_nRF52/mbed"
~/repos/PixArt_PAH8011_HeartRate_nRF52 $ mbed remove pixart_heart_rate_demo/pixart_pah8011/mbed-os
[mbed] Removing library "mbed-os" in "/Users/janjon01/repos/PixArt_PAH8011_HeartRate_nRF52/pixart_heart_rate_demo/pixart_pah8011/mbed-os"
~/repos/PixArt_PAH8011_HeartRate_nRF52 $ mbed remove pixart_heart_rate_demo/mbed-os
[mbed] Removing library "mbed-os" in "/Users/janjon01/repos/PixArt_PAH8011_HeartRate_nRF52/pixart_heart_rate_demo/mbed-os"
~/repos/PixArt_PAH8011_HeartRate_nRF52 $ mbed add mbed-os
[mbed] Adding library "mbed-os" from "ssh://git@github.com/ARMmbed/mbed-os.git" at latest revision in the current branch
[mbed] Updating reference "mbed-os" -> "https://github.com/ARMmbed/mbed-os/#501a7b6949f7ae365fecfe05f35fe6c3048a086e"

Then try and build with ARMCC. Unfortunately this project cannot be built with GCC, as they only have the compiled code for ARMCC in the library.

Hi Jan,

Thank you for the quick answer and the effort that you have put in. But I was still not able to compile the code.

I tried getting the latest repositories with the "Update All" option but that too didn't work. Then I went into "Revisions" options and saw that the mbed version was very old (pointing to some commit in 2017). I changed the head and the code compiled successfully. But neither the "build repositories" option on the page https://os.mbed.com/teams/PixArt/code/PixArt_PAH8011_HeartRate_NUCLEO-L476RG/ nor importing the code into IAR through "Export to desktop IDE" works.

I'm new to this platform and online compiling. I'm sorry if the questions are silly or out of context .

Thank you.

Allan.

posted by Allan Tom Mathew 29 May 2018

Hi Jan,

Update: I'm able to export the repository as an IAR project. It lacks 'pixart_heart_rate_demo.h' but manually adding the file solved the problem. But the IAR compiler throws an error.

Error[Li060]: module "SerialBase.o(mbed.a)" contains C++ code built for use with the (E)C++98 library. This code is not link compatible with the new (C++14) library.

The IAR doesn't have a lot of configurations to tweak. Do you have an idea as to how to tackle this error?

Thank you.

posted by Allan Tom Mathew 29 May 2018

Hi Allan,

You need to use IAR v7 not IAR v8 with precompiled binary. In the end I'm not sure this will work as the pixhart precompiled binary targets armcc; not IAR.

posted by Vincent (pan-) Coubard 04 Jun 2018

Yeah, as Vincent says, this library only contains precompiled binaries for ARMCC, not IAR...

posted by Jan Jongboom 04 Jun 2018

Hi Vincent and Jan,

Thank you for the information. I did download the 7.80 version and tried compiling the code in it. I was able to tackle a lot of issues but got stuck on this error:

Error[Li005]: no definition for "hardfp_log10f" [referenced from peak_search.o(pah8series_motion5_326_m4f_keil.ar)] Error[Li005]: no definition for "hardfp_expf" [referenced from peak_search.o(pah8series_motion5_326_m4f_keil.ar)] Error[Li005]: no definition for "hardfp_sqrtf" [referenced from math_op.o(pah8series_motion5_326_m4f_keil.ar)]

I guess the pre-compiled binary is not working on IAR. Thanks a lot for the help. Really appreciate it.

Thank you.

posted by Allan Tom Mathew 11 Jun 2018