Contiki 2.5
fib-bootloader.h
Go to the documentation of this file.
1 /** @file hal/micro/cortexm3/bootloader/fib-bootloader.h
2  * @brief Definition and description of FIB bootloader shared functions.
3  *
4  * <!--(C) COPYRIGHT 2010 STMicroelectronics. All rights reserved. -->
5  */
6 
7 #ifndef __FIB_BOOTLOADER_H__
8 #define __FIB_BOOTLOADER_H__
9 
10 //------------------------------------------------------------------------------
11 // Reset signatures.
12 
13 #define FIB_RESET_GO_ZERO 0xF00F0100
14 // Reset signatures 0xF00F0100 to 0xF00F010F can be chosen using the go command.
15 #define FIB_RESET_GO_JUMP 0xF00F0110
16 #define FIB_RESET_BAUD_RATE 0xF00F0111
17 #define FIB_RESET_READ_UNPROTECT 0xF00F0112
18 #define FIB_RESET_GPIO_BOOTMODE 0xF00F0113
19 #define FIB_RESET_PART_DATA 0xF00F0114
20 #define FIB_RESET_NMI_HARD_FAULT 0xF00F0115
21 
22 //------------------------------------------------------------------------------
23 // Status values.
24 
25 typedef int32u FibStatus;
26 
27 #define FIB_SUCCESS 0
28 #define FIB_ERR_UNALIGNED 1
29 #define FIB_ERR_INVALID_ADDRESS 2
30 #define FIB_ERR_INVALID_TYPE 3
31 #define FIB_ERR_WRITE_PROTECTED 4
32 #define FIB_ERR_WRITE_FAILED 5
33 #define FIB_ERR_ERASE_REQUIRED 6
34 #define FIB_ERR_VERIFY_FAILED 7
35 
36 //------------------------------------------------------------------------------
37 // Erase types.
38 
39 typedef int32u FibEraseType;
40 
41 #define MFB_MASS_ERASE 0x01
42 #define MFB_PAGE_ERASE 0x02
43 #define CIB_ERASE 0x03
44 
45 #define DO_ERASE 0x0100
46 #define DO_VERIFY 0x0200
47 
48 //------------------------------------------------------------------------------
49 // Shared flash functions.
50 
51 FibStatus fibFlashWrite(int32u address, int8u *data,
52  int32u writeLength, int32u verifyLength);
53 
54 FibStatus fibFlashErase(FibEraseType eraseType, int32u address);
55 
56 #endif //__FIB_BOOTLOADER_H__