/***************************************************************************** LPC31xx loader startup code. Copyright (c) 2009 Rowley Associates Limited. This file may be distributed under the terms of the License Agreement provided with this software. THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *****************************************************************************/ .section .bootimage, "ax" .global boot_reset .global cust_reserved boot_reset: b _start .word 0x41676d69 // magic .word 0 // execution_crc32 .word 0,0,0,0 // Reserved0 .word 0x0000000A // imageType imageLength: .word 0x4000 // imageLength - 16K maximum secondary bootloader .word 0 // releaseID .word 0 // buildTime .word 0 // sbzBootParameter cust_reserved: .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 // cust_reserved .word 0 // header_crc32 .word 0,0,0,0 // Reserved1 .section .init, "ax" .code 32 .align 0 .global _start _start: ldr sp, =__stack_section_end__ ldr r2, =__bss_start__ ldr r3, =__bss_end__ mov r4, #0 zero_bss_loop: cmp r2, r3 beq zero_bss_end strb r4, [r2], #+1 b zero_bss_loop zero_bss_end: bl main teq r0, #0 movne pc, r0 loop: b loop