Hello guys!
I have a problem with i2c interface on JN5168 module.
I have a function to initialize I2C interface on module, but it completely blocks device (Look like hard fault)
Here is includes:
/*-- Hardware specific libraries --------------------------------------------*/
#include "AppHardwareApi.h"
Here is my function:
/******************************************************************************
* @brief Function
* @param None.
* @retval None.
*****************************************************************************/
void memExt_I2C_Init_HW(void)
{
Debug_WriteLine("memExt_I2C_Init_HW()");
Debug_WriteLine("Before vAHI_SiMasterConfigure()");
////16M/((scale+1)*5) = 100k
//Init I2C
//vAHI_SiMasterConfigure(TRUE, FALSE, 7); // Enabled, no interrupt, 400kHz
vAHI_SiMasterConfigure(TRUE, FALSE, 31); // Enabled, no interrupt, 100kHz
Debug_WriteLine("After vAHI_SiMasterConfigure()");
}
In my debug log i see next:
0000000.168: memExt_I2C_Init_HW()
0000000.171: Before vAHI_SiMasterConfigure()
{\xfe}
And after no more debug log, device freezes.
What is my error, why i2c is not initializing?
Of course this code executing after u32AHI_Init();
My function caling from in vStartApplication();
Using JN-4170 SDK.