|
53 | 53 | * ### Usage Manual |
54 | 54 | * As shown in the following picture, when the EMSK configuration in SPI flash is loaded into the FPGA, |
55 | 55 | * a simple primary bootloader is also loaded in ICCM. Through the primary bootloader, the application or secondary bootloader can be |
56 | | - * loaded into ICCM or external memory (DDR memory), bootloader start address is 0x17F00004, ram address is 0x17F00000. |
| 56 | + * loaded into external memory (DDR memory), bootloader start address is 0x17F00004, ram address is 0x17F00000. |
57 | 57 | * |
58 | 58 | * For EMSK1.x, bootloader core configuration must be arcem6, for EMSK2.x, bootloader core configuration must be arcem7d. |
59 | 59 | * |
|
66 | 66 | * </div> |
67 | 67 | * \endhtmlonly |
68 | 68 | * |
69 | | - * Here are steps for how to program the secondary bootloader application into onboard SPIFlash(Take EMSK2.0 - ARC EM7D as example) and automatically load and run *boot.hex* or *boot.bin* in SDCard. |
| 69 | + * Here are steps for how to program the secondary bootloader application into onboard SPIFlash(Take EMSK2.3 - ARC EM7D as example) and automatically load and run *boot.hex* or *boot.bin* in SDCard. |
70 | 70 | * - Generate a secondary bootloader binary file |
71 | | - * * cd <embARC>/example/emsk/bootloader |
72 | | - * * make TOOLCHAIN=gnu BD_VER=20 CUR_CORE=arcem7d bin |
73 | | - * * If the binary file is generated successfully, you will output as follows: |
| 71 | + * + cd <embARC>/example/baremetal/bootloader |
| 72 | + * + Generate binary file: make TOOLCHAIN=gnu BD_VER=23 CUR_CORE=arcem7d bin |
| 73 | + * - If the binary file is generated successfully, you will output as follows: |
74 | 74 | * \code |
75 | | - * "Compiling : " ../../../arc/arc_exception.c |
76 | | - * "Assembling : " ../../../arc/arc_startup.s |
77 | | - * "Assembling : " ../../../arc/arc_exc_asm.s |
78 | | - * "Archiving : " obj_emsk_20/gnu_arcem7d/libemsk.a |
79 | | - * "Archiving : " obj_emsk_20/gnu_arcem7d/libmidcommon.a |
80 | | - * "Archiving : " obj_emsk_20/gnu_arcem7d/libmidfatfs.a |
81 | | - * arc-elf32-ar: creating obj_emsk_20/gnu_arcem7d/libemsk.a |
82 | | - * arc-elf32-ar: creating obj_emsk_20/gnu_aarrcc-eem7dl/fli3b2mi-dafatrf:s .ac |
83 | | - * reating obj_emsk_20/gnu_arcem7d/libmidcommon.a |
84 | | - * "Archiving : " obj_emsk_20/gnu_arcem7d/libmidntshell.a |
85 | | - * arc-elf32-ar: creating obj_emsk_20/gnu_arcem7d/libmidntshell.a |
86 | | - * "Archiving : " obj_emsk_20/gnu_arcem7d/libarc.a |
87 | | - * arc-elf32-ar: creating obj_emsk_20/gnu_arcem7d/libarc.a |
88 | | - * "Archiving : " obj_emsk_20/gnu_arcem7d/libembarc.a |
89 | | - * arc-elf32-ar: creating obj_emsk_20/gnu_arcem7d/libembarc.a |
90 | | - * "Linking : " obj_emsk_20/gnu_arcem7d/emsk_bootloader_gnu_arcem7d.elf |
91 | | - * "Generating Binary obj_emsk_20/gnu_arcem7d/emsk_bootloader_gnu_arcem7d.bin" |
| 75 | + * "Compiling : " ../../../middleware/ntshell/cmds/cmds_fs/ymodem/ymodemio.c |
| 76 | + * "Compiling : " ../../../middleware/ntshell/port/ntshell_usrcmd.c |
| 77 | + * "Compiling : " ../../../middleware/ntshell/port/ntshell_task.c |
| 78 | + * "Archiving : " obj_emsk_23/gnu_arcem7d/libmidntshell.a |
| 79 | + * "Compiling : " ../../../middleware/parson/parson.c |
| 80 | + * "Archiving : " obj_emsk_23/gnu_arcem7d/libmidparson.a |
| 81 | + * "Compiling : " ../../../arc/arc_timer.c |
| 82 | + * "Compiling : " ../../../arc/arc_cache.c |
| 83 | + * "Compiling : " ../../../arc/arc_exception.c |
| 84 | + * "Compiling : " ../../../arc/arc_udma.c |
| 85 | + * "Assembling : " ../../../arc/arc_exc_asm.s |
| 86 | + * "Archiving : " obj_emsk_23/gnu_arcem7d/libcpuarc.a |
| 87 | + * "Compiling : " ../../../library/clib/fatfs_dirent.c |
| 88 | + * "Compiling : " ../../../library/clib/malloc.c |
| 89 | + * "Compiling : " ../../../library/clib/embARC_sbrk.c |
| 90 | + * "Compiling : " ../../../library/clib/embARC_misc.c |
| 91 | + * "Compiling : " ../../../library/clib/embARC_syscalls.c |
| 92 | + * "Compiling : " ../../../library/clib/ya_getopt.c |
| 93 | + * "Compiling : " ../../../library/clib/embARC_target.c |
| 94 | + * "Archiving : " obj_emsk_23/gnu_arcem7d/liblibclib.a |
| 95 | + * "Archiving : " obj_emsk_23/gnu_arcem7d/libembarc.a |
| 96 | + * "Linking : " obj_emsk_23/gnu_arcem7d/emsk_bootloader_gnu_arcem7d.elf |
| 97 | + * "Generating Binary obj_emsk_23/gnu_arcem7d/emsk_bootloader_gnu_arcem7d.bin" |
92 | 98 | * \endcode |
93 | 99 | * - Program generated secondary bootloader binary file into SPIFlash |
94 | | - * * Insert SDCard to your PC, and copy the binary file *obj_emsk_20/gnu_arcem7d/emsk_bootloader_gnu_arcem7d.bin* to SDCard Root, and rename it to *em7d_2bt.bin* |
95 | | - * * Insert the SDCard to EMSK Board, and build and run the *<embARC>/example/ntshell* example, please choose the right core configuration |
96 | | - * * Then use ntshell command *spirw* to program the *em7d_2bt.bin* into spiflash. |
| 100 | + * + Insert SDCard to your PC, and copy the binary file *obj_emsk_23/gnu_arcem7d/emsk_bootloader_gnu_arcem7d.bin* to SDCard Root, and rename it to *em7d_2bt.bin* |
| 101 | + * + Insert the SDCard to EMSK Board, and build and run the <em><embARC>/example/baremetal/bootloader</em> example, please choose the right core configuration |
| 102 | + * + Then use ntshell command *spirw* to program the *em7d_2bt.bin* into spiflash. |
97 | 103 | * - Firstly, run *spirw* to show help |
98 | 104 | * - Secondly, run *spirw -i* to check SPIFlash ID, it should be **Device ID = ef4018** |
99 | 105 | * - Thirdly, run *spirw -w em7d_2bt.bin 0x17f00000 0x17f00004* to program spiflash |
|
102 | 108 | * * If programmed successfully, when the board is reset, make sure Bit 4 of the onboard DIP switch is ON to enable secondary bootloader run. |
103 | 109 | *  |
104 | 110 | * - Generate *boot.bin* using any embARC example which ram start address should be 0x10000000 and use bootloader to run it |
105 | | - * * Here take *<embARC>/example/freertos/demo* for example |
106 | | - * * cd <embARC>/example/freertos/demo |
107 | | - * * Build and generate binary file: *make TOOLCHAIN=gnu BD_VER=20 CUR_CORE=arcem7d bin* |
108 | | - * * Insert SDCard to PC, and copy generated binary file *obj_emsk_20/gnu_arcem7d/freertos-demo_gnu_arcem7d.bin* to SDCard Root, and rename it to boot.bin |
| 111 | + * * Here take <em><embARC>/example/freertos/kernel</em> for example |
| 112 | + * * cd <embARC>/example/freertos/kernel |
| 113 | + * * Build and generate binary file: *make TOOLCHAIN=gnu BD_VER=23 CUR_CORE=arcem7d bin* |
| 114 | + * * Insert SDCard to PC, and copy generated binary file *obj_emsk_20/gnu_arcem7d/freertos_kernel_gnu_arcem7d.bin* to SDCard Root, and rename it to boot.bin |
109 | 115 | * * Insert SDCard back to EMSK, make sure bit 4 of DIP Switch is ON, and press re-configure button above letter **C**, and wait for autoload. |
110 | 116 | * *  |
111 | 117 | * - Know Issues |
|
125 | 131 | * * Load application finished: LED on board -> 0xFF, if application is running normally, LED will quickly change to 0x0 |
126 | 132 | * * Load application failed: LED on board -> 0xAA |
127 | 133 | * * Skip loading application, and enter to NTShell runtime: LED on board -> 0x0 |
128 | | - * - You can refer to \ref NTSHELL_COMMAND_LIST "list of NTShell commands". |
| 134 | + * - Type *help* command in ntshell to show the list of supported commands. |
129 | 135 | * |
130 | 136 | *  |
131 | 137 | * |
|
139 | 145 | * \file |
140 | 146 | * \ingroup EMBARC_APP_BAREMETAL_BOOTLOADER |
141 | 147 | * \brief example of secondary bootloader after the bootrom of EMSK |
142 | | - * \todo The ntshell is OK but boot file open error. |
| 148 | + * \todo |
143 | 149 | */ |
144 | 150 |
|
145 | 151 | /** |
@@ -207,6 +213,7 @@ int main(void) |
207 | 213 | uint32_t max_promt_ms = PROMT_DELAY_S * 1000; |
208 | 214 | uint32_t boot_json[1000]; |
209 | 215 | fp_t fp; |
| 216 | + |
210 | 217 | /* No USE_BOARD_MAIN */ |
211 | 218 | board_init(); |
212 | 219 | cpu_unlock(); /* unlock cpu to let interrupt work */ |
|
0 commit comments