====== SDK 12.3.0 기준 =========
1) 일반 app 수정
DFU 진입을 원하는 BLE 서비스에서 하기 코드 추가
테스트용으로 귀찮아서 노티 서비스에 추가함.
if(p_evt_write->data[0] == 1)
{
p_our_service->noti_our_enable = true;
NRF_LOG_INFO("Notification enabled\r\n");
#define BOOTLOADER_DFU_START 0xB1
NRF_POWER->GPREGRET = BOOTLOADER_DFU_START;
NRF_LOG_INFO("bootloder reset!!\r\n");
NVIC_SystemReset();
}
else if(p_evt_write->data[0] == 0)
{
p_our_service->noti_our_enable = false;
NRF_LOG_INFO("Notification disabled\r\n");
}
2) 부트로더 수정
nrf_dfu.c
uint32_t nrf_dfu_init()
{
...
#define BOOTLOADER_DFU_START 0xB1
//if (NRF_POWER->GPREGRET == BOOTLOADER_DFU_START)
if(NRF_POWER->GPREGRET & BOOTLOADER_DFU_START)
{
NRF_POWER->GPREGRET &= ~BOOTLOADER_DFU_START;
NRF_LOG_INFO("Application sent bootloader request Comand\n");
enter_bootloader_mode = 1;
}
}
'BLE > Nordic' 카테고리의 다른 글
NFC 관련 (일반 GPIO 설정) (0) | 2018.03.21 |
---|---|
인증 테스트 방법 (DTM) (0) | 2017.07.04 |