I ran into a problem, where the setup is following: DA14531 DB with an i2c sensor connected through Pro devkit. SDA is P2_7, SCL is P2_8, software and hardware is tested and working - another code, which reads the sensor runs flawless.
This code, which runs to NMI handler __BKPT(0) is doing a normal i2c readout, nothing special. Flash is disabled, it is running from debug, because I use hibernation. Wake up and sleep works, but when I try to run the readout function, code stops at __BKPT(0).
What is __BKPT(0)?
Why does i2c readout not work? Same code runs in anouther sketch without problems.
Attached two pics from IDE.
Thanks in advance!
I found the culprit. I did not reserve, nor configured the pins for the i2c comm. Then, the development BKPT() is called.
RESERVE_GPIO and GPIO_ConfigurePin solved the issue.
I managed to re-test the app and found no evidence of failure so far. I optimized driver, checked callbacks but found nothing.
My only idea is around sleeping and hibernation. Do I have to care about re-init of i2c bus on wake up or the standard user_periph_setup handles it for me (as if it was a normal boot operation)?
Thanks for your response in advance!
Thanks for your comments. That is correct. The pins should be reserved and configured. Please see more details here :