Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

bootdata.c 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. //#include "imxrt.h"
  2. #include <stdint.h>
  3. extern void ResetHandler(void);
  4. extern unsigned long _estack;
  5. extern unsigned long _flashimagelen;
  6. __attribute__ ((section(".vectors"), used))
  7. const uint32_t vector_table[2] = {
  8. #if defined(__IMXRT1052__)
  9. (uint32_t)&_estack,
  10. #elif defined(__IMXRT1062__)
  11. 0x20010000, // 64K DTCM for boot, ResetHandler configures stack after ITCM/DTCM setup
  12. #endif
  13. (uint32_t)&ResetHandler
  14. };
  15. __attribute__ ((section(".bootdata"), used))
  16. const uint32_t BootData[3] = {
  17. 0x60000000,
  18. (uint32_t)&_flashimagelen,
  19. 0
  20. };
  21. __attribute__ ((section(".ivt"), used))
  22. const uint32_t ImageVectorTable[8] = {
  23. 0x402000D1, // header
  24. (uint32_t)vector_table, // docs are wrong, needs to be vec table, not start addr
  25. 0, // reserved
  26. 0, // dcd
  27. (uint32_t)BootData, // abs address of boot data
  28. (uint32_t)ImageVectorTable, // self
  29. 0, // command sequence file
  30. 0 // reserved
  31. };
  32. __attribute__ ((section(".flashconfig"), used))
  33. uint32_t FlexSPI_NOR_Config[128] = {
  34. // 448 byte common FlexSPI configuration block, 8.6.3.1 page 223 (RT1060 rev 0)
  35. // MCU_Flashloader_Reference_Manual.pdf, 8.2.1, Table 8-2, page 72-75
  36. 0x42464346, // Tag 0x00
  37. 0x56010000, // Version
  38. 0, // reserved
  39. 0x00020101, // columnAdressWidth,dataSetupTime,dataHoldTime,readSampleClkSrc
  40. 0x00000000, // waitTimeCfgCommands,-,deviceModeCfgEnable
  41. 0, // deviceModeSeq
  42. 0, // deviceModeArg
  43. 0x00000000, // -,-,-,configCmdEnable
  44. 0, // configCmdSeqs 0x20
  45. 0,
  46. 0,
  47. 0,
  48. 0, // cfgCmdArgs 0x30
  49. 0,
  50. 0,
  51. 0,
  52. 0x00000000, // controllerMiscOption 0x40
  53. 0x00030401, // lutCustomSeqEnable,serialClkFreq,sflashPadType,deviceType
  54. 0, // reserved
  55. 0, // reserved
  56. 0x00200000, // sflashA1Size 0x50
  57. 0, // sflashA2Size
  58. 0, // sflashB1Size
  59. 0, // sflashB2Size
  60. 0, // csPadSettingOverride 0x60
  61. 0, // sclkPadSettingOverride
  62. 0, // dataPadSettingOverride
  63. 0, // dqsPadSettingOverride
  64. 0, // timeoutInMs 0x70
  65. 0, // commandInterval
  66. 0, // dataValidTime
  67. 0x00000000, // busyBitPolarity,busyOffset
  68. 0x0A1804EB, // lookupTable[0] 0x80
  69. 0x26043206, // lookupTable[1]
  70. 0, // lookupTable[2]
  71. 0, // lookupTable[3]
  72. 0x24040405, // lookupTable[4] 0x90
  73. 0, // lookupTable[5]
  74. 0, // lookupTable[6]
  75. 0, // lookupTable[7]
  76. 0, // lookupTable[8] 0xA0
  77. 0, // lookupTable[9]
  78. 0, // lookupTable[10]
  79. 0, // lookupTable[11]
  80. 0x00000406, // lookupTable[12] 0xB0
  81. 0, // lookupTable[13]
  82. 0, // lookupTable[14]
  83. 0, // lookupTable[15]
  84. 0, // lookupTable[16] 0xC0
  85. 0, // lookupTable[17]
  86. 0, // lookupTable[18]
  87. 0, // lookupTable[19]
  88. 0x08180420, // lookupTable[20] 0xD0
  89. 0, // lookupTable[21]
  90. 0, // lookupTable[22]
  91. 0, // lookupTable[23]
  92. 0, // lookupTable[24] 0xE0
  93. 0, // lookupTable[25]
  94. 0, // lookupTable[26]
  95. 0, // lookupTable[27]
  96. 0, // lookupTable[28] 0xF0
  97. 0, // lookupTable[29]
  98. 0, // lookupTable[30]
  99. 0, // lookupTable[31]
  100. 0x081804D8, // lookupTable[32] 0x100
  101. 0, // lookupTable[33]
  102. 0, // lookupTable[34]
  103. 0, // lookupTable[35]
  104. 0x08180402, // lookupTable[36] 0x110
  105. 0x00002004, // lookupTable[37]
  106. 0, // lookupTable[38]
  107. 0, // lookupTable[39]
  108. 0, // lookupTable[40] 0x120
  109. 0, // lookupTable[41]
  110. 0, // lookupTable[42]
  111. 0, // lookupTable[43]
  112. 0x00000460, // lookupTable[44] 0x130
  113. 0, // lookupTable[45]
  114. 0, // lookupTable[46]
  115. 0, // lookupTable[47]
  116. 0, // lookupTable[48] 0x140
  117. 0, // lookupTable[49]
  118. 0, // lookupTable[50]
  119. 0, // lookupTable[51]
  120. 0, // lookupTable[52] 0x150
  121. 0, // lookupTable[53]
  122. 0, // lookupTable[54]
  123. 0, // lookupTable[55]
  124. 0, // lookupTable[56] 0x160
  125. 0, // lookupTable[57]
  126. 0, // lookupTable[58]
  127. 0, // lookupTable[59]
  128. 0, // lookupTable[60] 0x170
  129. 0, // lookupTable[61]
  130. 0, // lookupTable[62]
  131. 0, // lookupTable[63]
  132. 0, // LUT 0: Read 0x180
  133. 0, // LUT 1: ReadStatus
  134. 0, // LUT 3: WriteEnable
  135. 0, // LUT 5: EraseSector
  136. 0, // LUT 9: PageProgram 0x190
  137. 0, // LUT 11: ChipErase
  138. 0, // LUT 15: Dummy
  139. 0, // LUT unused?
  140. 0, // LUT unused? 0x1A0
  141. 0, // LUT unused?
  142. 0, // LUT unused?
  143. 0, // LUT unused?
  144. 0, // reserved 0x1B0
  145. 0, // reserved
  146. 0, // reserved
  147. 0, // reserved
  148. // 64 byte Serial NOR configuration block, 8.6.3.2, page 346
  149. 256, // pageSize 0x1C0
  150. 4096, // sectorSize
  151. 1, // ipCmdSerialClkFreq
  152. 0, // reserved
  153. 0x00010000, // block size 0x1D0
  154. 0, // reserved
  155. 0, // reserved
  156. 0, // reserved
  157. 0, // reserved 0x1E0
  158. 0, // reserved
  159. 0, // reserved
  160. 0, // reserved
  161. 0, // reserved 0x1F0
  162. 0, // reserved
  163. 0, // reserved
  164. 0 // reserved
  165. };