SilentSensors / mbed-dev

Fork of mbed-dev by mbed official

Committer:
WaleedElmughrabi
Date:
Thu Sep 20 16:11:23 2018 +0000
Revision:
188:60408c49b6d4
Parent:
186:707f6e361f3e
Fork modified for BG96 error

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 174:b96e65c34a4d 1 /* mbed Microcontroller Library
AnnaBridge 174:b96e65c34a4d 2 *******************************************************************************
AnnaBridge 174:b96e65c34a4d 3 * Copyright (c) 2016, STMicroelectronics
AnnaBridge 174:b96e65c34a4d 4 * All rights reserved.
AnnaBridge 174:b96e65c34a4d 5 *
AnnaBridge 174:b96e65c34a4d 6 * Redistribution and use in source and binary forms, with or without
AnnaBridge 174:b96e65c34a4d 7 * modification, are permitted provided that the following conditions are met:
AnnaBridge 174:b96e65c34a4d 8 *
AnnaBridge 174:b96e65c34a4d 9 * 1. Redistributions of source code must retain the above copyright notice,
AnnaBridge 174:b96e65c34a4d 10 * this list of conditions and the following disclaimer.
AnnaBridge 174:b96e65c34a4d 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
AnnaBridge 174:b96e65c34a4d 12 * this list of conditions and the following disclaimer in the documentation
AnnaBridge 174:b96e65c34a4d 13 * and/or other materials provided with the distribution.
AnnaBridge 174:b96e65c34a4d 14 * 3. Neither the name of STMicroelectronics nor the names of its contributors
AnnaBridge 174:b96e65c34a4d 15 * may be used to endorse or promote products derived from this software
AnnaBridge 174:b96e65c34a4d 16 * without specific prior written permission.
AnnaBridge 174:b96e65c34a4d 17 *
AnnaBridge 174:b96e65c34a4d 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AnnaBridge 174:b96e65c34a4d 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
AnnaBridge 174:b96e65c34a4d 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
AnnaBridge 174:b96e65c34a4d 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
AnnaBridge 174:b96e65c34a4d 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
AnnaBridge 174:b96e65c34a4d 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
AnnaBridge 174:b96e65c34a4d 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
AnnaBridge 174:b96e65c34a4d 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
AnnaBridge 174:b96e65c34a4d 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
AnnaBridge 174:b96e65c34a4d 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AnnaBridge 174:b96e65c34a4d 28 *******************************************************************************
AnnaBridge 174:b96e65c34a4d 29 */
AnnaBridge 174:b96e65c34a4d 30 #ifndef MBED_FLASH_DATA_H
AnnaBridge 174:b96e65c34a4d 31 #define MBED_FLASH_DATA_H
AnnaBridge 174:b96e65c34a4d 32
AnnaBridge 174:b96e65c34a4d 33 #include "device.h"
AnnaBridge 174:b96e65c34a4d 34 #include <stdint.h>
AnnaBridge 174:b96e65c34a4d 35
AnnaBridge 174:b96e65c34a4d 36 #if DEVICE_FLASH
AnnaBridge 174:b96e65c34a4d 37
Anna Bridge 186:707f6e361f3e 38 #define FLASH_SIZE ((uint32_t)0x200000)
Anna Bridge 186:707f6e361f3e 39
Anna Bridge 186:707f6e361f3e 40 //=====================================================================
Anna Bridge 186:707f6e361f3e 41 // The Single Bank mode is selected by default.
Anna Bridge 186:707f6e361f3e 42 // To enable the Dual Bank mode you have to:
Anna Bridge 186:707f6e361f3e 43 // 1) enable the FLASH_DUAL_BANK configuration using a json file
Anna Bridge 186:707f6e361f3e 44 // 2) enable the nDBANK option byte using STLink-Utility software
Anna Bridge 186:707f6e361f3e 45 //=====================================================================
Anna Bridge 186:707f6e361f3e 46 #if MBED_CONF_TARGET_FLASH_DUAL_BANK
Anna Bridge 186:707f6e361f3e 47
Anna Bridge 186:707f6e361f3e 48 #define ADDR_FLASH_SECTOR_0 ((uint32_t)0x08000000) /* Base address of Sector 0, 16 Kbytes */
Anna Bridge 186:707f6e361f3e 49 #define ADDR_FLASH_SECTOR_1 ((uint32_t)0x08004000) /* Base address of Sector 1, 16 Kbytes */
Anna Bridge 186:707f6e361f3e 50 #define ADDR_FLASH_SECTOR_2 ((uint32_t)0x08008000) /* Base address of Sector 2, 16 Kbytes */
Anna Bridge 186:707f6e361f3e 51 #define ADDR_FLASH_SECTOR_3 ((uint32_t)0x0800C000) /* Base address of Sector 3, 16 Kbytes */
Anna Bridge 186:707f6e361f3e 52
Anna Bridge 186:707f6e361f3e 53 #define ADDR_FLASH_SECTOR_4 ((uint32_t)0x08010000) /* Base address of Sector 4, 64 Kbytes */
Anna Bridge 186:707f6e361f3e 54
Anna Bridge 186:707f6e361f3e 55 #define ADDR_FLASH_SECTOR_5 ((uint32_t)0x08020000) /* Base address of Sector 5, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 56 #define ADDR_FLASH_SECTOR_6 ((uint32_t)0x08040000) /* Base address of Sector 6, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 57 #define ADDR_FLASH_SECTOR_7 ((uint32_t)0x08060000) /* Base address of Sector 7, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 58 #define ADDR_FLASH_SECTOR_8 ((uint32_t)0x08080000) /* Base address of Sector 8, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 59 #define ADDR_FLASH_SECTOR_9 ((uint32_t)0x080A0000) /* Base address of Sector 9, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 60 #define ADDR_FLASH_SECTOR_10 ((uint32_t)0x080C0000) /* Base address of Sector 10, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 61 #define ADDR_FLASH_SECTOR_11 ((uint32_t)0x080E0000) /* Base address of Sector 11, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 62
Anna Bridge 186:707f6e361f3e 63 #define ADDR_FLASH_SECTOR_12 ((uint32_t)0x08100000) /* Base address of Sector 12, 16 Kbytes */
Anna Bridge 186:707f6e361f3e 64 #define ADDR_FLASH_SECTOR_13 ((uint32_t)0x08104000) /* Base address of Sector 13, 16 Kbytes */
Anna Bridge 186:707f6e361f3e 65 #define ADDR_FLASH_SECTOR_14 ((uint32_t)0x08108000) /* Base address of Sector 14, 16 Kbytes */
Anna Bridge 186:707f6e361f3e 66 #define ADDR_FLASH_SECTOR_15 ((uint32_t)0x0810C000) /* Base address of Sector 15, 16 Kbytes */
AnnaBridge 174:b96e65c34a4d 67
Anna Bridge 186:707f6e361f3e 68 #define ADDR_FLASH_SECTOR_16 ((uint32_t)0x08110000) /* Base address of Sector 16, 64 Kbytes */
Anna Bridge 186:707f6e361f3e 69
Anna Bridge 186:707f6e361f3e 70 #define ADDR_FLASH_SECTOR_17 ((uint32_t)0x08120000) /* Base address of Sector 17, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 71 #define ADDR_FLASH_SECTOR_18 ((uint32_t)0x08140000) /* Base address of Sector 18, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 72 #define ADDR_FLASH_SECTOR_19 ((uint32_t)0x08160000) /* Base address of Sector 19, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 73 #define ADDR_FLASH_SECTOR_20 ((uint32_t)0x08180000) /* Base address of Sector 20, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 74 #define ADDR_FLASH_SECTOR_21 ((uint32_t)0x081A0000) /* Base address of Sector 21, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 75 #define ADDR_FLASH_SECTOR_22 ((uint32_t)0x081C0000) /* Base address of Sector 22, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 76 #define ADDR_FLASH_SECTOR_23 ((uint32_t)0x081E0000) /* Base address of Sector 23, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 77
Anna Bridge 186:707f6e361f3e 78 #else // SINGLE BANK
Anna Bridge 186:707f6e361f3e 79
Anna Bridge 186:707f6e361f3e 80 #define ADDR_FLASH_SECTOR_0 ((uint32_t)0x08000000) /* Base address of Sector 0, 32 Kbytes */
Anna Bridge 186:707f6e361f3e 81 #define ADDR_FLASH_SECTOR_1 ((uint32_t)0x08008000) /* Base address of Sector 1, 32 Kbytes */
Anna Bridge 186:707f6e361f3e 82 #define ADDR_FLASH_SECTOR_2 ((uint32_t)0x08010000) /* Base address of Sector 2, 32 Kbytes */
Anna Bridge 186:707f6e361f3e 83 #define ADDR_FLASH_SECTOR_3 ((uint32_t)0x08018000) /* Base address of Sector 3, 32 Kbytes */
Anna Bridge 186:707f6e361f3e 84
Anna Bridge 186:707f6e361f3e 85 #define ADDR_FLASH_SECTOR_4 ((uint32_t)0x08020000) /* Base address of Sector 4, 128 Kbytes */
Anna Bridge 186:707f6e361f3e 86
Anna Bridge 186:707f6e361f3e 87 #define ADDR_FLASH_SECTOR_5 ((uint32_t)0x08040000) /* Base address of Sector 5, 256 Kbytes */
Anna Bridge 186:707f6e361f3e 88 #define ADDR_FLASH_SECTOR_6 ((uint32_t)0x08080000) /* Base address of Sector 6, 256 Kbytes */
Anna Bridge 186:707f6e361f3e 89 #define ADDR_FLASH_SECTOR_7 ((uint32_t)0x080C0000) /* Base address of Sector 7, 256 Kbytes */
Anna Bridge 186:707f6e361f3e 90 #define ADDR_FLASH_SECTOR_8 ((uint32_t)0x08100000) /* Base address of Sector 8, 256 Kbytes */
Anna Bridge 186:707f6e361f3e 91 #define ADDR_FLASH_SECTOR_9 ((uint32_t)0x08140000) /* Base address of Sector 9, 256 Kbytes */
Anna Bridge 186:707f6e361f3e 92 #define ADDR_FLASH_SECTOR_10 ((uint32_t)0x08180000) /* Base address of Sector 10, 256 Kbytes */
Anna Bridge 186:707f6e361f3e 93 #define ADDR_FLASH_SECTOR_11 ((uint32_t)0x081C0000) /* Base address of Sector 11, 256 Kbytes */
Anna Bridge 186:707f6e361f3e 94
Anna Bridge 186:707f6e361f3e 95 #endif // MBED_CONF_TARGET_FLASH_DUAL_BANK
Anna Bridge 186:707f6e361f3e 96
Anna Bridge 186:707f6e361f3e 97 #endif // DEVICE_FLASH
AnnaBridge 174:b96e65c34a4d 98
AnnaBridge 174:b96e65c34a4d 99 #endif