- 由外部32768晶振转成内部32768
修改sdk_config.h中的宏定义
1) 系统低速32768时钟// CLOCK_ENABLED - nrf_drv_clock - CLOCK peripheral driver //========================================================== #ifndef CLOCK_ENABLED #define CLOCK_ENABLED 1 #endif
// CLOCK_CONFIG_LF_SRC - LF Clock Source // RC // XTAL // Synth
#ifndef CLOCK_CONFIG_LF_SRC #define CLOCK_CONFIG_LF_SRC 0 #endif
// CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority
// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice // 0 (highest) // 1 // 2 // 3 // 4 // 5 // 6 // 7
#ifndef CLOCK_CONFIG_IRQ_PRIORITY #define CLOCK_CONFIG_IRQ_PRIORITY 7 #endif
2) 协议栈低速32768时钟
//==========================================================
// Clock - SoftDevice clock configuration
//========================================================== // NRF_SDH_CLOCK_LF_SRC - SoftDevice clock source. // NRF_CLOCK_LF_SRC_RC // NRF_CLOCK_LF_SRC_XTAL // NRF_CLOCK_LF_SRC_SYNTH
#ifndef NRF_SDH_CLOCK_LF_SRC #define NRF_SDH_CLOCK_LF_SRC 0 #endif
// NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. #ifndef NRF_SDH_CLOCK_LF_RC_CTIV #define NRF_SDH_CLOCK_LF_RC_CTIV 16 #endif
// NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. // How often (in number of calibration intervals) the RC oscillator shall be calibrated // if the temperature has not changed.
#ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2 #endif
// NRF_SDH_CLOCK_LF_XTAL_ACCURACY - External crystal clock accuracy used in the LL to compute timing windows. // NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM // NRF_CLOCK_LF_XTAL_ACCURACY_500_PPM // NRF_CLOCK_LF_XTAL_ACCURACY_150_PPM // NRF_CLOCK_LF_XTAL_ACCURACY_100_PPM // NRF_CLOCK_LF_XTAL_ACCURACY_75_PPM // NRF_CLOCK_LF_XTAL_ACCURACY_50_PPM // NRF_CLOCK_LF_XTAL_ACCURACY_30_PPM // NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM
#ifndef NRF_SDH_CLOCK_LF_XTAL_ACCURACY #define NRF_SDH_CLOCK_LF_XTAL_ACCURACY 7 #endif
此版本的SDK没有对NRF_SDH_CLOCK_LF_XTAL_ACCURACY 作编译限制,建议使用
NRF_CLOCK_LF_XTAL_ACCURACY_500_PPM 这个参数