BLE FOTA APP

Dependencies:   BLE_API mbed

It doesn't work with the default FOTA bootloader. It use NVIC_SystemReset() to enter a bootloader.

Committer:
yihui
Date:
Fri Oct 10 03:36:28 2014 +0000
Revision:
1:a607cd9655d7
use NVIC_SystemReset() to run bootloader

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yihui 1:a607cd9655d7 1 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
yihui 1:a607cd9655d7 2 *
yihui 1:a607cd9655d7 3 * The information contained herein is confidential property of Nordic
yihui 1:a607cd9655d7 4 * Semiconductor ASA.Terms and conditions of usage are described in detail
yihui 1:a607cd9655d7 5 * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
yihui 1:a607cd9655d7 6 *
yihui 1:a607cd9655d7 7 * Licensees are granted free, non-transferable use of the information. NO
yihui 1:a607cd9655d7 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
yihui 1:a607cd9655d7 9 * the file.
yihui 1:a607cd9655d7 10 *
yihui 1:a607cd9655d7 11 * $LastChangedRevision: 17685 $
yihui 1:a607cd9655d7 12 */
yihui 1:a607cd9655d7 13
yihui 1:a607cd9655d7 14 /**
yihui 1:a607cd9655d7 15 * @file
yihui 1:a607cd9655d7 16 * @brief NMVC driver API.
yihui 1:a607cd9655d7 17 */
yihui 1:a607cd9655d7 18
yihui 1:a607cd9655d7 19 #ifndef NRF_NVMC_H__
yihui 1:a607cd9655d7 20 #define NRF_NVMC_H__
yihui 1:a607cd9655d7 21
yihui 1:a607cd9655d7 22 #include <stdint.h>
yihui 1:a607cd9655d7 23
yihui 1:a607cd9655d7 24
yihui 1:a607cd9655d7 25 /**
yihui 1:a607cd9655d7 26 * @defgroup nrf_nvmc Non-volatile memory controller
yihui 1:a607cd9655d7 27 * @{
yihui 1:a607cd9655d7 28 * @ingroup nrf_drivers
yihui 1:a607cd9655d7 29 * @brief Driver for the nRF51 NVMC peripheral.
yihui 1:a607cd9655d7 30 *
yihui 1:a607cd9655d7 31 * This driver allows writing to the non-volatile memory (NVM) regions
yihui 1:a607cd9655d7 32 * of the nRF51. In order to write to NVM the controller must be powered
yihui 1:a607cd9655d7 33 * on and the relevant page must be erased.
yihui 1:a607cd9655d7 34 *
yihui 1:a607cd9655d7 35 */
yihui 1:a607cd9655d7 36
yihui 1:a607cd9655d7 37
yihui 1:a607cd9655d7 38 /**
yihui 1:a607cd9655d7 39 * @brief Erase a page in flash. This is required before writing to any
yihui 1:a607cd9655d7 40 * address in the page.
yihui 1:a607cd9655d7 41 *
yihui 1:a607cd9655d7 42 * @param address Start address of the page.
yihui 1:a607cd9655d7 43 */
yihui 1:a607cd9655d7 44 void nrf_nvmc_page_erase(uint32_t address);
yihui 1:a607cd9655d7 45
yihui 1:a607cd9655d7 46
yihui 1:a607cd9655d7 47 /**
yihui 1:a607cd9655d7 48 * @brief Write a single byte to flash.
yihui 1:a607cd9655d7 49 *
yihui 1:a607cd9655d7 50 * The function reads the word containing the byte, and then
yihui 1:a607cd9655d7 51 * rewrites the entire word.
yihui 1:a607cd9655d7 52 *
yihui 1:a607cd9655d7 53 * @param address Address to write to.
yihui 1:a607cd9655d7 54 * @param value Value to write.
yihui 1:a607cd9655d7 55 */
yihui 1:a607cd9655d7 56 void nrf_nvmc_write_byte(uint32_t address , uint8_t value);
yihui 1:a607cd9655d7 57
yihui 1:a607cd9655d7 58
yihui 1:a607cd9655d7 59 /**
yihui 1:a607cd9655d7 60 * @brief Write a 32-bit word to flash.
yihui 1:a607cd9655d7 61 * @param address Address to write to.
yihui 1:a607cd9655d7 62 * @param value Value to write.
yihui 1:a607cd9655d7 63 */
yihui 1:a607cd9655d7 64 void nrf_nvmc_write_word(uint32_t address, uint32_t value);
yihui 1:a607cd9655d7 65
yihui 1:a607cd9655d7 66
yihui 1:a607cd9655d7 67 /**
yihui 1:a607cd9655d7 68 * @brief Write consecutive bytes to flash.
yihui 1:a607cd9655d7 69 *
yihui 1:a607cd9655d7 70 * @param address Address to write to.
yihui 1:a607cd9655d7 71 * @param src Pointer to data to copy from.
yihui 1:a607cd9655d7 72 * @param num_bytes Number of bytes in src to write.
yihui 1:a607cd9655d7 73 */
yihui 1:a607cd9655d7 74 void nrf_nvmc_write_bytes(uint32_t address, const uint8_t * src, uint32_t num_bytes);
yihui 1:a607cd9655d7 75
yihui 1:a607cd9655d7 76
yihui 1:a607cd9655d7 77 /**
yihui 1:a607cd9655d7 78 @ @brief Write consecutive words to flash.
yihui 1:a607cd9655d7 79 *
yihui 1:a607cd9655d7 80 * @param address Address to write to.
yihui 1:a607cd9655d7 81 * @param src Pointer to data to copy from.
yihui 1:a607cd9655d7 82 * @param num_words Number of bytes in src to write.
yihui 1:a607cd9655d7 83 */
yihui 1:a607cd9655d7 84 void nrf_nvmc_write_words(uint32_t address, const uint32_t * src, uint32_t num_words);
yihui 1:a607cd9655d7 85
yihui 1:a607cd9655d7 86
yihui 1:a607cd9655d7 87 #endif // NRF_NVMC_H__
yihui 1:a607cd9655d7 88 /** @} */
yihui 1:a607cd9655d7 89
yihui 1:a607cd9655d7 90