Contiki 2.5
memmap.h
Go to the documentation of this file.
1 /** @file hal/micro/cortexm3/stm32w108/memmap.h
2  * @brief Definition of STM32W108 chip specific memory map information
3  *
4  * <!--(C) COPYRIGHT 2010 STMicroelectronics. All rights reserved. -->
5  */
6 
7 #ifndef __MEMMAP_H__
8  #error This header should not be included directly, use hal/micro/cortexm3/memmap.h
9 #endif
10 
11 #ifndef __STM32W108_MEMMAP_H__
12 #define __STM32W108_MEMMAP_H__
13 
14 #define RAM_BOTTOM (0x20000000u)
15 #define RAM_SIZE_B (0x2000)
16 #define RAM_SIZE_W (RAM_SIZE_B/4)
17 #define RAM_TOP (RAM_BOTTOM+RAM_SIZE_B-1)
18 
19 #define MFB_BOTTOM (0x08000000u)
20 #define MFB_SIZE_B (0x20000)
21 #define MFB_SIZE_W (MFB_SIZE_B/4)
22 #define MFB_TOP (MFB_BOTTOM+MFB_SIZE_B-1)
23 #define MFB_PAGE_SIZE_B (1024)
24 #define MFB_PAGE_SIZE_W (MFB_PAGE_SIZE_B/4)
25 #define MFB_PAGE_MASK_B (0xFFFFFC00)
26 #define MFB_REGION_SIZE (4) // One write protection region is 4 pages.
27 #define MFB_ADDR_MASK (0x0003FFFFu)
28 
29 #define CIB_BOTTOM (0x08040800u)
30 #define CIB_SIZE_B (0x200)
31 #define CIB_SIZE_W (CIB_SIZE_B/4)
32 #define CIB_TOP (CIB_BOTTOM+CIB_SIZE_B-1)
33 #define CIB_PAGE_SIZE_B (512)
34 #define CIB_PAGE_SIZE_W (CIB_PAGE_SIZE_B/4)
35 #define CIB_OB_BOTTOM (CIB_BOTTOM+0x00) //bottom address of CIB option bytes
36 #define CIB_OB_TOP (CIB_BOTTOM+0x0F) //top address of CIB option bytes
37 
38 #define FIB_BOTTOM (0x08040000u)
39 #define FIB_SIZE_B (0x800)
40 #define FIB_SIZE_W (FIB_SIZE_B/4)
41 #define FIB_TOP (FIB_BOTTOM+FIB_SIZE_B-1)
42 #define FIB_PAGE_SIZE_B (1024)
43 #define FIB_PAGE_SIZE_W (FIB_PAGE_SIZE_B/4)
44 
45 #define FPEC_KEY1 0x45670123 //magic key defined in hardware
46 #define FPEC_KEY2 0xCDEF89AB //magic key defined in hardware
47 
48 //Translation between page number and simee (word based) address
49 #define SIMEE_ADDR_TO_PAGE(x) ((int8u)(((int16u)(x)) >> 9))
50 #define PAGE_TO_SIMEE_ADDR(x) (((int16u)(x)) << 9)
51 
52 //Translation between page number and code addresses, used by bootloaders
53 #define PROG_ADDR_TO_PAGE(x) ((int8u)((((int32u)(x))&MFB_ADDR_MASK) >> 10))
54 #define PAGE_TO_PROG_ADDR(x) ((((int32u)(x)) << 10)|MFB_BOTTOM)
55 
56 
57 #endif //__STM32W108_MEMMAP_H__