硬件問題:
問題1:藍牙不廣播,或者有廣播但連接不上,檢查 32M晶振
問題2:特殊管腳使用
1、P9,P10 :該管腳默認就是NFC功能,NFC儘量不用,作爲普通IO需要程序配置
2、P21 :默認是復位功能
問題3:
52832電源電路有問題(電容電感焊接問題),導致可以debug但load不能運行,串口打印信息不全
軟件問題:
問題1:10ms的定時器,中間的延時不能超過 nrf_delay_ms(20);
問題2:浮點運算器功耗
NVIC_SetPriority(FPU_IRQn, APP_IRQ_PRIORITY_LOW);
NVIC_EnableIRQ(FPU_IRQn);
#define FPU_EXCEPTION_MASK 0x0000009F
void FPU_IRQHandler(void)
{
uint32_t *fpscr = (uint32_t *)(FPU->FPCAR+0x40);
(void)__get_FPSCR();
*fpscr = *fpscr & ~(FPU_EXCEPTION_MASK);
}
/**@brief Function for placing the application in low power state while waiting for events.
*/
不清中斷,無法再次進入睡眠模式sd_app_evt_wait();
#define FPU_EXCEPTION_MASK 0x0000009F
static void power_manage(void)
{
/* Clear exceptions and PendingIRQ from the FPU unit */
__set_FPSCR(__get_FPSCR() & ~(FPU_EXCEPTION_MASK));
(void) __get_FPSCR();
NVIC_ClearPendingIRQ(FPU_IRQn);
/* Call SoftDevice Wait For event */
uint32_t err_code = sd_app_evt_wait();
APP_ERROR_CHECK(err_code);
}
問題3:NRF_ERROR_INVALID_STATE
由原來Static ble_nus_t m_nus; /**< Structure to identify the Nordic UART Service. */
改爲extern ,因爲其他文件也調用,所以要外部引用聲明
ble_nus_t m_nus; /**< Structure to identify the Nordic UART Service. */
extern ble_nus_t m_nus; /**< Structure to identify the Nordic UART Service. */
問題4:
for循環調用erro = ble_nus_string_send( &m_nus, datbuf, 20 );
多次後返回BLE_ERROR_NO_TX_PACKETS錯誤。
#define BLE_ERROR_NO_TX_PACKETS (NRF_ERROR_STK_BASE_NUM+0x004) /**< Not enough application packets available on this connection. */
這樣發送方式有問題,大量數據改用定時器發送。
問題5:
問題6:
串口數據打印不全,改大發送buff
問題7:
不接外部32.768K晶振,使用內部時鐘配置
//#define NRF_CLOCK_LFCLKSRC {.source = NRF_CLOCK_LF_SRC_XTAL, \
// .rc_ctiv = 0, \
// .rc_temp_ctiv = 0, \
// .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
#define NRF_CLOCK_LFCLKSRC {.source = NRF_CLOCK_LF_SRC_RC, \
.rc_ctiv = 32, \
.rc_temp_ctiv = 2, \
.xtal_accuracy = 0}
問題8:
..\user\USER_KEY_AND_LED\user_key_and_led.c(51): error: #20: identifier "APP_IRQ_PRIORITY_HIGH" is undefined
添加頭文件 :#include "app_util_platform.h"