I am facing Hard Fault issue while writing data over TWI.
nRF52832 SDK for Mesh V3.2.0
Hardware board - nRF52 Development Kit
Windows 7 64 Bit
TWI slave device - Touch Sensor
I am trying interface nRF52832 with Touch Sensor over TWI. In this process I was expected to write around 15-20 control resistors of Touch sensor.
But I am able to transmit/write only single byte over TWI after that nRF52 remains in the Hard Fault Handler.
Before initiating write sequence I have ensured controller is free from TWI activity with the help of function "nrf_drv_twi_is_busy()".
Please guide to resolve this Hard Fault issue.
Thanks & Regards,
Thank you for your reply.
We are using "nRF52832 SDK for Mesh V3.2.0"
First I will turn on Hardfault handler and check for the error. If required I'll try to share my code.
I have turned on Hardfault Handler and checked. My observations are as follows.
1) After enabling Hardfault Handler I am not getting any log in Debug Terminal for the failure condition. Weather Hardfault handler prints log in same Debug Terminal or any other port it sends log (like Serial).
2) If I run same project in release mode (Instead of debug mode) then it works OK. (No Hardfault issue or Reset condition observed in Debug Terminal)
The application should return an error code before it goes to the hard fault handler in debug mode. Which function is it that causes the application to go the hard fault handler? Is it nrf_drv_twi_tx? What does it return?
While sending data over SIGmesh application is getting hard-fault error.
And as per debugging it shows that "timer_sch_reschedule()" is causing hard-fault error
This refers to above issue. I wish to update you as follows.
After re-allocating functionality (I2C write activity started and completed out of ISR function and some minor changes to minimize load on ISR function)
Now I am getting Mesh assert at 0x0002B6DE error. It is related to function "timer_sch_reschedule()" in timer_scheduler.c file (checked with Addr2ling utility command)
Kindly guide us to resolve this error.
It's really difficult to provide good support without seeing any code. Could you share a project that will reproduce the error and is able to run on the development kit? You can copy and upload the project folder with config file, source files, and main. I can make the case private if you prefer it.