move softdevice to /lib #1
This commit is contained in:
parent
df71d3444d
commit
276cfd5589
@ -1,35 +0,0 @@
|
||||
Copyright (c) 2007 - 2018, 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, except as embedded into a Nordic
|
||||
Semiconductor ASA integrated circuit in a product or a software update for
|
||||
such product, 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 its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
4. This software, with or without modification, must only be used with a
|
||||
Nordic Semiconductor ASA integrated circuit.
|
||||
|
||||
5. Any software provided in binary form under this license must not be reverse
|
||||
engineered, decompiled, modified and/or disassembled.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON 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.
|
@ -1,165 +0,0 @@
|
||||
:020000040000FA
|
||||
:1000000000040020990900002D0600007909000075
|
||||
:1000100037060000410600004B060000000000000B
|
||||
:10002000000000000000000000000000BD0900000A
|
||||
:1000300055060000000000005F0600006906000091
|
||||
:10004000730600007D060000870600009106000090
|
||||
:100050009B060000A5060000AF060000B9060000E0
|
||||
:10006000C3060000CD060000D7060000E106000030
|
||||
:10007000EB060000F5060000FF060000090700007F
|
||||
:10008000130700001D0700002707000031070000CC
|
||||
:100090003B070000450700004F070000590700001C
|
||||
:1000A000630700006D07000077070000810700006C
|
||||
:1000B0008B070000950700009F070000A9070000BC
|
||||
:1000C000B3070000BD070000C7070000D10700000C
|
||||
:1000D000DB070000E5070000EF070000F90700005C
|
||||
:1000E000030800000D0800001708000021080000A8
|
||||
:1000F0002B080000350800003F08000049080000F8
|
||||
:10010000530800001FB500F003F88DE80F001FBD75
|
||||
:1001100000F038BC70B50B46010B184400F6FF70B8
|
||||
:10012000040B4FF080500022090303692403406947
|
||||
:1001300043431D1B104600F0E9F929462046BDE85F
|
||||
:10014000704000F0E3B9F0B54FF6FF734FF4B475AB
|
||||
:100150001A466E1E12E0A94201D3344600E00C4656
|
||||
:10016000B1EB040130F8027B641E3B441A44F9D120
|
||||
:100170009CB204EB134394B204EB12420029EAD17F
|
||||
:1001800098B200EB134002EB124140EA0140F0BD8F
|
||||
:10019000C34992B00446D1E90001CDE91001FF2224
|
||||
:1001A0004021684600F094FB94E80F008DE80F00B2
|
||||
:1001B000684610A902E004C841F8042D8842FAD12B
|
||||
:1001C00010216846FFF7BFFF1090AA208DF8440069
|
||||
:1001D00000F0FAF800F0DDF84FF01024A0691022CA
|
||||
:1001E0006946803000F0DEF8A069082210A900F00E
|
||||
:1001F000D9F800F0C2F870B504460068A94D072888
|
||||
:1002000069D2DFE800F033041929561E2500D4E92D
|
||||
:10021000026564682946304600F0FDF82A4621460A
|
||||
:10022000304600F0BFF8AA002146304600F024FB1B
|
||||
:10023000002800D0032070BD00F0D6FB4FF48050A2
|
||||
:1002400007E0201D00F0C6F80028F4D100F0CCFB38
|
||||
:1002500060682860002070BD241D94E807009200AB
|
||||
:1002600000F00AFB0028F6D00E2070BD00F0BEF8AA
|
||||
:100270000028FAD1D4E9010100EB81034FF080504E
|
||||
:10028000026945696A43934209D84FF010225369C5
|
||||
:1002900003EB81030169406941438B4201D9092085
|
||||
:1002A00070BD5069401C01D10F2070BD2046FFF782
|
||||
:1002B0006FFF00F09BF80028F7D1201D00F08AF8AE
|
||||
:1002C0000028F2D160680028F0D100F07DF800F03D
|
||||
:1002D00060F800F052F8072070BD10B50C461828E1
|
||||
:1002E00002D00120086010BD2068FFF784FF206065
|
||||
:1002F00010BD4FF01024A069401C05D0A569A66967
|
||||
:1003000080353079AA2808D06069401C2DD06069FA
|
||||
:100310000068401C29D060692CE010212846FFF7B6
|
||||
:1003200012FF316881421CD1A16901F18002C03104
|
||||
:1003300005E030B108CA51F8040D984201D10120FE
|
||||
:1003400000E000208A42F4D158B1286810B1042896
|
||||
:1003500003D0FEE7284600F070F85249686808604C
|
||||
:1003600008E000F016F800F008F84FF4805001683B
|
||||
:10037000491C01D000F012FBFEE7BFF34F8F4A4843
|
||||
:1003800001684A4A01F4E06111430160BFF34F8FF5
|
||||
:10039000FEE74FF010208169491C02D0806900F00F
|
||||
:1003A0008CB870472DE9F04117460D4606460024EB
|
||||
:1003B00006E03046296800F093F8641C2D1D361DB8
|
||||
:1003C000BC42F6D3BDE8F0814FF0102080694FF4B5
|
||||
:1003D00080519FE64FF080510A69496900684A439D
|
||||
:1003E000824201D810207047002070474FF08050A3
|
||||
:1003F0000169406941434FF01020826902F5805243
|
||||
:10040000914201D2092070478069401C01D0002030
|
||||
:1004100070470420704770B50C4605464FF480665F
|
||||
:1004200008E0284600F049F8B44205D3A4F58064FA
|
||||
:1004300005F58055002CF4D170BD4168044609B122
|
||||
:10044000012600E000264FF010256869A26892009E
|
||||
:1004500000F012FAF8B1A06881006869FFF75AFE4F
|
||||
:10046000BEB16E694FF08050A56864680169426949
|
||||
:100470005143A1420DD9016940694143A94208D9BC
|
||||
:1004800029463046FFF7C7FF2A4621463046FFF788
|
||||
:1004900089FFFFF772FFFFF797FFFFF77AFFF8E793
|
||||
:1004A0000C0A0000000000200CED00E00400FA053A
|
||||
:1004B000144801680029FCD07047134A02211160DA
|
||||
:1004C00010490B68002BFCD00F4B1B1D18600868EF
|
||||
:1004D0000028FCD00020106008680028FCD070477D
|
||||
:1004E000094B10B501221A60064A1468002CFCD092
|
||||
:1004F000016010680028FCD00020186010680028F7
|
||||
:10050000FCD010BD00E4014004E5014070B50C468C
|
||||
:10051000054600F073F810B900F07EF828B12146C6
|
||||
:100520002846BDE8704000F007B821462846BDE8DF
|
||||
:10053000704000F037B800007FB5002200920192B1
|
||||
:10054000029203920A0B000B6946012302440AE05F
|
||||
:10055000440900F01F0651F8245003FA06F635430B
|
||||
:1005600041F82450401C8242F2D80D490868009A94
|
||||
:1005700010430860081D0168019A1143016000F0F2
|
||||
:100580003DF800280AD0064910310868029A104345
|
||||
:100590000860091D0868039A104308607FBD0000C9
|
||||
:1005A0000006004030B50F4C002200BF04EB0213E0
|
||||
:1005B000D3F800582DB9D3F8045815B9D3F8085812
|
||||
:1005C0001DB1521C082AF1D330BD082AFCD204EB1D
|
||||
:1005D0000212C2F80008C3F804180220C3F8080881
|
||||
:1005E00030BD000000E001404FF08050D0F83001F5
|
||||
:1005F000082801D000207047012070474FF080503C
|
||||
:10060000D0F83011062905D0D0F83001401C01D0B7
|
||||
:1006100000207047012070474FF08050D0F8300123
|
||||
:100620000A2801D0002070470120704708208F4918
|
||||
:1006300009680958084710208C4909680958084773
|
||||
:1006400014208A4909680958084718208749096809
|
||||
:100650000958084730208549096809580847382053
|
||||
:1006600082490968095808473C20804909680958A7
|
||||
:10067000084740207D4909680958084744207B49BC
|
||||
:1006800009680958084748207849096809580847FF
|
||||
:100690004C20764909680958084750207349096871
|
||||
:1006A00009580847542071490968095808475820D3
|
||||
:1006B0006E490968095808475C206C49096809585F
|
||||
:1006C0000847602069490968095808476420674954
|
||||
:1006D00009680958084768206449096809580847A3
|
||||
:1006E0006C20624909680958084770205F49096809
|
||||
:1006F0000958084774205D49096809580847782057
|
||||
:100700005A490968095808477C2058490968095816
|
||||
:1007100008478020554909680958084784205349EB
|
||||
:100720000968095808478820504909680958084746
|
||||
:100730008C204E4909680958084790204B490968A0
|
||||
:1007400009580847942049490968095808479820DA
|
||||
:1007500046490968095808479C20444909680958CE
|
||||
:100760000847A0204149096809580847A4203F4983
|
||||
:10077000096809580847A8203C49096809580847EA
|
||||
:10078000AC203A49096809580847B0203749096838
|
||||
:1007900009580847B4203549096809580847B8205E
|
||||
:1007A0003249096809580847BC2030490968095886
|
||||
:1007B0000847C0202D49096809580847C4202B491B
|
||||
:1007C000096809580847C82028490968095808478E
|
||||
:1007D000CC202649096809580847D02023490968D0
|
||||
:1007E00009580847D4202149096809580847D820E2
|
||||
:1007F0001E49096809580847DC201C49096809583E
|
||||
:100800000847E0201949096809580847E4201749B2
|
||||
:10081000096809580847E820144909680958084731
|
||||
:10082000EC201249096809580847F0200F49096867
|
||||
:1008300009580847F4200D49096809580847F82065
|
||||
:100840000A49096809580847FC20084909680958F5
|
||||
:1008500008475FF480700549096809580847000097
|
||||
:1008600003480449024A034B70470000000000207F
|
||||
:10087000180A0000180A000040EA010310B59B079F
|
||||
:100880000FD1042A0DD310C808C9121F9C42F8D0FA
|
||||
:1008900020BA19BA884201D9012010BD4FF0FF30AB
|
||||
:1008A00010BD1AB1D30703D0521C07E0002010BDC1
|
||||
:1008B00010F8013B11F8014B1B1B07D110F8013B4D
|
||||
:1008C00011F8014B1B1B01D1921EF1D1184610BD2E
|
||||
:1008D00002F0FF0343EA032242EA024200F005B8B5
|
||||
:1008E0007047704770474FF000020429C0F0128033
|
||||
:1008F00010F0030C00F01B80CCF1040CBCF1020FD3
|
||||
:1009000018BF00F8012BA8BF20F8022BA1EB0C01A7
|
||||
:1009100000F00DB85FEAC17C24BF00F8012B00F89D
|
||||
:10092000012B48BF00F8012B70474FF0000200B5C3
|
||||
:10093000134694469646203922BFA0E80C50A0E802
|
||||
:100940000C50B1F12001BFF4F7AF090728BFA0E8B0
|
||||
:100950000C5048BF0CC05DF804EB890028BF40F87C
|
||||
:10096000042B08BF704748BF20F8022B11F0804FBE
|
||||
:1009700018BF00F8012B7047014B1B68DB68184754
|
||||
:100980000000002009480A497047FFF7FBFFFFF706
|
||||
:10099000B9FB00BD20BFFDE7064B1847064A1060B3
|
||||
:1009A000016881F30888406800470000180A0000C9
|
||||
:1009B000180A0000F3020000000000201EF0040FDF
|
||||
:1009C0000CBFEFF30881EFF30981886902380078E2
|
||||
:1009D000182803D100E00000074A1047074A1268B0
|
||||
:1009E0002C3212681047000000B5054B1B68054A01
|
||||
:1009F0009B58984700BD0000DB020000000000206B
|
||||
:100A0000080A0000040000000010000000000000C0
|
||||
:080A100000FFFFFF0090D0037E
|
||||
:040000050000099955
|
||||
:00000001FF
|
@ -1,242 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 - 2017, 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, except as embedded into a Nordic
|
||||
* Semiconductor ASA integrated circuit in a product or a software update for
|
||||
* such product, 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 its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* 4. This software, with or without modification, must only be used with a
|
||||
* Nordic Semiconductor ASA integrated circuit.
|
||||
*
|
||||
* 5. Any software provided in binary form under this license must not be reverse
|
||||
* engineered, decompiled, modified and/or disassembled.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON 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
|
||||
|
||||
*/
|
||||
|
||||
#ifndef NRF_MBR_H__
|
||||
#define NRF_MBR_H__
|
||||
|
||||
#include "nrf_svc.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @addtogroup NRF_MBR_DEFINES Defines
|
||||
* @{ */
|
||||
|
||||
/**@brief MBR SVC Base number. */
|
||||
#define MBR_SVC_BASE (0x18)
|
||||
|
||||
/**@brief Page size in words. */
|
||||
#define MBR_PAGE_SIZE_IN_WORDS (1024)
|
||||
|
||||
/** @brief The size that must be reserved for the MBR when a SoftDevice is written to flash.
|
||||
This is the offset where the first byte of the SoftDevice hex file is written.*/
|
||||
#define MBR_SIZE (0x1000)
|
||||
|
||||
/** @} */
|
||||
|
||||
/** @addtogroup NRF_MBR_ENUMS Enumerations
|
||||
* @{ */
|
||||
|
||||
/**@brief nRF Master Boot Record API SVC numbers. */
|
||||
enum NRF_MBR_SVCS
|
||||
{
|
||||
SD_MBR_COMMAND = MBR_SVC_BASE, /**< ::sd_mbr_command */
|
||||
};
|
||||
|
||||
/**@brief Possible values for ::sd_mbr_command_t.command */
|
||||
enum NRF_MBR_COMMANDS
|
||||
{
|
||||
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, /**< Initialize forwarding interrupts to SD, and run reset function in SD. Does not require any parameters in ::sd_mbr_command_t params.*/
|
||||
SD_MBR_COMMAND_COMPARE, /**< This command works like memcmp. @see ::sd_mbr_command_compare_t*/
|
||||
SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET, /**< Change the address the MBR starts after a reset. @see ::sd_mbr_command_vector_table_base_set_t*/
|
||||
SD_MBR_COMMAND_RESERVED,
|
||||
SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET, /**< Start forwarding all interrupts to this address. @see ::sd_mbr_command_irq_forward_address_set_t*/
|
||||
};
|
||||
|
||||
/** @} */
|
||||
|
||||
/** @addtogroup NRF_MBR_TYPES Types
|
||||
* @{ */
|
||||
|
||||
/**@brief This command copies part of a new SoftDevice
|
||||
*
|
||||
* 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 BPROT 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.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
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 @ref MBR_PAGE_SIZE_IN_WORDS words.*/
|
||||
} sd_mbr_command_copy_sd_t;
|
||||
|
||||
|
||||
/**@brief This command works like memcmp, but takes the length in words.
|
||||
*
|
||||
* @retval ::NRF_SUCCESS indicates that the contents of both memory blocks are equal.
|
||||
* @retval ::NRF_ERROR_NULL indicates that the contents of the memory blocks are not equal.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
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;
|
||||
|
||||
|
||||
/**@brief This command copies a new BootLoader.
|
||||
*
|
||||
* With this command, destination of BootLoader is always the address written in
|
||||
* NRF_UICR->BOOTADDR.
|
||||
*
|
||||
* Destination is erased by this function.
|
||||
* If (destination+bl_len) is in the middle of a flash page, that whole flash page will be erased.
|
||||
*
|
||||
* This function will use the flash protect peripheral (BPROT or ACL) 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_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 if parameters attempts to read or write outside flash area.
|
||||
* @retval ::NRF_ERROR_NO_MEM if no parameter page is provided (see SoftDevice Specification for more info)
|
||||
*/
|
||||
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;
|
||||
|
||||
/**@brief Change the address the MBR starts after a reset
|
||||
*
|
||||
* 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 this function should be called with @ref address set to 0. The
|
||||
* MBR will then start forwarding interrupts to the address in NFR_UICR->BOOTADDR or to the
|
||||
* SoftDevice if the BOOTADDR is not set.
|
||||
*
|
||||
* On success, this function will not return. It will reset the device.
|
||||
*
|
||||
* @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.
|
||||
* @retval ::NRF_ERROR_NO_MEM if no parameter page is provided (see SoftDevice Specification for more info)
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t address; /**< The base address of the interrupt vector table for forwarded interrupts.*/
|
||||
} sd_mbr_command_vector_table_base_set_t;
|
||||
|
||||
/**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the MBR
|
||||
*
|
||||
* Unlike sd_mbr_command_vector_table_base_set_t, this function does not reset, and it does not
|
||||
* change where the MBR starts after reset.
|
||||
*
|
||||
* @retval ::NRF_SUCCESS
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t address; /**< The base address of the interrupt vector table for forwarded interrupts.*/
|
||||
} sd_mbr_command_irq_forward_address_set_t;
|
||||
|
||||
/**@brief Input structure containing data used when calling ::sd_mbr_command
|
||||
*
|
||||
* Depending on what command value that is set, the corresponding params value type must also be
|
||||
* set. See @ref NRF_MBR_COMMANDS for command types and corresponding params value type. If command
|
||||
* @ref SD_MBR_COMMAND_INIT_SD is set, it is not necessary to set any values under params.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t command; /**< Type of command to be issued. See @ref NRF_MBR_COMMANDS. */
|
||||
union
|
||||
{
|
||||
sd_mbr_command_copy_sd_t copy_sd; /**< Parameters for copy SoftDevice.*/
|
||||
sd_mbr_command_compare_t compare; /**< Parameters for verify.*/
|
||||
sd_mbr_command_copy_bl_t copy_bl; /**< Parameters for copy BootLoader. Requires parameter page. */
|
||||
sd_mbr_command_vector_table_base_set_t base_set; /**< Parameters for vector table base set. Requires parameter page.*/
|
||||
sd_mbr_command_irq_forward_address_set_t irq_forward_address_set; /**< Parameters for irq forward address set*/
|
||||
} params; /**< Command parameters. */
|
||||
} sd_mbr_command_t;
|
||||
|
||||
/** @} */
|
||||
|
||||
/** @addtogroup NRF_MBR_FUNCTIONS Functions
|
||||
* @{ */
|
||||
|
||||
/**@brief Issue Master Boot Record commands
|
||||
*
|
||||
* Commands used when updating a SoftDevice and bootloader.
|
||||
*
|
||||
* The @ref SD_MBR_COMMAND_COPY_BL and @ref SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET requires
|
||||
* parameters to be retained by the MBR when resetting the IC. This is done in a separate flash
|
||||
* page provided by the application. The UICR register UICR.NRFFW[1] must be set to an address
|
||||
* corresponding to a page in the application flash space. This page will be cleared by the MBR and
|
||||
* used to store the command before reset. When the UICR.NRFFW[1] field is set the page it refers
|
||||
* to must not be used by the application. If the UICR.NRFFW[1] is set to 0xFFFFFFFF (the default)
|
||||
* MBR commands which use flash will be unavailable and return @ref NRF_ERROR_NO_MEM.
|
||||
*
|
||||
* @param[in] param Pointer to a struct describing the command.
|
||||
*
|
||||
* @note For return values, see ::sd_mbr_command_copy_sd_t, ::sd_mbr_command_copy_bl_t,
|
||||
* ::sd_mbr_command_compare_t, ::sd_mbr_command_vector_table_base_set_t,
|
||||
* ::sd_mbr_command_irq_forward_address_set_t
|
||||
*
|
||||
* @retval ::NRF_ERROR_NO_MEM if UICR.NRFFW[1] is not set (i.e. is 0xFFFFFFFF).
|
||||
* @retval ::NRF_ERROR_INVALID_PARAM if an invalid command is given.
|
||||
*/
|
||||
SVCALL(SD_MBR_COMMAND, uint32_t, sd_mbr_command(sd_mbr_command_t* param));
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif // NRF_MBR_H__
|
||||
|
||||
/**
|
||||
@}
|
||||
*/
|
@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012 - 2017, 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, except as embedded into a Nordic
|
||||
* Semiconductor ASA integrated circuit in a product or a software update for
|
||||
* such product, 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 its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* 4. This software, with or without modification, must only be used with a
|
||||
* Nordic Semiconductor ASA integrated circuit.
|
||||
*
|
||||
* 5. Any software provided in binary form under this license must not be reverse
|
||||
* engineered, decompiled, modified and/or disassembled.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON 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.
|
||||
*/
|
||||
|
||||
#ifndef NRF_SVC__
|
||||
#define NRF_SVC__
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef SVCALL_AS_NORMAL_FUNCTION
|
||||
#define SVCALL(number, return_type, signature) return_type signature
|
||||
#else
|
||||
|
||||
#ifndef SVCALL
|
||||
#if defined (__CC_ARM)
|
||||
#define SVCALL(number, return_type, signature) return_type __svc(number) signature
|
||||
#elif defined (__GNUC__)
|
||||
#ifdef __cplusplus
|
||||
#define GCC_CAST_CPP (uint16_t)
|
||||
#else
|
||||
#define GCC_CAST_CPP
|
||||
#endif
|
||||
#define SVCALL(number, return_type, signature) \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \
|
||||
__attribute__((naked)) \
|
||||
__attribute__((unused)) \
|
||||
static return_type signature \
|
||||
{ \
|
||||
__asm( \
|
||||
"svc %0\n" \
|
||||
"bx r14" : : "I" (GCC_CAST_CPP number) : "r0" \
|
||||
); \
|
||||
} \
|
||||
_Pragma("GCC diagnostic pop")
|
||||
|
||||
#elif defined (__ICCARM__)
|
||||
#define PRAGMA(x) _Pragma(#x)
|
||||
#define SVCALL(number, return_type, signature) \
|
||||
PRAGMA(swi_number = (number)) \
|
||||
__swi return_type signature;
|
||||
#else
|
||||
#define SVCALL(number, return_type, signature) return_type signature
|
||||
#endif
|
||||
#endif // SVCALL
|
||||
|
||||
#endif // SVCALL_AS_NORMAL_FUNCTION
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif // NRF_SVC__
|
@ -25,7 +25,7 @@ SD_VERSION = 6.0.0
|
||||
|
||||
SD_NAME_UPPER = $(subst s,S,$(SD_NAME))
|
||||
|
||||
SD_PATH = ../../softdevice/$(SD_VERSION)
|
||||
SD_PATH = ../../lib/softdevice/$(SD_VERSION)
|
||||
SD_HEX = $(SD_PATH)/$(SD_NAME)/hex/$(SD_NAME)_nrf52_$(SD_VERSION)_softdevice.hex
|
||||
LINKER_SCRIPT = $(SRC_PATH)/$(SD_NAME)_$(SD_VERSION).ld
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
gcc_entry_point="Reset_Handler"
|
||||
linker_memory_map_file="$(ProjectDir)/nRF52840_xxAA_MemoryMap.xml"
|
||||
linker_section_placement_file="$(ProjectDir)/flash_placement.xml"
|
||||
macros="DeviceHeaderFile=$(PackagesDir)/nRF/CMSIS/Device/Include/nrf.h;DeviceLibraryIdentifier=M4lf;DeviceSystemFile=$(PackagesDir)/nRF/CMSIS/Device/Source/system_nrf52840.c;DeviceVectorsFile=$(PackagesDir)/nRF/Source/ses_nrf52840_Vectors.s;DeviceFamily=nRF;Target=nRF52840_xxAA;Placement=Flash;SdkDir=../../lib/sdk/components;Sdk11Dir=../../lib/sdk11/components;SdDir=../../softdevice/6.0.0;TusbDir=../../lib/tinyusb/tinyusb"
|
||||
macros="DeviceHeaderFile=$(PackagesDir)/nRF/CMSIS/Device/Include/nrf.h;DeviceLibraryIdentifier=M4lf;DeviceSystemFile=$(PackagesDir)/nRF/CMSIS/Device/Source/system_nrf52840.c;DeviceVectorsFile=$(PackagesDir)/nRF/Source/ses_nrf52840_Vectors.s;DeviceFamily=nRF;Target=nRF52840_xxAA;Placement=Flash;SdkDir=../../lib/sdk/components;Sdk11Dir=../../lib/sdk11/components;SdDir=../../lib/softdevice/6.0.0;TusbDir=../../lib/tinyusb/tinyusb"
|
||||
project_directory=""
|
||||
project_type="Executable"
|
||||
target_reset_script="Reset();"
|
||||
@ -66,44 +66,6 @@
|
||||
gcc_optimization_level="Debug"
|
||||
link_use_linker_script_file="No"
|
||||
linker_section_placement_file="flash_placement.xml" />
|
||||
<folder Name="softdevice">
|
||||
<folder Name="6.0.0">
|
||||
<folder Name="common" />
|
||||
<folder Name="mbr">
|
||||
<folder Name="nrf52840">
|
||||
<folder Name="headers">
|
||||
<file file_name="../../softdevice/6.0.0/mbr/nrf52840/headers/nrf_mbr.h" />
|
||||
<file file_name="../../softdevice/6.0.0/mbr/nrf52840/headers/nrf_svc.h" />
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
<folder Name="s140">
|
||||
<folder Name="headers">
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/ble.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/ble_err.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/ble_gap.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/ble_gatt.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/ble_gattc.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/ble_gatts.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/ble_hci.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/ble_l2cap.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/ble_ranges.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/ble_types.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/nrf_error.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/nrf_error_sdm.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/nrf_error_soc.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/nrf_nvic.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/nrf_sd_def.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/nrf_sdm.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/nrf_soc.h" />
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/nrf_svc.h" />
|
||||
<folder Name="nrf52">
|
||||
<file file_name="../../softdevice/6.0.0/s140/headers/nrf52/nrf_mbr.h" />
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
<configuration Name="Debug Single" gcc_optimization_level="Debug" />
|
||||
<configuration Name="Debug Dual" gcc_optimization_level="Debug" />
|
||||
<configuration
|
||||
@ -249,6 +211,35 @@
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
<folder Name="softdevice">
|
||||
<folder Name="6.0.0">
|
||||
<folder Name="s140">
|
||||
<folder Name="headers">
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/ble.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/ble_err.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/ble_gap.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/ble_gatt.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/ble_gattc.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/ble_gatts.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/ble_hci.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/ble_l2cap.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/ble_ranges.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/ble_types.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/nrf_error.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/nrf_error_sdm.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/nrf_error_soc.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/nrf_nvic.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/nrf_sd_def.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/nrf_sdm.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/nrf_soc.h" />
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/nrf_svc.h" />
|
||||
<folder Name="nrf52">
|
||||
<file file_name="../../lib/softdevice/6.0.0/s140/headers/nrf52/nrf_mbr.h" />
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
</folder>
|
||||
</project>
|
||||
<configuration
|
||||
|
Loading…
Reference in New Issue
Block a user