LC709203F test code giving hardfault

Hello,

I tried running the LC709203F test code in the RIOT/tests/driver_lc709203f on my SAMR21 Xplained Pro board and it is giving me a hardfault as seen in the following image:

In the readme it says to make sure “LC709203F_INT_PIN is set in your board’s periph_conf.h”.

I am assuming this means to use “INT” pin on the battery gauge as a GPIO and define that in the in boards/samr21-xpro/include/periph_conf.h file, which I did with the line:

#define LC709203F_INT_PIN GPIO(PA,13) //one of the available GPIOs of the board

,however it still gives me the hardfault above.

I am a beginner with RIOT, so I don’t know whether I am doing something wrong or there is a bug with the drivers, so any guidance on how to resolve this would be greatly appreciated.

Thanks.

Hi,

The README of the test application is incorrect, LC709203F_INT_PIN is used nowhere. Looking at the driver parameters in drivers/lc709203f/include/lc709203f_params.h the define should be LC709203F_PARAMS_ALARM_PIN. And it should be defined in the board.h header (for simplicity), in your case:

#define LC709203F_PARAMS_ALARM_PIN   GPIO(PA,13)

Thank you, works now!