1 // SPDX-License-Identifier: BSD-3-Clause
3 /******************************************************************************
5 * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
7 ******************************************************************************/
11 /******************************************************************************
13 * The entry point for the application startup code.
15 ******************************************************************************/
16 extern int main(void);
18 /******************************************************************************
20 * Reserve space for the system stack.
22 ******************************************************************************/
23 __attribute__ ((section(".stack")))
24 static uint32_t stack[100];
25 const uint32_t stack_pntr = (uint32_t)stack + sizeof(stack);
27 /******************************************************************************
29 * The following are constructs created by the linker indicating where
30 * the "bss" and "ebss" segments reside in memory.
32 ******************************************************************************/
34 extern uint32_t _ebss;
36 /******************************************************************************
38 * This is the entry point that handles setting the stack within the allowed
39 * workspace, initializing the .bss segment, and then jumping to main.
41 ******************************************************************************/
42 __attribute__ ((section(".entry")))
45 /* Workaround for ITT instructions. */
51 /* Initialize stack pointer */
52 __asm(" ldr sp, =stack_pntr");
54 /* Zero fill the bss segment. */
55 __asm(" ldr r0, =_bss\n"
62 " strlt r2, [r0], #4\n"
65 /* Call the application's entry point. */
68 /* If we ever return, enter an infinite loop */