Skip to content

Commit 195a50b

Browse files
committed
Merge pull request #185 from tkuyucu/master
nrf-mbed merge
2 parents 95996b8 + 2dfdee5 commit 195a50b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+10398
-56
lines changed

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/TOOLCHAIN_ARM_STD/startup_nRF51822.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; mbed Microcontroller Library
2-
; Copyright (c) 2006-2013 ARM Limited
2+
; Copyright (c) 2013 Nordic Semiconductor.
33
;Licensed under the Apache License, Version 2.0 (the "License");
44
;you may not use this file except in compliance with the License.
55
;You may obtain a copy of the License at

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/cmsis_nvic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ uint32_t NVIC_GetVector(IRQn_Type IRQn) {
5252
}*/
5353

5454
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {
55-
int i;
55+
// int i;
5656
// Space for dynamic vectors, initialised to allocate in R/W
5757
static volatile uint32_t* vectors = (uint32_t*)NVIC_RAM_VECTOR_ADDRESS;
5858
/*
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef _NORDIC_GLOBAL_H_
2+
#define _NORDIC_GLOBAL_H_
3+
4+
/* There are no global defines in mbed, so we need to define */
5+
/* mandatory conditional compilation flags here */
6+
//#define NRF51
7+
#ifndef DEBUG_NRF_USER
8+
#define DEBUG_NRF_USER
9+
#endif
10+
#ifndef BLE_STACK_SUPPORT_REQD
11+
#define BLE_STACK_SUPPORT_REQD
12+
#endif
13+
#ifndef BOARD_PCA10001
14+
#define BOARD_PCA10001
15+
#endif
16+
17+
#endif

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/nrf51.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
/* mbed Microcontroller Library
2-
3-
* Copyright (c) 2006-2013 ARM Limited
1+
/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
42
*
5-
* Licensed under the Apache License, Version 2.0 (the "License");
6-
* you may not use this file except in compliance with the License.
7-
* You may obtain a copy of the License at
3+
* The information contained herein is property of Nordic Semiconductor ASA.
4+
* Terms and conditions of usage are described in detail in NORDIC
5+
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
86
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Licensees are granted free, non-transferable use of the information. NO
8+
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9+
* the file.
1010
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
1611
*/
1712

1813

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/nrf51822.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mbed Microcontroller Library
22
3-
* Copyright (c) 2006-2013 ARM Limited
3+
* Copyright (c) 2013 Nordic Semiconductor.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
1919
#ifndef NRF_H
2020
#define NRF_H
2121

22-
22+
#include "nordic_global.h"
2323
#include "compiler_abstraction.h"
2424
#include "nrf51.h"
2525
#include "nrf51_bitfields.h"

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mbed Microcontroller Library
22
3-
* Copyright (c) 2006-2013 ARM Limited
3+
* Copyright (c) 2013 Nordic Semiconductor.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -43,33 +43,19 @@ void SystemCoreClockUpdate(void)
4343
}
4444

4545
void SystemInit(void)
46-
{
46+
{
47+
NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos);
48+
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
49+
}
50+
//write FWID (NRF_UICR->FWID is readonly)
51+
*(uint32_t *)0x10001010 = 0xFFFF0049;
4752

48-
//Write the necessary UICR and FWID values if needed
49-
if (NRF_UICR->CLENR0 == 0xFFFFFFFF){
50-
NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos);
51-
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
52-
}
53-
54-
NRF_UICR->CLENR0 = 0x14000;
55-
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
56-
}
57-
58-
//write FWID (NRF_UICR->FWID is readonly)
59-
*(uint32_t *)0x10001010 = 0xFFFF0049;
60-
61-
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
62-
}
63-
64-
NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos);
65-
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
66-
}
67-
68-
NVIC_SystemReset();
69-
while (true){
70-
}
53+
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
54+
}
55+
56+
NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos);
57+
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
7158
}
72-
7359
// Prepare the peripherals for use as indicated by the PAN 26 "System: Manual setup is required
7460
// to enable the use of peripherals" found at Product Anomaly document for your device found at
7561
// https://www.nordicsemi.com/. The side effect of executing these instructions in the devices

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mbed Microcontroller Library
22
3-
* Copyright (c) 2006-2013 ARM Limited
3+
* Copyright (c) 2013 Nordic Semiconductor.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
NORDIC SEMICONDUCTOR ASA SOFTDEVICE LICENSE AGREEMENT
2+
3+
4+
License Agreement for the Nordic Semiconductor ASA ("Nordic")
5+
S110 Bluetooth SoftDevice software package ("SoftDevice").
6+
7+
8+
You ("You" "Licensee") must carefully and thoroughly read this License
9+
Agreement ("Agreement"), and accept to adhere to this Agreement before
10+
downloading, installing and/or using any software or content in the
11+
SoftDevice provided herewith.
12+
13+
YOU ACCEPT THIS LICENSE AGREEMENT BY (A) CLICKING ACCEPT OR AGREE TO
14+
THIS LICENSE AGREEMENT, WHERE THIS OPTION IS MADE AVAILABLE TO YOU; OR
15+
(B) BY ACTUALLY USING THE SOFTDEVICE, IN THIS CASE YOU AGREE THAT THE
16+
USE OF THE SOFTDEVICE CONSTITUTES ACCEPTANCE OF THE LICENSING
17+
AGREEMENT FROM THAT POINT ONWARDS.
18+
19+
IF YOU DO NOT AGREE TO BE BOUND BY THE TERMS OF THIS AGREEMENT, THEN
20+
DO NOT DOWNLOAD, INSTALL/COMPLETE INSTALLATION OF, OR IN ANY OTHER WAY
21+
MAKE USE OF THE SOFTDEVICE.
22+
23+
24+
25+
1. Grant of License
26+
27+
Subject to the terms in this Agreement Nordic grants Licensee a
28+
limited, non-exclusive, non-transferable, non-sub licensable,
29+
revocable license ("License"): (a) to use the SoftDevice solely in
30+
connection with a Nordic integrated circuit, and (b) to distribute the
31+
SoftDevice solely as integrated in Licensee Product. Licensee shall
32+
not use the SoftDevice for any purpose other than specifically
33+
authorized herein. It is a material breach of this agreement to use or
34+
modify the SoftDevice for use on any wireless connectivity integrated
35+
circuit other than a Nordic integrated circuit.
36+
37+
38+
2. Title
39+
40+
Nordic retains full rights, title, and ownership to the SoftDevice and
41+
any and all patents, copyrights, trade secrets, trade names,
42+
trademarks, and other intellectual property rights in and to the
43+
SoftDevice.
44+
45+
46+
3. No Modifications or Reverse Engineering
47+
48+
Licensee shall not, modify, reverse engineer, disassemble, decompile
49+
or otherwise attempt to discover the source code of any non-source
50+
code parts of the SoftDevice including, but not limited to
51+
pre-compiled hex files, binaries and object code.
52+
53+
54+
4. Distribution Restrictions
55+
56+
Except as set forward in Section 1 above, the Licensee may not
57+
disclose or distribute any or all parts of the SoftDevice to any third
58+
party. Licensee agrees to provide reasonable security precautions to
59+
prevent unauthorized access to or use of the SoftDevice as proscribed
60+
herein. Licensee also agrees that use of and access to the SoftDevice
61+
will be strictly limited to the employees and subcontractors of the
62+
Licensee necessary for the performance of development, verification
63+
and production tasks under this Agreement. The Licensee is responsible
64+
for making such employees and subcontractors comply with the
65+
obligations concerning use and non-disclosure of the SoftDevice.
66+
67+
68+
6. No Other Rights
69+
70+
Licensee shall use the SoftDevice only in compliance with this
71+
Agreement and shall refrain from using the SoftDevice in any way that
72+
may be contrary to this Agreement.
73+
74+
75+
7. Fees
76+
77+
Nordic grants the License to the Licensee free of charge provided that
78+
the Licensee undertakes the obligations in the Agreement and warrants
79+
to comply with the Agreement.
80+
81+
82+
8. DISCLAIMER OF WARRANTY
83+
84+
THE SOFTDEVICE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND
85+
EXPRESS OR IMPLIED AND NEITHER NORDIC, ITS LICENSORS OR AFFILIATES NOR
86+
THE COPYRIGHT HOLDERS MAKE ANY REPRESENTATIONS OR WARRANTIES, EXPRESS
87+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
88+
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR THAT THE
89+
SOFTDEVICE WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
90+
TRADEMARKS OR OTHER RIGHTS. THERE IS NO WARRANTY BY NORDIC OR BY ANY
91+
OTHER PARTY THAT THE FUNCTIONS CONTAINED IN THE SOFTDEVICE WILL MEET
92+
THE REQUIREMENTS OF LICENSEE OR THAT THE OPERATION OF THE SOFTDEVICE
93+
WILL BE UNINTERRUPTED OR ERROR-FREE. LICENSEE ASSUMES ALL
94+
RESPONSIBILITY AND RISK FOR THE SELECTION OF THE SOFTDEVICE TO ACHIEVE
95+
LICENSEE’S INTENDED RESULTS AND FOR THE INSTALLATION, USE AND RESULTS
96+
OBTAINED FROM IT.
97+
98+
99+
9. No Support
100+
101+
Nordic is not obligated to furnish or make available to Licensee any
102+
further information, software, technical information, know-how,
103+
show-how, bug-fixes or support. Nordic reserves the right to make
104+
changes to the SoftDevice without further notice.
105+
106+
107+
10. Limitation of Liability
108+
109+
In no event shall Nordic, its employees or suppliers, licensors or
110+
affiliates be liable for any lost profits, revenue, sales, data or
111+
costs of procurement of substitute goods or services, property damage,
112+
personal injury, interruption of business, loss of business
113+
information or for any special, direct, indirect, incidental,
114+
economic, punitive, special or consequential damages, however caused
115+
and whether arising under contract, tort, negligence, or other theory
116+
of liability arising out of the use of or inability to use the
117+
SoftDevice, even if Nordic or its employees or suppliers, licensors or
118+
affiliates are advised of the possibility of such damages. Because
119+
some countries/states/jurisdictions do not allow the exclusion or
120+
limitation of liability, but may allow liability to be limited, in
121+
such cases, Nordic, its employees or licensors or affiliates’
122+
liability shall be limited to USD 50.
123+
124+
125+
11. Breach of Contract
126+
127+
Upon a breach of contract by the Licensee, Nordic and its licensor are
128+
entitled to damages in respect of any direct loss which can be
129+
reasonably attributed to the breach by the Licensee. If the Licensee
130+
has acted with gross negligence or willful misconduct, the Licensee
131+
shall cover both direct and indirect costs for Nordic and its
132+
licensors.
133+
134+
135+
12. Indemnity
136+
137+
Licensee undertakes to indemnify, hold harmless and defend Nordic and
138+
its directors, officers, affiliates, shareholders, licensors,
139+
employees and agents from and against any claims or lawsuits,
140+
including attorney's fees, that arise or result of the Licensee’s
141+
execution of the License and which is not due to causes for which
142+
Nordic is responsible.
143+
144+
145+
13. Governing Law
146+
147+
This Agreement shall be construed according to the laws of Norway, and
148+
hereby submits to the exclusive jurisdiction of the Oslo tingrett.
149+
150+
151+
14. Assignment
152+
153+
Licensee shall not assign this Agreement or any rights or obligations
154+
hereunder without the prior written consent of Nordic.
155+
156+
157+
15. Termination
158+
159+
Without prejudice to any other rights, Nordic may cancel this
160+
Agreement if Licensee does not abide by the terms and conditions of
161+
this Agreement. Upon termination Licensee must promptly cease the use
162+
of the License and destroy all copies of the Licensed Technology and
163+
any other material provided by Nordic or its affiliate, or produced by
164+
the Licensee in connection with the Agreement or the Licensed
165+
Technology.
166+
167+
168+
16. Third party beneficiaries
169+
170+
Nordic’s licensors are intended third party beneficiaries under this
171+
Agreement.
172+
173+
174+

0 commit comments

Comments
 (0)