硬件问题:
问题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"