Microbug / nRF51822

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Wed May 13 08:49:34 2015 +0100
Parent:
163:65f11741e3d4
Child:
165:67fcad70785a
Commit message:
Synchronized with git rev 4fb156a6
Author: Rohit Grover
Release 0.3.4
=============

Enhancements
~~~~~~~~~~~~

* Upgrade to Nordic's S130 softdevice (production version). This is a
merge between the previous S110 and S120 softdevices. It brings in
features from BLE4.1.

Bugfixes
~~~~~~~~

none.

Changed in this revision

nordic-sdk/components/softdevice/s130/include/nrf_mbr.h Show annotated file Show diff for this revision Revisions of this file
nordic-sdk/components/softdevice/s130/include/nrf_svc.h Show annotated file Show diff for this revision Revisions of this file
--- a/nordic-sdk/components/softdevice/s130/include/nrf_mbr.h	Wed May 13 08:49:34 2015 +0100
+++ b/nordic-sdk/components/softdevice/s130/include/nrf_mbr.h	Wed May 13 08:49:34 2015 +0100
@@ -1,26 +1,26 @@
-/* 
+/*
  * Copyright (c) Nordic Semiconductor ASA
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without modification,
  * are permitted provided that the following conditions are met:
- * 
+ *
  *   1. Redistributions of source code must retain the above copyright notice, this
  *   list of conditions and the following disclaimer.
- * 
+ *
  *   2. Redistributions in binary form must reproduce the above copyright notice, this
  *   list of conditions and the following disclaimer in the documentation and/or
  *   other materials provided with the distribution.
- * 
+ *
  *   3. Neither the name of Nordic Semiconductor ASA nor the names of other
  *   contributors to this software may be used to endorse or promote products
  *   derived from this software without specific prior written permission.
- * 
+ *
  *   4. This software must only be used in a processor manufactured by Nordic
  *   Semiconductor ASA, or in a processor manufactured by a third party that
  *   is used in combination with a processor manufactured by Nordic Semiconductor.
- * 
- * 
+ *
+ *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -31,14 +31,14 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  */
 /**
   @defgroup nrf_mbr_api Master Boot Record API
   @{
-     
+
   @brief APIs for updating SoftDevice and BootLoader
- 
+
 */
 
 /* Header guard */
@@ -53,7 +53,7 @@
  * @{ */
 
 /**@brief MBR SVC Base number. */
-#define MBR_SVC_BASE 0x18   
+#define MBR_SVC_BASE        (0x18)
 
 /**@brief Page size in words. */
 #define PAGE_SIZE_IN_WORDS 256
@@ -71,7 +71,7 @@
 /**@brief Possible values for ::sd_mbr_command_t.command */
 enum NRF_MBR_COMMANDS
 {
-  SD_MBR_COMMAND_COPY_BL,               /**< Copy a new a new BootLoader. @see sd_mbr_command_copy_bl_t */
+  SD_MBR_COMMAND_COPY_BL,               /**< Copy a new BootLoader. @see sd_mbr_command_copy_bl_t */
   SD_MBR_COMMAND_COPY_SD,               /**< Copy a new SoftDevice. @see ::sd_mbr_command_copy_sd_t*/
   SD_MBR_COMMAND_INIT_SD,               /**< Init forwarding interrupts to SD, and run reset function in SD*/
   SD_MBR_COMMAND_COMPARE,               /**< This command works like memcmp. @see ::sd_mbr_command_compare_t*/
@@ -84,12 +84,12 @@
  * @{ */
 
 /**@brief This command copies part of a new SoftDevice
- * The destination area is erased before copying. 
+ * The destination area is erased before copying.
  * If dst is in the middle of a flash page, that whole flash page will be erased.
  * If (dst+len) is in the middle of a flash page, that whole flash page will be erased.
- * 
+ *
  * The user of this function is responsible for setting the PROTENSET registers.
- * 
+ *
  * @retval ::NRF_SUCCESS indicates that the contents of the memory blocks where copied correctly.
  * @retval ::NRF_ERROR_INTERNAL indicates that the contents of the memory blocks where not verified correctly after copying.
  */
@@ -97,8 +97,8 @@
 {
   uint32_t *src;  /**< Pointer to the source of data to be copied.*/
   uint32_t *dst;  /**< Pointer to the destination where the content is to be copied.*/
-  uint32_t len;   /**< Number of 32 bit words to copy. Must be a multiple of 256 words.*/
-}sd_mbr_command_copy_sd_t;
+  uint32_t len;   /**< Number of 32 bit words to copy. Must be a multiple of @ref PAGE_SIZE_IN_WORDS words.*/
+} sd_mbr_command_copy_sd_t;
 
 
 /**@brief This command works like memcmp, but takes the length in words.
@@ -111,7 +111,7 @@
   uint32_t *ptr1; /**< Pointer to block of memory. */
   uint32_t *ptr2; /**< Pointer to block of memory. */
   uint32_t len;   /**< Number of 32 bit words to compare.*/
-}sd_mbr_command_compare_t;
+} sd_mbr_command_compare_t;
 
 
 /**@brief This command copies a new BootLoader.
@@ -121,45 +121,45 @@
  *  If (destination+bl_len) is in the middle of a flash page, that whole flash page will be erased.
  *
  *  This function will use PROTENSET to protect the flash that is not intended to be written.
- * 
+ *
  *  On Success, this function will not return. It will start the new BootLoader from reset-vector as normal.
  *
- * @retval ::NRF_ERROR_INVALID_STATE indicates that something was wrong.
  * @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen.
  * @retval ::NRF_ERROR_FORBIDDEN if NRF_UICR->BOOTADDR is not set.
- * @retval ::NRF_ERROR_INVALID_LENGTH is invalid.
+ * @retval ::NRF_ERROR_INVALID_LENGTH if parameters attempts to read or write outside flash area.
  */
 typedef struct
 {
   uint32_t *bl_src;  /**< Pointer to the source of the Bootloader to be be copied.*/
   uint32_t bl_len;   /**< Number of 32 bit words to copy for BootLoader. */
-}sd_mbr_command_copy_bl_t;
+} sd_mbr_command_copy_bl_t;
 
 /**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the MBR
- * 
+ *
  * Once this function has been called, this address is where the MBR will start to forward interrupts to after a reset.
  *
- * To restore default forwarding thiss function should be called with @param address set to 0.
- * The MBR will then start forwarding to interrupts to the adress in NFR_UICR->BOOTADDR or to the SoftDevice if the BOOTADDR is not set.
+ * To restore default forwarding this function should be called with @param address set to 0.
+ * The MBR will then start forwarding to interrupts to the address in NFR_UICR->BOOTADDR or to the SoftDevice if the BOOTADDR is not set.
  *
- * @retval ::NRF_SUCCESS
+ * @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen.
+ * @retval ::NRF_ERROR_INVALID_ADDR if parameter address is outside of the flash size.
  */
 typedef struct
-{ 
+{
   uint32_t address; /**< The base address of the interrupt vector table for forwarded interrupts.*/
-}sd_mbr_command_vector_table_base_set_t;
+} sd_mbr_command_vector_table_base_set_t;
 
 typedef struct
 {
   uint32_t command;  /**< type of command to be issued see @ref NRF_MBR_COMMANDS. */
-  union 
+  union
   {
-    sd_mbr_command_copy_sd_t copy_sd;  /**< Parameters for copy.*/
-    sd_mbr_command_copy_bl_t copy_bl;  /**< Parameters for copy SoftDevice and BootLoader.*/
+    sd_mbr_command_copy_sd_t copy_sd;  /**< Parameters for copy SoftDevice.*/
+    sd_mbr_command_copy_bl_t copy_bl;  /**< Parameters for copy BootLoader.*/
     sd_mbr_command_compare_t compare;  /**< Parameters for verify.*/
     sd_mbr_command_vector_table_base_set_t base_set; /**< Parameters for vector table base set.*/
   } params;
-}sd_mbr_command_t;
+} sd_mbr_command_t;
 
 /** @} */
 
--- a/nordic-sdk/components/softdevice/s130/include/nrf_svc.h	Wed May 13 08:49:34 2015 +0100
+++ b/nordic-sdk/components/softdevice/s130/include/nrf_svc.h	Wed May 13 08:49:34 2015 +0100
@@ -56,7 +56,7 @@
         "bx r14" : : "I" ((uint32_t)number) : "r0" \
     ); \
   }    \
-  _Pragma("GCC diagnostic pop") \
+  _Pragma("GCC diagnostic pop")
 #elif defined (__ICCARM__)
 #define PRAGMA(x) _Pragma(#x)
 #define SVCALL(number, return_type, signature) \