1. at the beginning of board power-on, the system automatically determines whether the mode is autoboot (this is determined by the hardware engineer's pin connection to the MCU ), I used the S3C2410 with nandflash and switched it to autoboot. It started from nandflash.
2. after determining that the mode is autoboot, the MCU's built-in nandflash controller automatically takes the top 4 K area of nandflash (this 4 K area stores the top 4 K code of bootloader) copy it to Samsung's so-called "steppingstone" (actually a 4 k sram ).
3. After the first 4 K code is copied, The nandflash controller automatically maps "steppingstone" to the first 4 K region starting with the arm address space 0x00000000.
4. After the ing process is complete, the nandflash Controller directs the PC pointer directly to the 0x00000000 position of the arm address space and prepares to execute the code on "steppingstone.
5. the 4 K code copied from nandflash on steppingstone is the first 4 K code of bootloader written by programmers. this bootloader has been written before and has been burned to the frontend of nandflash starting from 0x00000000 .. the 4 K code on steppingstone is the first 4 K code of bootloader.
6. after the PC points to 0x00000000 of the arm address space, the system starts to execute the command code. the task of this 4 K code is to initialize the hardware, set the interrupt vector table, set the stack, and then a very important task is to integrate the bootloader (including the 4 K startup Code) in the front of nandflash) copy the code to SDRAM. The size of the bootloader code is determined by writing the bootloader. then you only need to determine the starting position of the bootloader to map to the SDRAM.
7. after the bootloader on nandflash is moved, find the address of the next instruction of the last instruction of the 4 K code to be moved to the bootloader address of the SDRAM, and then jump to the position, continue executing the remaining bootloader code (pilot system ).