STM32F103 ucLinux development BOOT

STM32F103 ucLinux development BOOT

STM3210E-EVAL official development
board main chip STM32F103ZET6:

On-chip 512K Flash, address 0x0800 0000 ~ 0x0807 FFFF;

64K RAM, address 0x2000 0000 ~ 2000 FFFF.

NorFlash and SRAM are expanded by using its FSMC function:
NorFlash size 16M, address 0x6400 0000 ~ 6500 0000
SRAM size 1M, address 0x6800 0000 ~ 0x6810 0000

 

ST's official website has given the kit developed by uCLinux, but the BOOT provided is just a Hex file without source code.

After reading the UBOOT source code, I understand what BOOT has to do. I wrote a super simple BOOT under KEIL, which can jump to the kernel and pass

The printf function prints the output, the source code download address:

http://www.pudn.com/downloads611/sourcecode/embedded/detail2490802.html 

 

The main source code is as follows:

SystemInit(); //Initialize the clock

FSMC_SRAM_Init(); // SRAM initialization
FSMC_NOR_Init(); // NOR FLASH initialization

USART1_Configuration(USART1_BPS); // RS232 configuration, serial port 1 as console output

setup_start_tag(); //ATAG_CORE
//setup_memory_tags(); //I analyze the HEX file of the official website, there is no ATAG_MEM
setup_commandline_tag(g_strCmdLine); //ATAG_CMDLINE
setup_end_tag(); //ATAG_NONE

theKernel = (void (*)(int, int, unsigned int))((uint32_t)KernelStartAddrss); //Jump address, on-chip FLash is 0x0800 3000, off-chip Nor Flash is 0x6400 0000
theKernel(0, 2189, ((uint32_t)TagStartAddress)); //analysis Kernel source code, Tag start address should be 0x6800 0100. After this sentence is executed, the jump is realized.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325689334&siteId=291194637