1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #include <stdint.h>
- #include "nrf.h"
- #include "nrf_bootloader_app_start.h"
- #include "nrf_bootloader_info.h"
- #include "nrf_log.h"
- #include "nrf_dfu_mbr.h"
- #include "nrf_log_ctrl.h"
- #include "nrf_bootloader_info.h"
- void nrf_bootloader_app_start_final(uint32_t start_addr);
- void nrf_bootloader_app_start(void)
- {
- uint32_t start_addr = MBR_SIZE;
- NRF_LOG_DEBUG("Running nrf_bootloader_app_start with address: 0x%08x", start_addr);
- uint32_t err_code;
-
-
- NRF_LOG_DEBUG("Disabling interrupts. NVIC->ICER[0]: 0x%x", NVIC->ICER[0]);
- NVIC->ICER[0]=0xFFFFFFFF;
- NVIC->ICPR[0]=0xFFFFFFFF;
- #if defined(__NRF_NVIC_ISER_COUNT) && __NRF_NVIC_ISER_COUNT == 2
- NVIC->ICER[1]=0xFFFFFFFF;
- NVIC->ICPR[1]=0xFFFFFFFF;
- #endif
- err_code = nrf_dfu_mbr_irq_forward_address_set();
- if (err_code != NRF_SUCCESS)
- {
- NRF_LOG_ERROR("Failed running nrf_dfu_mbr_irq_forward_address_set()");
- }
- NRF_LOG_FLUSH();
- nrf_bootloader_app_start_final(start_addr);
- }
|