test

Fork of mbed-dev by mbed official

Committer:
AnnaBridge
Date:
Wed Oct 25 14:53:38 2017 +0100
Revision:
177:447f873cad2f
This updates the lib to the mbed lib v 154

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 177:447f873cad2f 1 /* mbed Microcontroller Library
AnnaBridge 177:447f873cad2f 2 * Copyright (c) 2017 ARM Limited
AnnaBridge 177:447f873cad2f 3 *
AnnaBridge 177:447f873cad2f 4 * Licensed under the Apache License, Version 2.0 (the "License");
AnnaBridge 177:447f873cad2f 5 * you may not use this file except in compliance with the License.
AnnaBridge 177:447f873cad2f 6 * You may obtain a copy of the License at
AnnaBridge 177:447f873cad2f 7 *
AnnaBridge 177:447f873cad2f 8 * http://www.apache.org/licenses/LICENSE-2.0
AnnaBridge 177:447f873cad2f 9 *
AnnaBridge 177:447f873cad2f 10 * Unless required by applicable law or agreed to in writing, software
AnnaBridge 177:447f873cad2f 11 * distributed under the License is distributed on an "AS IS" BASIS,
AnnaBridge 177:447f873cad2f 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AnnaBridge 177:447f873cad2f 13 * See the License for the specific language governing permissions and
AnnaBridge 177:447f873cad2f 14 * limitations under the License.
AnnaBridge 177:447f873cad2f 15 */
AnnaBridge 177:447f873cad2f 16
AnnaBridge 177:447f873cad2f 17 #include "mbed_toolchain.h"
AnnaBridge 177:447f873cad2f 18
AnnaBridge 177:447f873cad2f 19 /* Code Read Protection
AnnaBridge 177:447f873cad2f 20
AnnaBridge 177:447f873cad2f 21 NONE 0xFFFFFFFF - No code protection.
AnnaBridge 177:447f873cad2f 22
AnnaBridge 177:447f873cad2f 23 CRP1 0x12345678 - Write to RAM command can not access RAM below 0x10000200.
AnnaBridge 177:447f873cad2f 24 - Read Memory command: disabled.
AnnaBridge 177:447f873cad2f 25 - Copy RAM to Flash command: cannot write to Sector 0.
AnnaBridge 177:447f873cad2f 26 - "Go" command: disabled.
AnnaBridge 177:447f873cad2f 27 - Erase sector(s) command: can erase any individual sector except
AnnaBridge 177:447f873cad2f 28 sector 0 only, or can erase all sectors at once.
AnnaBridge 177:447f873cad2f 29 - Compare command: disabled
AnnaBridge 177:447f873cad2f 30
AnnaBridge 177:447f873cad2f 31 CRP2 0x87654321 - Write to RAM command: disabled.
AnnaBridge 177:447f873cad2f 32 - Copy RAM to Flash: disabled.
AnnaBridge 177:447f873cad2f 33 - Erase command: only allows erase of all sectors.
AnnaBridge 177:447f873cad2f 34
AnnaBridge 177:447f873cad2f 35 CRP3 0x43218765 - Access to chip via the SWD pins is disabled. ISP entry
AnnaBridge 177:447f873cad2f 36 by pulling PIO0_1 LOW is disabled if a valid user code is
AnnaBridge 177:447f873cad2f 37 present in flash sector 0.
AnnaBridge 177:447f873cad2f 38 Caution: If CRP3 is selected, no future factory testing can be
AnnaBridge 177:447f873cad2f 39 performed on the device.
AnnaBridge 177:447f873cad2f 40 */
AnnaBridge 177:447f873cad2f 41 #if !defined(APPLICATION_ADDR) // Relocate CRP if there is a bootloader.
AnnaBridge 177:447f873cad2f 42 #define APPLICATION_ADDR 0
AnnaBridge 177:447f873cad2f 43 #endif
AnnaBridge 177:447f873cad2f 44
AnnaBridge 177:447f873cad2f 45 #define CRP_NONE 0xFFFFFFFF
AnnaBridge 177:447f873cad2f 46 #define CRP_1 0x12345678
AnnaBridge 177:447f873cad2f 47 #define CRP_2 0x87654321
AnnaBridge 177:447f873cad2f 48 #define CRP_3 0x43218765
AnnaBridge 177:447f873cad2f 49
AnnaBridge 177:447f873cad2f 50 #ifndef CRP
AnnaBridge 177:447f873cad2f 51 #define CRP CRP_NONE
AnnaBridge 177:447f873cad2f 52 #endif
AnnaBridge 177:447f873cad2f 53
AnnaBridge 177:447f873cad2f 54 MBED_SECTION(".CRPSection") MBED_USED const long CRP_Key = CRP;