Skip to content

Commit 334f072

Browse files
committed
doc: update bootloader example's documentation
1 parent 9f5c56b commit 334f072

File tree

3 files changed

+38
-31
lines changed

3 files changed

+38
-31
lines changed
41.5 KB
Loading
3.47 KB
Loading

example/baremetal/bootloader/main.c

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* ### Usage Manual
5454
* As shown in the following picture, when the EMSK configuration in SPI flash is loaded into the FPGA,
5555
* 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.
5757
*
5858
* For EMSK1.x, bootloader core configuration must be arcem6, for EMSK2.x, bootloader core configuration must be arcem7d.
5959
*
@@ -66,34 +66,40 @@
6666
* </div>
6767
* \endhtmlonly
6868
*
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.
7070
* - 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:
7474
* \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"
9298
* \endcode
9399
* - 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.
97103
* - Firstly, run *spirw* to show help
98104
* - Secondly, run *spirw -i* to check SPIFlash ID, it should be **Device ID = ef4018**
99105
* - Thirdly, run *spirw -w em7d_2bt.bin 0x17f00000 0x17f00004* to program spiflash
@@ -102,10 +108,10 @@
102108
* * If programmed successfully, when the board is reset, make sure Bit 4 of the onboard DIP switch is ON to enable secondary bootloader run.
103109
* ![ScreenShot of secondary bootloader autoboot when board configuration is reloaded](pic/images/example/emsk/emsk_bootloader_onspiflash.jpg)
104110
* - 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
109115
* * 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.
110116
* * ![ScreenShot of secondary bootloader auto load boot.bin](pic/images/example/emsk/emsk_bootloader_loadbootbin.jpg)
111117
* - Know Issues
@@ -125,7 +131,7 @@
125131
* * Load application finished: LED on board -> 0xFF, if application is running normally, LED will quickly change to 0x0
126132
* * Load application failed: LED on board -> 0xAA
127133
* * 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.
129135
*
130136
* ![ScreenShot of bootloader under baremetal](pic/images/example/emsk/emsk_bootloader.jpg)
131137
*
@@ -139,7 +145,7 @@
139145
* \file
140146
* \ingroup EMBARC_APP_BAREMETAL_BOOTLOADER
141147
* \brief example of secondary bootloader after the bootrom of EMSK
142-
* \todo The ntshell is OK but boot file open error.
148+
* \todo
143149
*/
144150

145151
/**
@@ -207,6 +213,7 @@ int main(void)
207213
uint32_t max_promt_ms = PROMT_DELAY_S * 1000;
208214
uint32_t boot_json[1000];
209215
fp_t fp;
216+
210217
/* No USE_BOARD_MAIN */
211218
board_init();
212219
cpu_unlock(); /* unlock cpu to let interrupt work */

0 commit comments

Comments
 (0)