Skip to content

Commit be99477

Browse files
microbuilderurutva
authored andcommitted
Support the MPS3 AN524
Add support for the MPS3 AN524, a cortex-m33-based prototyping platform. Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org> Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org> Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
1 parent b1a8dd9 commit be99477

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+16122
-0
lines changed

Arm/MPS3_AN524/CMakeLists.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
5+
set(CMAKE_C_STANDARD 99)
6+
7+
set(GSG_BASE_DIR ${CMAKE_SOURCE_DIR}/../..)
8+
set(CORE_SRC_DIR ${GSG_BASE_DIR}/core/src)
9+
set(CORE_LIB_DIR ${GSG_BASE_DIR}/core/lib)
10+
11+
# use the repo version of ninja on Windows as there is no Ninja installer
12+
if(WIN32)
13+
set(CMAKE_MAKE_PROGRAM ${GSG_BASE_DIR}/cmake/ninja CACHE STRING "Ninja location")
14+
endif()
15+
16+
# Set the toolchain if not defined
17+
if(NOT CMAKE_TOOLCHAIN_FILE)
18+
set(CMAKE_TOOLCHAIN_FILE "${GSG_BASE_DIR}/cmake/arm-gcc-cortex-m33.cmake")
19+
endif()
20+
21+
include(${GSG_BASE_DIR}/cmake/utilities.cmake)
22+
23+
# Define the Project
24+
# The project name must be mps3_524 to conform to the 8.3 naming convention
25+
project(mps3_524 C ASM)
26+
27+
# Exceptions required by CMSIS UART driver (-Wno-ignored-qualifiers -Wno-return-type)
28+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-ignored-qualifiers -Wno-return-type")
29+
30+
# add_subdirectory(${CORE_SRC_DIR} core_src)
31+
add_subdirectory(lib)
32+
add_subdirectory(app)

Arm/MPS3_AN524/app/CMakeLists.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (c) 2021 Linaro Limited.
2+
# Licensed under the MIT License.
3+
4+
set(LINKER_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/startup/mps3_an524.ld")
5+
6+
set(SOURCES
7+
startup/startup_cmsdk_mps3_an524_bl2.S
8+
main.c
9+
)
10+
11+
add_executable(${PROJECT_NAME} ${SOURCES})
12+
13+
target_link_libraries(${PROJECT_NAME}
14+
PUBLIC
15+
# azrtos::threadx
16+
# azrtos::netxduo
17+
18+
# app_common
19+
# jsmn
20+
AN524
21+
# netx_driver
22+
)
23+
24+
target_link_options(${PROJECT_NAME}
25+
PRIVATE
26+
-T${LINKER_SCRIPT} -Wl,-Map=${PROJECT_NAME}.map)
27+
28+
set_target_properties(${PROJECT_NAME}
29+
PROPERTIES
30+
LINK_DEPENDS ${LINKER_SCRIPT}
31+
SUFFIX ".elf"
32+
)
33+
34+
target_include_directories(${PROJECT_NAME}
35+
PUBLIC
36+
.
37+
)

Arm/MPS3_AN524/app/main.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* Copyright (c) 2021 Linaro Limited. */
2+
3+
#include <stdio.h>
4+
5+
int main(void)
6+
{
7+
/* ToDo: HW init (UART, pins, etc. ) */
8+
9+
/* tx_kernel_enter(); */
10+
11+
return 0;
12+
}
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
;/*
2+
; * Copyright (c) 2009-2019 Arm Limited. All rights reserved.
3+
; *
4+
; * Licensed under the Apache License, Version 2.0 (the "License");
5+
; * you may not use this file except in compliance with the License.
6+
; * You may obtain a copy of the License at
7+
; *
8+
; * http://www.apache.org/licenses/LICENSE-2.0
9+
; *
10+
; * Unless required by applicable law or agreed to in writing, software
11+
; * distributed under the License is distributed on an "AS IS" BASIS,
12+
; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
; * See the License for the specific language governing permissions and
14+
; * limitations under the License.
15+
; *
16+
; *
17+
; * This file is derivative of CMSIS V5.00 gcc_arm.ld
18+
; */
19+
20+
/* Linker script to configure memory regions. */
21+
/* This file will be run through the pre-processor. */
22+
23+
/* #include "region_defs.h" */
24+
25+
MEMORY
26+
{
27+
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 0x40000 /* 256 KB */
28+
RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 0x20000 /* 128 KB */
29+
}
30+
31+
__heap_size__ = 0x0001000;
32+
__msp_stack_size__ = 0x0001800;
33+
34+
/* Library configurations */
35+
GROUP(libgcc.a libc.a libm.a libnosys.a)
36+
37+
ENTRY(Reset_Handler)
38+
39+
SECTIONS
40+
{
41+
.text :
42+
{
43+
__Vectors_Start = .;
44+
KEEP(*(.vectors))
45+
__Vectors_End = .;
46+
__Vectors_Size = __Vectors_End - __Vectors_Start;
47+
__end__ = .;
48+
49+
*(.text*)
50+
51+
KEEP(*(.init))
52+
KEEP(*(.fini))
53+
54+
55+
/* .ctors */
56+
*crtbegin.o(.ctors)
57+
*crtbegin?.o(.ctors)
58+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
59+
*(SORT(.ctors.*))
60+
*(.ctors)
61+
62+
/* .dtors */
63+
*crtbegin.o(.dtors)
64+
*crtbegin?.o(.dtors)
65+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
66+
*(SORT(.dtors.*))
67+
*(.dtors)
68+
69+
*(.rodata*)
70+
71+
KEEP(*(.eh_frame*))
72+
} > FLASH
73+
74+
.ARM.extab :
75+
{
76+
*(.ARM.extab* .gnu.linkonce.armextab.*)
77+
} > FLASH
78+
79+
__exidx_start = .;
80+
.ARM.exidx :
81+
{
82+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
83+
} > FLASH
84+
__exidx_end = .;
85+
86+
/* To copy multiple ROM to RAM sections,
87+
* define etext2/data2_start/data2_end and
88+
* define __STARTUP_COPY_MULTIPLE in startup_cmsdk_mps3_an524_bl2.S */
89+
.copy.table :
90+
{
91+
. = ALIGN(4);
92+
__copy_table_start__ = .;
93+
LONG (__etext)
94+
LONG (__data_start__)
95+
LONG (__data_end__ - __data_start__)
96+
LONG (DEFINED(__etext2) ? __etext2 : 0)
97+
LONG (DEFINED(__data2_start__) ? __data2_start__ : 0)
98+
LONG (DEFINED(__data2_start__) ? __data2_end__ - __data2_start__ : 0)
99+
__copy_table_end__ = .;
100+
} > FLASH
101+
102+
/* To clear multiple BSS sections,
103+
* uncomment .zero.table section and,
104+
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_cmsdk_mps3_an524_bl2.S */
105+
.zero.table :
106+
{
107+
. = ALIGN(4);
108+
__zero_table_start__ = .;
109+
LONG (__bss_start__)
110+
LONG (__bss_end__ - __bss_start__)
111+
LONG (DEFINED(__bss2_start__) ? __bss2_start__ : 0)
112+
LONG (DEFINED(__bss2_start__) ? __bss2_end__ - __bss2_start__ : 0)
113+
__zero_table_end__ = .;
114+
} > FLASH
115+
116+
__etext = .;
117+
118+
.data : AT (__etext)
119+
{
120+
__data_start__ = .;
121+
*(vtable)
122+
*(.data*)
123+
124+
. = ALIGN(4);
125+
/* preinit data */
126+
PROVIDE_HIDDEN (__preinit_array_start = .);
127+
KEEP(*(.preinit_array))
128+
PROVIDE_HIDDEN (__preinit_array_end = .);
129+
130+
. = ALIGN(4);
131+
/* init data */
132+
PROVIDE_HIDDEN (__init_array_start = .);
133+
KEEP(*(SORT(.init_array.*)))
134+
KEEP(*(.init_array))
135+
PROVIDE_HIDDEN (__init_array_end = .);
136+
137+
138+
. = ALIGN(4);
139+
/* finit data */
140+
PROVIDE_HIDDEN (__fini_array_start = .);
141+
KEEP(*(SORT(.fini_array.*)))
142+
KEEP(*(.fini_array))
143+
PROVIDE_HIDDEN (__fini_array_end = .);
144+
145+
KEEP(*(.jcr*))
146+
. = ALIGN(4);
147+
/* All data end */
148+
__data_end__ = .;
149+
150+
} > RAM
151+
Image$$ER_DATA$$Base = ADDR(.data);
152+
153+
.bss :
154+
{
155+
. = ALIGN(4);
156+
__bss_start__ = .;
157+
*(.bss*)
158+
*(COMMON)
159+
. = ALIGN(4);
160+
__bss_end__ = .;
161+
} > RAM
162+
163+
bss_size = __bss_end__ - __bss_start__;
164+
165+
.msp_stack : ALIGN(32)
166+
{
167+
. += __msp_stack_size__;
168+
} > RAM
169+
Image$$ARM_LIB_STACK$$ZI$$Base = ADDR(.msp_stack);
170+
Image$$ARM_LIB_STACK$$ZI$$Limit = ADDR(.msp_stack) + SIZEOF(.msp_stack);
171+
172+
.heap : ALIGN(8)
173+
{
174+
. = ALIGN(8);
175+
__end__ = .;
176+
PROVIDE(end = .);
177+
__HeapBase = .;
178+
. += __heap_size__;
179+
__HeapLimit = .;
180+
__heap_limit = .; /* Add for _sbrk */
181+
} > RAM
182+
Image$$ARM_LIB_HEAP$$ZI$$Limit = ADDR(.heap) + SIZEOF(.heap);
183+
__RAM_segment_used_end__ = .;
184+
185+
PROVIDE(__stack = Image$$ARM_LIB_STACK$$ZI$$Limit);
186+
}

0 commit comments

Comments
 (0)