c781cc19d3672ce555f77aa7ea2cc0eef5b1e56c
[SCSI2SD-V6.git] / software / SCSI2SD / USB_Bootloader.cydsn / CortexM3 / ARM_GCC_473 / Release / BL.lst
1 ARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                        page 1\r
2 \r
3 \r
4    1                            .syntax unified\r
5    2                            .cpu cortex-m3\r
6    3                            .fpu softvfp\r
7    4                            .eabi_attribute 20, 1\r
8    5                            .eabi_attribute 21, 1\r
9    6                            .eabi_attribute 23, 3\r
10    7                            .eabi_attribute 24, 1\r
11    8                            .eabi_attribute 25, 1\r
12    9                            .eabi_attribute 26, 1\r
13   10                            .eabi_attribute 30, 4\r
14   11                            .eabi_attribute 34, 1\r
15   12                            .eabi_attribute 18, 4\r
16   13                            .thumb\r
17   14                            .file   "BL.c"\r
18   15                            .text\r
19   16                    .Ltext0:\r
20   17                            .cfi_sections   .debug_frame\r
21   18                            .section        .text.BL_LaunchBootloadable,"ax",%progbits\r
22   19                            .align  1\r
23   20                            .thumb\r
24   21                            .thumb_func\r
25   22                            .type   BL_LaunchBootloadable, %function\r
26   23                    BL_LaunchBootloadable:\r
27   24                    .LFB62:\r
28   25                            .file 1 ".\\Generated_Source\\PSoC5\\BL.c"\r
29    1:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
30    2:.\Generated_Source\PSoC5/BL.c **** * File Name: BL.c\r
31    3:.\Generated_Source\PSoC5/BL.c **** * Version 1.20\r
32    4:.\Generated_Source\PSoC5/BL.c **** *\r
33    5:.\Generated_Source\PSoC5/BL.c **** *  Description:\r
34    6:.\Generated_Source\PSoC5/BL.c **** *   Provides an API for the Bootloader component. The API includes functions\r
35    7:.\Generated_Source\PSoC5/BL.c **** *   for starting boot loading operations, validating the application and\r
36    8:.\Generated_Source\PSoC5/BL.c **** *   jumping to the application.\r
37    9:.\Generated_Source\PSoC5/BL.c **** *\r
38   10:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
39   11:.\Generated_Source\PSoC5/BL.c **** * Copyright 2008-2013, Cypress Semiconductor Corporation.  All rights reserved.\r
40   12:.\Generated_Source\PSoC5/BL.c **** * You may use this file only in accordance with the license, terms, conditions,\r
41   13:.\Generated_Source\PSoC5/BL.c **** * disclaimers, and limitations in the end user license agreement accompanying\r
42   14:.\Generated_Source\PSoC5/BL.c **** * the software package with which this file was provided.\r
43   15:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
44   16:.\Generated_Source\PSoC5/BL.c **** \r
45   17:.\Generated_Source\PSoC5/BL.c **** #include "BL_PVT.h"\r
46   18:.\Generated_Source\PSoC5/BL.c **** \r
47   19:.\Generated_Source\PSoC5/BL.c **** #include "project.h"\r
48   20:.\Generated_Source\PSoC5/BL.c **** #include <string.h>\r
49   21:.\Generated_Source\PSoC5/BL.c **** \r
50   22:.\Generated_Source\PSoC5/BL.c **** \r
51   23:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
52   24:.\Generated_Source\PSoC5/BL.c **** * The Checksum and SizeBytes are forcefully set in code. We then post process\r
53   25:.\Generated_Source\PSoC5/BL.c **** * the hex file from the linker and inject their values then. When the hex file\r
54   26:.\Generated_Source\PSoC5/BL.c **** * is loaded onto the device these two variables should have valid values.\r
55   27:.\Generated_Source\PSoC5/BL.c **** * Because the compiler can do optimizations remove the constant\r
56   28:.\Generated_Source\PSoC5/BL.c **** * accesses, these should not be accessed directly. Instead, the variables\r
57   29:.\Generated_Source\PSoC5/BL.c **** * CyBtldr_ChecksumAccess & CyBtldr_SizeBytesAccess should be used to get the\r
58   30:.\Generated_Source\PSoC5/BL.c **** * proper values at runtime.\r
59   31:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
60   32:.\Generated_Source\PSoC5/BL.c **** #if defined(__ARMCC_VERSION) || defined (__GNUC__)\r
61 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 2\r
62 \r
63 \r
64   33:.\Generated_Source\PSoC5/BL.c ****     __attribute__((section (".bootloader")))\r
65   34:.\Generated_Source\PSoC5/BL.c **** #elif defined (__ICCARM__)\r
66   35:.\Generated_Source\PSoC5/BL.c ****     #pragma location=".bootloader"\r
67   36:.\Generated_Source\PSoC5/BL.c **** #endif  /* defined(__ARMCC_VERSION) || defined (__GNUC__) */\r
68   37:.\Generated_Source\PSoC5/BL.c **** \r
69   38:.\Generated_Source\PSoC5/BL.c **** const uint8  CYCODE BL_Checksum = 0u;\r
70   39:.\Generated_Source\PSoC5/BL.c **** const uint8  CYCODE *BL_ChecksumAccess  = (const uint8  CYCODE *)(&BL_Checksum);\r
71   40:.\Generated_Source\PSoC5/BL.c **** \r
72   41:.\Generated_Source\PSoC5/BL.c **** #if defined(__ARMCC_VERSION) || defined (__GNUC__)\r
73   42:.\Generated_Source\PSoC5/BL.c ****     __attribute__((section (".bootloader")))\r
74   43:.\Generated_Source\PSoC5/BL.c **** #elif defined (__ICCARM__)\r
75   44:.\Generated_Source\PSoC5/BL.c ****     #pragma location=".bootloader"\r
76   45:.\Generated_Source\PSoC5/BL.c **** #endif  /* defined(__ARMCC_VERSION) || defined (__GNUC__) */\r
77   46:.\Generated_Source\PSoC5/BL.c **** \r
78   47:.\Generated_Source\PSoC5/BL.c **** const uint32 CYCODE BL_SizeBytes = 0xFFFFFFFFu;\r
79   48:.\Generated_Source\PSoC5/BL.c **** const uint32 CYCODE *BL_SizeBytesAccess = (const uint32 CYCODE *)(&BL_SizeBytes);\r
80   49:.\Generated_Source\PSoC5/BL.c **** \r
81   50:.\Generated_Source\PSoC5/BL.c **** \r
82   51:.\Generated_Source\PSoC5/BL.c **** #if(0u != BL_DUAL_APP_BOOTLOADER)\r
83   52:.\Generated_Source\PSoC5/BL.c ****     uint8 BL_activeApp = BL_MD_BTLDB_ACTIVE_NONE;\r
84   53:.\Generated_Source\PSoC5/BL.c **** #else\r
85   54:.\Generated_Source\PSoC5/BL.c ****     #define BL_activeApp      (BL_MD_BTLDB_ACTIVE_0)\r
86   55:.\Generated_Source\PSoC5/BL.c **** #endif  /* (0u != BL_DUAL_APP_BOOTLOADER) */\r
87   56:.\Generated_Source\PSoC5/BL.c **** \r
88   57:.\Generated_Source\PSoC5/BL.c **** \r
89   58:.\Generated_Source\PSoC5/BL.c **** /***************************************\r
90   59:.\Generated_Source\PSoC5/BL.c **** *     Function Prototypes\r
91   60:.\Generated_Source\PSoC5/BL.c **** ***************************************/\r
92   61:.\Generated_Source\PSoC5/BL.c **** static cystatus BL_WritePacket(uint8 status, uint8 buffer[], uint16 size) CYSMALL \\r
93   62:.\Generated_Source\PSoC5/BL.c ****                                     ;\r
94   63:.\Generated_Source\PSoC5/BL.c **** \r
95   64:.\Generated_Source\PSoC5/BL.c **** static uint16   BL_CalcPacketChecksum(const uint8 buffer[], uint16 size) CYSMALL \\r
96   65:.\Generated_Source\PSoC5/BL.c ****                                     ;\r
97   66:.\Generated_Source\PSoC5/BL.c **** \r
98   67:.\Generated_Source\PSoC5/BL.c **** static uint8    BL_Calc8BitFlashSum(uint32 start, uint32 size) CYSMALL \\r
99   68:.\Generated_Source\PSoC5/BL.c ****                                     ;\r
100   69:.\Generated_Source\PSoC5/BL.c **** #if(!CY_PSOC4)\r
101   70:.\Generated_Source\PSoC5/BL.c **** static uint8    BL_Calc8BitEepromSum(uint32 start, uint32 size) CYSMALL \\r
102   71:.\Generated_Source\PSoC5/BL.c ****                                     ;\r
103   72:.\Generated_Source\PSoC5/BL.c **** #endif /* (!CY_PSOC4) */\r
104   73:.\Generated_Source\PSoC5/BL.c **** \r
105   74:.\Generated_Source\PSoC5/BL.c **** static void     BL_HostLink(uint8 timeOut) \\r
106   75:.\Generated_Source\PSoC5/BL.c ****                                     ;\r
107   76:.\Generated_Source\PSoC5/BL.c **** \r
108   77:.\Generated_Source\PSoC5/BL.c **** static void     BL_LaunchApplication(void) CYSMALL \\r
109   78:.\Generated_Source\PSoC5/BL.c ****                                     ;\r
110   79:.\Generated_Source\PSoC5/BL.c **** \r
111   80:.\Generated_Source\PSoC5/BL.c **** static cystatus BL_ValidateBootloadable(uint8 appId) CYSMALL \\r
112   81:.\Generated_Source\PSoC5/BL.c ****                                     ;\r
113   82:.\Generated_Source\PSoC5/BL.c **** \r
114   83:.\Generated_Source\PSoC5/BL.c **** static uint32   BL_GetMetadata(uint8 fieldName, uint8 appId)\\r
115   84:.\Generated_Source\PSoC5/BL.c ****                                     ;\r
116   85:.\Generated_Source\PSoC5/BL.c **** \r
117   86:.\Generated_Source\PSoC5/BL.c **** #if(!CY_PSOC3)\r
118   87:.\Generated_Source\PSoC5/BL.c ****     /* Implementation for the PSoC 3 resides in a BL_psoc3.a51 file.  */\r
119   88:.\Generated_Source\PSoC5/BL.c ****     static void     BL_LaunchBootloadable(uint32 appAddr);\r
120   89:.\Generated_Source\PSoC5/BL.c **** #endif  /* (!CY_PSOC3) */\r
121 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 3\r
122 \r
123 \r
124   90:.\Generated_Source\PSoC5/BL.c **** \r
125   91:.\Generated_Source\PSoC5/BL.c **** \r
126   92:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
127   93:.\Generated_Source\PSoC5/BL.c **** * Function Name: BL_CalcPacketChecksum\r
128   94:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
129   95:.\Generated_Source\PSoC5/BL.c **** *\r
130   96:.\Generated_Source\PSoC5/BL.c **** * Summary:\r
131   97:.\Generated_Source\PSoC5/BL.c **** *  This computes the 16 bit checksum for the provided number of bytes contained\r
132   98:.\Generated_Source\PSoC5/BL.c **** *  in the provided buffer\r
133   99:.\Generated_Source\PSoC5/BL.c **** *\r
134  100:.\Generated_Source\PSoC5/BL.c **** * Parameters:\r
135  101:.\Generated_Source\PSoC5/BL.c **** *  buffer:\r
136  102:.\Generated_Source\PSoC5/BL.c **** *     The buffer containing the data to compute the checksum for\r
137  103:.\Generated_Source\PSoC5/BL.c **** *  size:\r
138  104:.\Generated_Source\PSoC5/BL.c **** *     The number of bytes in buffer to compute the checksum for\r
139  105:.\Generated_Source\PSoC5/BL.c **** *\r
140  106:.\Generated_Source\PSoC5/BL.c **** * Returns:\r
141  107:.\Generated_Source\PSoC5/BL.c **** *  16 bit checksum for the provided data\r
142  108:.\Generated_Source\PSoC5/BL.c **** *\r
143  109:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
144  110:.\Generated_Source\PSoC5/BL.c **** static uint16 BL_CalcPacketChecksum(const uint8 buffer[], uint16 size) \\r
145  111:.\Generated_Source\PSoC5/BL.c ****                     CYSMALL \r
146  112:.\Generated_Source\PSoC5/BL.c **** {\r
147  113:.\Generated_Source\PSoC5/BL.c ****     #if(0u != BL_PACKET_CHECKSUM_CRC)\r
148  114:.\Generated_Source\PSoC5/BL.c **** \r
149  115:.\Generated_Source\PSoC5/BL.c ****         uint16 CYDATA crc = BL_CRC_CCITT_INITIAL_VALUE;\r
150  116:.\Generated_Source\PSoC5/BL.c ****         uint16 CYDATA tmp;\r
151  117:.\Generated_Source\PSoC5/BL.c ****         uint8  CYDATA i;\r
152  118:.\Generated_Source\PSoC5/BL.c ****         uint16 CYDATA tmpIndex = size;\r
153  119:.\Generated_Source\PSoC5/BL.c **** \r
154  120:.\Generated_Source\PSoC5/BL.c ****         if(0u == size)\r
155  121:.\Generated_Source\PSoC5/BL.c ****         {\r
156  122:.\Generated_Source\PSoC5/BL.c ****             crc = ~crc;\r
157  123:.\Generated_Source\PSoC5/BL.c ****         }\r
158  124:.\Generated_Source\PSoC5/BL.c ****         else\r
159  125:.\Generated_Source\PSoC5/BL.c ****         {\r
160  126:.\Generated_Source\PSoC5/BL.c ****             do\r
161  127:.\Generated_Source\PSoC5/BL.c ****             {\r
162  128:.\Generated_Source\PSoC5/BL.c ****                 tmp = buffer[tmpIndex - size];\r
163  129:.\Generated_Source\PSoC5/BL.c **** \r
164  130:.\Generated_Source\PSoC5/BL.c ****                 for (i = 0u; i < 8u; i++)\r
165  131:.\Generated_Source\PSoC5/BL.c ****                 {\r
166  132:.\Generated_Source\PSoC5/BL.c ****                     if (0u != ((crc & 0x0001u) ^ (tmp & 0x0001u)))\r
167  133:.\Generated_Source\PSoC5/BL.c ****                     {\r
168  134:.\Generated_Source\PSoC5/BL.c ****                         crc = (crc >> 1u) ^ BL_CRC_CCITT_POLYNOMIAL;\r
169  135:.\Generated_Source\PSoC5/BL.c ****                     }\r
170  136:.\Generated_Source\PSoC5/BL.c ****                     else\r
171  137:.\Generated_Source\PSoC5/BL.c ****                     {\r
172  138:.\Generated_Source\PSoC5/BL.c ****                         crc >>= 1u;\r
173  139:.\Generated_Source\PSoC5/BL.c ****                     }\r
174  140:.\Generated_Source\PSoC5/BL.c **** \r
175  141:.\Generated_Source\PSoC5/BL.c ****                     tmp >>= 1u;\r
176  142:.\Generated_Source\PSoC5/BL.c ****                 }\r
177  143:.\Generated_Source\PSoC5/BL.c **** \r
178  144:.\Generated_Source\PSoC5/BL.c ****                 size--;\r
179  145:.\Generated_Source\PSoC5/BL.c ****             }\r
180  146:.\Generated_Source\PSoC5/BL.c ****             while(0u != size);\r
181 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 4\r
182 \r
183 \r
184  147:.\Generated_Source\PSoC5/BL.c **** \r
185  148:.\Generated_Source\PSoC5/BL.c ****             crc = ~crc;\r
186  149:.\Generated_Source\PSoC5/BL.c ****             tmp = crc;\r
187  150:.\Generated_Source\PSoC5/BL.c ****             crc = ( uint16 )(crc << 8u) | (tmp >> 8u);\r
188  151:.\Generated_Source\PSoC5/BL.c ****         }\r
189  152:.\Generated_Source\PSoC5/BL.c **** \r
190  153:.\Generated_Source\PSoC5/BL.c ****         return(crc);\r
191  154:.\Generated_Source\PSoC5/BL.c **** \r
192  155:.\Generated_Source\PSoC5/BL.c ****     #else\r
193  156:.\Generated_Source\PSoC5/BL.c **** \r
194  157:.\Generated_Source\PSoC5/BL.c ****         uint16 CYDATA sum = 0u;\r
195  158:.\Generated_Source\PSoC5/BL.c **** \r
196  159:.\Generated_Source\PSoC5/BL.c ****         while (size > 0u)\r
197  160:.\Generated_Source\PSoC5/BL.c ****         {\r
198  161:.\Generated_Source\PSoC5/BL.c ****             sum += buffer[size - 1u];\r
199  162:.\Generated_Source\PSoC5/BL.c ****             size--;\r
200  163:.\Generated_Source\PSoC5/BL.c ****         }\r
201  164:.\Generated_Source\PSoC5/BL.c **** \r
202  165:.\Generated_Source\PSoC5/BL.c ****         return(( uint16 )1u + ( uint16 )(~sum));\r
203  166:.\Generated_Source\PSoC5/BL.c **** \r
204  167:.\Generated_Source\PSoC5/BL.c ****     #endif /* (0u != BL_PACKET_CHECKSUM_CRC) */\r
205  168:.\Generated_Source\PSoC5/BL.c **** }\r
206  169:.\Generated_Source\PSoC5/BL.c **** \r
207  170:.\Generated_Source\PSoC5/BL.c **** \r
208  171:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
209  172:.\Generated_Source\PSoC5/BL.c **** * Function Name: BL_Calc8BitFlashSum\r
210  173:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
211  174:.\Generated_Source\PSoC5/BL.c **** *\r
212  175:.\Generated_Source\PSoC5/BL.c **** * Summary:\r
213  176:.\Generated_Source\PSoC5/BL.c **** *  This computes the 8 bit sum for the provided number of bytes contained in\r
214  177:.\Generated_Source\PSoC5/BL.c **** *  flash.\r
215  178:.\Generated_Source\PSoC5/BL.c **** *\r
216  179:.\Generated_Source\PSoC5/BL.c **** * Parameters:\r
217  180:.\Generated_Source\PSoC5/BL.c **** *  start:\r
218  181:.\Generated_Source\PSoC5/BL.c **** *     The starting address to start summing data for\r
219  182:.\Generated_Source\PSoC5/BL.c **** *  size:\r
220  183:.\Generated_Source\PSoC5/BL.c **** *     The number of bytes to read and compute the sum for\r
221  184:.\Generated_Source\PSoC5/BL.c **** *\r
222  185:.\Generated_Source\PSoC5/BL.c **** * Returns:\r
223  186:.\Generated_Source\PSoC5/BL.c **** *   8 bit sum for the provided data\r
224  187:.\Generated_Source\PSoC5/BL.c **** *\r
225  188:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
226  189:.\Generated_Source\PSoC5/BL.c **** static uint8 BL_Calc8BitFlashSum(uint32 start, uint32 size) \\r
227  190:.\Generated_Source\PSoC5/BL.c ****                 CYSMALL \r
228  191:.\Generated_Source\PSoC5/BL.c **** {\r
229  192:.\Generated_Source\PSoC5/BL.c ****     uint8 CYDATA sum = 0u;\r
230  193:.\Generated_Source\PSoC5/BL.c **** \r
231  194:.\Generated_Source\PSoC5/BL.c ****     while (size > 0u)\r
232  195:.\Generated_Source\PSoC5/BL.c ****     {\r
233  196:.\Generated_Source\PSoC5/BL.c ****         size--;\r
234  197:.\Generated_Source\PSoC5/BL.c ****         sum += BL_GET_CODE_BYTE(start + size);\r
235  198:.\Generated_Source\PSoC5/BL.c ****     }\r
236  199:.\Generated_Source\PSoC5/BL.c **** \r
237  200:.\Generated_Source\PSoC5/BL.c ****     return(sum);\r
238  201:.\Generated_Source\PSoC5/BL.c **** }\r
239  202:.\Generated_Source\PSoC5/BL.c **** \r
240  203:.\Generated_Source\PSoC5/BL.c **** \r
241 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 5\r
242 \r
243 \r
244  204:.\Generated_Source\PSoC5/BL.c **** #if(!CY_PSOC4)\r
245  205:.\Generated_Source\PSoC5/BL.c **** \r
246  206:.\Generated_Source\PSoC5/BL.c ****     /*******************************************************************************\r
247  207:.\Generated_Source\PSoC5/BL.c ****     * Function Name: BL_Calc8BitEepromSum\r
248  208:.\Generated_Source\PSoC5/BL.c ****     ********************************************************************************\r
249  209:.\Generated_Source\PSoC5/BL.c ****     *\r
250  210:.\Generated_Source\PSoC5/BL.c ****     * Summary:\r
251  211:.\Generated_Source\PSoC5/BL.c ****     *  This computes the 8 bit sum for the provided number of bytes contained in\r
252  212:.\Generated_Source\PSoC5/BL.c ****     *  EEPROM.\r
253  213:.\Generated_Source\PSoC5/BL.c ****     *\r
254  214:.\Generated_Source\PSoC5/BL.c ****     * Parameters:\r
255  215:.\Generated_Source\PSoC5/BL.c ****     *  start:\r
256  216:.\Generated_Source\PSoC5/BL.c ****     *     The starting address to start summing data for\r
257  217:.\Generated_Source\PSoC5/BL.c ****     *  size:\r
258  218:.\Generated_Source\PSoC5/BL.c ****     *     The number of bytes to read and compute the sum for\r
259  219:.\Generated_Source\PSoC5/BL.c ****     *\r
260  220:.\Generated_Source\PSoC5/BL.c ****     * Returns:\r
261  221:.\Generated_Source\PSoC5/BL.c ****     *   8 bit sum for the provided data\r
262  222:.\Generated_Source\PSoC5/BL.c ****     *\r
263  223:.\Generated_Source\PSoC5/BL.c ****     *******************************************************************************/\r
264  224:.\Generated_Source\PSoC5/BL.c ****     static uint8 BL_Calc8BitEepromSum(uint32 start, uint32 size) \\r
265  225:.\Generated_Source\PSoC5/BL.c ****                     CYSMALL \r
266  226:.\Generated_Source\PSoC5/BL.c ****     {\r
267  227:.\Generated_Source\PSoC5/BL.c ****         uint8 CYDATA sum = 0u;\r
268  228:.\Generated_Source\PSoC5/BL.c **** \r
269  229:.\Generated_Source\PSoC5/BL.c ****         while (size > 0u)\r
270  230:.\Generated_Source\PSoC5/BL.c ****         {\r
271  231:.\Generated_Source\PSoC5/BL.c ****             size--;\r
272  232:.\Generated_Source\PSoC5/BL.c ****             sum += BL_GET_EEPROM_BYTE(start + size);\r
273  233:.\Generated_Source\PSoC5/BL.c ****         }\r
274  234:.\Generated_Source\PSoC5/BL.c **** \r
275  235:.\Generated_Source\PSoC5/BL.c ****         return(sum);\r
276  236:.\Generated_Source\PSoC5/BL.c ****     }\r
277  237:.\Generated_Source\PSoC5/BL.c **** \r
278  238:.\Generated_Source\PSoC5/BL.c **** #endif  /* (!CY_PSOC4) */\r
279  239:.\Generated_Source\PSoC5/BL.c **** \r
280  240:.\Generated_Source\PSoC5/BL.c **** \r
281  241:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
282  242:.\Generated_Source\PSoC5/BL.c **** * Function Name: BL_Start\r
283  243:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
284  244:.\Generated_Source\PSoC5/BL.c **** * Summary:\r
285  245:.\Generated_Source\PSoC5/BL.c **** *  This function is called in order executing following algorithm:\r
286  246:.\Generated_Source\PSoC5/BL.c **** *\r
287  247:.\Generated_Source\PSoC5/BL.c **** *  - Identify active bootloadable application (applicable only to\r
288  248:.\Generated_Source\PSoC5/BL.c **** *    Multi-application bootloader)\r
289  249:.\Generated_Source\PSoC5/BL.c **** *\r
290  250:.\Generated_Source\PSoC5/BL.c **** *  - Validate bootloader application (desing-time configurable, Bootloader\r
291  251:.\Generated_Source\PSoC5/BL.c **** *    application validation option of the component customizer)\r
292  252:.\Generated_Source\PSoC5/BL.c **** *\r
293  253:.\Generated_Source\PSoC5/BL.c **** *  - Validate active bootloadable application\r
294  254:.\Generated_Source\PSoC5/BL.c **** *\r
295  255:.\Generated_Source\PSoC5/BL.c **** *  - Run communication subroutine (desing-time configurable, Wait for command\r
296  256:.\Generated_Source\PSoC5/BL.c **** *    option of the component customizer)\r
297  257:.\Generated_Source\PSoC5/BL.c **** *\r
298  258:.\Generated_Source\PSoC5/BL.c **** *  - Schedule bootloadable and reset device\r
299  259:.\Generated_Source\PSoC5/BL.c **** *\r
300  260:.\Generated_Source\PSoC5/BL.c **** * Parameters:\r
301 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 6\r
302 \r
303 \r
304  261:.\Generated_Source\PSoC5/BL.c **** *  None\r
305  262:.\Generated_Source\PSoC5/BL.c **** *\r
306  263:.\Generated_Source\PSoC5/BL.c **** * Return:\r
307  264:.\Generated_Source\PSoC5/BL.c **** *  This method will never return. It will either load a new application and\r
308  265:.\Generated_Source\PSoC5/BL.c **** *  reset the device or it will jump directly to the existing application.\r
309  266:.\Generated_Source\PSoC5/BL.c **** *\r
310  267:.\Generated_Source\PSoC5/BL.c **** * Side Effects:\r
311  268:.\Generated_Source\PSoC5/BL.c **** *  If this method determines that the bootloader appliation itself is corrupt,\r
312  269:.\Generated_Source\PSoC5/BL.c **** *  this method will not return, instead it will simply hang the application.\r
313  270:.\Generated_Source\PSoC5/BL.c **** *\r
314  271:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
315  272:.\Generated_Source\PSoC5/BL.c **** void BL_Start(void) CYSMALL \r
316  273:.\Generated_Source\PSoC5/BL.c **** {\r
317  274:.\Generated_Source\PSoC5/BL.c ****     #if(0u != BL_BOOTLOADER_APP_VALIDATION)\r
318  275:.\Generated_Source\PSoC5/BL.c ****         uint8 CYDATA calcedChecksum;\r
319  276:.\Generated_Source\PSoC5/BL.c ****     #endif    /* (0u != BL_BOOTLOADER_APP_VALIDATION) */\r
320  277:.\Generated_Source\PSoC5/BL.c **** \r
321  278:.\Generated_Source\PSoC5/BL.c ****     #if(!CY_PSOC4)\r
322  279:.\Generated_Source\PSoC5/BL.c ****         uint8 CYXDATA BL_flashBuffer[BL_FROW_SIZE];\r
323  280:.\Generated_Source\PSoC5/BL.c ****     #endif  /* (!CY_PSOC4) */\r
324  281:.\Generated_Source\PSoC5/BL.c **** \r
325  282:.\Generated_Source\PSoC5/BL.c ****     cystatus tmpStatus;\r
326  283:.\Generated_Source\PSoC5/BL.c **** \r
327  284:.\Generated_Source\PSoC5/BL.c **** \r
328  285:.\Generated_Source\PSoC5/BL.c ****     /* Identify active bootloadable application */\r
329  286:.\Generated_Source\PSoC5/BL.c ****     #if(0u != BL_DUAL_APP_BOOTLOADER)\r
330  287:.\Generated_Source\PSoC5/BL.c **** \r
331  288:.\Generated_Source\PSoC5/BL.c ****         if(BL_MD_BTLDB_ACTIVE_VALUE(0u) == BL_MD_BTLDB_IS_ACTIVE)\r
332  289:.\Generated_Source\PSoC5/BL.c ****         {\r
333  290:.\Generated_Source\PSoC5/BL.c ****             BL_activeApp = BL_MD_BTLDB_ACTIVE_0;\r
334  291:.\Generated_Source\PSoC5/BL.c ****         }\r
335  292:.\Generated_Source\PSoC5/BL.c ****         else if (BL_MD_BTLDB_ACTIVE_VALUE(1u) == BL_MD_BTLDB_IS_ACTIVE)\r
336  293:.\Generated_Source\PSoC5/BL.c ****         {\r
337  294:.\Generated_Source\PSoC5/BL.c ****             BL_activeApp = BL_MD_BTLDB_ACTIVE_1;\r
338  295:.\Generated_Source\PSoC5/BL.c ****         }\r
339  296:.\Generated_Source\PSoC5/BL.c ****         else\r
340  297:.\Generated_Source\PSoC5/BL.c ****         {\r
341  298:.\Generated_Source\PSoC5/BL.c ****             BL_activeApp = BL_MD_BTLDB_ACTIVE_NONE;\r
342  299:.\Generated_Source\PSoC5/BL.c ****         }\r
343  300:.\Generated_Source\PSoC5/BL.c **** \r
344  301:.\Generated_Source\PSoC5/BL.c ****     #endif  /* (0u != BL_DUAL_APP_BOOTLOADER) */\r
345  302:.\Generated_Source\PSoC5/BL.c **** \r
346  303:.\Generated_Source\PSoC5/BL.c **** \r
347  304:.\Generated_Source\PSoC5/BL.c ****     /* Initialize Flash subsystem for non-PSoC 4 devices */\r
348  305:.\Generated_Source\PSoC5/BL.c ****     #if(!CY_PSOC4)\r
349  306:.\Generated_Source\PSoC5/BL.c ****         if (CYRET_SUCCESS != CySetTemp())\r
350  307:.\Generated_Source\PSoC5/BL.c ****         {\r
351  308:.\Generated_Source\PSoC5/BL.c ****             CyHalt(0x00u);\r
352  309:.\Generated_Source\PSoC5/BL.c ****         }\r
353  310:.\Generated_Source\PSoC5/BL.c **** \r
354  311:.\Generated_Source\PSoC5/BL.c ****         if (CYRET_SUCCESS != CySetFlashEEBuffer(BL_flashBuffer))\r
355  312:.\Generated_Source\PSoC5/BL.c ****         {\r
356  313:.\Generated_Source\PSoC5/BL.c ****             CyHalt(0x00u);\r
357  314:.\Generated_Source\PSoC5/BL.c ****         }\r
358  315:.\Generated_Source\PSoC5/BL.c ****     #endif  /* (CY_PSOC4) */\r
359  316:.\Generated_Source\PSoC5/BL.c **** \r
360  317:.\Generated_Source\PSoC5/BL.c **** \r
361 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 7\r
362 \r
363 \r
364  318:.\Generated_Source\PSoC5/BL.c ****     /***********************************************************************\r
365  319:.\Generated_Source\PSoC5/BL.c ****     * Bootloader Application Validation\r
366  320:.\Generated_Source\PSoC5/BL.c ****     *\r
367  321:.\Generated_Source\PSoC5/BL.c ****     * Halt device if:\r
368  322:.\Generated_Source\PSoC5/BL.c ****     *  - Calculated checksum does not much one stored in metadata section\r
369  323:.\Generated_Source\PSoC5/BL.c ****     *  - Invalid pointer to the place where bootloader application ends\r
370  324:.\Generated_Source\PSoC5/BL.c ****     *  - Flash subsystem where not initialized correctly\r
371  325:.\Generated_Source\PSoC5/BL.c ****     ***********************************************************************/\r
372  326:.\Generated_Source\PSoC5/BL.c ****     #if(0u != BL_BOOTLOADER_APP_VALIDATION)\r
373  327:.\Generated_Source\PSoC5/BL.c **** \r
374  328:.\Generated_Source\PSoC5/BL.c ****         /* Calculate Bootloader application checksum */\r
375  329:.\Generated_Source\PSoC5/BL.c ****         calcedChecksum = BL_Calc8BitFlashSum(BL_MD_BTLDR_ADDR_PTR,\r
376  330:.\Generated_Source\PSoC5/BL.c ****                 *BL_SizeBytesAccess - BL_MD_BTLDR_ADDR_PTR);\r
377  331:.\Generated_Source\PSoC5/BL.c **** \r
378  332:.\Generated_Source\PSoC5/BL.c ****         /* we actually included the checksum, so remove it */\r
379  333:.\Generated_Source\PSoC5/BL.c ****         calcedChecksum -= *BL_ChecksumAccess;\r
380  334:.\Generated_Source\PSoC5/BL.c ****         calcedChecksum = ( uint8 )1u + ( uint8 )(~calcedChecksum);\r
381  335:.\Generated_Source\PSoC5/BL.c **** \r
382  336:.\Generated_Source\PSoC5/BL.c ****         /* Checksum and pointer to bootloader verification */\r
383  337:.\Generated_Source\PSoC5/BL.c ****         if((calcedChecksum != *BL_ChecksumAccess) ||\r
384  338:.\Generated_Source\PSoC5/BL.c ****            (0u == *BL_SizeBytesAccess))\r
385  339:.\Generated_Source\PSoC5/BL.c ****         {\r
386  340:.\Generated_Source\PSoC5/BL.c ****             CyHalt(0x00u);\r
387  341:.\Generated_Source\PSoC5/BL.c ****         }\r
388  342:.\Generated_Source\PSoC5/BL.c **** \r
389  343:.\Generated_Source\PSoC5/BL.c ****     #endif  /* (0u != BL_BOOTLOADER_APP_VALIDATION) */\r
390  344:.\Generated_Source\PSoC5/BL.c **** \r
391  345:.\Generated_Source\PSoC5/BL.c **** \r
392  346:.\Generated_Source\PSoC5/BL.c ****     /***********************************************************************\r
393  347:.\Generated_Source\PSoC5/BL.c ****     * Active Bootloadable Application Validation\r
394  348:.\Generated_Source\PSoC5/BL.c ****     *\r
395  349:.\Generated_Source\PSoC5/BL.c ****     * If active bootloadable application is invalid or bootloader\r
396  350:.\Generated_Source\PSoC5/BL.c ****     * application is scheduled - do the following:\r
397  351:.\Generated_Source\PSoC5/BL.c ****     *  - schedule bootloader application to be run after software reset\r
398  352:.\Generated_Source\PSoC5/BL.c ****     *  - Go to the communication subroutine. Will wait for commands forever\r
399  353:.\Generated_Source\PSoC5/BL.c ****     ***********************************************************************/\r
400  354:.\Generated_Source\PSoC5/BL.c ****     tmpStatus = BL_ValidateBootloadable(BL_activeApp);\r
401  355:.\Generated_Source\PSoC5/BL.c **** \r
402  356:.\Generated_Source\PSoC5/BL.c ****     if ((BL_GET_RUN_TYPE == BL_START_BTLDR) ||\r
403  357:.\Generated_Source\PSoC5/BL.c ****         (CYRET_SUCCESS != tmpStatus))\r
404  358:.\Generated_Source\PSoC5/BL.c ****     {\r
405  359:.\Generated_Source\PSoC5/BL.c ****         BL_SET_RUN_TYPE(0u);\r
406  360:.\Generated_Source\PSoC5/BL.c **** \r
407  361:.\Generated_Source\PSoC5/BL.c ****         BL_HostLink(BL_WAIT_FOR_COMMAND_FOREVER);\r
408  362:.\Generated_Source\PSoC5/BL.c ****     }\r
409  363:.\Generated_Source\PSoC5/BL.c **** \r
410  364:.\Generated_Source\PSoC5/BL.c **** \r
411  365:.\Generated_Source\PSoC5/BL.c ****     /* Go to the communication subroutine. Will wait for commands specifed time */\r
412  366:.\Generated_Source\PSoC5/BL.c ****     #if(0u != BL_WAIT_FOR_COMMAND)\r
413  367:.\Generated_Source\PSoC5/BL.c **** \r
414  368:.\Generated_Source\PSoC5/BL.c ****         /* Timeout is in 100s of miliseconds */\r
415  369:.\Generated_Source\PSoC5/BL.c ****         BL_HostLink(BL_WAIT_FOR_COMMAND_TIME);\r
416  370:.\Generated_Source\PSoC5/BL.c **** \r
417  371:.\Generated_Source\PSoC5/BL.c ****     #endif  /* (0u != BL_WAIT_FOR_COMMAND) */\r
418  372:.\Generated_Source\PSoC5/BL.c **** \r
419  373:.\Generated_Source\PSoC5/BL.c **** \r
420  374:.\Generated_Source\PSoC5/BL.c ****     /* Schedule bootloadable application and perform software reset */\r
421 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 8\r
422 \r
423 \r
424  375:.\Generated_Source\PSoC5/BL.c ****     BL_LaunchApplication();\r
425  376:.\Generated_Source\PSoC5/BL.c **** }\r
426  377:.\Generated_Source\PSoC5/BL.c **** \r
427  378:.\Generated_Source\PSoC5/BL.c **** \r
428  379:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
429  380:.\Generated_Source\PSoC5/BL.c **** * Function Name: BL_LaunchApplication\r
430  381:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
431  382:.\Generated_Source\PSoC5/BL.c **** *\r
432  383:.\Generated_Source\PSoC5/BL.c **** * Summary:\r
433  384:.\Generated_Source\PSoC5/BL.c **** *  Jumps the PC to the start address of the user application in flash.\r
434  385:.\Generated_Source\PSoC5/BL.c **** *\r
435  386:.\Generated_Source\PSoC5/BL.c **** * Parameters:\r
436  387:.\Generated_Source\PSoC5/BL.c **** *  None\r
437  388:.\Generated_Source\PSoC5/BL.c **** *\r
438  389:.\Generated_Source\PSoC5/BL.c **** * Returns:\r
439  390:.\Generated_Source\PSoC5/BL.c **** *  This method will never return if it succesfully goes to the user application.\r
440  391:.\Generated_Source\PSoC5/BL.c **** *\r
441  392:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
442  393:.\Generated_Source\PSoC5/BL.c **** static void BL_LaunchApplication(void) CYSMALL \r
443  394:.\Generated_Source\PSoC5/BL.c **** {\r
444  395:.\Generated_Source\PSoC5/BL.c ****     /* Schedule Bootloadable to start after reset */\r
445  396:.\Generated_Source\PSoC5/BL.c ****     BL_SET_RUN_TYPE(BL_START_APP);\r
446  397:.\Generated_Source\PSoC5/BL.c **** \r
447  398:.\Generated_Source\PSoC5/BL.c ****     CySoftwareReset();\r
448  399:.\Generated_Source\PSoC5/BL.c **** }\r
449  400:.\Generated_Source\PSoC5/BL.c **** \r
450  401:.\Generated_Source\PSoC5/BL.c **** \r
451  402:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
452  403:.\Generated_Source\PSoC5/BL.c **** * Function Name: CyBtldr_CheckLaunch\r
453  404:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
454  405:.\Generated_Source\PSoC5/BL.c **** *\r
455  406:.\Generated_Source\PSoC5/BL.c **** * Summary:\r
456  407:.\Generated_Source\PSoC5/BL.c **** *  This routine checks to see if the bootloader or the bootloadable application\r
457  408:.\Generated_Source\PSoC5/BL.c **** *  should be run.  If the application is to be run, it will start executing.\r
458  409:.\Generated_Source\PSoC5/BL.c **** *  If the bootloader is to be run, it will return so the bootloader can\r
459  410:.\Generated_Source\PSoC5/BL.c **** *  continue starting up.\r
460  411:.\Generated_Source\PSoC5/BL.c **** *\r
461  412:.\Generated_Source\PSoC5/BL.c **** * Parameters:\r
462  413:.\Generated_Source\PSoC5/BL.c **** *  None\r
463  414:.\Generated_Source\PSoC5/BL.c **** *\r
464  415:.\Generated_Source\PSoC5/BL.c **** * Returns:\r
465  416:.\Generated_Source\PSoC5/BL.c **** *  None\r
466  417:.\Generated_Source\PSoC5/BL.c **** *\r
467  418:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
468  419:.\Generated_Source\PSoC5/BL.c **** void CyBtldr_CheckLaunch(void) CYSMALL \r
469  420:.\Generated_Source\PSoC5/BL.c **** {\r
470  421:.\Generated_Source\PSoC5/BL.c **** \r
471  422:.\Generated_Source\PSoC5/BL.c **** #if(CY_PSOC4)\r
472  423:.\Generated_Source\PSoC5/BL.c **** \r
473  424:.\Generated_Source\PSoC5/BL.c ****     /*******************************************************************************\r
474  425:.\Generated_Source\PSoC5/BL.c ****     * Set cyBtldrRunType to zero in case of non-software reset occured. This means\r
475  426:.\Generated_Source\PSoC5/BL.c ****     * that bootloader application is scheduled - that is initial clean state. The\r
476  427:.\Generated_Source\PSoC5/BL.c ****     * value of cyBtldrRunType is valid only in case of software reset.\r
477  428:.\Generated_Source\PSoC5/BL.c ****     *******************************************************************************/\r
478  429:.\Generated_Source\PSoC5/BL.c ****     if (0u == (BL_RES_CAUSE_REG & BL_RES_CAUSE_RESET_SOFT))\r
479  430:.\Generated_Source\PSoC5/BL.c ****     {\r
480  431:.\Generated_Source\PSoC5/BL.c ****         cyBtldrRunType = 0u;\r
481 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 9\r
482 \r
483 \r
484  432:.\Generated_Source\PSoC5/BL.c ****     }\r
485  433:.\Generated_Source\PSoC5/BL.c **** \r
486  434:.\Generated_Source\PSoC5/BL.c **** #endif /* (CY_PSOC4) */\r
487  435:.\Generated_Source\PSoC5/BL.c **** \r
488  436:.\Generated_Source\PSoC5/BL.c **** \r
489  437:.\Generated_Source\PSoC5/BL.c ****     if (BL_GET_RUN_TYPE == BL_START_APP)\r
490  438:.\Generated_Source\PSoC5/BL.c ****     {\r
491  439:.\Generated_Source\PSoC5/BL.c ****         BL_SET_RUN_TYPE(0u);\r
492  440:.\Generated_Source\PSoC5/BL.c **** \r
493  441:.\Generated_Source\PSoC5/BL.c ****         /*******************************************************************************\r
494  442:.\Generated_Source\PSoC5/BL.c ****         * Indicates that we have told ourselves to jump to the application since we have\r
495  443:.\Generated_Source\PSoC5/BL.c ****         * already told ourselves to jump, we do not do any expensive verification of the\r
496  444:.\Generated_Source\PSoC5/BL.c ****         * application. We just check to make sure that the value at CY_APP_ADDR_ADDRESS\r
497  445:.\Generated_Source\PSoC5/BL.c ****         * is something other than 0.\r
498  446:.\Generated_Source\PSoC5/BL.c ****         *******************************************************************************/\r
499  447:.\Generated_Source\PSoC5/BL.c ****         if(0u != BL_GetMetadata(BL_GET_METADATA_BTLDB_ADDR, BL_activeApp))\r
500  448:.\Generated_Source\PSoC5/BL.c ****         {\r
501  449:.\Generated_Source\PSoC5/BL.c ****             /* Never return from this method */\r
502  450:.\Generated_Source\PSoC5/BL.c ****             BL_LaunchBootloadable(BL_GetMetadata(BL_GET_METADATA_BTLDB_ADDR,\r
503  451:.\Generated_Source\PSoC5/BL.c ****                                                                              BL_activeApp));\r
504  452:.\Generated_Source\PSoC5/BL.c ****         }\r
505  453:.\Generated_Source\PSoC5/BL.c ****     }\r
506  454:.\Generated_Source\PSoC5/BL.c **** }\r
507  455:.\Generated_Source\PSoC5/BL.c **** \r
508  456:.\Generated_Source\PSoC5/BL.c **** \r
509  457:.\Generated_Source\PSoC5/BL.c **** /* Moves the arguement appAddr (RO) into PC, moving execution to the appAddr */\r
510  458:.\Generated_Source\PSoC5/BL.c **** #if defined (__ARMCC_VERSION)\r
511  459:.\Generated_Source\PSoC5/BL.c **** \r
512  460:.\Generated_Source\PSoC5/BL.c ****     __asm static void BL_LaunchBootloadable(uint32 appAddr)\r
513  461:.\Generated_Source\PSoC5/BL.c ****     {\r
514  462:.\Generated_Source\PSoC5/BL.c ****         BX  R0\r
515  463:.\Generated_Source\PSoC5/BL.c ****         ALIGN\r
516  464:.\Generated_Source\PSoC5/BL.c ****     }\r
517  465:.\Generated_Source\PSoC5/BL.c **** \r
518  466:.\Generated_Source\PSoC5/BL.c **** #elif defined(__GNUC__)\r
519  467:.\Generated_Source\PSoC5/BL.c **** \r
520  468:.\Generated_Source\PSoC5/BL.c ****     __attribute__((noinline)) /* Workaround for GCC toolchain bug with inlining */\r
521  469:.\Generated_Source\PSoC5/BL.c ****     __attribute__((naked))\r
522  470:.\Generated_Source\PSoC5/BL.c ****     static void BL_LaunchBootloadable(uint32 appAddr)\r
523  471:.\Generated_Source\PSoC5/BL.c ****     {\r
524   26                            .loc 1 471 0\r
525   27                            .cfi_startproc\r
526   28                            @ Naked Function: prologue and epilogue provided by programmer.\r
527   29                            @ args = 0, pretend = 0, frame = 0\r
528   30                            @ frame_needed = 0, uses_anonymous_args = 0\r
529   31                    .LVL0:\r
530  472:.\Generated_Source\PSoC5/BL.c ****         __asm volatile("    BX  R0\n");\r
531   32                            .loc 1 472 0\r
532   33                    @ 472 ".\Generated_Source\PSoC5\BL.c" 1\r
533   34 0000 0047                      BX  R0\r
534   35                    \r
535   36                    @ 0 "" 2\r
536  473:.\Generated_Source\PSoC5/BL.c ****     }\r
537   37                            .loc 1 473 0\r
538   38                            .thumb\r
539   39                            .cfi_endproc\r
540   40                    .LFE62:\r
541 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 10\r
542 \r
543 \r
544   41                            .size   BL_LaunchBootloadable, .-BL_LaunchBootloadable\r
545   42                            .section        .text.BL_GetMetadata.constprop.1,"ax",%progbits\r
546   43                            .align  1\r
547   44                            .thumb\r
548   45                            .thumb_func\r
549   46                            .type   BL_GetMetadata.constprop.1, %function\r
550   47                    BL_GetMetadata.constprop.1:\r
551   48                    .LFB69:\r
552  474:.\Generated_Source\PSoC5/BL.c **** \r
553  475:.\Generated_Source\PSoC5/BL.c **** #elif defined (__ICCARM__)\r
554  476:.\Generated_Source\PSoC5/BL.c **** \r
555  477:.\Generated_Source\PSoC5/BL.c ****     static void BL_LaunchBootloadable(uint32 appAddr)\r
556  478:.\Generated_Source\PSoC5/BL.c ****     {\r
557  479:.\Generated_Source\PSoC5/BL.c ****         __asm volatile("    BX  R0\n");\r
558  480:.\Generated_Source\PSoC5/BL.c ****     }\r
559  481:.\Generated_Source\PSoC5/BL.c **** \r
560  482:.\Generated_Source\PSoC5/BL.c **** #endif  /* (__ARMCC_VERSION) */\r
561  483:.\Generated_Source\PSoC5/BL.c **** \r
562  484:.\Generated_Source\PSoC5/BL.c **** \r
563  485:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
564  486:.\Generated_Source\PSoC5/BL.c **** * Function Name: BL_ValidateBootloadable\r
565  487:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
566  488:.\Generated_Source\PSoC5/BL.c **** * Summary:\r
567  489:.\Generated_Source\PSoC5/BL.c **** *  This routine computes the checksum, zero check, 0xFF check of the\r
568  490:.\Generated_Source\PSoC5/BL.c **** *  application area to determine whether a valid application is loaded.\r
569  491:.\Generated_Source\PSoC5/BL.c **** *\r
570  492:.\Generated_Source\PSoC5/BL.c **** * Parameters:\r
571  493:.\Generated_Source\PSoC5/BL.c **** *  appId:\r
572  494:.\Generated_Source\PSoC5/BL.c **** *      The application number to verify\r
573  495:.\Generated_Source\PSoC5/BL.c **** *\r
574  496:.\Generated_Source\PSoC5/BL.c **** * Returns:\r
575  497:.\Generated_Source\PSoC5/BL.c **** *  CYRET_SUCCESS  - if successful\r
576  498:.\Generated_Source\PSoC5/BL.c **** *  CYRET_BAD_DATA - if the bootloadable is corrupt\r
577  499:.\Generated_Source\PSoC5/BL.c **** *\r
578  500:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
579  501:.\Generated_Source\PSoC5/BL.c **** static cystatus BL_ValidateBootloadable(uint8 appId) CYSMALL \\r
580  502:.\Generated_Source\PSoC5/BL.c **** \r
581  503:.\Generated_Source\PSoC5/BL.c ****     {\r
582  504:.\Generated_Source\PSoC5/BL.c ****         uint32 CYDATA idx;\r
583  505:.\Generated_Source\PSoC5/BL.c **** \r
584  506:.\Generated_Source\PSoC5/BL.c ****         uint32 CYDATA end   = BL_FIRST_APP_BYTE(appId) +\r
585  507:.\Generated_Source\PSoC5/BL.c ****                                 BL_GetMetadata(BL_GET_METADATA_BTLDB_LENGTH,\r
586  508:.\Generated_Source\PSoC5/BL.c ****                                                        appId);\r
587  509:.\Generated_Source\PSoC5/BL.c **** \r
588  510:.\Generated_Source\PSoC5/BL.c ****         CYBIT         valid = 0u; /* Assume bad flash image */\r
589  511:.\Generated_Source\PSoC5/BL.c ****         uint8  CYDATA calcedChecksum = 0u;\r
590  512:.\Generated_Source\PSoC5/BL.c **** \r
591  513:.\Generated_Source\PSoC5/BL.c **** \r
592  514:.\Generated_Source\PSoC5/BL.c ****         #if(0u != BL_DUAL_APP_BOOTLOADER)\r
593  515:.\Generated_Source\PSoC5/BL.c **** \r
594  516:.\Generated_Source\PSoC5/BL.c ****             if(appId > 1u)\r
595  517:.\Generated_Source\PSoC5/BL.c ****             {\r
596  518:.\Generated_Source\PSoC5/BL.c ****                 return(CYRET_BAD_DATA);\r
597  519:.\Generated_Source\PSoC5/BL.c ****             }\r
598  520:.\Generated_Source\PSoC5/BL.c **** \r
599  521:.\Generated_Source\PSoC5/BL.c ****         #endif  /* (0u != BL_DUAL_APP_BOOTLOADER) */\r
600  522:.\Generated_Source\PSoC5/BL.c **** \r
601 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 11\r
602 \r
603 \r
604  523:.\Generated_Source\PSoC5/BL.c **** \r
605  524:.\Generated_Source\PSoC5/BL.c ****         #if(0u != BL_FAST_APP_VALIDATION)\r
606  525:.\Generated_Source\PSoC5/BL.c **** \r
607  526:.\Generated_Source\PSoC5/BL.c ****             if(BL_MD_BTLDB_VERIFIED_VALUE(appId) == BL_MD_BTLDB_IS_VERIFIED)\r
608  527:.\Generated_Source\PSoC5/BL.c ****             {\r
609  528:.\Generated_Source\PSoC5/BL.c ****                 return(CYRET_SUCCESS);\r
610  529:.\Generated_Source\PSoC5/BL.c ****             }\r
611  530:.\Generated_Source\PSoC5/BL.c **** \r
612  531:.\Generated_Source\PSoC5/BL.c ****         #endif  /* (0u != BL_FAST_APP_VALIDATION) */\r
613  532:.\Generated_Source\PSoC5/BL.c **** \r
614  533:.\Generated_Source\PSoC5/BL.c **** \r
615  534:.\Generated_Source\PSoC5/BL.c ****         /* Calculate checksum of bootloadable image */\r
616  535:.\Generated_Source\PSoC5/BL.c ****         for(idx = BL_FIRST_APP_BYTE(appId); idx < end; ++idx)\r
617  536:.\Generated_Source\PSoC5/BL.c ****         {\r
618  537:.\Generated_Source\PSoC5/BL.c ****             uint8 CYDATA curByte = BL_GET_CODE_BYTE(idx);\r
619  538:.\Generated_Source\PSoC5/BL.c **** \r
620  539:.\Generated_Source\PSoC5/BL.c ****             if((curByte != 0u) && (curByte != 0xFFu))\r
621  540:.\Generated_Source\PSoC5/BL.c ****             {\r
622  541:.\Generated_Source\PSoC5/BL.c ****                 valid = 1u;\r
623  542:.\Generated_Source\PSoC5/BL.c ****             }\r
624  543:.\Generated_Source\PSoC5/BL.c **** \r
625  544:.\Generated_Source\PSoC5/BL.c ****             calcedChecksum += curByte;\r
626  545:.\Generated_Source\PSoC5/BL.c ****         }\r
627  546:.\Generated_Source\PSoC5/BL.c **** \r
628  547:.\Generated_Source\PSoC5/BL.c **** \r
629  548:.\Generated_Source\PSoC5/BL.c ****         /***************************************************************************\r
630  549:.\Generated_Source\PSoC5/BL.c ****         * We do not compute checksum over the meta data section, so no need to\r
631  550:.\Generated_Source\PSoC5/BL.c ****         * subtract off App Verified or App Active information here like we do when\r
632  551:.\Generated_Source\PSoC5/BL.c ****         * verifying a row.\r
633  552:.\Generated_Source\PSoC5/BL.c ****         ***************************************************************************/\r
634  553:.\Generated_Source\PSoC5/BL.c **** \r
635  554:.\Generated_Source\PSoC5/BL.c **** \r
636  555:.\Generated_Source\PSoC5/BL.c ****         #if((!CY_PSOC4) && (CYDEV_ECC_ENABLE == 0u))\r
637  556:.\Generated_Source\PSoC5/BL.c **** \r
638  557:.\Generated_Source\PSoC5/BL.c ****             /* Add ECC data to checksum */\r
639  558:.\Generated_Source\PSoC5/BL.c ****             idx = ((BL_FIRST_APP_BYTE(appId)) >> 3u);\r
640  559:.\Generated_Source\PSoC5/BL.c **** \r
641  560:.\Generated_Source\PSoC5/BL.c ****             /* Flash may run into meta data, ECC does not so use full row */\r
642  561:.\Generated_Source\PSoC5/BL.c ****             end = (end == (CY_FLASH_SIZE - BL_MD_SIZEOF))\r
643  562:.\Generated_Source\PSoC5/BL.c ****                 ? (CY_FLASH_SIZE >> 3u)\r
644  563:.\Generated_Source\PSoC5/BL.c ****                 : (end >> 3u);\r
645  564:.\Generated_Source\PSoC5/BL.c **** \r
646  565:.\Generated_Source\PSoC5/BL.c ****             for (; idx < end; ++idx)\r
647  566:.\Generated_Source\PSoC5/BL.c ****             {\r
648  567:.\Generated_Source\PSoC5/BL.c ****                 calcedChecksum += CY_GET_XTND_REG8((volatile uint8 *)(CYDEV_ECC_BASE + idx));\r
649  568:.\Generated_Source\PSoC5/BL.c ****             }\r
650  569:.\Generated_Source\PSoC5/BL.c **** \r
651  570:.\Generated_Source\PSoC5/BL.c ****         #endif  /* ((!CY_PSOC4) && (CYDEV_ECC_ENABLE == 0u)) */\r
652  571:.\Generated_Source\PSoC5/BL.c **** \r
653  572:.\Generated_Source\PSoC5/BL.c **** \r
654  573:.\Generated_Source\PSoC5/BL.c ****         calcedChecksum = ( uint8 )1u + ( uint8 )(~calcedChecksum);\r
655  574:.\Generated_Source\PSoC5/BL.c **** \r
656  575:.\Generated_Source\PSoC5/BL.c ****         if((calcedChecksum != BL_MD_BTLDB_CHECKSUM_VALUE(appId)) ||\r
657  576:.\Generated_Source\PSoC5/BL.c ****            (0u == valid))\r
658  577:.\Generated_Source\PSoC5/BL.c ****         {\r
659  578:.\Generated_Source\PSoC5/BL.c ****             return(CYRET_BAD_DATA);\r
660  579:.\Generated_Source\PSoC5/BL.c ****         }\r
661 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 12\r
662 \r
663 \r
664  580:.\Generated_Source\PSoC5/BL.c **** \r
665  581:.\Generated_Source\PSoC5/BL.c **** \r
666  582:.\Generated_Source\PSoC5/BL.c ****         #if(0u != BL_FAST_APP_VALIDATION)\r
667  583:.\Generated_Source\PSoC5/BL.c ****             BL_SetFlashByte((uint32) BL_MD_BTLDB_VERIFIED_OFFSET(appId),\r
668  584:.\Generated_Source\PSoC5/BL.c ****                                           BL_MD_BTLDB_IS_VERIFIED);\r
669  585:.\Generated_Source\PSoC5/BL.c ****         #endif  /* (0u != BL_FAST_APP_VALIDATION) */\r
670  586:.\Generated_Source\PSoC5/BL.c **** \r
671  587:.\Generated_Source\PSoC5/BL.c **** \r
672  588:.\Generated_Source\PSoC5/BL.c ****         return(CYRET_SUCCESS);\r
673  589:.\Generated_Source\PSoC5/BL.c **** }\r
674  590:.\Generated_Source\PSoC5/BL.c **** \r
675  591:.\Generated_Source\PSoC5/BL.c **** \r
676  592:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
677  593:.\Generated_Source\PSoC5/BL.c **** * Function Name: BL_HostLink\r
678  594:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
679  595:.\Generated_Source\PSoC5/BL.c **** *\r
680  596:.\Generated_Source\PSoC5/BL.c **** * Summary:\r
681  597:.\Generated_Source\PSoC5/BL.c **** *  Causes the bootloader to attempt to read data being transmitted by the\r
682  598:.\Generated_Source\PSoC5/BL.c **** *  host application.  If data is sent from the host, this establishes the\r
683  599:.\Generated_Source\PSoC5/BL.c **** *  communication interface to process all requests.\r
684  600:.\Generated_Source\PSoC5/BL.c **** *\r
685  601:.\Generated_Source\PSoC5/BL.c **** * Parameters:\r
686  602:.\Generated_Source\PSoC5/BL.c **** *  timeOut:\r
687  603:.\Generated_Source\PSoC5/BL.c **** *   The amount of time to listen for data before giving up. Timeout is\r
688  604:.\Generated_Source\PSoC5/BL.c **** *   measured in 10s of ms.  Use 0 for infinite wait.\r
689  605:.\Generated_Source\PSoC5/BL.c **** *\r
690  606:.\Generated_Source\PSoC5/BL.c **** * Return:\r
691  607:.\Generated_Source\PSoC5/BL.c **** *   None\r
692  608:.\Generated_Source\PSoC5/BL.c **** *\r
693  609:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
694  610:.\Generated_Source\PSoC5/BL.c **** static void BL_HostLink(uint8 timeOut) \r
695  611:.\Generated_Source\PSoC5/BL.c **** {\r
696  612:.\Generated_Source\PSoC5/BL.c ****     uint16    CYDATA numberRead;\r
697  613:.\Generated_Source\PSoC5/BL.c ****     uint16    CYDATA rspSize;\r
698  614:.\Generated_Source\PSoC5/BL.c ****     uint8     CYDATA ackCode;\r
699  615:.\Generated_Source\PSoC5/BL.c ****     uint16    CYDATA pktChecksum;\r
700  616:.\Generated_Source\PSoC5/BL.c ****     cystatus  CYDATA readStat;\r
701  617:.\Generated_Source\PSoC5/BL.c ****     uint16    CYDATA pktSize    = 0u;\r
702  618:.\Generated_Source\PSoC5/BL.c ****     uint16    CYDATA dataOffset = 0u;\r
703  619:.\Generated_Source\PSoC5/BL.c ****     uint8     CYDATA timeOutCnt = 10u;\r
704  620:.\Generated_Source\PSoC5/BL.c **** \r
705  621:.\Generated_Source\PSoC5/BL.c ****     #if(0u == BL_DUAL_APP_BOOTLOADER)\r
706  622:.\Generated_Source\PSoC5/BL.c ****         uint8 CYDATA clearedMetaData = 0u;\r
707  623:.\Generated_Source\PSoC5/BL.c ****     #endif  /* (0u == BL_DUAL_APP_BOOTLOADER) */\r
708  624:.\Generated_Source\PSoC5/BL.c **** \r
709  625:.\Generated_Source\PSoC5/BL.c ****     CYBIT     communicationState = BL_COMMUNICATION_STATE_IDLE;\r
710  626:.\Generated_Source\PSoC5/BL.c **** \r
711  627:.\Generated_Source\PSoC5/BL.c ****     uint8     packetBuffer[BL_SIZEOF_COMMAND_BUFFER];\r
712  628:.\Generated_Source\PSoC5/BL.c ****     uint8     dataBuffer  [BL_SIZEOF_COMMAND_BUFFER];\r
713  629:.\Generated_Source\PSoC5/BL.c **** \r
714  630:.\Generated_Source\PSoC5/BL.c **** \r
715  631:.\Generated_Source\PSoC5/BL.c ****     /* Initialize communications channel. */\r
716  632:.\Generated_Source\PSoC5/BL.c ****     CyBtldrCommStart();\r
717  633:.\Generated_Source\PSoC5/BL.c **** \r
718  634:.\Generated_Source\PSoC5/BL.c ****     /* Enable global interrupts */\r
719  635:.\Generated_Source\PSoC5/BL.c ****     CyGlobalIntEnable;\r
720  636:.\Generated_Source\PSoC5/BL.c **** \r
721 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 13\r
722 \r
723 \r
724  637:.\Generated_Source\PSoC5/BL.c ****     do\r
725  638:.\Generated_Source\PSoC5/BL.c ****     {\r
726  639:.\Generated_Source\PSoC5/BL.c ****         ackCode = CYRET_SUCCESS;\r
727  640:.\Generated_Source\PSoC5/BL.c **** \r
728  641:.\Generated_Source\PSoC5/BL.c ****         do\r
729  642:.\Generated_Source\PSoC5/BL.c ****         {\r
730  643:.\Generated_Source\PSoC5/BL.c ****             readStat = CyBtldrCommRead(packetBuffer,\r
731  644:.\Generated_Source\PSoC5/BL.c ****                                         BL_SIZEOF_COMMAND_BUFFER,\r
732  645:.\Generated_Source\PSoC5/BL.c ****                                         &numberRead,\r
733  646:.\Generated_Source\PSoC5/BL.c ****                                         (0u == timeOut) ? 0xFFu : timeOut);\r
734  647:.\Generated_Source\PSoC5/BL.c ****             if (0u != timeOut)\r
735  648:.\Generated_Source\PSoC5/BL.c ****             {\r
736  649:.\Generated_Source\PSoC5/BL.c ****                 timeOutCnt--;\r
737  650:.\Generated_Source\PSoC5/BL.c ****             }\r
738  651:.\Generated_Source\PSoC5/BL.c **** \r
739  652:.\Generated_Source\PSoC5/BL.c ****         } while ( (0u != timeOutCnt) && (readStat != CYRET_SUCCESS) );\r
740  653:.\Generated_Source\PSoC5/BL.c **** \r
741  654:.\Generated_Source\PSoC5/BL.c **** \r
742  655:.\Generated_Source\PSoC5/BL.c ****         if( readStat != CYRET_SUCCESS )\r
743  656:.\Generated_Source\PSoC5/BL.c ****         {\r
744  657:.\Generated_Source\PSoC5/BL.c ****             continue;\r
745  658:.\Generated_Source\PSoC5/BL.c ****         }\r
746  659:.\Generated_Source\PSoC5/BL.c **** \r
747  660:.\Generated_Source\PSoC5/BL.c ****         if((numberRead < BL_MIN_PKT_SIZE) ||\r
748  661:.\Generated_Source\PSoC5/BL.c ****            (packetBuffer[BL_SOP_ADDR] != BL_SOP))\r
749  662:.\Generated_Source\PSoC5/BL.c ****         {\r
750  663:.\Generated_Source\PSoC5/BL.c ****             ackCode = BL_ERR_DATA;\r
751  664:.\Generated_Source\PSoC5/BL.c ****         }\r
752  665:.\Generated_Source\PSoC5/BL.c ****         else\r
753  666:.\Generated_Source\PSoC5/BL.c ****         {\r
754  667:.\Generated_Source\PSoC5/BL.c ****             pktSize = ((uint16)((uint16)packetBuffer[BL_SIZE_ADDR + 1u] << 8u)) |\r
755  668:.\Generated_Source\PSoC5/BL.c ****                                packetBuffer[BL_SIZE_ADDR];\r
756  669:.\Generated_Source\PSoC5/BL.c **** \r
757  670:.\Generated_Source\PSoC5/BL.c ****             pktChecksum = ((uint16)((uint16)packetBuffer[BL_CHK_ADDR(pktSize) + 1u] << 8u)) |\r
758  671:.\Generated_Source\PSoC5/BL.c ****                                    packetBuffer[BL_CHK_ADDR(pktSize)];\r
759  672:.\Generated_Source\PSoC5/BL.c **** \r
760  673:.\Generated_Source\PSoC5/BL.c ****             if((pktSize + BL_MIN_PKT_SIZE) > numberRead)\r
761  674:.\Generated_Source\PSoC5/BL.c ****             {\r
762  675:.\Generated_Source\PSoC5/BL.c ****                 ackCode = BL_ERR_LENGTH;\r
763  676:.\Generated_Source\PSoC5/BL.c ****             }\r
764  677:.\Generated_Source\PSoC5/BL.c ****             else if(packetBuffer[BL_EOP_ADDR(pktSize)] != BL_EOP)\r
765  678:.\Generated_Source\PSoC5/BL.c ****             {\r
766  679:.\Generated_Source\PSoC5/BL.c ****                 ackCode = BL_ERR_DATA;\r
767  680:.\Generated_Source\PSoC5/BL.c ****             }\r
768  681:.\Generated_Source\PSoC5/BL.c ****             else if(pktChecksum != BL_CalcPacketChecksum(packetBuffer,\r
769  682:.\Generated_Source\PSoC5/BL.c ****                                                                         pktSize + BL_DATA_ADDR))\r
770  683:.\Generated_Source\PSoC5/BL.c ****             {\r
771  684:.\Generated_Source\PSoC5/BL.c ****                 ackCode = BL_ERR_CHECKSUM;\r
772  685:.\Generated_Source\PSoC5/BL.c ****             }\r
773  686:.\Generated_Source\PSoC5/BL.c ****             else\r
774  687:.\Generated_Source\PSoC5/BL.c ****             {\r
775  688:.\Generated_Source\PSoC5/BL.c ****                 /* Empty section */\r
776  689:.\Generated_Source\PSoC5/BL.c ****             }\r
777  690:.\Generated_Source\PSoC5/BL.c ****         }\r
778  691:.\Generated_Source\PSoC5/BL.c **** \r
779  692:.\Generated_Source\PSoC5/BL.c ****         rspSize = 0u;\r
780  693:.\Generated_Source\PSoC5/BL.c ****         if(ackCode == CYRET_SUCCESS)\r
781 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 14\r
782 \r
783 \r
784  694:.\Generated_Source\PSoC5/BL.c ****         {\r
785  695:.\Generated_Source\PSoC5/BL.c ****             uint8 CYDATA btldrData = packetBuffer[BL_DATA_ADDR];\r
786  696:.\Generated_Source\PSoC5/BL.c **** \r
787  697:.\Generated_Source\PSoC5/BL.c ****             ackCode = BL_ERR_DATA;\r
788  698:.\Generated_Source\PSoC5/BL.c ****             switch(packetBuffer[BL_CMD_ADDR])\r
789  699:.\Generated_Source\PSoC5/BL.c ****             {\r
790  700:.\Generated_Source\PSoC5/BL.c **** \r
791  701:.\Generated_Source\PSoC5/BL.c **** \r
792  702:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
793  703:.\Generated_Source\PSoC5/BL.c ****             *   Get metadata\r
794  704:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
795  705:.\Generated_Source\PSoC5/BL.c ****             #if(0u != BL_CMD_GET_METADATA)\r
796  706:.\Generated_Source\PSoC5/BL.c **** \r
797  707:.\Generated_Source\PSoC5/BL.c ****                 case BL_COMMAND_GET_METADATA:\r
798  708:.\Generated_Source\PSoC5/BL.c **** \r
799  709:.\Generated_Source\PSoC5/BL.c ****                     if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 1u))\r
800  710:.\Generated_Source\PSoC5/BL.c ****                     {\r
801  711:.\Generated_Source\PSoC5/BL.c ****                         if (btldrData >= BL_MAX_NUM_OF_BTLDB)\r
802  712:.\Generated_Source\PSoC5/BL.c ****                         {\r
803  713:.\Generated_Source\PSoC5/BL.c ****                             ackCode = BL_ERR_APP;\r
804  714:.\Generated_Source\PSoC5/BL.c ****                         }\r
805  715:.\Generated_Source\PSoC5/BL.c ****                         else if(CYRET_SUCCESS == BL_ValidateBootloadable(btldrData))\r
806  716:.\Generated_Source\PSoC5/BL.c ****                         {\r
807  717:.\Generated_Source\PSoC5/BL.c ****                             #if(CY_PSOC3)\r
808  718:.\Generated_Source\PSoC5/BL.c ****                                 (void) memcpy(&packetBuffer[BL_DATA_ADDR],\r
809  719:.\Generated_Source\PSoC5/BL.c ****                                             ((uint8  CYCODE *) (BL_META_BASE(btldrData))), 56);\r
810  720:.\Generated_Source\PSoC5/BL.c ****                             #else\r
811  721:.\Generated_Source\PSoC5/BL.c ****                                 (void) memcpy(&packetBuffer[BL_DATA_ADDR],\r
812  722:.\Generated_Source\PSoC5/BL.c ****                                             (uint8 *) BL_META_BASE(btldrData), 56u);\r
813  723:.\Generated_Source\PSoC5/BL.c ****                             #endif  /* (CY_PSOC3) */\r
814  724:.\Generated_Source\PSoC5/BL.c **** \r
815  725:.\Generated_Source\PSoC5/BL.c ****                             rspSize = 56u;\r
816  726:.\Generated_Source\PSoC5/BL.c ****                             ackCode = CYRET_SUCCESS;\r
817  727:.\Generated_Source\PSoC5/BL.c ****                         }\r
818  728:.\Generated_Source\PSoC5/BL.c ****                         else\r
819  729:.\Generated_Source\PSoC5/BL.c ****                         {\r
820  730:.\Generated_Source\PSoC5/BL.c ****                             ackCode = BL_ERR_APP;\r
821  731:.\Generated_Source\PSoC5/BL.c ****                         }\r
822  732:.\Generated_Source\PSoC5/BL.c ****                     }\r
823  733:.\Generated_Source\PSoC5/BL.c ****                     break;\r
824  734:.\Generated_Source\PSoC5/BL.c **** \r
825  735:.\Generated_Source\PSoC5/BL.c ****             #endif  /* (0u != BL_CMD_GET_METADATA) */\r
826  736:.\Generated_Source\PSoC5/BL.c **** \r
827  737:.\Generated_Source\PSoC5/BL.c **** \r
828  738:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
829  739:.\Generated_Source\PSoC5/BL.c ****             *   Verify checksum\r
830  740:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
831  741:.\Generated_Source\PSoC5/BL.c ****             case BL_COMMAND_CHECKSUM:\r
832  742:.\Generated_Source\PSoC5/BL.c **** \r
833  743:.\Generated_Source\PSoC5/BL.c ****                 if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 0u))\r
834  744:.\Generated_Source\PSoC5/BL.c ****                 {\r
835  745:.\Generated_Source\PSoC5/BL.c ****                     packetBuffer[BL_DATA_ADDR] =\r
836  746:.\Generated_Source\PSoC5/BL.c ****                             (uint8)(BL_ValidateBootloadable(BL_activeApp) == CYRET_SUCCESS);\r
837  747:.\Generated_Source\PSoC5/BL.c **** \r
838  748:.\Generated_Source\PSoC5/BL.c ****                     rspSize = 1u;\r
839  749:.\Generated_Source\PSoC5/BL.c ****                     ackCode = CYRET_SUCCESS;\r
840  750:.\Generated_Source\PSoC5/BL.c ****                 }\r
841 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 15\r
842 \r
843 \r
844  751:.\Generated_Source\PSoC5/BL.c ****                 break;\r
845  752:.\Generated_Source\PSoC5/BL.c **** \r
846  753:.\Generated_Source\PSoC5/BL.c **** \r
847  754:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
848  755:.\Generated_Source\PSoC5/BL.c ****             *   Get flash size\r
849  756:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
850  757:.\Generated_Source\PSoC5/BL.c ****             #if(0u != BL_CMD_GET_FLASH_SIZE_AVAIL)\r
851  758:.\Generated_Source\PSoC5/BL.c **** \r
852  759:.\Generated_Source\PSoC5/BL.c ****                 case BL_COMMAND_REPORT_SIZE:\r
853  760:.\Generated_Source\PSoC5/BL.c **** \r
854  761:.\Generated_Source\PSoC5/BL.c ****                     if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 1u))\r
855  762:.\Generated_Source\PSoC5/BL.c ****                     {\r
856  763:.\Generated_Source\PSoC5/BL.c ****                         /* btldrData holds flash array ID sent by host */\r
857  764:.\Generated_Source\PSoC5/BL.c ****                         if(btldrData < BL_NUM_OF_FLASH_ARRAYS)\r
858  765:.\Generated_Source\PSoC5/BL.c ****                         {\r
859  766:.\Generated_Source\PSoC5/BL.c ****                             #if (1u == BL_NUM_OF_FLASH_ARRAYS)\r
860  767:.\Generated_Source\PSoC5/BL.c ****                                 uint16 CYDATA startRow = (uint16)*BL_SizeBytesAccess / CYDEV_FLS_RO\r
861  768:.\Generated_Source\PSoC5/BL.c ****                             #else\r
862  769:.\Generated_Source\PSoC5/BL.c ****                                 uint16 CYDATA startRow = 0u;\r
863  770:.\Generated_Source\PSoC5/BL.c ****                             #endif  /* (1u == BL_NUM_OF_FLASH_ARRAYS) */\r
864  771:.\Generated_Source\PSoC5/BL.c **** \r
865  772:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR]      = LO8(startRow);\r
866  773:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR + 1u] = HI8(startRow);\r
867  774:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR + 2u] = LO8(CY_FLASH_NUMBER_ROWS - 1u);\r
868  775:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR + 3u] = HI8(CY_FLASH_NUMBER_ROWS - 1u);\r
869  776:.\Generated_Source\PSoC5/BL.c **** \r
870  777:.\Generated_Source\PSoC5/BL.c ****                             rspSize = 4u;\r
871  778:.\Generated_Source\PSoC5/BL.c ****                             ackCode = CYRET_SUCCESS;\r
872  779:.\Generated_Source\PSoC5/BL.c ****                         }\r
873  780:.\Generated_Source\PSoC5/BL.c **** \r
874  781:.\Generated_Source\PSoC5/BL.c ****                     }\r
875  782:.\Generated_Source\PSoC5/BL.c ****                     break;\r
876  783:.\Generated_Source\PSoC5/BL.c **** \r
877  784:.\Generated_Source\PSoC5/BL.c ****             #endif  /* (0u != BL_CMD_GET_FLASH_SIZE_AVAIL) */\r
878  785:.\Generated_Source\PSoC5/BL.c **** \r
879  786:.\Generated_Source\PSoC5/BL.c **** \r
880  787:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
881  788:.\Generated_Source\PSoC5/BL.c ****             *   Get application status\r
882  789:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
883  790:.\Generated_Source\PSoC5/BL.c ****             #if(0u != BL_DUAL_APP_BOOTLOADER)\r
884  791:.\Generated_Source\PSoC5/BL.c **** \r
885  792:.\Generated_Source\PSoC5/BL.c ****                 #if(0u != BL_CMD_GET_APP_STATUS_AVAIL)\r
886  793:.\Generated_Source\PSoC5/BL.c **** \r
887  794:.\Generated_Source\PSoC5/BL.c ****                     case BL_COMMAND_APP_STATUS:\r
888  795:.\Generated_Source\PSoC5/BL.c **** \r
889  796:.\Generated_Source\PSoC5/BL.c ****                         if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 1u)\r
890  797:.\Generated_Source\PSoC5/BL.c ****                         {\r
891  798:.\Generated_Source\PSoC5/BL.c **** \r
892  799:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR] =\r
893  800:.\Generated_Source\PSoC5/BL.c ****                                 (uint8)BL_ValidateBootloadable(btldrData);\r
894  801:.\Generated_Source\PSoC5/BL.c **** \r
895  802:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR + 1u] =\r
896  803:.\Generated_Source\PSoC5/BL.c ****                                 (uint8)BL_MD_BTLDB_ACTIVE_VALUE(btldrData);\r
897  804:.\Generated_Source\PSoC5/BL.c **** \r
898  805:.\Generated_Source\PSoC5/BL.c ****                             rspSize = 2u;\r
899  806:.\Generated_Source\PSoC5/BL.c ****                             ackCode = CYRET_SUCCESS;\r
900  807:.\Generated_Source\PSoC5/BL.c ****                         }\r
901 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 16\r
902 \r
903 \r
904  808:.\Generated_Source\PSoC5/BL.c ****                         break;\r
905  809:.\Generated_Source\PSoC5/BL.c **** \r
906  810:.\Generated_Source\PSoC5/BL.c ****                 #endif  /* (0u != BL_CMD_GET_APP_STATUS_AVAIL) */\r
907  811:.\Generated_Source\PSoC5/BL.c **** \r
908  812:.\Generated_Source\PSoC5/BL.c ****             #endif  /* (0u != BL_DUAL_APP_BOOTLOADER) */\r
909  813:.\Generated_Source\PSoC5/BL.c **** \r
910  814:.\Generated_Source\PSoC5/BL.c **** \r
911  815:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
912  816:.\Generated_Source\PSoC5/BL.c ****             *   Program / Erase row\r
913  817:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
914  818:.\Generated_Source\PSoC5/BL.c ****             case BL_COMMAND_PROGRAM:\r
915  819:.\Generated_Source\PSoC5/BL.c **** \r
916  820:.\Generated_Source\PSoC5/BL.c ****             /* The btldrData variable holds Flash Array ID */\r
917  821:.\Generated_Source\PSoC5/BL.c **** \r
918  822:.\Generated_Source\PSoC5/BL.c ****         #if (0u != BL_CMD_ERASE_ROW_AVAIL)\r
919  823:.\Generated_Source\PSoC5/BL.c **** \r
920  824:.\Generated_Source\PSoC5/BL.c ****             case BL_COMMAND_ERASE:\r
921  825:.\Generated_Source\PSoC5/BL.c ****                 if (BL_COMMAND_ERASE == packetBuffer[BL_CMD_ADDR])\r
922  826:.\Generated_Source\PSoC5/BL.c ****                 {\r
923  827:.\Generated_Source\PSoC5/BL.c ****                     if ((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 3u))\r
924  828:.\Generated_Source\PSoC5/BL.c ****                     {\r
925  829:.\Generated_Source\PSoC5/BL.c ****                         #if(!CY_PSOC4)\r
926  830:.\Generated_Source\PSoC5/BL.c ****                             if((btldrData >= BL_FIRST_EE_ARRAYID) &&\r
927  831:.\Generated_Source\PSoC5/BL.c ****                                (btldrData <= BL_LAST_EE_ARRAYID))\r
928  832:.\Generated_Source\PSoC5/BL.c ****                             {\r
929  833:.\Generated_Source\PSoC5/BL.c ****                                 /* Size of EEPROM row */\r
930  834:.\Generated_Source\PSoC5/BL.c ****                                 dataOffset = CY_EEPROM_SIZEOF_ROW;\r
931  835:.\Generated_Source\PSoC5/BL.c ****                             }\r
932  836:.\Generated_Source\PSoC5/BL.c ****                             else\r
933  837:.\Generated_Source\PSoC5/BL.c ****                             {\r
934  838:.\Generated_Source\PSoC5/BL.c ****                                 /* Size of FLASH row (depends on ECC configuration) */\r
935  839:.\Generated_Source\PSoC5/BL.c ****                                 dataOffset = BL_FROW_SIZE;\r
936  840:.\Generated_Source\PSoC5/BL.c ****                             }\r
937  841:.\Generated_Source\PSoC5/BL.c ****                         #else\r
938  842:.\Generated_Source\PSoC5/BL.c ****                             /* Size of FLASH row (no ECC available) */\r
939  843:.\Generated_Source\PSoC5/BL.c ****                             dataOffset = BL_FROW_SIZE;\r
940  844:.\Generated_Source\PSoC5/BL.c ****                         #endif  /* (!CY_PSOC4) */\r
941  845:.\Generated_Source\PSoC5/BL.c **** \r
942  846:.\Generated_Source\PSoC5/BL.c ****                         #if(CY_PSOC3)\r
943  847:.\Generated_Source\PSoC5/BL.c ****                             (void) memset(dataBuffer, (char8) 0, (int16) dataOffset);\r
944  848:.\Generated_Source\PSoC5/BL.c ****                         #else\r
945  849:.\Generated_Source\PSoC5/BL.c ****                             (void) memset(dataBuffer, 0, dataOffset);\r
946  850:.\Generated_Source\PSoC5/BL.c ****                         #endif  /* (CY_PSOC3) */\r
947  851:.\Generated_Source\PSoC5/BL.c ****                     }\r
948  852:.\Generated_Source\PSoC5/BL.c ****                     else\r
949  853:.\Generated_Source\PSoC5/BL.c ****                     {\r
950  854:.\Generated_Source\PSoC5/BL.c ****                         break;\r
951  855:.\Generated_Source\PSoC5/BL.c ****                     }\r
952  856:.\Generated_Source\PSoC5/BL.c ****                 }\r
953  857:.\Generated_Source\PSoC5/BL.c **** \r
954  858:.\Generated_Source\PSoC5/BL.c ****         #endif  /* (0u != BL_CMD_ERASE_ROW_AVAIL) */\r
955  859:.\Generated_Source\PSoC5/BL.c **** \r
956  860:.\Generated_Source\PSoC5/BL.c **** \r
957  861:.\Generated_Source\PSoC5/BL.c ****                 if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize >= 3u))\r
958  862:.\Generated_Source\PSoC5/BL.c ****                 {\r
959  863:.\Generated_Source\PSoC5/BL.c **** \r
960  864:.\Generated_Source\PSoC5/BL.c ****                     /* The command may be sent along with the last block of data, to program the ro\r
961 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 17\r
962 \r
963 \r
964  865:.\Generated_Source\PSoC5/BL.c ****                     #if(CY_PSOC3)\r
965  866:.\Generated_Source\PSoC5/BL.c ****                         (void) memcpy(&dataBuffer[dataOffset],\r
966  867:.\Generated_Source\PSoC5/BL.c ****                                       &packetBuffer[BL_DATA_ADDR + 3u],\r
967  868:.\Generated_Source\PSoC5/BL.c ****                                       ( int16 )pktSize - 3);\r
968  869:.\Generated_Source\PSoC5/BL.c ****                     #else\r
969  870:.\Generated_Source\PSoC5/BL.c ****                         (void) memcpy(&dataBuffer[dataOffset],\r
970  871:.\Generated_Source\PSoC5/BL.c ****                                       &packetBuffer[BL_DATA_ADDR + 3u],\r
971  872:.\Generated_Source\PSoC5/BL.c ****                                       pktSize - 3u);\r
972  873:.\Generated_Source\PSoC5/BL.c ****                     #endif  /* (CY_PSOC3) */\r
973  874:.\Generated_Source\PSoC5/BL.c **** \r
974  875:.\Generated_Source\PSoC5/BL.c ****                     dataOffset += (pktSize - 3u);\r
975  876:.\Generated_Source\PSoC5/BL.c **** \r
976  877:.\Generated_Source\PSoC5/BL.c ****                     #if(!CY_PSOC4)\r
977  878:.\Generated_Source\PSoC5/BL.c ****                         if((btldrData >= BL_FIRST_EE_ARRAYID) &&\r
978  879:.\Generated_Source\PSoC5/BL.c ****                            (btldrData <= BL_LAST_EE_ARRAYID))\r
979  880:.\Generated_Source\PSoC5/BL.c ****                         {\r
980  881:.\Generated_Source\PSoC5/BL.c **** \r
981  882:.\Generated_Source\PSoC5/BL.c ****                             CyEEPROM_Start();\r
982  883:.\Generated_Source\PSoC5/BL.c **** \r
983  884:.\Generated_Source\PSoC5/BL.c ****                             /* Size of EEPROM row */\r
984  885:.\Generated_Source\PSoC5/BL.c ****                             pktSize = CY_EEPROM_SIZEOF_ROW;\r
985  886:.\Generated_Source\PSoC5/BL.c ****                         }\r
986  887:.\Generated_Source\PSoC5/BL.c ****                         else\r
987  888:.\Generated_Source\PSoC5/BL.c ****                         {\r
988  889:.\Generated_Source\PSoC5/BL.c ****                             /* Size of FLASH row (depends on ECC configuration) */\r
989  890:.\Generated_Source\PSoC5/BL.c ****                             pktSize = BL_FROW_SIZE;\r
990  891:.\Generated_Source\PSoC5/BL.c ****                         }\r
991  892:.\Generated_Source\PSoC5/BL.c ****                     #else\r
992  893:.\Generated_Source\PSoC5/BL.c ****                         /* Size of FLASH row (no ECC available) */\r
993  894:.\Generated_Source\PSoC5/BL.c ****                         pktSize = BL_FROW_SIZE;\r
994  895:.\Generated_Source\PSoC5/BL.c ****                     #endif  /* (!CY_PSOC4) */\r
995  896:.\Generated_Source\PSoC5/BL.c **** \r
996  897:.\Generated_Source\PSoC5/BL.c **** \r
997  898:.\Generated_Source\PSoC5/BL.c ****                     /* Check if we have all data to program */\r
998  899:.\Generated_Source\PSoC5/BL.c ****                     if(dataOffset == pktSize)\r
999  900:.\Generated_Source\PSoC5/BL.c ****                     {\r
1000  901:.\Generated_Source\PSoC5/BL.c ****                         /* Get FLASH/EEPROM row number */\r
1001  902:.\Generated_Source\PSoC5/BL.c ****                         dataOffset = ((uint16)((uint16)packetBuffer[BL_DATA_ADDR + 2u] << 8u)) |\r
1002  903:.\Generated_Source\PSoC5/BL.c ****                                               packetBuffer[BL_DATA_ADDR + 1u];\r
1003  904:.\Generated_Source\PSoC5/BL.c **** \r
1004  905:.\Generated_Source\PSoC5/BL.c ****                         #if(!CY_PSOC4)\r
1005  906:.\Generated_Source\PSoC5/BL.c ****                             if(btldrData <= BL_LAST_FLASH_ARRAYID)\r
1006  907:.\Generated_Source\PSoC5/BL.c ****                             {\r
1007  908:.\Generated_Source\PSoC5/BL.c ****                         #endif  /* (!CY_PSOC4) */\r
1008  909:.\Generated_Source\PSoC5/BL.c **** \r
1009  910:.\Generated_Source\PSoC5/BL.c ****                         #if(0u == BL_DUAL_APP_BOOTLOADER)\r
1010  911:.\Generated_Source\PSoC5/BL.c **** \r
1011  912:.\Generated_Source\PSoC5/BL.c ****                             if(0u == clearedMetaData)\r
1012  913:.\Generated_Source\PSoC5/BL.c ****                             {\r
1013  914:.\Generated_Source\PSoC5/BL.c ****                                 /* Metadata section must be filled with zeroes */\r
1014  915:.\Generated_Source\PSoC5/BL.c **** \r
1015  916:.\Generated_Source\PSoC5/BL.c ****                                 uint8 erase[BL_FROW_SIZE];\r
1016  917:.\Generated_Source\PSoC5/BL.c **** \r
1017  918:.\Generated_Source\PSoC5/BL.c ****                                 #if(CY_PSOC3)\r
1018  919:.\Generated_Source\PSoC5/BL.c ****                                     (void) memset(erase, (char8) 0, (int16) BL_FROW_SIZE);\r
1019  920:.\Generated_Source\PSoC5/BL.c ****                                 #else\r
1020  921:.\Generated_Source\PSoC5/BL.c ****                                     (void) memset(erase, 0, BL_FROW_SIZE);\r
1021 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 18\r
1022 \r
1023 \r
1024  922:.\Generated_Source\PSoC5/BL.c ****                                 #endif  /* (CY_PSOC3) */\r
1025  923:.\Generated_Source\PSoC5/BL.c **** \r
1026  924:.\Generated_Source\PSoC5/BL.c ****                                 #if(CY_PSOC4)\r
1027  925:.\Generated_Source\PSoC5/BL.c ****                                     (void) CySysFlashWriteRow(BL_MD_ROW, erase);\r
1028  926:.\Generated_Source\PSoC5/BL.c ****                                 #else\r
1029  927:.\Generated_Source\PSoC5/BL.c ****                                     (void) CyWriteRowFull((uint8)  BL_MD_FLASH_ARRAY_NUM,\r
1030  928:.\Generated_Source\PSoC5/BL.c ****                                                           (uint16) BL_MD_ROW,\r
1031  929:.\Generated_Source\PSoC5/BL.c ****                                                                     erase,\r
1032  930:.\Generated_Source\PSoC5/BL.c ****                                                                     BL_FROW_SIZE);\r
1033  931:.\Generated_Source\PSoC5/BL.c ****                                 #endif  /* (CY_PSOC4) */\r
1034  932:.\Generated_Source\PSoC5/BL.c **** \r
1035  933:.\Generated_Source\PSoC5/BL.c ****                                 /* Set up flag that metadata was cleared */\r
1036  934:.\Generated_Source\PSoC5/BL.c ****                                 clearedMetaData = 1u;\r
1037  935:.\Generated_Source\PSoC5/BL.c ****                             }\r
1038  936:.\Generated_Source\PSoC5/BL.c **** \r
1039  937:.\Generated_Source\PSoC5/BL.c ****                         #else\r
1040  938:.\Generated_Source\PSoC5/BL.c **** \r
1041  939:.\Generated_Source\PSoC5/BL.c ****                             if(BL_activeApp < BL_MD_BTLDB_ACTIVE_NONE)\r
1042  940:.\Generated_Source\PSoC5/BL.c ****                             {\r
1043  941:.\Generated_Source\PSoC5/BL.c ****                                 /* First active bootloadable application row */\r
1044  942:.\Generated_Source\PSoC5/BL.c ****                                 uint16 firstRow = (uint16) 1u +\r
1045  943:.\Generated_Source\PSoC5/BL.c ****                                     (uint16) BL_GetMetadata(BL_GET_METADATA_BTLDR_LAST_ROW,\r
1046  944:.\Generated_Source\PSoC5/BL.c ****                                                                           BL_activeApp);\r
1047  945:.\Generated_Source\PSoC5/BL.c **** \r
1048  946:.\Generated_Source\PSoC5/BL.c ****                                 #if(CY_PSOC4)\r
1049  947:.\Generated_Source\PSoC5/BL.c ****                                     uint16 row = dataOffset;\r
1050  948:.\Generated_Source\PSoC5/BL.c ****                                 #else\r
1051  949:.\Generated_Source\PSoC5/BL.c ****                                     uint16 row = (uint16)(btldrData * (CYDEV_FLS_SECTOR_SIZE / CYDE\r
1052  950:.\Generated_Source\PSoC5/BL.c ****                                                   dataOffset;\r
1053  951:.\Generated_Source\PSoC5/BL.c ****                                 #endif  /* (CY_PSOC4) */\r
1054  952:.\Generated_Source\PSoC5/BL.c **** \r
1055  953:.\Generated_Source\PSoC5/BL.c **** \r
1056  954:.\Generated_Source\PSoC5/BL.c ****                                 /******************************************************************\r
1057  955:.\Generated_Source\PSoC5/BL.c ****                                 * Last row is equal to the first row plus the number of rows availa\r
1058  956:.\Generated_Source\PSoC5/BL.c ****                                 * app. To compute this, we first subtract the number of appliaction\r
1059  957:.\Generated_Source\PSoC5/BL.c ****                                 * the total flash rows: (CY_FLASH_NUMBER_ROWS - 2u).\r
1060  958:.\Generated_Source\PSoC5/BL.c ****                                 *\r
1061  959:.\Generated_Source\PSoC5/BL.c ****                                 * Then subtract off the first row:\r
1062  960:.\Generated_Source\PSoC5/BL.c ****                                 * App Rows = (CY_FLASH_NUMBER_ROWS - 2u - firstRow)\r
1063  961:.\Generated_Source\PSoC5/BL.c ****                                 * Then divide that number by the number of application that must fi\r
1064  962:.\Generated_Source\PSoC5/BL.c ****                                 * space, if we are app1 then that number is 2, if app2 then 1.  Our\r
1065  963:.\Generated_Source\PSoC5/BL.c ****                                 * then: (2u - BL_activeApp).\r
1066  964:.\Generated_Source\PSoC5/BL.c ****                                 *\r
1067  965:.\Generated_Source\PSoC5/BL.c ****                                 * Adding this number to firstRow gives the address right beyond our\r
1068  966:.\Generated_Source\PSoC5/BL.c ****                                 * so we subtract 1.\r
1069  967:.\Generated_Source\PSoC5/BL.c ****                                 *******************************************************************\r
1070  968:.\Generated_Source\PSoC5/BL.c ****                                 uint16 lastRow = (firstRow - 1u) +\r
1071  969:.\Generated_Source\PSoC5/BL.c ****                                                   ((uint16)((CYDEV_FLASH_SIZE / CYDEV_FLS_ROW_SIZE)\r
1072  970:.\Generated_Source\PSoC5/BL.c ****                                                   ((uint16)2u - (uint16)BL_activeApp));\r
1073  971:.\Generated_Source\PSoC5/BL.c **** \r
1074  972:.\Generated_Source\PSoC5/BL.c **** \r
1075  973:.\Generated_Source\PSoC5/BL.c ****                                 /******************************************************************\r
1076  974:.\Generated_Source\PSoC5/BL.c ****                                 * Check to see if the row to program is within the range of the act\r
1077  975:.\Generated_Source\PSoC5/BL.c ****                                 * application, or if it maches the active application's metadata ro\r
1078  976:.\Generated_Source\PSoC5/BL.c ****                                 * refuse to program as it would corrupt the active app.\r
1079  977:.\Generated_Source\PSoC5/BL.c ****                                 *******************************************************************\r
1080  978:.\Generated_Source\PSoC5/BL.c ****                                 if(((row >= firstRow) && (row <= lastRow)) ||\r
1081 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 19\r
1082 \r
1083 \r
1084  979:.\Generated_Source\PSoC5/BL.c ****                                    ((btldrData == BL_MD_FLASH_ARRAY_NUM) &&\r
1085  980:.\Generated_Source\PSoC5/BL.c ****                                    (dataOffset == BL_MD_ROW_NUM(BL_activeApp))))\r
1086  981:.\Generated_Source\PSoC5/BL.c ****                                 {\r
1087  982:.\Generated_Source\PSoC5/BL.c ****                                     ackCode = BL_ERR_ACTIVE;\r
1088  983:.\Generated_Source\PSoC5/BL.c ****                                     dataOffset = 0u;\r
1089  984:.\Generated_Source\PSoC5/BL.c ****                                     break;\r
1090  985:.\Generated_Source\PSoC5/BL.c ****                                 }\r
1091  986:.\Generated_Source\PSoC5/BL.c ****                             }\r
1092  987:.\Generated_Source\PSoC5/BL.c **** \r
1093  988:.\Generated_Source\PSoC5/BL.c ****                         #endif  /* (0u == BL_DUAL_APP_BOOTLOADER) */\r
1094  989:.\Generated_Source\PSoC5/BL.c **** \r
1095  990:.\Generated_Source\PSoC5/BL.c ****                         #if(!CY_PSOC4)\r
1096  991:.\Generated_Source\PSoC5/BL.c ****                             }\r
1097  992:.\Generated_Source\PSoC5/BL.c ****                         #endif  /* (!CY_PSOC4) */\r
1098  993:.\Generated_Source\PSoC5/BL.c **** \r
1099  994:.\Generated_Source\PSoC5/BL.c ****                         #if(CY_PSOC4)\r
1100  995:.\Generated_Source\PSoC5/BL.c **** \r
1101  996:.\Generated_Source\PSoC5/BL.c ****                             ackCode = (CYRET_SUCCESS != CySysFlashWriteRow((uint32) dataOffset, dat\r
1102  997:.\Generated_Source\PSoC5/BL.c ****                                 ? BL_ERR_ROW \\r
1103  998:.\Generated_Source\PSoC5/BL.c ****                                 : CYRET_SUCCESS;\r
1104  999:.\Generated_Source\PSoC5/BL.c **** \r
1105 1000:.\Generated_Source\PSoC5/BL.c ****                         #else\r
1106 1001:.\Generated_Source\PSoC5/BL.c **** \r
1107 1002:.\Generated_Source\PSoC5/BL.c ****                             ackCode = (CYRET_SUCCESS != CyWriteRowFull(btldrData, dataOffset, dataB\r
1108 1003:.\Generated_Source\PSoC5/BL.c ****                                 ? BL_ERR_ROW \\r
1109 1004:.\Generated_Source\PSoC5/BL.c ****                                 : CYRET_SUCCESS;\r
1110 1005:.\Generated_Source\PSoC5/BL.c **** \r
1111 1006:.\Generated_Source\PSoC5/BL.c ****                         #endif  /* (CY_PSOC4) */\r
1112 1007:.\Generated_Source\PSoC5/BL.c **** \r
1113 1008:.\Generated_Source\PSoC5/BL.c ****                     }\r
1114 1009:.\Generated_Source\PSoC5/BL.c ****                     else\r
1115 1010:.\Generated_Source\PSoC5/BL.c ****                     {\r
1116 1011:.\Generated_Source\PSoC5/BL.c ****                         ackCode = BL_ERR_LENGTH;\r
1117 1012:.\Generated_Source\PSoC5/BL.c ****                     }\r
1118 1013:.\Generated_Source\PSoC5/BL.c **** \r
1119 1014:.\Generated_Source\PSoC5/BL.c ****                     dataOffset = 0u;\r
1120 1015:.\Generated_Source\PSoC5/BL.c ****                 }\r
1121 1016:.\Generated_Source\PSoC5/BL.c ****                 break;\r
1122 1017:.\Generated_Source\PSoC5/BL.c **** \r
1123 1018:.\Generated_Source\PSoC5/BL.c **** \r
1124 1019:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
1125 1020:.\Generated_Source\PSoC5/BL.c ****             *   Sync bootloader\r
1126 1021:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
1127 1022:.\Generated_Source\PSoC5/BL.c ****             #if(0u != BL_CMD_SYNC_BOOTLOADER_AVAIL)\r
1128 1023:.\Generated_Source\PSoC5/BL.c **** \r
1129 1024:.\Generated_Source\PSoC5/BL.c ****             case BL_COMMAND_SYNC:\r
1130 1025:.\Generated_Source\PSoC5/BL.c **** \r
1131 1026:.\Generated_Source\PSoC5/BL.c ****                 if(BL_COMMUNICATION_STATE_ACTIVE == communicationState)\r
1132 1027:.\Generated_Source\PSoC5/BL.c ****                 {\r
1133 1028:.\Generated_Source\PSoC5/BL.c ****                     /* If something failed the host would send this command to reset the bootloader\r
1134 1029:.\Generated_Source\PSoC5/BL.c ****                     dataOffset = 0u;\r
1135 1030:.\Generated_Source\PSoC5/BL.c **** \r
1136 1031:.\Generated_Source\PSoC5/BL.c ****                     /* Don't ack the packet, just get ready to accept the next one */\r
1137 1032:.\Generated_Source\PSoC5/BL.c ****                     continue;\r
1138 1033:.\Generated_Source\PSoC5/BL.c ****                 }\r
1139 1034:.\Generated_Source\PSoC5/BL.c ****                 break;\r
1140 1035:.\Generated_Source\PSoC5/BL.c **** \r
1141 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 20\r
1142 \r
1143 \r
1144 1036:.\Generated_Source\PSoC5/BL.c ****             #endif  /* (0u != BL_CMD_SYNC_BOOTLOADER_AVAIL) */\r
1145 1037:.\Generated_Source\PSoC5/BL.c **** \r
1146 1038:.\Generated_Source\PSoC5/BL.c **** \r
1147 1039:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
1148 1040:.\Generated_Source\PSoC5/BL.c ****             *   Set active application\r
1149 1041:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
1150 1042:.\Generated_Source\PSoC5/BL.c ****             #if(0u != BL_DUAL_APP_BOOTLOADER)\r
1151 1043:.\Generated_Source\PSoC5/BL.c **** \r
1152 1044:.\Generated_Source\PSoC5/BL.c ****                 case BL_COMMAND_APP_ACTIVE:\r
1153 1045:.\Generated_Source\PSoC5/BL.c **** \r
1154 1046:.\Generated_Source\PSoC5/BL.c ****                     if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 1u))\r
1155 1047:.\Generated_Source\PSoC5/BL.c ****                     {\r
1156 1048:.\Generated_Source\PSoC5/BL.c ****                         if(CYRET_SUCCESS == BL_ValidateBootloadable(btldrData))\r
1157 1049:.\Generated_Source\PSoC5/BL.c ****                         {\r
1158 1050:.\Generated_Source\PSoC5/BL.c ****                             uint8 CYDATA idx;\r
1159 1051:.\Generated_Source\PSoC5/BL.c **** \r
1160 1052:.\Generated_Source\PSoC5/BL.c ****                             for(idx = 0u; idx < BL_MAX_NUM_OF_BTLDB; idx++)\r
1161 1053:.\Generated_Source\PSoC5/BL.c ****                             {\r
1162 1054:.\Generated_Source\PSoC5/BL.c ****                                 BL_SetFlashByte((uint32) BL_MD_BTLDB_ACTIVE_OFFSET(idx),\r
1163 1055:.\Generated_Source\PSoC5/BL.c ****                                                               (uint8 )(idx == btldrData));\r
1164 1056:.\Generated_Source\PSoC5/BL.c ****                             }\r
1165 1057:.\Generated_Source\PSoC5/BL.c ****                             BL_activeApp = btldrData;\r
1166 1058:.\Generated_Source\PSoC5/BL.c ****                             ackCode = CYRET_SUCCESS;\r
1167 1059:.\Generated_Source\PSoC5/BL.c ****                         }\r
1168 1060:.\Generated_Source\PSoC5/BL.c ****                         else\r
1169 1061:.\Generated_Source\PSoC5/BL.c ****                         {\r
1170 1062:.\Generated_Source\PSoC5/BL.c ****                             ackCode = BL_ERR_APP;\r
1171 1063:.\Generated_Source\PSoC5/BL.c ****                         }\r
1172 1064:.\Generated_Source\PSoC5/BL.c ****                     }\r
1173 1065:.\Generated_Source\PSoC5/BL.c ****                     break;\r
1174 1066:.\Generated_Source\PSoC5/BL.c **** \r
1175 1067:.\Generated_Source\PSoC5/BL.c ****             #endif  /* (0u != BL_DUAL_APP_BOOTLOADER) */\r
1176 1068:.\Generated_Source\PSoC5/BL.c **** \r
1177 1069:.\Generated_Source\PSoC5/BL.c **** \r
1178 1070:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
1179 1071:.\Generated_Source\PSoC5/BL.c ****             *   Send data\r
1180 1072:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
1181 1073:.\Generated_Source\PSoC5/BL.c ****             #if (0u != BL_CMD_SEND_DATA_AVAIL)\r
1182 1074:.\Generated_Source\PSoC5/BL.c **** \r
1183 1075:.\Generated_Source\PSoC5/BL.c ****                 case BL_COMMAND_DATA:\r
1184 1076:.\Generated_Source\PSoC5/BL.c **** \r
1185 1077:.\Generated_Source\PSoC5/BL.c ****                     if(BL_COMMUNICATION_STATE_ACTIVE == communicationState)\r
1186 1078:.\Generated_Source\PSoC5/BL.c ****                     {\r
1187 1079:.\Generated_Source\PSoC5/BL.c ****                         /*  Make sure that dataOffset is valid before copying the data */\r
1188 1080:.\Generated_Source\PSoC5/BL.c ****                         if((dataOffset + pktSize) <= BL_SIZEOF_COMMAND_BUFFER)\r
1189 1081:.\Generated_Source\PSoC5/BL.c ****                         {\r
1190 1082:.\Generated_Source\PSoC5/BL.c ****                             ackCode = CYRET_SUCCESS;\r
1191 1083:.\Generated_Source\PSoC5/BL.c **** \r
1192 1084:.\Generated_Source\PSoC5/BL.c ****                             #if(CY_PSOC3)\r
1193 1085:.\Generated_Source\PSoC5/BL.c ****                                 (void) memcpy(&dataBuffer[dataOffset],\r
1194 1086:.\Generated_Source\PSoC5/BL.c ****                                               &packetBuffer[BL_DATA_ADDR],\r
1195 1087:.\Generated_Source\PSoC5/BL.c ****                                               ( int16 )pktSize);\r
1196 1088:.\Generated_Source\PSoC5/BL.c ****                             #else\r
1197 1089:.\Generated_Source\PSoC5/BL.c ****                                 (void) memcpy(&dataBuffer[dataOffset],\r
1198 1090:.\Generated_Source\PSoC5/BL.c ****                                               &packetBuffer[BL_DATA_ADDR],\r
1199 1091:.\Generated_Source\PSoC5/BL.c ****                                               pktSize);\r
1200 1092:.\Generated_Source\PSoC5/BL.c ****                             #endif  /* (CY_PSOC3) */\r
1201 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 21\r
1202 \r
1203 \r
1204 1093:.\Generated_Source\PSoC5/BL.c **** \r
1205 1094:.\Generated_Source\PSoC5/BL.c ****                             dataOffset += pktSize;\r
1206 1095:.\Generated_Source\PSoC5/BL.c ****                         }\r
1207 1096:.\Generated_Source\PSoC5/BL.c ****                         else\r
1208 1097:.\Generated_Source\PSoC5/BL.c ****                         {\r
1209 1098:.\Generated_Source\PSoC5/BL.c ****                             ackCode = BL_ERR_LENGTH;\r
1210 1099:.\Generated_Source\PSoC5/BL.c ****                         }\r
1211 1100:.\Generated_Source\PSoC5/BL.c ****                     }\r
1212 1101:.\Generated_Source\PSoC5/BL.c **** \r
1213 1102:.\Generated_Source\PSoC5/BL.c ****                     break;\r
1214 1103:.\Generated_Source\PSoC5/BL.c **** \r
1215 1104:.\Generated_Source\PSoC5/BL.c ****             #endif  /* (0u != BL_CMD_SEND_DATA_AVAIL) */\r
1216 1105:.\Generated_Source\PSoC5/BL.c **** \r
1217 1106:.\Generated_Source\PSoC5/BL.c **** \r
1218 1107:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
1219 1108:.\Generated_Source\PSoC5/BL.c ****             *   Enter bootloader\r
1220 1109:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
1221 1110:.\Generated_Source\PSoC5/BL.c ****             case BL_COMMAND_ENTER:\r
1222 1111:.\Generated_Source\PSoC5/BL.c **** \r
1223 1112:.\Generated_Source\PSoC5/BL.c ****                 if(pktSize == 0u)\r
1224 1113:.\Generated_Source\PSoC5/BL.c ****                 {\r
1225 1114:.\Generated_Source\PSoC5/BL.c ****                     #if(CY_PSOC3)\r
1226 1115:.\Generated_Source\PSoC5/BL.c **** \r
1227 1116:.\Generated_Source\PSoC5/BL.c ****                         BL_ENTER CYDATA BtldrVersion =\r
1228 1117:.\Generated_Source\PSoC5/BL.c ****                             {CYSWAP_ENDIAN32(CYDEV_CHIP_JTAG_ID), CYDEV_CHIP_REV_EXPECT, BL_VERSION\r
1229 1118:.\Generated_Source\PSoC5/BL.c **** \r
1230 1119:.\Generated_Source\PSoC5/BL.c ****                     #else\r
1231 1120:.\Generated_Source\PSoC5/BL.c **** \r
1232 1121:.\Generated_Source\PSoC5/BL.c ****                         BL_ENTER CYDATA BtldrVersion =\r
1233 1122:.\Generated_Source\PSoC5/BL.c ****                             {CYDEV_CHIP_JTAG_ID, CYDEV_CHIP_REV_EXPECT, BL_VERSION};\r
1234 1123:.\Generated_Source\PSoC5/BL.c **** \r
1235 1124:.\Generated_Source\PSoC5/BL.c ****                     #endif  /* (CY_PSOC3) */\r
1236 1125:.\Generated_Source\PSoC5/BL.c **** \r
1237 1126:.\Generated_Source\PSoC5/BL.c ****                     communicationState = BL_COMMUNICATION_STATE_ACTIVE;\r
1238 1127:.\Generated_Source\PSoC5/BL.c **** \r
1239 1128:.\Generated_Source\PSoC5/BL.c ****                     rspSize = sizeof(BL_ENTER);\r
1240 1129:.\Generated_Source\PSoC5/BL.c **** \r
1241 1130:.\Generated_Source\PSoC5/BL.c ****                     #if(CY_PSOC3)\r
1242 1131:.\Generated_Source\PSoC5/BL.c ****                         (void) memcpy(&packetBuffer[BL_DATA_ADDR],\r
1243 1132:.\Generated_Source\PSoC5/BL.c ****                                       &BtldrVersion,\r
1244 1133:.\Generated_Source\PSoC5/BL.c ****                                       ( int16 )rspSize);\r
1245 1134:.\Generated_Source\PSoC5/BL.c ****                     #else\r
1246 1135:.\Generated_Source\PSoC5/BL.c ****                         (void) memcpy(&packetBuffer[BL_DATA_ADDR],\r
1247 1136:.\Generated_Source\PSoC5/BL.c ****                                       &BtldrVersion,\r
1248 1137:.\Generated_Source\PSoC5/BL.c ****                                       rspSize);\r
1249 1138:.\Generated_Source\PSoC5/BL.c ****                     #endif  /* (CY_PSOC3) */\r
1250 1139:.\Generated_Source\PSoC5/BL.c **** \r
1251 1140:.\Generated_Source\PSoC5/BL.c ****                     ackCode = CYRET_SUCCESS;\r
1252 1141:.\Generated_Source\PSoC5/BL.c ****                 }\r
1253 1142:.\Generated_Source\PSoC5/BL.c ****                 break;\r
1254 1143:.\Generated_Source\PSoC5/BL.c **** \r
1255 1144:.\Generated_Source\PSoC5/BL.c **** \r
1256 1145:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
1257 1146:.\Generated_Source\PSoC5/BL.c ****             *   Verify row\r
1258 1147:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
1259 1148:.\Generated_Source\PSoC5/BL.c ****             case BL_COMMAND_VERIFY:\r
1260 1149:.\Generated_Source\PSoC5/BL.c **** \r
1261 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 22\r
1262 \r
1263 \r
1264 1150:.\Generated_Source\PSoC5/BL.c ****                 if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 3u))\r
1265 1151:.\Generated_Source\PSoC5/BL.c ****                 {\r
1266 1152:.\Generated_Source\PSoC5/BL.c ****                     /* Get FLASH/EEPROM row number */\r
1267 1153:.\Generated_Source\PSoC5/BL.c ****                     uint16 CYDATA rowNum = ((uint16)((uint16)packetBuffer[BL_DATA_ADDR + 2u] << 8u)\r
1268 1154:.\Generated_Source\PSoC5/BL.c ****                                                     packetBuffer[BL_DATA_ADDR + 1u];\r
1269 1155:.\Generated_Source\PSoC5/BL.c **** \r
1270 1156:.\Generated_Source\PSoC5/BL.c ****                     #if(!CY_PSOC4)\r
1271 1157:.\Generated_Source\PSoC5/BL.c **** \r
1272 1158:.\Generated_Source\PSoC5/BL.c ****                         uint32 CYDATA rowAddr;\r
1273 1159:.\Generated_Source\PSoC5/BL.c ****                         uint8 CYDATA checksum;\r
1274 1160:.\Generated_Source\PSoC5/BL.c **** \r
1275 1161:.\Generated_Source\PSoC5/BL.c ****                         if((btldrData >= BL_FIRST_EE_ARRAYID) &&\r
1276 1162:.\Generated_Source\PSoC5/BL.c ****                            (btldrData <= BL_LAST_EE_ARRAYID))\r
1277 1163:.\Generated_Source\PSoC5/BL.c ****                         {\r
1278 1164:.\Generated_Source\PSoC5/BL.c ****                             /* EEPROM */\r
1279 1165:.\Generated_Source\PSoC5/BL.c ****                             /* Both PSoC 3 and PSoC 5LP architectures have one EEPROM array. */\r
1280 1166:.\Generated_Source\PSoC5/BL.c ****                             rowAddr = (uint32)rowNum * CYDEV_EEPROM_ROW_SIZE;\r
1281 1167:.\Generated_Source\PSoC5/BL.c **** \r
1282 1168:.\Generated_Source\PSoC5/BL.c ****                             checksum = BL_Calc8BitEepromSum(rowAddr, CYDEV_EEPROM_ROW_SIZE);\r
1283 1169:.\Generated_Source\PSoC5/BL.c ****                         }\r
1284 1170:.\Generated_Source\PSoC5/BL.c ****                         else\r
1285 1171:.\Generated_Source\PSoC5/BL.c ****                         {\r
1286 1172:.\Generated_Source\PSoC5/BL.c ****                             /* FLASH */\r
1287 1173:.\Generated_Source\PSoC5/BL.c ****                             rowAddr = ((uint32)btldrData * CYDEV_FLS_SECTOR_SIZE)\r
1288 1174:.\Generated_Source\PSoC5/BL.c ****                                        + ((uint32)rowNum * CYDEV_FLS_ROW_SIZE);\r
1289 1175:.\Generated_Source\PSoC5/BL.c **** \r
1290 1176:.\Generated_Source\PSoC5/BL.c ****                             checksum = BL_Calc8BitFlashSum(rowAddr, CYDEV_FLS_ROW_SIZE);\r
1291 1177:.\Generated_Source\PSoC5/BL.c ****                         }\r
1292 1178:.\Generated_Source\PSoC5/BL.c **** \r
1293 1179:.\Generated_Source\PSoC5/BL.c ****                     #else\r
1294 1180:.\Generated_Source\PSoC5/BL.c **** \r
1295 1181:.\Generated_Source\PSoC5/BL.c ****                         uint32 CYDATA rowAddr = ((uint32)btldrData * CYDEV_FLS_SECTOR_SIZE)\r
1296 1182:.\Generated_Source\PSoC5/BL.c ****                                             + ((uint32)rowNum * CYDEV_FLS_ROW_SIZE);\r
1297 1183:.\Generated_Source\PSoC5/BL.c **** \r
1298 1184:.\Generated_Source\PSoC5/BL.c ****                         uint8 CYDATA checksum = BL_Calc8BitFlashSum(rowAddr, CYDEV_FLS_ROW_SIZE);\r
1299 1185:.\Generated_Source\PSoC5/BL.c **** \r
1300 1186:.\Generated_Source\PSoC5/BL.c ****                     #endif  /* (!CY_PSOC4) */\r
1301 1187:.\Generated_Source\PSoC5/BL.c **** \r
1302 1188:.\Generated_Source\PSoC5/BL.c **** \r
1303 1189:.\Generated_Source\PSoC5/BL.c ****                     /* Calculate checksum on data from ECC */\r
1304 1190:.\Generated_Source\PSoC5/BL.c ****                     #if(!CY_PSOC4) && (CYDEV_ECC_ENABLE == 0u)\r
1305 1191:.\Generated_Source\PSoC5/BL.c **** \r
1306 1192:.\Generated_Source\PSoC5/BL.c ****                         if(btldrData <= BL_LAST_FLASH_ARRAYID)\r
1307 1193:.\Generated_Source\PSoC5/BL.c ****                         {\r
1308 1194:.\Generated_Source\PSoC5/BL.c ****                             uint16 CYDATA tmpIndex;\r
1309 1195:.\Generated_Source\PSoC5/BL.c **** \r
1310 1196:.\Generated_Source\PSoC5/BL.c ****                             rowAddr = CYDEV_ECC_BASE + ((uint32)btldrData * (CYDEV_FLS_SECTOR_SIZE \r
1311 1197:.\Generated_Source\PSoC5/BL.c ****                                         + ((uint32)rowNum * CYDEV_ECC_ROW_SIZE);\r
1312 1198:.\Generated_Source\PSoC5/BL.c **** \r
1313 1199:.\Generated_Source\PSoC5/BL.c ****                             for(tmpIndex = 0u; tmpIndex < CYDEV_ECC_ROW_SIZE; tmpIndex++)\r
1314 1200:.\Generated_Source\PSoC5/BL.c ****                             {\r
1315 1201:.\Generated_Source\PSoC5/BL.c ****                                 checksum += CY_GET_XTND_REG8((uint8 CYFAR *)(rowAddr + tmpIndex));\r
1316 1202:.\Generated_Source\PSoC5/BL.c ****                             }\r
1317 1203:.\Generated_Source\PSoC5/BL.c ****                         }\r
1318 1204:.\Generated_Source\PSoC5/BL.c **** \r
1319 1205:.\Generated_Source\PSoC5/BL.c ****                     #endif  /* (!CY_PSOC4) && (CYDEV_ECC_ENABLE == 0u) */\r
1320 1206:.\Generated_Source\PSoC5/BL.c **** \r
1321 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 23\r
1322 \r
1323 \r
1324 1207:.\Generated_Source\PSoC5/BL.c **** \r
1325 1208:.\Generated_Source\PSoC5/BL.c ****                     /******************************************************************************\r
1326 1209:.\Generated_Source\PSoC5/BL.c ****                     * App Verified & App Active are information that is updated in flash at runtime\r
1327 1210:.\Generated_Source\PSoC5/BL.c ****                     * remove these items from the checksum to allow the host to verify everything i\r
1328 1211:.\Generated_Source\PSoC5/BL.c ****                     * correct.\r
1329 1212:.\Generated_Source\PSoC5/BL.c ****                      ******************************************************************************\r
1330 1213:.\Generated_Source\PSoC5/BL.c ****                     if((BL_MD_FLASH_ARRAY_NUM == btldrData) &&\r
1331 1214:.\Generated_Source\PSoC5/BL.c ****                        (BL_CONTAIN_METADATA(rowNum)))\r
1332 1215:.\Generated_Source\PSoC5/BL.c ****                     {\r
1333 1216:.\Generated_Source\PSoC5/BL.c ****                         checksum -= BL_MD_BTLDB_ACTIVE_VALUE  (BL_GET_APP_ID(rowNum));\r
1334 1217:.\Generated_Source\PSoC5/BL.c ****                         checksum -= BL_MD_BTLDB_VERIFIED_VALUE(BL_GET_APP_ID(rowNum));\r
1335 1218:.\Generated_Source\PSoC5/BL.c ****                     }\r
1336 1219:.\Generated_Source\PSoC5/BL.c **** \r
1337 1220:.\Generated_Source\PSoC5/BL.c ****                     packetBuffer[BL_DATA_ADDR] = (uint8)1u + (uint8)(~checksum);\r
1338 1221:.\Generated_Source\PSoC5/BL.c ****                     ackCode = CYRET_SUCCESS;\r
1339 1222:.\Generated_Source\PSoC5/BL.c ****                     rspSize = 1u;\r
1340 1223:.\Generated_Source\PSoC5/BL.c ****                 }\r
1341 1224:.\Generated_Source\PSoC5/BL.c ****                 break;\r
1342 1225:.\Generated_Source\PSoC5/BL.c **** \r
1343 1226:.\Generated_Source\PSoC5/BL.c **** \r
1344 1227:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
1345 1228:.\Generated_Source\PSoC5/BL.c ****             *   Exit bootloader\r
1346 1229:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
1347 1230:.\Generated_Source\PSoC5/BL.c ****             case BL_COMMAND_EXIT:\r
1348 1231:.\Generated_Source\PSoC5/BL.c **** \r
1349 1232:.\Generated_Source\PSoC5/BL.c ****                 if(CYRET_SUCCESS == BL_ValidateBootloadable(BL_activeApp))\r
1350 1233:.\Generated_Source\PSoC5/BL.c ****                 {\r
1351 1234:.\Generated_Source\PSoC5/BL.c ****                     BL_SET_RUN_TYPE(BL_START_APP);\r
1352 1235:.\Generated_Source\PSoC5/BL.c ****                 }\r
1353 1236:.\Generated_Source\PSoC5/BL.c **** \r
1354 1237:.\Generated_Source\PSoC5/BL.c ****                 CySoftwareReset();\r
1355 1238:.\Generated_Source\PSoC5/BL.c **** \r
1356 1239:.\Generated_Source\PSoC5/BL.c ****                 /* Will never get here */\r
1357 1240:.\Generated_Source\PSoC5/BL.c ****                 break;\r
1358 1241:.\Generated_Source\PSoC5/BL.c **** \r
1359 1242:.\Generated_Source\PSoC5/BL.c **** \r
1360 1243:.\Generated_Source\PSoC5/BL.c ****             /***************************************************************************\r
1361 1244:.\Generated_Source\PSoC5/BL.c ****             *   Unsupported command\r
1362 1245:.\Generated_Source\PSoC5/BL.c ****             ***************************************************************************/\r
1363 1246:.\Generated_Source\PSoC5/BL.c ****             default:\r
1364 1247:.\Generated_Source\PSoC5/BL.c ****                 ackCode = BL_ERR_CMD;\r
1365 1248:.\Generated_Source\PSoC5/BL.c ****                 break;\r
1366 1249:.\Generated_Source\PSoC5/BL.c ****             }\r
1367 1250:.\Generated_Source\PSoC5/BL.c ****         }\r
1368 1251:.\Generated_Source\PSoC5/BL.c **** \r
1369 1252:.\Generated_Source\PSoC5/BL.c ****         /* ?CK the packet and function. */\r
1370 1253:.\Generated_Source\PSoC5/BL.c ****         (void) BL_WritePacket(ackCode, packetBuffer, rspSize);\r
1371 1254:.\Generated_Source\PSoC5/BL.c **** \r
1372 1255:.\Generated_Source\PSoC5/BL.c ****     } while ((0u == timeOut) || (BL_COMMUNICATION_STATE_ACTIVE == communicationState));\r
1373 1256:.\Generated_Source\PSoC5/BL.c **** }\r
1374 1257:.\Generated_Source\PSoC5/BL.c **** \r
1375 1258:.\Generated_Source\PSoC5/BL.c **** \r
1376 1259:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
1377 1260:.\Generated_Source\PSoC5/BL.c **** * Function Name: BL_WritePacket\r
1378 1261:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
1379 1262:.\Generated_Source\PSoC5/BL.c **** *\r
1380 1263:.\Generated_Source\PSoC5/BL.c **** * Summary:\r
1381 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 24\r
1382 \r
1383 \r
1384 1264:.\Generated_Source\PSoC5/BL.c **** *  Creates a bootloader responce packet and transmits it back to the bootloader\r
1385 1265:.\Generated_Source\PSoC5/BL.c **** *  host application over the already established communications protocol.\r
1386 1266:.\Generated_Source\PSoC5/BL.c **** *\r
1387 1267:.\Generated_Source\PSoC5/BL.c **** * Parameters:\r
1388 1268:.\Generated_Source\PSoC5/BL.c **** *  status:\r
1389 1269:.\Generated_Source\PSoC5/BL.c **** *      The status code to pass back as the second byte of the packet\r
1390 1270:.\Generated_Source\PSoC5/BL.c **** *  buffer:\r
1391 1271:.\Generated_Source\PSoC5/BL.c **** *      The buffer containing the data portion of the packet\r
1392 1272:.\Generated_Source\PSoC5/BL.c **** *  size:\r
1393 1273:.\Generated_Source\PSoC5/BL.c **** *      The number of bytes contained within the buffer to pass back\r
1394 1274:.\Generated_Source\PSoC5/BL.c **** *\r
1395 1275:.\Generated_Source\PSoC5/BL.c **** * Return:\r
1396 1276:.\Generated_Source\PSoC5/BL.c **** *   CYRET_SUCCESS if successful.\r
1397 1277:.\Generated_Source\PSoC5/BL.c **** *   CYRET_UNKNOWN if there was an error tranmitting the packet.\r
1398 1278:.\Generated_Source\PSoC5/BL.c **** *\r
1399 1279:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
1400 1280:.\Generated_Source\PSoC5/BL.c **** static cystatus BL_WritePacket(uint8 status, uint8 buffer[], uint16 size) CYSMALL \\r
1401 1281:.\Generated_Source\PSoC5/BL.c ****                                             \r
1402 1282:.\Generated_Source\PSoC5/BL.c **** {\r
1403 1283:.\Generated_Source\PSoC5/BL.c ****     uint16 CYDATA checksum;\r
1404 1284:.\Generated_Source\PSoC5/BL.c **** \r
1405 1285:.\Generated_Source\PSoC5/BL.c ****     /* Start of the packet. */\r
1406 1286:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_SOP_ADDR]      = BL_SOP;\r
1407 1287:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_CMD_ADDR]      = status;\r
1408 1288:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_SIZE_ADDR]     = LO8(size);\r
1409 1289:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_SIZE_ADDR + 1u] = HI8(size);\r
1410 1290:.\Generated_Source\PSoC5/BL.c **** \r
1411 1291:.\Generated_Source\PSoC5/BL.c ****     /* Compute the checksum. */\r
1412 1292:.\Generated_Source\PSoC5/BL.c ****     checksum = BL_CalcPacketChecksum(buffer, size + BL_DATA_ADDR);\r
1413 1293:.\Generated_Source\PSoC5/BL.c **** \r
1414 1294:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_CHK_ADDR(size)]     = LO8(checksum);\r
1415 1295:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_CHK_ADDR(1u + size)] = HI8(checksum);\r
1416 1296:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_EOP_ADDR(size)]     = BL_EOP;\r
1417 1297:.\Generated_Source\PSoC5/BL.c **** \r
1418 1298:.\Generated_Source\PSoC5/BL.c ****     /* Start the packet transmit. */\r
1419 1299:.\Generated_Source\PSoC5/BL.c ****     return(CyBtldrCommWrite(buffer, size + BL_MIN_PKT_SIZE, &size, 150u));\r
1420 1300:.\Generated_Source\PSoC5/BL.c **** }\r
1421 1301:.\Generated_Source\PSoC5/BL.c **** \r
1422 1302:.\Generated_Source\PSoC5/BL.c **** \r
1423 1303:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
1424 1304:.\Generated_Source\PSoC5/BL.c **** * Function Name: BL_SetFlashByte\r
1425 1305:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
1426 1306:.\Generated_Source\PSoC5/BL.c **** *\r
1427 1307:.\Generated_Source\PSoC5/BL.c **** * Summary:\r
1428 1308:.\Generated_Source\PSoC5/BL.c **** *  Writes byte a flash memory location\r
1429 1309:.\Generated_Source\PSoC5/BL.c **** *\r
1430 1310:.\Generated_Source\PSoC5/BL.c **** * Parameters:\r
1431 1311:.\Generated_Source\PSoC5/BL.c **** *  address:\r
1432 1312:.\Generated_Source\PSoC5/BL.c **** *      Address in Flash memory where data will be written\r
1433 1313:.\Generated_Source\PSoC5/BL.c **** *\r
1434 1314:.\Generated_Source\PSoC5/BL.c **** *  runType:\r
1435 1315:.\Generated_Source\PSoC5/BL.c **** *      Byte to be written\r
1436 1316:.\Generated_Source\PSoC5/BL.c **** *\r
1437 1317:.\Generated_Source\PSoC5/BL.c **** * Return:\r
1438 1318:.\Generated_Source\PSoC5/BL.c **** *  None\r
1439 1319:.\Generated_Source\PSoC5/BL.c **** *\r
1440 1320:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
1441 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 25\r
1442 \r
1443 \r
1444 1321:.\Generated_Source\PSoC5/BL.c **** void BL_SetFlashByte(uint32 address, uint8 runType) \r
1445 1322:.\Generated_Source\PSoC5/BL.c **** {\r
1446 1323:.\Generated_Source\PSoC5/BL.c ****     uint32 flsAddr = address - CYDEV_FLASH_BASE;\r
1447 1324:.\Generated_Source\PSoC5/BL.c ****     uint8  rowData[CYDEV_FLS_ROW_SIZE];\r
1448 1325:.\Generated_Source\PSoC5/BL.c **** \r
1449 1326:.\Generated_Source\PSoC5/BL.c ****     #if !(CY_PSOC4)\r
1450 1327:.\Generated_Source\PSoC5/BL.c ****         uint8 arrayId = ( uint8 )(flsAddr / CYDEV_FLS_SECTOR_SIZE);\r
1451 1328:.\Generated_Source\PSoC5/BL.c ****     #endif  /* !(CY_PSOC4) */\r
1452 1329:.\Generated_Source\PSoC5/BL.c **** \r
1453 1330:.\Generated_Source\PSoC5/BL.c ****     uint16 rowNum = ( uint16 )((flsAddr % CYDEV_FLS_SECTOR_SIZE) / CYDEV_FLS_ROW_SIZE);\r
1454 1331:.\Generated_Source\PSoC5/BL.c ****     uint32 baseAddr = address - (address % CYDEV_FLS_ROW_SIZE);\r
1455 1332:.\Generated_Source\PSoC5/BL.c ****     uint16 idx;\r
1456 1333:.\Generated_Source\PSoC5/BL.c **** \r
1457 1334:.\Generated_Source\PSoC5/BL.c ****     for(idx = 0u; idx < CYDEV_FLS_ROW_SIZE; idx++)\r
1458 1335:.\Generated_Source\PSoC5/BL.c ****     {\r
1459 1336:.\Generated_Source\PSoC5/BL.c ****         rowData[idx] = BL_GET_CODE_BYTE(baseAddr + idx);\r
1460 1337:.\Generated_Source\PSoC5/BL.c ****     }\r
1461 1338:.\Generated_Source\PSoC5/BL.c **** \r
1462 1339:.\Generated_Source\PSoC5/BL.c ****     rowData[address % CYDEV_FLS_ROW_SIZE] = runType;\r
1463 1340:.\Generated_Source\PSoC5/BL.c **** \r
1464 1341:.\Generated_Source\PSoC5/BL.c ****     #if(CY_PSOC4)\r
1465 1342:.\Generated_Source\PSoC5/BL.c ****         (void) CySysFlashWriteRow((uint32) rowNum, rowData);\r
1466 1343:.\Generated_Source\PSoC5/BL.c ****     #else\r
1467 1344:.\Generated_Source\PSoC5/BL.c ****         (void) CyWriteRowData(arrayId, rowNum, rowData);\r
1468 1345:.\Generated_Source\PSoC5/BL.c ****     #endif  /* (CY_PSOC4) */\r
1469 1346:.\Generated_Source\PSoC5/BL.c **** }\r
1470 1347:.\Generated_Source\PSoC5/BL.c **** \r
1471 1348:.\Generated_Source\PSoC5/BL.c **** \r
1472 1349:.\Generated_Source\PSoC5/BL.c **** /*******************************************************************************\r
1473 1350:.\Generated_Source\PSoC5/BL.c **** * Function Name: BL_GetMetadata\r
1474 1351:.\Generated_Source\PSoC5/BL.c **** ********************************************************************************\r
1475 1352:.\Generated_Source\PSoC5/BL.c **** *\r
1476 1353:.\Generated_Source\PSoC5/BL.c **** * Summary:\r
1477 1354:.\Generated_Source\PSoC5/BL.c **** *  Returns value of the multi-byte field.\r
1478 1355:.\Generated_Source\PSoC5/BL.c **** *\r
1479 1356:.\Generated_Source\PSoC5/BL.c **** * Parameters:\r
1480 1357:.\Generated_Source\PSoC5/BL.c **** *  fieldName:\r
1481 1358:.\Generated_Source\PSoC5/BL.c **** *   The field to get data from:\r
1482 1359:.\Generated_Source\PSoC5/BL.c **** *     BL_GET_METADATA_BTLDB_ADDR\r
1483 1360:.\Generated_Source\PSoC5/BL.c **** *     BL_GET_METADATA_BTLDR_LAST_ROW\r
1484 1361:.\Generated_Source\PSoC5/BL.c **** *     BL_GET_METADATA_BTLDB_LENGTH\r
1485 1362:.\Generated_Source\PSoC5/BL.c **** *     BL_GET_METADATA_BTLDR_APP_VERSION\r
1486 1363:.\Generated_Source\PSoC5/BL.c **** *     BL_GET_METADATA_BTLDB_APP_VERSION\r
1487 1364:.\Generated_Source\PSoC5/BL.c **** *     BL_GET_METADATA_BTLDB_APP_ID\r
1488 1365:.\Generated_Source\PSoC5/BL.c **** *     BL_GET_METADATA_BTLDB_APP_CUST_ID\r
1489 1366:.\Generated_Source\PSoC5/BL.c **** *\r
1490 1367:.\Generated_Source\PSoC5/BL.c **** *  appId:\r
1491 1368:.\Generated_Source\PSoC5/BL.c **** *   Number of the bootlodable application.\r
1492 1369:.\Generated_Source\PSoC5/BL.c **** *\r
1493 1370:.\Generated_Source\PSoC5/BL.c **** * Return:\r
1494 1371:.\Generated_Source\PSoC5/BL.c **** *  None\r
1495 1372:.\Generated_Source\PSoC5/BL.c **** *\r
1496 1373:.\Generated_Source\PSoC5/BL.c **** *******************************************************************************/\r
1497 1374:.\Generated_Source\PSoC5/BL.c **** static uint32 BL_GetMetadata(uint8 fieldName, uint8 appId)\r
1498   49                            .loc 1 1374 0\r
1499   50                            .cfi_startproc\r
1500   51                            @ args = 0, pretend = 0, frame = 0\r
1501 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 26\r
1502 \r
1503 \r
1504   52                            @ frame_needed = 0, uses_anonymous_args = 0\r
1505   53                    .LVL1:\r
1506 1375:.\Generated_Source\PSoC5/BL.c **** {\r
1507 1376:.\Generated_Source\PSoC5/BL.c ****     uint32 fieldPtr;\r
1508 1377:.\Generated_Source\PSoC5/BL.c ****     uint8  fieldSize = 2u;\r
1509 1378:.\Generated_Source\PSoC5/BL.c ****     uint32 result;\r
1510 1379:.\Generated_Source\PSoC5/BL.c **** \r
1511 1380:.\Generated_Source\PSoC5/BL.c ****     switch (fieldName)\r
1512   54                            .loc 1 1380 0\r
1513   55 0000 431E                  subs    r3, r0, #1\r
1514 1374:.\Generated_Source\PSoC5/BL.c **** static uint32 BL_GetMetadata(uint8 fieldName, uint8 appId)\r
1515   56                            .loc 1 1374 0\r
1516   57 0002 10B5                  push    {r4, lr}\r
1517   58                    .LCFI0:\r
1518   59                            .cfi_def_cfa_offset 8\r
1519   60                            .cfi_offset 4, -8\r
1520   61                            .cfi_offset 14, -4\r
1521 1374:.\Generated_Source\PSoC5/BL.c **** static uint32 BL_GetMetadata(uint8 fieldName, uint8 appId)\r
1522   62                            .loc 1 1374 0\r
1523   63 0004 0246                  mov     r2, r0\r
1524   64                            .loc 1 1380 0\r
1525   65 0006 062B                  cmp     r3, #6\r
1526   66 0008 0DD8                  bhi     .L3\r
1527   67 000a DFE803F0              tbb     [pc, r3]\r
1528   68                    .L11:\r
1529   69 000e 06                    .byte   (.L4-.L11)/2\r
1530   70 000f 0E                    .byte   (.L16-.L11)/2\r
1531   71 0010 23                    .byte   (.L17-.L11)/2\r
1532   72 0011 04                    .byte   (.L7-.L11)/2\r
1533   73 0012 08                    .byte   (.L8-.L11)/2\r
1534   74 0013 0A                    .byte   (.L9-.L11)/2\r
1535   75 0014 21                    .byte   (.L10-.L11)/2\r
1536   76 0015 00                    .align  1\r
1537   77                    .L7:\r
1538 1381:.\Generated_Source\PSoC5/BL.c ****     {\r
1539 1382:.\Generated_Source\PSoC5/BL.c ****     case BL_GET_METADATA_BTLDB_APP_CUST_ID:\r
1540 1383:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = BL_MD_BTLDB_APP_CUST_ID_OFFSET(appId);\r
1541 1384:.\Generated_Source\PSoC5/BL.c ****         fieldSize = 4u;\r
1542 1385:.\Generated_Source\PSoC5/BL.c ****         break;\r
1543 1386:.\Generated_Source\PSoC5/BL.c **** \r
1544 1387:.\Generated_Source\PSoC5/BL.c ****     case BL_GET_METADATA_BTLDR_APP_VERSION:\r
1545 1388:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = BL_MD_BTLDR_APP_VERSION_OFFSET(appId);\r
1546   78                            .loc 1 1388 0\r
1547   79 0016 1648                  ldr     r0, .L26\r
1548   80                    .LVL2:\r
1549   81 0018 08E0                  b       .L5\r
1550   82                    .LVL3:\r
1551   83                    .L4:\r
1552 1389:.\Generated_Source\PSoC5/BL.c ****         break;\r
1553 1390:.\Generated_Source\PSoC5/BL.c **** \r
1554 1391:.\Generated_Source\PSoC5/BL.c ****     case BL_GET_METADATA_BTLDB_ADDR:\r
1555 1392:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = BL_MD_BTLDB_ADDR_OFFSET(appId);\r
1556   84                            .loc 1 1392 0\r
1557   85 001a 164B                  ldr     r3, .L26+4\r
1558   86 001c 1BE0                  b       .L6\r
1559   87                    .L8:\r
1560   88                    .LVL4:\r
1561 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 27\r
1562 \r
1563 \r
1564 1393:.\Generated_Source\PSoC5/BL.c ****     #if(!CY_PSOC3)\r
1565 1394:.\Generated_Source\PSoC5/BL.c ****         fieldSize = 4u;\r
1566 1395:.\Generated_Source\PSoC5/BL.c ****     #endif  /* (!CY_PSOC3) */\r
1567 1396:.\Generated_Source\PSoC5/BL.c ****         break;\r
1568 1397:.\Generated_Source\PSoC5/BL.c **** \r
1569 1398:.\Generated_Source\PSoC5/BL.c ****     case BL_GET_METADATA_BTLDR_LAST_ROW:\r
1570 1399:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = BL_MD_BTLDR_LAST_ROW_OFFSET(appId);\r
1571 1400:.\Generated_Source\PSoC5/BL.c ****         break;\r
1572 1401:.\Generated_Source\PSoC5/BL.c **** \r
1573 1402:.\Generated_Source\PSoC5/BL.c ****     case BL_GET_METADATA_BTLDB_LENGTH:\r
1574 1403:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = BL_MD_BTLDB_LENGTH_OFFSET(appId);\r
1575 1404:.\Generated_Source\PSoC5/BL.c ****     #if(!CY_PSOC3)\r
1576 1405:.\Generated_Source\PSoC5/BL.c ****         fieldSize = 4u;\r
1577 1406:.\Generated_Source\PSoC5/BL.c ****     #endif  /* (!CY_PSOC3) */\r
1578 1407:.\Generated_Source\PSoC5/BL.c ****         break;\r
1579 1408:.\Generated_Source\PSoC5/BL.c **** \r
1580 1409:.\Generated_Source\PSoC5/BL.c ****     case BL_GET_METADATA_BTLDB_APP_VERSION:\r
1581 1410:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = BL_MD_BTLDB_APP_VERSION_OFFSET(appId);\r
1582   89                            .loc 1 1410 0\r
1583   90 001e 1648                  ldr     r0, .L26+8\r
1584   91                    .LVL5:\r
1585   92 0020 04E0                  b       .L5\r
1586   93                    .LVL6:\r
1587   94                    .L9:\r
1588 1411:.\Generated_Source\PSoC5/BL.c ****         break;\r
1589 1412:.\Generated_Source\PSoC5/BL.c **** \r
1590 1413:.\Generated_Source\PSoC5/BL.c ****     case BL_GET_METADATA_BTLDB_APP_ID:\r
1591 1414:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = BL_MD_BTLDB_APP_ID_OFFSET(appId);\r
1592   95                            .loc 1 1414 0\r
1593   96 0022 1648                  ldr     r0, .L26+12\r
1594   97                    .LVL7:\r
1595   98 0024 02E0                  b       .L5\r
1596   99                    .LVL8:\r
1597  100                    .L3:\r
1598 1415:.\Generated_Source\PSoC5/BL.c ****         break;\r
1599 1416:.\Generated_Source\PSoC5/BL.c **** \r
1600 1417:.\Generated_Source\PSoC5/BL.c ****     default:\r
1601 1418:.\Generated_Source\PSoC5/BL.c ****         /* Should never be here */\r
1602 1419:.\Generated_Source\PSoC5/BL.c ****         CYASSERT(0u != 0u);\r
1603 1420:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = 0u;\r
1604  101                            .loc 1 1420 0\r
1605  102 0026 0020                  movs    r0, #0\r
1606  103                    .LVL9:\r
1607  104 0028 00E0                  b       .L5\r
1608  105                    .LVL10:\r
1609  106                    .L16:\r
1610 1399:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = BL_MD_BTLDR_LAST_ROW_OFFSET(appId);\r
1611  107                            .loc 1 1399 0\r
1612  108 002a 1548                  ldr     r0, .L26+16\r
1613  109                    .LVL11:\r
1614  110                    .L5:\r
1615 1421:.\Generated_Source\PSoC5/BL.c ****         break;\r
1616 1422:.\Generated_Source\PSoC5/BL.c ****     }\r
1617 1423:.\Generated_Source\PSoC5/BL.c **** \r
1618 1424:.\Generated_Source\PSoC5/BL.c **** \r
1619 1425:.\Generated_Source\PSoC5/BL.c ****     /* Read all fields as big-endian */\r
1620 1426:.\Generated_Source\PSoC5/BL.c ****     if (2u == fieldSize)\r
1621 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 28\r
1622 \r
1623 \r
1624 1427:.\Generated_Source\PSoC5/BL.c ****     {\r
1625 1428:.\Generated_Source\PSoC5/BL.c ****         result =  (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr + 1u));\r
1626  111                            .loc 1 1428 0\r
1627  112 002c 4178                  ldrb    r1, [r0, #1]    @ zero_extendqisi2\r
1628  113                    .LVL12:\r
1629 1429:.\Generated_Source\PSoC5/BL.c ****         result |= (uint32) CY_GET_XTND_REG8((volatile uint8 *) fieldPtr      ) <<  8u;\r
1630  114                            .loc 1 1429 0\r
1631  115 002e 0078                  ldrb    r0, [r0, #0]    @ zero_extendqisi2\r
1632  116                    .LVL13:\r
1633  117 0030 41EA0020              orr     r0, r1, r0, lsl #8\r
1634  118                    .LVL14:\r
1635  119                    .L15:\r
1636 1430:.\Generated_Source\PSoC5/BL.c ****     }\r
1637 1431:.\Generated_Source\PSoC5/BL.c ****     else\r
1638 1432:.\Generated_Source\PSoC5/BL.c ****     {\r
1639 1433:.\Generated_Source\PSoC5/BL.c ****         result =  (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr + 3u));\r
1640 1434:.\Generated_Source\PSoC5/BL.c ****         result |= (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr + 2u)) <<  8u;\r
1641 1435:.\Generated_Source\PSoC5/BL.c ****         result |= (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr + 1u)) << 16u;\r
1642 1436:.\Generated_Source\PSoC5/BL.c ****         result |= (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr     )) << 24u;\r
1643 1437:.\Generated_Source\PSoC5/BL.c ****     }\r
1644 1438:.\Generated_Source\PSoC5/BL.c **** \r
1645 1439:.\Generated_Source\PSoC5/BL.c ****     /* Following fields should be little-endian */\r
1646 1440:.\Generated_Source\PSoC5/BL.c **** #if(!CY_PSOC3)\r
1647 1441:.\Generated_Source\PSoC5/BL.c ****     switch (fieldName)\r
1648  120                            .loc 1 1441 0\r
1649  121 0034 022A                  cmp     r2, #2\r
1650  122 0036 04D0                  beq     .L14\r
1651  123 0038 032A                  cmp     r2, #3\r
1652  124 003a 07D0                  beq     .L13\r
1653  125 003c 012A                  cmp     r2, #1\r
1654  126 003e 15D1                  bne     .L24\r
1655  127 0040 04E0                  b       .L13\r
1656  128                    .L14:\r
1657 1442:.\Generated_Source\PSoC5/BL.c ****     {\r
1658 1443:.\Generated_Source\PSoC5/BL.c ****     case BL_GET_METADATA_BTLDR_LAST_ROW:\r
1659 1444:.\Generated_Source\PSoC5/BL.c ****         result = CYSWAP_ENDIAN16(result);\r
1660  129                            .loc 1 1444 0\r
1661  130 0042 0202                  lsls    r2, r0, #8\r
1662  131 0044 42EA1023              orr     r3, r2, r0, lsr #8\r
1663  132 0048 98B2                  uxth    r0, r3\r
1664  133                    .LVL15:\r
1665  134 004a 10BD                  pop     {r4, pc}\r
1666  135                    .L13:\r
1667  136 004c 00BA                  rev     r0, r0\r
1668  137                    .LVL16:\r
1669  138 004e 10BD                  pop     {r4, pc}\r
1670  139                    .LVL17:\r
1671  140                    .L10:\r
1672 1383:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = BL_MD_BTLDB_APP_CUST_ID_OFFSET(appId);\r
1673  141                            .loc 1 1383 0\r
1674  142 0050 0C4B                  ldr     r3, .L26+20\r
1675  143 0052 00E0                  b       .L6\r
1676  144                    .L17:\r
1677 1403:.\Generated_Source\PSoC5/BL.c ****         fieldPtr  = BL_MD_BTLDB_LENGTH_OFFSET(appId);\r
1678  145                            .loc 1 1403 0\r
1679  146 0054 0C4B                  ldr     r3, .L26+24\r
1680  147                    .L6:\r
1681 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 29\r
1682 \r
1683 \r
1684  148                    .LVL18:\r
1685 1433:.\Generated_Source\PSoC5/BL.c ****         result =  (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr + 3u));\r
1686  149                            .loc 1 1433 0\r
1687  150 0056 D878                  ldrb    r0, [r3, #3]    @ zero_extendqisi2\r
1688  151                    .LVL19:\r
1689 1434:.\Generated_Source\PSoC5/BL.c ****         result |= (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr + 2u)) <<  8u;\r
1690  152                            .loc 1 1434 0\r
1691  153 0058 9C78                  ldrb    r4, [r3, #2]    @ zero_extendqisi2\r
1692  154                    .LVL20:\r
1693 1435:.\Generated_Source\PSoC5/BL.c ****         result |= (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr + 1u)) << 16u;\r
1694  155                            .loc 1 1435 0\r
1695  156 005a 5978                  ldrb    r1, [r3, #1]    @ zero_extendqisi2\r
1696  157                    .LVL21:\r
1697 1436:.\Generated_Source\PSoC5/BL.c ****         result |= (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr     )) << 24u;\r
1698  158                            .loc 1 1436 0\r
1699  159 005c 1B78                  ldrb    r3, [r3, #0]    @ zero_extendqisi2\r
1700  160                    .LVL22:\r
1701 1434:.\Generated_Source\PSoC5/BL.c ****         result |= (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr + 2u)) <<  8u;\r
1702  161                            .loc 1 1434 0\r
1703  162 005e 40EA0360              orr     r0, r0, r3, lsl #24\r
1704  163                    .LVL23:\r
1705 1435:.\Generated_Source\PSoC5/BL.c ****         result |= (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr + 1u)) << 16u;\r
1706  164                            .loc 1 1435 0\r
1707  165 0062 40EA0423              orr     r3, r0, r4, lsl #8\r
1708 1436:.\Generated_Source\PSoC5/BL.c ****         result |= (uint32) CY_GET_XTND_REG8((volatile uint8 *)(fieldPtr     )) << 24u;\r
1709  166                            .loc 1 1436 0\r
1710  167 0066 43EA0140              orr     r0, r3, r1, lsl #16\r
1711  168                    .LVL24:\r
1712  169 006a E3E7                  b       .L15\r
1713  170                    .LVL25:\r
1714  171                    .L24:\r
1715 1445:.\Generated_Source\PSoC5/BL.c ****         break;\r
1716 1446:.\Generated_Source\PSoC5/BL.c **** \r
1717 1447:.\Generated_Source\PSoC5/BL.c ****     case BL_GET_METADATA_BTLDB_ADDR:\r
1718 1448:.\Generated_Source\PSoC5/BL.c ****     case BL_GET_METADATA_BTLDB_LENGTH:\r
1719 1449:.\Generated_Source\PSoC5/BL.c ****         result = CYSWAP_ENDIAN32(result);\r
1720 1450:.\Generated_Source\PSoC5/BL.c ****         break;\r
1721 1451:.\Generated_Source\PSoC5/BL.c **** \r
1722 1452:.\Generated_Source\PSoC5/BL.c ****     default:\r
1723 1453:.\Generated_Source\PSoC5/BL.c ****         break;\r
1724 1454:.\Generated_Source\PSoC5/BL.c ****     }\r
1725 1455:.\Generated_Source\PSoC5/BL.c **** \r
1726 1456:.\Generated_Source\PSoC5/BL.c **** #endif  /* (!CY_PSOC3) */\r
1727 1457:.\Generated_Source\PSoC5/BL.c **** \r
1728 1458:.\Generated_Source\PSoC5/BL.c ****     return (result);\r
1729 1459:.\Generated_Source\PSoC5/BL.c **** }\r
1730  172                            .loc 1 1459 0\r
1731  173 006c 10BD                  pop     {r4, pc}\r
1732  174                    .L27:\r
1733  175 006e 00BF                  .align  2\r
1734  176                    .L26:\r
1735  177 0070 D2FF0100              .word   131026\r
1736  178 0074 C1FF0100              .word   131009\r
1737  179 0078 D6FF0100              .word   131030\r
1738  180 007c D4FF0100              .word   131028\r
1739  181 0080 C5FF0100              .word   131013\r
1740  182 0084 D8FF0100              .word   131032\r
1741 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 30\r
1742 \r
1743 \r
1744  183 0088 C9FF0100              .word   131017\r
1745  184                            .cfi_endproc\r
1746  185                    .LFE69:\r
1747  186                            .size   BL_GetMetadata.constprop.1, .-BL_GetMetadata.constprop.1\r
1748  187                            .section        .text.BL_ValidateBootloadable.constprop.0,"ax",%progbits\r
1749  188                            .align  1\r
1750  189                            .thumb\r
1751  190                            .thumb_func\r
1752  191                            .type   BL_ValidateBootloadable.constprop.0, %function\r
1753  192                    BL_ValidateBootloadable.constprop.0:\r
1754  193                    .LFB70:\r
1755  501:.\Generated_Source\PSoC5/BL.c **** static cystatus BL_ValidateBootloadable(uint8 appId) CYSMALL \\r
1756  194                            .loc 1 501 0\r
1757  195                            .cfi_startproc\r
1758  196                            @ args = 0, pretend = 0, frame = 0\r
1759  197                            @ frame_needed = 0, uses_anonymous_args = 0\r
1760  198                    .LVL26:\r
1761  199 0000 70B5                  push    {r4, r5, r6, lr}\r
1762  200                    .LCFI1:\r
1763  201                            .cfi_def_cfa_offset 16\r
1764  202                            .cfi_offset 4, -16\r
1765  203                            .cfi_offset 5, -12\r
1766  204                            .cfi_offset 6, -8\r
1767  205                            .cfi_offset 14, -4\r
1768  506:.\Generated_Source\PSoC5/BL.c ****         uint32 CYDATA end   = BL_FIRST_APP_BYTE(appId) +\r
1769  206                            .loc 1 506 0\r
1770  207 0002 0220                  movs    r0, #2\r
1771  208 0004 FFF7FEFF              bl      BL_GetMetadata.constprop.1\r
1772  209                    .LVL27:\r
1773  210 0008 0646                  mov     r6, r0\r
1774  507:.\Generated_Source\PSoC5/BL.c ****                                 BL_GetMetadata(BL_GET_METADATA_BTLDB_LENGTH,\r
1775  211                            .loc 1 507 0\r
1776  212 000a 0320                  movs    r0, #3\r
1777  213 000c FFF7FEFF              bl      BL_GetMetadata.constprop.1\r
1778  214                    .LVL28:\r
1779  506:.\Generated_Source\PSoC5/BL.c ****         uint32 CYDATA end   = BL_FIRST_APP_BYTE(appId) +\r
1780  215                            .loc 1 506 0\r
1781  216 0010 711C                  adds    r1, r6, #1\r
1782  217 0012 00EB0126              add     r6, r0, r1, lsl #8\r
1783  218                    .LVL29:\r
1784  535:.\Generated_Source\PSoC5/BL.c ****         for(idx = BL_FIRST_APP_BYTE(appId); idx < end; ++idx)\r
1785  219                            .loc 1 535 0\r
1786  220 0016 0220                  movs    r0, #2\r
1787  221 0018 FFF7FEFF              bl      BL_GetMetadata.constprop.1\r
1788  222                    .LVL30:\r
1789  511:.\Generated_Source\PSoC5/BL.c ****         uint8  CYDATA calcedChecksum = 0u;\r
1790  223                            .loc 1 511 0\r
1791  224 001c 0024                  movs    r4, #0\r
1792  535:.\Generated_Source\PSoC5/BL.c ****         for(idx = BL_FIRST_APP_BYTE(appId); idx < end; ++idx)\r
1793  225                            .loc 1 535 0\r
1794  226 001e 0130                  adds    r0, r0, #1\r
1795  227 0020 0102                  lsls    r1, r0, #8\r
1796  228                    .LVL31:\r
1797  510:.\Generated_Source\PSoC5/BL.c ****         CYBIT         valid = 0u; /* Assume bad flash image */\r
1798  229                            .loc 1 510 0\r
1799  230 0022 2546                  mov     r5, r4\r
1800  231                    .LVL32:\r
1801 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 31\r
1802 \r
1803 \r
1804  232                    .L29:\r
1805  535:.\Generated_Source\PSoC5/BL.c ****         for(idx = BL_FIRST_APP_BYTE(appId); idx < end; ++idx)\r
1806  233                            .loc 1 535 0\r
1807  234 0024 B142                  cmp     r1, r6\r
1808  235 0026 09D2                  bcs     .L44\r
1809  236                    .L31:\r
1810  237                    .LBB3:\r
1811  537:.\Generated_Source\PSoC5/BL.c ****             uint8 CYDATA curByte = BL_GET_CODE_BYTE(idx);\r
1812  238                            .loc 1 537 0\r
1813  239 0028 11F8010B              ldrb    r0, [r1], #1    @ zero_extendqisi2\r
1814  240                    .LVL33:\r
1815  539:.\Generated_Source\PSoC5/BL.c ****             if((curByte != 0u) && (curByte != 0xFFu))\r
1816  241                            .loc 1 539 0\r
1817  242 002c 421E                  subs    r2, r0, #1\r
1818  243 002e D3B2                  uxtb    r3, r2\r
1819  544:.\Generated_Source\PSoC5/BL.c ****             calcedChecksum += curByte;\r
1820  244                            .loc 1 544 0\r
1821  245 0030 0419                  adds    r4, r0, r4\r
1822  246                    .LVL34:\r
1823  541:.\Generated_Source\PSoC5/BL.c ****                 valid = 1u;\r
1824  247                            .loc 1 541 0\r
1825  248 0032 FD2B                  cmp     r3, #253\r
1826  249 0034 98BF                  it      ls\r
1827  250 0036 0125                  movls   r5, #1\r
1828  251                    .LVL35:\r
1829  544:.\Generated_Source\PSoC5/BL.c ****             calcedChecksum += curByte;\r
1830  252                            .loc 1 544 0\r
1831  253 0038 E4B2                  uxtb    r4, r4\r
1832  254                    .LVL36:\r
1833  255 003a F3E7                  b       .L29\r
1834  256                    .LVL37:\r
1835  257                    .L44:\r
1836  258                    .LBE3:\r
1837  558:.\Generated_Source\PSoC5/BL.c ****             idx = ((BL_FIRST_APP_BYTE(appId)) >> 3u);\r
1838  259                            .loc 1 558 0\r
1839  260 003c 0220                  movs    r0, #2\r
1840  261 003e FFF7FEFF              bl      BL_GetMetadata.constprop.1\r
1841  262                    .LVL38:\r
1842  563:.\Generated_Source\PSoC5/BL.c ****                 : (end >> 3u);\r
1843  263                            .loc 1 563 0\r
1844  264 0042 0F49                  ldr     r1, .L46\r
1845  558:.\Generated_Source\PSoC5/BL.c ****             idx = ((BL_FIRST_APP_BYTE(appId)) >> 3u);\r
1846  265                            .loc 1 558 0\r
1847  266 0044 421C                  adds    r2, r0, #1\r
1848  267 0046 1302                  lsls    r3, r2, #8\r
1849  268 0048 DB08                  lsrs    r3, r3, #3\r
1850  269                    .LVL39:\r
1851  563:.\Generated_Source\PSoC5/BL.c ****                 : (end >> 3u);\r
1852  270                            .loc 1 563 0\r
1853  271 004a 8E42                  cmp     r6, r1\r
1854  272 004c 01D0                  beq     .L39\r
1855  273 004e F608                  lsrs    r6, r6, #3\r
1856  274                    .LVL40:\r
1857  275 0050 01E0                  b       .L43\r
1858  276                    .LVL41:\r
1859  277                    .L39:\r
1860  278 0052 4FF48046              mov     r6, #16384\r
1861 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 32\r
1862 \r
1863 \r
1864  279                    .LVL42:\r
1865  280                    .L43:\r
1866  565:.\Generated_Source\PSoC5/BL.c ****             for (; idx < end; ++idx)\r
1867  281                            .loc 1 565 0\r
1868  282 0056 B342                  cmp     r3, r6\r
1869  283 0058 06D2                  bcs     .L45\r
1870  284                    .L34:\r
1871  501:.\Generated_Source\PSoC5/BL.c **** static cystatus BL_ValidateBootloadable(uint8 appId) CYSMALL \\r
1872  285                            .loc 1 501 0\r
1873  286 005a 03F19041              add     r1, r3, #1207959552\r
1874  567:.\Generated_Source\PSoC5/BL.c ****                 calcedChecksum += CY_GET_XTND_REG8((volatile uint8 *)(CYDEV_ECC_BASE + idx));\r
1875  287                            .loc 1 567 0\r
1876  288 005e 0878                  ldrb    r0, [r1, #0]    @ zero_extendqisi2\r
1877  565:.\Generated_Source\PSoC5/BL.c ****             for (; idx < end; ++idx)\r
1878  289                            .loc 1 565 0\r
1879  290 0060 0133                  adds    r3, r3, #1\r
1880  291                    .LVL43:\r
1881  567:.\Generated_Source\PSoC5/BL.c ****                 calcedChecksum += CY_GET_XTND_REG8((volatile uint8 *)(CYDEV_ECC_BASE + idx));\r
1882  292                            .loc 1 567 0\r
1883  293 0062 0219                  adds    r2, r0, r4\r
1884  294 0064 D4B2                  uxtb    r4, r2\r
1885  295                    .LVL44:\r
1886  296 0066 F6E7                  b       .L43\r
1887  297                    .LVL45:\r
1888  298                    .L45:\r
1889  575:.\Generated_Source\PSoC5/BL.c ****         if((calcedChecksum != BL_MD_BTLDB_CHECKSUM_VALUE(appId)) ||\r
1890  299                            .loc 1 575 0\r
1891  300 0068 0548                  ldr     r0, .L46\r
1892  573:.\Generated_Source\PSoC5/BL.c ****         calcedChecksum = ( uint8 )1u + ( uint8 )(~calcedChecksum);\r
1893  301                            .loc 1 573 0\r
1894  302 006a 6442                  negs    r4, r4\r
1895  303                    .LVL46:\r
1896  575:.\Generated_Source\PSoC5/BL.c ****         if((calcedChecksum != BL_MD_BTLDB_CHECKSUM_VALUE(appId)) ||\r
1897  304                            .loc 1 575 0\r
1898  305 006c 0278                  ldrb    r2, [r0, #0]    @ zero_extendqisi2\r
1899  306 006e E4B2                  uxtb    r4, r4\r
1900  307                    .LVL47:\r
1901  308 0070 9442                  cmp     r4, r2\r
1902  309 0072 01D0                  beq     .L35\r
1903  310                    .L37:\r
1904  578:.\Generated_Source\PSoC5/BL.c ****             return(CYRET_BAD_DATA);\r
1905  311                            .loc 1 578 0\r
1906  312 0074 0620                  movs    r0, #6\r
1907  313 0076 70BD                  pop     {r4, r5, r6, pc}\r
1908  314                    .L35:\r
1909  575:.\Generated_Source\PSoC5/BL.c ****         if((calcedChecksum != BL_MD_BTLDB_CHECKSUM_VALUE(appId)) ||\r
1910  315                            .loc 1 575 0\r
1911  316 0078 002D                  cmp     r5, #0\r
1912  317 007a FBD0                  beq     .L37\r
1913  588:.\Generated_Source\PSoC5/BL.c ****         return(CYRET_SUCCESS);\r
1914  318                            .loc 1 588 0\r
1915  319 007c 0020                  movs    r0, #0\r
1916  589:.\Generated_Source\PSoC5/BL.c **** }\r
1917  320                            .loc 1 589 0\r
1918  321 007e 70BD                  pop     {r4, r5, r6, pc}\r
1919  322                    .L47:\r
1920  323                            .align  2\r
1921 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 33\r
1922 \r
1923 \r
1924  324                    .L46:\r
1925  325 0080 C0FF0100              .word   131008\r
1926  326                            .cfi_endproc\r
1927  327                    .LFE70:\r
1928  328                            .size   BL_ValidateBootloadable.constprop.0, .-BL_ValidateBootloadable.constprop.0\r
1929  329                            .section        .text.BL_HostLink,"ax",%progbits\r
1930  330                            .align  1\r
1931  331                            .thumb\r
1932  332                            .thumb_func\r
1933  333                            .type   BL_HostLink, %function\r
1934  334                    BL_HostLink:\r
1935  335                    .LFB64:\r
1936  611:.\Generated_Source\PSoC5/BL.c **** {\r
1937  336                            .loc 1 611 0\r
1938  337                            .cfi_startproc\r
1939  338                            @ args = 0, pretend = 0, frame = 896\r
1940  339                            @ frame_needed = 0, uses_anonymous_args = 0\r
1941  340                    .LVL48:\r
1942  341 0000 2DE9F04F              push    {r4, r5, r6, r7, r8, r9, sl, fp, lr}\r
1943  342                    .LCFI2:\r
1944  343                            .cfi_def_cfa_offset 36\r
1945  344                            .cfi_offset 4, -36\r
1946  345                            .cfi_offset 5, -32\r
1947  346                            .cfi_offset 6, -28\r
1948  347                            .cfi_offset 7, -24\r
1949  348                            .cfi_offset 8, -20\r
1950  349                            .cfi_offset 9, -16\r
1951  350                            .cfi_offset 10, -12\r
1952  351                            .cfi_offset 11, -8\r
1953  352                            .cfi_offset 14, -4\r
1954  353 0004 ADF5617D              sub     sp, sp, #900\r
1955  354                    .LCFI3:\r
1956  355                            .cfi_def_cfa_offset 936\r
1957  611:.\Generated_Source\PSoC5/BL.c **** {\r
1958  356                            .loc 1 611 0\r
1959  357 0008 8046                  mov     r8, r0\r
1960  632:.\Generated_Source\PSoC5/BL.c ****     CyBtldrCommStart();\r
1961  358                            .loc 1 632 0\r
1962  359 000a FFF7FEFF              bl      USBFS_CyBtldrCommStart\r
1963  360                    .LVL49:\r
1964  635:.\Generated_Source\PSoC5/BL.c ****     CyGlobalIntEnable;\r
1965  361                            .loc 1 635 0\r
1966  362                    @ 635 ".\Generated_Source\PSoC5\BL.c" 1\r
1967  363 000e 62B6                  CPSIE   i\r
1968  364                    @ 0 "" 2\r
1969  625:.\Generated_Source\PSoC5/BL.c ****     CYBIT     communicationState = BL_COMMUNICATION_STATE_IDLE;\r
1970  365                            .loc 1 625 0\r
1971  366                            .thumb\r
1972  367 0010 0026                  movs    r6, #0\r
1973  622:.\Generated_Source\PSoC5/BL.c ****         uint8 CYDATA clearedMetaData = 0u;\r
1974  368                            .loc 1 622 0\r
1975  369 0012 B246                  mov     sl, r6\r
1976  619:.\Generated_Source\PSoC5/BL.c ****     uint8     CYDATA timeOutCnt = 10u;\r
1977  370                            .loc 1 619 0\r
1978  371 0014 4FF00A09              mov     r9, #10\r
1979  618:.\Generated_Source\PSoC5/BL.c ****     uint16    CYDATA dataOffset = 0u;\r
1980  372                            .loc 1 618 0\r
1981 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 34\r
1982 \r
1983 \r
1984  373 0018 3746                  mov     r7, r6\r
1985  374                    .LVL50:\r
1986  375                    .L128:\r
1987  643:.\Generated_Source\PSoC5/BL.c ****             readStat = CyBtldrCommRead(packetBuffer,\r
1988  376                            .loc 1 643 0\r
1989  377 001a B8F1000F              cmp     r8, #0\r
1990  378 001e 01D1                  bne     .L86\r
1991  379                    .LVL51:\r
1992  380                    .L112:\r
1993  381 0020 FF23                  movs    r3, #255\r
1994  382 0022 00E0                  b       .L50\r
1995  383                    .LVL52:\r
1996  384                    .L86:\r
1997  385 0024 4346                  mov     r3, r8\r
1998  386                    .LVL53:\r
1999  387                    .L50:\r
2000  643:.\Generated_Source\PSoC5/BL.c ****             readStat = CyBtldrCommRead(packetBuffer,\r
2001  388                            .loc 1 643 0 is_stmt 0 discriminator 3\r
2002  389 0026 4AA8                  add     r0, sp, #296\r
2003  390 0028 4FF49671              mov     r1, #300\r
2004  391 002c 01AA                  add     r2, sp, #4\r
2005  392 002e FFF7FEFF              bl      USBFS_CyBtldrCommRead\r
2006  393                    .LVL54:\r
2007  647:.\Generated_Source\PSoC5/BL.c ****             if (0u != timeOut)\r
2008  394                            .loc 1 647 0 is_stmt 1 discriminator 3\r
2009  395 0032 B8F1000F              cmp     r8, #0\r
2010  396 0036 03D0                  beq     .L51\r
2011  649:.\Generated_Source\PSoC5/BL.c ****                 timeOutCnt--;\r
2012  397                            .loc 1 649 0\r
2013  398 0038 09F1FF39              add     r9, r9, #-1\r
2014  399 003c 5FFA89F9              uxtb    r9, r9\r
2015  400                    .LVL55:\r
2016  401                    .L51:\r
2017  652:.\Generated_Source\PSoC5/BL.c ****         } while ( (0u != timeOutCnt) && (readStat != CYRET_SUCCESS) );\r
2018  402                            .loc 1 652 0\r
2019  403 0040 B9F1000F              cmp     r9, #0\r
2020  404 0044 02D0                  beq     .L52\r
2021  652:.\Generated_Source\PSoC5/BL.c ****         } while ( (0u != timeOutCnt) && (readStat != CYRET_SUCCESS) );\r
2022  405                            .loc 1 652 0 is_stmt 0 discriminator 1\r
2023  406 0046 0028                  cmp     r0, #0\r
2024  407 0048 E7D1                  bne     .L128\r
2025  408 004a 01E0                  b       .L54\r
2026  409                    .L52:\r
2027  655:.\Generated_Source\PSoC5/BL.c ****         if( readStat != CYRET_SUCCESS )\r
2028  410                            .loc 1 655 0 is_stmt 1\r
2029  411 004c 0028                  cmp     r0, #0\r
2030  412 004e 71D1                  bne     .L55\r
2031  413                    .L54:\r
2032  660:.\Generated_Source\PSoC5/BL.c ****         if((numberRead < BL_MIN_PKT_SIZE) ||\r
2033  414                            .loc 1 660 0\r
2034  415 0050 BDF80420              ldrh    r2, [sp, #4]\r
2035  416 0054 062A                  cmp     r2, #6\r
2036  417 0056 40F27B81              bls     .L90\r
2037  660:.\Generated_Source\PSoC5/BL.c ****         if((numberRead < BL_MIN_PKT_SIZE) ||\r
2038  418                            .loc 1 660 0 is_stmt 0 discriminator 1\r
2039  419 005a 9DF82831              ldrb    r3, [sp, #296]  @ zero_extendqisi2\r
2040  420 005e 012B                  cmp     r3, #1\r
2041 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 35\r
2042 \r
2043 \r
2044  421 0060 40F07681              bne     .L90\r
2045  667:.\Generated_Source\PSoC5/BL.c ****             pktSize = ((uint16)((uint16)packetBuffer[BL_SIZE_ADDR + 1u] << 8u)) |\r
2046  422                            .loc 1 667 0 is_stmt 1\r
2047  423 0064 9DF82A01              ldrb    r0, [sp, #298]  @ zero_extendqisi2\r
2048  424                    .LVL56:\r
2049  425 0068 9DF82B51              ldrb    r5, [sp, #299]  @ zero_extendqisi2\r
2050  670:.\Generated_Source\PSoC5/BL.c ****             pktChecksum = ((uint16)((uint16)packetBuffer[BL_CHK_ADDR(pktSize) + 1u] << 8u)) |\r
2051  426                            .loc 1 670 0\r
2052  427 006c 4AA9                  add     r1, sp, #296\r
2053  667:.\Generated_Source\PSoC5/BL.c ****             pktSize = ((uint16)((uint16)packetBuffer[BL_SIZE_ADDR + 1u] << 8u)) |\r
2054  428                            .loc 1 667 0\r
2055  429 006e 40EA0525              orr     r5, r0, r5, lsl #8\r
2056  430                    .LVL57:\r
2057  673:.\Generated_Source\PSoC5/BL.c ****             if((pktSize + BL_MIN_PKT_SIZE) > numberRead)\r
2058  431                            .loc 1 673 0\r
2059  432 0072 EC1D                  adds    r4, r5, #7\r
2060  670:.\Generated_Source\PSoC5/BL.c ****             pktChecksum = ((uint16)((uint16)packetBuffer[BL_CHK_ADDR(pktSize) + 1u] << 8u)) |\r
2061  433                            .loc 1 670 0\r
2062  434 0074 4B19                  adds    r3, r1, r5\r
2063  673:.\Generated_Source\PSoC5/BL.c ****             if((pktSize + BL_MIN_PKT_SIZE) > numberRead)\r
2064  435                            .loc 1 673 0\r
2065  436 0076 9442                  cmp     r4, r2\r
2066  670:.\Generated_Source\PSoC5/BL.c ****             pktChecksum = ((uint16)((uint16)packetBuffer[BL_CHK_ADDR(pktSize) + 1u] << 8u)) |\r
2067  437                            .loc 1 670 0\r
2068  438 0078 5879                  ldrb    r0, [r3, #5]    @ zero_extendqisi2\r
2069  671:.\Generated_Source\PSoC5/BL.c ****                                    packetBuffer[BL_CHK_ADDR(pktSize)];\r
2070  439                            .loc 1 671 0\r
2071  440 007a 1979                  ldrb    r1, [r3, #4]    @ zero_extendqisi2\r
2072  441                    .LVL58:\r
2073  673:.\Generated_Source\PSoC5/BL.c ****             if((pktSize + BL_MIN_PKT_SIZE) > numberRead)\r
2074  442                            .loc 1 673 0\r
2075  443 007c 00F26681              bhi     .L89\r
2076  677:.\Generated_Source\PSoC5/BL.c ****             else if(packetBuffer[BL_EOP_ADDR(pktSize)] != BL_EOP)\r
2077  444                            .loc 1 677 0\r
2078  445 0080 9A79                  ldrb    r2, [r3, #6]    @ zero_extendqisi2\r
2079  446 0082 172A                  cmp     r2, #23\r
2080  447 0084 40F06481              bne     .L90\r
2081  681:.\Generated_Source\PSoC5/BL.c ****             else if(pktChecksum != BL_CalcPacketChecksum(packetBuffer,\r
2082  448                            .loc 1 681 0\r
2083  449 0088 2B1D                  adds    r3, r5, #4\r
2084  450 008a 9BB2                  uxth    r3, r3\r
2085  451                    .LVL59:\r
2086  157:.\Generated_Source\PSoC5/BL.c ****         uint16 CYDATA sum = 0u;\r
2087  452                            .loc 1 157 0\r
2088  453 008c 0022                  movs    r2, #0\r
2089  454                    .LVL60:\r
2090  455                    .L57:\r
2091  456                    .LBB20:\r
2092  457                    .LBB21:\r
2093  159:.\Generated_Source\PSoC5/BL.c ****         while (size > 0u)\r
2094  458                            .loc 1 159 0\r
2095  459 008e 3BB1                  cbz     r3, .L134\r
2096  460                    .L58:\r
2097  161:.\Generated_Source\PSoC5/BL.c ****             sum += buffer[size - 1u];\r
2098  461                            .loc 1 161 0\r
2099  462 0090 0DF22714              addw    r4, sp, #295\r
2100  463 0094 E45C                  ldrb    r4, [r4, r3]    @ zero_extendqisi2\r
2101 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 36\r
2102 \r
2103 \r
2104  162:.\Generated_Source\PSoC5/BL.c ****             size--;\r
2105  464                            .loc 1 162 0\r
2106  465 0096 013B                  subs    r3, r3, #1\r
2107  466                    .LVL61:\r
2108  161:.\Generated_Source\PSoC5/BL.c ****             sum += buffer[size - 1u];\r
2109  467                            .loc 1 161 0\r
2110  468 0098 1219                  adds    r2, r2, r4\r
2111  469                    .LVL62:\r
2112  470 009a 92B2                  uxth    r2, r2\r
2113  471                    .LVL63:\r
2114  162:.\Generated_Source\PSoC5/BL.c ****             size--;\r
2115  472                            .loc 1 162 0\r
2116  473 009c 9BB2                  uxth    r3, r3\r
2117  474                    .LVL64:\r
2118  475 009e F6E7                  b       .L57\r
2119  476                    .L134:\r
2120  165:.\Generated_Source\PSoC5/BL.c ****         return(( uint16 )1u + ( uint16 )(~sum));\r
2121  477                            .loc 1 165 0\r
2122  478 00a0 5242                  negs    r2, r2\r
2123  479                    .LVL65:\r
2124  480                    .LBE21:\r
2125  481                    .LBE20:\r
2126  681:.\Generated_Source\PSoC5/BL.c ****             else if(pktChecksum != BL_CalcPacketChecksum(packetBuffer,\r
2127  482                            .loc 1 681 0\r
2128  483 00a2 41EA0020              orr     r0, r1, r0, lsl #8\r
2129  484                    .LVL66:\r
2130  485 00a6 91B2                  uxth    r1, r2\r
2131  486                    .LVL67:\r
2132  487 00a8 8842                  cmp     r0, r1\r
2133  488 00aa 40F05381              bne     .L91\r
2134  489 00ae 4AE0                  b       .L135\r
2135  490                    .LVL68:\r
2136  491                    .L62:\r
2137  492                    .LBB22:\r
2138  761:.\Generated_Source\PSoC5/BL.c ****                     if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 1u))\r
2139  493                            .loc 1 761 0\r
2140  494 00b0 002E                  cmp     r6, #0\r
2141  495 00b2 00F04D81              beq     .L90\r
2142  761:.\Generated_Source\PSoC5/BL.c ****                     if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 1u))\r
2143  496                            .loc 1 761 0 is_stmt 0 discriminator 1\r
2144  497 00b6 012D                  cmp     r5, #1\r
2145  498 00b8 4FF00004              mov     r4, #0\r
2146  499 00bc 40F03C81              bne     .L96\r
2147  764:.\Generated_Source\PSoC5/BL.c ****                         if(btldrData < BL_NUM_OF_FLASH_ARRAYS)\r
2148  500                            .loc 1 764 0 is_stmt 1\r
2149  501 00c0 BBF1010F              cmp     fp, #1\r
2150  502 00c4 00F23881              bhi     .L96\r
2151  503                    .LVL69:\r
2152  504                    .LBB23:\r
2153  774:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR + 2u] = LO8(CY_FLASH_NUMBER_ROWS - 1u);\r
2154  505                            .loc 1 774 0\r
2155  506 00c8 FF23                  movs    r3, #255\r
2156  772:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR]      = LO8(startRow);\r
2157  507                            .loc 1 772 0\r
2158  508 00ca 8DF82C41              strb    r4, [sp, #300]\r
2159  773:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR + 1u] = HI8(startRow);\r
2160  509                            .loc 1 773 0\r
2161 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 37\r
2162 \r
2163 \r
2164  510 00ce 8DF82D41              strb    r4, [sp, #301]\r
2165  778:.\Generated_Source\PSoC5/BL.c ****                             ackCode = CYRET_SUCCESS;\r
2166  511                            .loc 1 778 0\r
2167  512 00d2 2546                  mov     r5, r4\r
2168  513                    .LVL70:\r
2169  774:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR + 2u] = LO8(CY_FLASH_NUMBER_ROWS - 1u);\r
2170  514                            .loc 1 774 0\r
2171  515 00d4 8DF82E31              strb    r3, [sp, #302]\r
2172  775:.\Generated_Source\PSoC5/BL.c ****                             packetBuffer[BL_DATA_ADDR + 3u] = HI8(CY_FLASH_NUMBER_ROWS - 1u);\r
2173  516                            .loc 1 775 0\r
2174  517 00d8 8DF82F61              strb    r6, [sp, #303]\r
2175  518                    .LVL71:\r
2176  777:.\Generated_Source\PSoC5/BL.c ****                             rspSize = 4u;\r
2177  519                            .loc 1 777 0\r
2178  520 00dc 0424                  movs    r4, #4\r
2179  521                    .LVL72:\r
2180  522                    .L61:\r
2181  523                    .LBE23:\r
2182  524                    .LBE22:\r
2183  525                    .LBB32:\r
2184  526                    .LBB33:\r
2185 1286:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_SOP_ADDR]      = BL_SOP;\r
2186  527                            .loc 1 1286 0\r
2187  528 00de 0120                  movs    r0, #1\r
2188 1289:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_SIZE_ADDR + 1u] = HI8(size);\r
2189  529                            .loc 1 1289 0\r
2190  530 00e0 0022                  movs    r2, #0\r
2191 1292:.\Generated_Source\PSoC5/BL.c ****     checksum = BL_CalcPacketChecksum(buffer, size + BL_DATA_ADDR);\r
2192  531                            .loc 1 1292 0\r
2193  532 00e2 211D                  adds    r1, r4, #4\r
2194  533 00e4 ADF80640              strh    r4, [sp, #6]    @ movhi\r
2195 1286:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_SOP_ADDR]      = BL_SOP;\r
2196  534                            .loc 1 1286 0\r
2197  535 00e8 8DF82801              strb    r0, [sp, #296]\r
2198 1287:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_CMD_ADDR]      = status;\r
2199  536                            .loc 1 1287 0\r
2200  537 00ec 8DF82951              strb    r5, [sp, #297]\r
2201 1288:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_SIZE_ADDR]     = LO8(size);\r
2202  538                            .loc 1 1288 0\r
2203  539 00f0 8DF82A41              strb    r4, [sp, #298]\r
2204 1289:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_SIZE_ADDR + 1u] = HI8(size);\r
2205  540                            .loc 1 1289 0\r
2206  541 00f4 8DF82B21              strb    r2, [sp, #299]\r
2207 1292:.\Generated_Source\PSoC5/BL.c ****     checksum = BL_CalcPacketChecksum(buffer, size + BL_DATA_ADDR);\r
2208  542                            .loc 1 1292 0\r
2209  543 00f8 8BB2                  uxth    r3, r1\r
2210  544                    .LVL73:\r
2211  545                    .L82:\r
2212  546                    .LBB34:\r
2213  547                    .LBB35:\r
2214  161:.\Generated_Source\PSoC5/BL.c ****             sum += buffer[size - 1u];\r
2215  548                            .loc 1 161 0\r
2216  549 00fa 0DF22710              addw    r0, sp, #295\r
2217  550 00fe C15C                  ldrb    r1, [r0, r3]    @ zero_extendqisi2\r
2218  162:.\Generated_Source\PSoC5/BL.c ****             size--;\r
2219  551                            .loc 1 162 0\r
2220  552 0100 013B                  subs    r3, r3, #1\r
2221 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 38\r
2222 \r
2223 \r
2224  161:.\Generated_Source\PSoC5/BL.c ****             sum += buffer[size - 1u];\r
2225  553                            .loc 1 161 0\r
2226  554 0102 5218                  adds    r2, r2, r1\r
2227  162:.\Generated_Source\PSoC5/BL.c ****             size--;\r
2228  555                            .loc 1 162 0\r
2229  556 0104 9BB2                  uxth    r3, r3\r
2230  161:.\Generated_Source\PSoC5/BL.c ****             sum += buffer[size - 1u];\r
2231  557                            .loc 1 161 0\r
2232  558 0106 92B2                  uxth    r2, r2\r
2233  559                    .LVL74:\r
2234  159:.\Generated_Source\PSoC5/BL.c ****         while (size > 0u)\r
2235  560                            .loc 1 159 0\r
2236  561 0108 002B                  cmp     r3, #0\r
2237  562 010a F6D1                  bne     .L82\r
2238  165:.\Generated_Source\PSoC5/BL.c ****         return(( uint16 )1u + ( uint16 )(~sum));\r
2239  563                            .loc 1 165 0\r
2240  564 010c 5042                  negs    r0, r2\r
2241  565 010e 81B2                  uxth    r1, r0\r
2242  566                    .LBE35:\r
2243  567                    .LBE34:\r
2244 1295:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_CHK_ADDR(1u + size)] = HI8(checksum);\r
2245  568                            .loc 1 1295 0\r
2246  569 0110 080A                  lsrs    r0, r1, #8\r
2247 1294:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_CHK_ADDR(size)]     = LO8(checksum);\r
2248  570                            .loc 1 1294 0\r
2249  571 0112 4BAA                  add     r2, sp, #300\r
2250  572                    .LVL75:\r
2251 1295:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_CHK_ADDR(1u + size)] = HI8(checksum);\r
2252  573                            .loc 1 1295 0\r
2253  574 0114 0DF22D13              addw    r3, sp, #301\r
2254  575                    .LVL76:\r
2255 1294:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_CHK_ADDR(size)]     = LO8(checksum);\r
2256  576                            .loc 1 1294 0\r
2257  577 0118 1155                  strb    r1, [r2, r4]\r
2258 1295:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_CHK_ADDR(1u + size)] = HI8(checksum);\r
2259  578                            .loc 1 1295 0\r
2260  579 011a 1855                  strb    r0, [r3, r4]\r
2261 1296:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_EOP_ADDR(size)]     = BL_EOP;\r
2262  580                            .loc 1 1296 0\r
2263  581 011c 1721                  movs    r1, #23\r
2264  582 011e 0DF59772              add     r2, sp, #302\r
2265 1299:.\Generated_Source\PSoC5/BL.c ****     return(CyBtldrCommWrite(buffer, size + BL_MIN_PKT_SIZE, &size, 150u));\r
2266  583                            .loc 1 1299 0\r
2267  584 0122 E31D                  adds    r3, r4, #7\r
2268 1296:.\Generated_Source\PSoC5/BL.c ****     buffer[BL_EOP_ADDR(size)]     = BL_EOP;\r
2269  585                            .loc 1 1296 0\r
2270  586 0124 1155                  strb    r1, [r2, r4]\r
2271 1299:.\Generated_Source\PSoC5/BL.c ****     return(CyBtldrCommWrite(buffer, size + BL_MIN_PKT_SIZE, &size, 150u));\r
2272  587                            .loc 1 1299 0\r
2273  588 0126 4AA8                  add     r0, sp, #296\r
2274  589                    .LVL77:\r
2275  590 0128 99B2                  uxth    r1, r3\r
2276  591 012a 0DF10602              add     r2, sp, #6\r
2277  592 012e 9623                  movs    r3, #150\r
2278  593 0130 FFF7FEFF              bl      USBFS_CyBtldrCommWrite\r
2279  594                    .LVL78:\r
2280  595                    .L55:\r
2281 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 39\r
2282 \r
2283 \r
2284  596                    .LBE33:\r
2285  597                    .LBE32:\r
2286 1255:.\Generated_Source\PSoC5/BL.c ****     } while ((0u == timeOut) || (BL_COMMUNICATION_STATE_ACTIVE == communicationState));\r
2287  598                            .loc 1 1255 0\r
2288  599 0134 B8F1000F              cmp     r8, #0\r
2289  600 0138 3FF472AF              beq     .L112\r
2290 1255:.\Generated_Source\PSoC5/BL.c ****     } while ((0u == timeOut) || (BL_COMMUNICATION_STATE_ACTIVE == communicationState));\r
2291  601                            .loc 1 1255 0 is_stmt 0 discriminator 1\r
2292  602 013c 002E                  cmp     r6, #0\r
2293  603 013e 00F01281              beq     .L136\r
2294  604                    .LVL79:\r
2295  605                    .L84:\r
2296 1029:.\Generated_Source\PSoC5/BL.c ****                     dataOffset = 0u;\r
2297  606                            .loc 1 1029 0 is_stmt 1\r
2298  607 0142 0126                  movs    r6, #1\r
2299  608 0144 69E7                  b       .L128\r
2300  609                    .LVL80:\r
2301  610                    .L135:\r
2302  611                    .LBB36:\r
2303  698:.\Generated_Source\PSoC5/BL.c ****             switch(packetBuffer[BL_CMD_ADDR])\r
2304  612                            .loc 1 698 0\r
2305  613 0146 9DF82921              ldrb    r2, [sp, #297]  @ zero_extendqisi2\r
2306  614                    .LVL81:\r
2307  695:.\Generated_Source\PSoC5/BL.c ****             uint8 CYDATA btldrData = packetBuffer[BL_DATA_ADDR];\r
2308  615                            .loc 1 695 0\r
2309  616 014a 9DF82CB1              ldrb    fp, [sp, #300]  @ zero_extendqisi2\r
2310  617                    .LVL82:\r
2311  698:.\Generated_Source\PSoC5/BL.c ****             switch(packetBuffer[BL_CMD_ADDR])\r
2312  618                            .loc 1 698 0\r
2313  619 014e A2F13103              sub     r3, r2, #49\r
2314  620                    .LVL83:\r
2315  621 0152 0A2B                  cmp     r3, #10\r
2316  622 0154 00F2F780              bhi     .L110\r
2317  623 0158 01A1                  adr     r1, .L85\r
2318  624 015a 51F823F0              ldr     pc, [r1, r3, lsl #2]\r
2319  625 015e 00BF                  .align  2\r
2320  626                    .L85:\r
2321  627 0160 8D010000              .word   .L60+1\r
2322  628 0164 B1000000              .word   .L62+1\r
2323  629 0168 47030000              .word   .L110+1\r
2324  630 016c AB010000              .word   .L63+1\r
2325  631 0170 5D020000              .word   .L69+1\r
2326  632 0174 47030000              .word   .L110+1\r
2327  633 0178 63020000              .word   .L71+1\r
2328  634 017c 81020000              .word   .L72+1\r
2329  635 0180 AB010000              .word   .L63+1\r
2330  636 0184 9B020000              .word   .L73+1\r
2331  637 0188 27030000              .word   .L80+1\r
2332  638                    .L60:\r
2333  743:.\Generated_Source\PSoC5/BL.c ****                 if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 0u))\r
2334  639                            .loc 1 743 0\r
2335  640 018c 002E                  cmp     r6, #0\r
2336  641 018e 00F0DF80              beq     .L90\r
2337  743:.\Generated_Source\PSoC5/BL.c ****                 if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 0u))\r
2338  642                            .loc 1 743 0 is_stmt 0 discriminator 1\r
2339  643 0192 002D                  cmp     r5, #0\r
2340  644 0194 40F0DC80              bne     .L90\r
2341 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 40\r
2342 \r
2343 \r
2344  746:.\Generated_Source\PSoC5/BL.c ****                             (uint8)(BL_ValidateBootloadable(BL_activeApp) == CYRET_SUCCESS);\r
2345  645                            .loc 1 746 0 is_stmt 1\r
2346  646 0198 FFF7FEFF              bl      BL_ValidateBootloadable.constprop.0\r
2347  647                    .LVL84:\r
2348  648 019c D0F10102              rsbs    r2, r0, #1\r
2349  649 01a0 38BF                  it      cc\r
2350  650 01a2 0022                  movcc   r2, #0\r
2351  651 01a4 8DF82C21              strb    r2, [sp, #300]\r
2352  652                    .LVL85:\r
2353  653 01a8 BBE0                  b       .L132\r
2354  654                    .LVL86:\r
2355  655                    .L63:\r
2356  825:.\Generated_Source\PSoC5/BL.c ****                 if (BL_COMMAND_ERASE == packetBuffer[BL_CMD_ADDR])\r
2357  656                            .loc 1 825 0\r
2358  657 01aa 342A                  cmp     r2, #52\r
2359  658 01ac 12D1                  bne     .L64\r
2360  827:.\Generated_Source\PSoC5/BL.c ****                     if ((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 3u))\r
2361  659                            .loc 1 827 0\r
2362  660 01ae 002E                  cmp     r6, #0\r
2363  661 01b0 00F0CE80              beq     .L90\r
2364  827:.\Generated_Source\PSoC5/BL.c ****                     if ((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize == 3u))\r
2365  662                            .loc 1 827 0 is_stmt 0 discriminator 1\r
2366  663 01b4 032D                  cmp     r5, #3\r
2367  664 01b6 40F0CB80              bne     .L90\r
2368  830:.\Generated_Source\PSoC5/BL.c ****                             if((btldrData >= BL_FIRST_EE_ARRAYID) &&\r
2369  665                            .loc 1 830 0 is_stmt 1\r
2370  666 01ba ABF14007              sub     r7, fp, #64\r
2371  834:.\Generated_Source\PSoC5/BL.c ****                                 dataOffset = CY_EEPROM_SIZEOF_ROW;\r
2372  667                            .loc 1 834 0\r
2373  668 01be 3F2F                  cmp     r7, #63\r
2374  669 01c0 8CBF                  ite     hi\r
2375  670 01c2 4FF49077              movhi   r7, #288\r
2376  671 01c6 1027                  movls   r7, #16\r
2377  672                    .LVL87:\r
2378  849:.\Generated_Source\PSoC5/BL.c ****                             (void) memset(dataBuffer, 0, dataOffset);\r
2379  673                            .loc 1 849 0\r
2380  674 01c8 95A8                  add     r0, sp, #596\r
2381  675 01ca 0021                  movs    r1, #0\r
2382  676 01cc 3A46                  mov     r2, r7\r
2383  677 01ce FFF7FEFF              bl      memset\r
2384  678                    .LVL88:\r
2385  679 01d2 05E0                  b       .L66\r
2386  680                    .LVL89:\r
2387  681                    .L64:\r
2388  861:.\Generated_Source\PSoC5/BL.c ****                 if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize >= 3u))\r
2389  682                            .loc 1 861 0\r
2390  683 01d4 002E                  cmp     r6, #0\r
2391  684 01d6 00F0BB80              beq     .L90\r
2392  861:.\Generated_Source\PSoC5/BL.c ****                 if((BL_COMMUNICATION_STATE_ACTIVE == communicationState) && (pktSize >= 3u))\r
2393  685                            .loc 1 861 0 is_stmt 0 discriminator 1\r
2394  686 01da 022D                  cmp     r5, #2\r
2395  687 01dc 40F2B880              bls     .L90\r
2396  688                    .LVL90:\r
2397  689                    .L66:\r
2398  870:.\Generated_Source\PSoC5/BL.c ****                         (void) memcpy(&dataBuffer[dataOffset],\r
2399  690                            .loc 1 870 0 is_stmt 1\r
2400  691 01e0 033D                  subs    r5, r5, #3\r
2401 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 41\r
2402 \r
2403 \r
2404  692                    .LVL91:\r
2405  693 01e2 95AB                  add     r3, sp, #596\r
2406  694 01e4 2A46                  mov     r2, r5\r
2407  695 01e6 D819                  adds    r0, r3, r7\r
2408  696 01e8 0DF22F11              addw    r1, sp, #303\r
2409  697 01ec FFF7FEFF              bl      memcpy\r
2410  698                    .LVL92:\r
2411  878:.\Generated_Source\PSoC5/BL.c ****                         if((btldrData >= BL_FIRST_EE_ARRAYID) &&\r
2412  699                            .loc 1 878 0\r
2413  700 01f0 ABF14000              sub     r0, fp, #64\r
2414  875:.\Generated_Source\PSoC5/BL.c ****                     dataOffset += (pktSize - 3u);\r
2415  701                            .loc 1 875 0\r
2416  702 01f4 7A19                  adds    r2, r7, r5\r
2417  878:.\Generated_Source\PSoC5/BL.c ****                         if((btldrData >= BL_FIRST_EE_ARRAYID) &&\r
2418  703                            .loc 1 878 0\r
2419  704 01f6 3F28                  cmp     r0, #63\r
2420  875:.\Generated_Source\PSoC5/BL.c ****                     dataOffset += (pktSize - 3u);\r
2421  705                            .loc 1 875 0\r
2422  706 01f8 96B2                  uxth    r6, r2\r
2423  707                    .LVL93:\r
2424  878:.\Generated_Source\PSoC5/BL.c ****                         if((btldrData >= BL_FIRST_EE_ARRAYID) &&\r
2425  708                            .loc 1 878 0\r
2426  709 01fa 03D8                  bhi     .L102\r
2427  882:.\Generated_Source\PSoC5/BL.c ****                             CyEEPROM_Start();\r
2428  710                            .loc 1 882 0\r
2429  711 01fc FFF7FEFF              bl      CyEEPROM_Start\r
2430  712                    .LVL94:\r
2431  885:.\Generated_Source\PSoC5/BL.c ****                             pktSize = CY_EEPROM_SIZEOF_ROW;\r
2432  713                            .loc 1 885 0\r
2433  714 0200 1024                  movs    r4, #16\r
2434  715 0202 01E0                  b       .L67\r
2435  716                    .LVL95:\r
2436  717                    .L102:\r
2437  890:.\Generated_Source\PSoC5/BL.c ****                             pktSize = BL_FROW_SIZE;\r
2438  718                            .loc 1 890 0\r
2439  719 0204 4FF49074              mov     r4, #288\r
2440  720                    .LVL96:\r
2441  721                    .L67:\r
2442  899:.\Generated_Source\PSoC5/BL.c ****                     if(dataOffset == pktSize)\r
2443  722                            .loc 1 899 0\r
2444  723 0208 A642                  cmp     r6, r4\r
2445  724 020a 40F09780              bne     .L103\r
2446  902:.\Generated_Source\PSoC5/BL.c ****                         dataOffset = ((uint16)((uint16)packetBuffer[BL_DATA_ADDR + 2u] << 8u)) |\r
2447  725                            .loc 1 902 0\r
2448  726 020e 9DF82E11              ldrb    r1, [sp, #302]  @ zero_extendqisi2\r
2449  727 0212 9DF82D71              ldrb    r7, [sp, #301]  @ zero_extendqisi2\r
2450  906:.\Generated_Source\PSoC5/BL.c ****                             if(btldrData <= BL_LAST_FLASH_ARRAYID)\r
2451  728                            .loc 1 906 0\r
2452  729 0216 BBF13F0F              cmp     fp, #63\r
2453  902:.\Generated_Source\PSoC5/BL.c ****                         dataOffset = ((uint16)((uint16)packetBuffer[BL_DATA_ADDR + 2u] << 8u)) |\r
2454  730                            .loc 1 902 0\r
2455  731 021a 47EA0125              orr     r5, r7, r1, lsl #8\r
2456  732                    .LVL97:\r
2457  906:.\Generated_Source\PSoC5/BL.c ****                             if(btldrData <= BL_LAST_FLASH_ARRAYID)\r
2458  733                            .loc 1 906 0\r
2459  734 021e 11D8                  bhi     .L68\r
2460  912:.\Generated_Source\PSoC5/BL.c ****                             if(0u == clearedMetaData)\r
2461 \fARM GAS  C:\Users\MICHA_~1\AppData\Local\Temp\ccttgPOR.s                       page 42\r
2462 \r
2463 \r
2464  735                            .loc 1 912 0\r
2465  736 0220 BAF1000F              cmp     sl, #0\r
2466  737 0224 0ED1                  bne     .L68\r
2467  738                    .LBB24:\r
2468  921:.\Generated_Source\PSoC5/BL.c ****                                     (void) memset(erase, 0, BL_FROW_SIZE);\r
2469  739                            .loc 1 921 0\r
2470  740 0226 5146                  mov     r1, sl\r
2471  741 0228 4FF49072              mov     r2, #288\r
2472  742 022c 02A8                  add     r0, sp, #8\r
2473  743 022e FFF7FEFF              bl      memset\r
2474  744                    .LVL98:\r
2475  927:.\Generated_Source\PSoC5/BL.c ****                                     (void) CyWriteRowFull((uint8)  BL_MD_FLASH_ARRAY_NUM,\r
2476  745                            .loc 1 927 0\r