contrib: replace the BSD-3-Clause license tag
[openocd.git] / contrib / loaders / flash / cc26xx / startup.c
1 /* SPDX-License-Identifier: BSD-3-Clause */
2
3 /******************************************************************************
4 *
5 * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
6 *
7 ******************************************************************************/
8
9 #include <stdint.h>
10
11 /******************************************************************************
12 *
13 * The entry point for the application startup code.
14 *
15 ******************************************************************************/
16 extern int main(void);
17
18 /******************************************************************************
19 *
20 * Reserve space for the system stack.
21 *
22 ******************************************************************************/
23 __attribute__ ((section(".stack")))
24 static uint32_t stack[100];
25 const uint32_t stack_pntr = (uint32_t)stack + sizeof(stack);
26
27 /******************************************************************************
28 *
29 * The following are constructs created by the linker indicating where
30 * the "bss" and "ebss" segments reside in memory.
31 *
32 ******************************************************************************/
33 extern uint32_t _bss;
34 extern uint32_t _ebss;
35
36 /******************************************************************************
37 *
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.
40 *
41 ******************************************************************************/
42 __attribute__ ((section(".entry")))
43 void entry(void)
44 {
45 /* Workaround for ITT instructions. */
46 __asm(" NOP");
47 __asm(" NOP");
48 __asm(" NOP");
49 __asm(" NOP");
50
51 /* Initialize stack pointer */
52 __asm(" ldr sp, =stack_pntr");
53
54 /* Zero fill the bss segment. */
55 __asm(" ldr r0, =_bss\n"
56 " ldr r1, =_ebss\n"
57 " mov r2, #0\n"
58 " .thumb_func\n"
59 " zero_loop:\n"
60 " cmp r0, r1\n"
61 " it lt\n"
62 " strlt r2, [r0], #4\n"
63 " blt zero_loop");
64
65 /* Call the application's entry point. */
66 main();
67
68 /* If we ever return, enter an infinite loop */
69 while (1)
70 ;
71 }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)