Skip to content

Commit ec5436b

Browse files
committed
bsp: Add STM32U083C-DK board
Signed-off-by: Mengsk <[email protected]>
1 parent 5130850 commit ec5436b

File tree

10 files changed

+1167
-1
lines changed

10 files changed

+1167
-1
lines changed
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
/*
2+
* FreeRTOS Kernel V10.0.0
3+
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
* this software and associated documentation files (the "Software"), to deal in
7+
* the Software without restriction, including without limitation the rights to
8+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
* the Software, and to permit persons to whom the Software is furnished to do so,
10+
* subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software. If you wish to use our Amazon
14+
* FreeRTOS name, please do so in a fair use way that does not cause confusion.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*
23+
* http://www.FreeRTOS.org
24+
* http://aws.amazon.com/freertos
25+
*
26+
* 1 tab == 4 spaces!
27+
*/
28+
29+
30+
#ifndef FREERTOS_CONFIG_H
31+
#define FREERTOS_CONFIG_H
32+
33+
/*-----------------------------------------------------------
34+
* Application specific definitions.
35+
*
36+
* These definitions should be adjusted for your particular hardware and
37+
* application requirements.
38+
*
39+
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
40+
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
41+
*
42+
* See http://www.freertos.org/a00110.html.
43+
*----------------------------------------------------------*/
44+
45+
// skip if included from IAR assembler
46+
#ifndef __IASMARM__
47+
#include "stm32u0xx.h"
48+
#endif
49+
50+
/* Cortex M23/M33 port configuration. */
51+
#define configENABLE_MPU 0
52+
#define configENABLE_FPU 0
53+
#define configENABLE_TRUSTZONE 0
54+
#define configMINIMAL_SECURE_STACK_SIZE (1024)
55+
56+
#define configUSE_PREEMPTION 1
57+
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
58+
#define configCPU_CLOCK_HZ SystemCoreClock
59+
#define configTICK_RATE_HZ ( 1000 )
60+
#define configMAX_PRIORITIES ( 5 )
61+
#define configMINIMAL_STACK_SIZE ( 200 )
62+
#define configTOTAL_HEAP_SIZE ( configSUPPORT_DYNAMIC_ALLOCATION*4*1024 )
63+
#define configMAX_TASK_NAME_LEN 16
64+
#define configUSE_16_BIT_TICKS 0
65+
#define configIDLE_SHOULD_YIELD 1
66+
#define configUSE_MUTEXES 1
67+
#define configUSE_RECURSIVE_MUTEXES 1
68+
#define configUSE_COUNTING_SEMAPHORES 1
69+
#define configQUEUE_REGISTRY_SIZE 4
70+
#define configUSE_QUEUE_SETS 0
71+
#define configUSE_TIME_SLICING 0
72+
#define configUSE_NEWLIB_REENTRANT 0
73+
#define configENABLE_BACKWARD_COMPATIBILITY 1
74+
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
75+
76+
#define configSUPPORT_STATIC_ALLOCATION 1
77+
#define configSUPPORT_DYNAMIC_ALLOCATION 0
78+
79+
/* Hook function related definitions. */
80+
#define configUSE_IDLE_HOOK 0
81+
#define configUSE_TICK_HOOK 0
82+
#define configUSE_MALLOC_FAILED_HOOK 0 // cause nested extern warning
83+
#define configCHECK_FOR_STACK_OVERFLOW 2
84+
#define configCHECK_HANDLER_INSTALLATION 0
85+
86+
/* Run time and task stats gathering related definitions. */
87+
#define configGENERATE_RUN_TIME_STATS 0
88+
#define configRECORD_STACK_HIGH_ADDRESS 1
89+
#define configUSE_TRACE_FACILITY 1 // legacy trace
90+
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
91+
92+
/* Co-routine definitions. */
93+
#define configUSE_CO_ROUTINES 0
94+
#define configMAX_CO_ROUTINE_PRIORITIES 2
95+
96+
/* Software timer related definitions. */
97+
#define configUSE_TIMERS 1
98+
#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES-2)
99+
#define configTIMER_QUEUE_LENGTH 32
100+
#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE
101+
102+
/* Optional functions - most linkers will remove unused functions anyway. */
103+
#define INCLUDE_vTaskPrioritySet 0
104+
#define INCLUDE_uxTaskPriorityGet 0
105+
#define INCLUDE_vTaskDelete 0
106+
#define INCLUDE_vTaskSuspend 1 // required for queue, semaphore, mutex to be blocked indefinitely with portMAX_DELAY
107+
#define INCLUDE_xResumeFromISR 0
108+
#define INCLUDE_vTaskDelayUntil 1
109+
#define INCLUDE_vTaskDelay 1
110+
#define INCLUDE_xTaskGetSchedulerState 0
111+
#define INCLUDE_xTaskGetCurrentTaskHandle 1
112+
#define INCLUDE_uxTaskGetStackHighWaterMark 0
113+
#define INCLUDE_xTaskGetIdleTaskHandle 0
114+
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
115+
#define INCLUDE_pcTaskGetTaskName 0
116+
#define INCLUDE_eTaskGetState 0
117+
#define INCLUDE_xEventGroupSetBitFromISR 0
118+
#define INCLUDE_xTimerPendFunctionCall 0
119+
120+
/* FreeRTOS hooks to NVIC vectors */
121+
#define xPortPendSVHandler PendSV_Handler
122+
#define xPortSysTickHandler SysTick_Handler
123+
#define vPortSVCHandler SVC_Handler
124+
125+
//--------------------------------------------------------------------+
126+
// Interrupt nesting behavior configuration.
127+
//--------------------------------------------------------------------+
128+
129+
// For Cortex-M specific: __NVIC_PRIO_BITS is defined in mcu header
130+
#define configPRIO_BITS 2
131+
132+
/* The lowest interrupt priority that can be used in a call to a "set priority" function. */
133+
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ((1<<configPRIO_BITS) - 1)
134+
135+
/* The highest interrupt priority that can be used by any interrupt service
136+
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
137+
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
138+
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
139+
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2
140+
141+
/* Interrupt priorities used by the kernel port layer itself. These are generic
142+
to all Cortex-M ports, and do not rely on any particular library functions. */
143+
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
144+
145+
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
146+
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
147+
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
148+
149+
#endif
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
/**
2+
******************************************************************************
3+
* @file LinkerScript.ld
4+
* @author Auto-generated by STM32CubeIDE
5+
* @brief Linker script for STM32U083MCTx Device from STM32U0 series
6+
* 256KBytes FLASH
7+
* 40KBytes RAM
8+
*
9+
* Set heap size, stack size and stack location according
10+
* to application requirements.
11+
*
12+
* Set memory bank area and size if external memory is used
13+
******************************************************************************
14+
* @attention
15+
*
16+
* Copyright (c) 2023 STMicroelectronics.
17+
* All rights reserved.
18+
*
19+
* This software is licensed under terms that can be found in the LICENSE file
20+
* in the root directory of this software component.
21+
* If no LICENSE file comes with this software, it is provided AS-IS.
22+
*
23+
******************************************************************************
24+
*/
25+
26+
/* Entry Point */
27+
ENTRY(Reset_Handler)
28+
29+
/* Highest address of the user mode stack */
30+
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
31+
32+
_Min_Heap_Size = 0x200; /* required amount of heap */
33+
_Min_Stack_Size = 0x400; /* required amount of stack */
34+
35+
/* Memories definition */
36+
MEMORY
37+
{
38+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 40K
39+
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K
40+
}
41+
42+
/* Sections */
43+
SECTIONS
44+
{
45+
/* The startup code into "FLASH" Rom type memory */
46+
.isr_vector :
47+
{
48+
. = ALIGN(4);
49+
KEEP(*(.isr_vector)) /* Startup code */
50+
. = ALIGN(4);
51+
} >FLASH
52+
53+
/* The program code and other data into "FLASH" Rom type memory */
54+
.text :
55+
{
56+
. = ALIGN(4);
57+
*(.text) /* .text sections (code) */
58+
*(.text*) /* .text* sections (code) */
59+
*(.glue_7) /* glue arm to thumb code */
60+
*(.glue_7t) /* glue thumb to arm code */
61+
*(.eh_frame)
62+
63+
KEEP (*(.init))
64+
KEEP (*(.fini))
65+
66+
. = ALIGN(4);
67+
_etext = .; /* define a global symbols at end of code */
68+
} >FLASH
69+
70+
/* Constant data into "FLASH" Rom type memory */
71+
.rodata :
72+
{
73+
. = ALIGN(4);
74+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
75+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
76+
. = ALIGN(4);
77+
} >FLASH
78+
79+
.ARM.extab : {
80+
. = ALIGN(4);
81+
*(.ARM.extab* .gnu.linkonce.armextab.*)
82+
. = ALIGN(4);
83+
} >FLASH
84+
85+
.ARM : {
86+
. = ALIGN(4);
87+
__exidx_start = .;
88+
*(.ARM.exidx*)
89+
__exidx_end = .;
90+
. = ALIGN(4);
91+
} >FLASH
92+
93+
.preinit_array :
94+
{
95+
. = ALIGN(4);
96+
PROVIDE_HIDDEN (__preinit_array_start = .);
97+
KEEP (*(.preinit_array*))
98+
PROVIDE_HIDDEN (__preinit_array_end = .);
99+
. = ALIGN(4);
100+
} >FLASH
101+
102+
.init_array :
103+
{
104+
. = ALIGN(4);
105+
PROVIDE_HIDDEN (__init_array_start = .);
106+
KEEP (*(SORT(.init_array.*)))
107+
KEEP (*(.init_array*))
108+
PROVIDE_HIDDEN (__init_array_end = .);
109+
. = ALIGN(4);
110+
} >FLASH
111+
112+
.fini_array :
113+
{
114+
. = ALIGN(4);
115+
PROVIDE_HIDDEN (__fini_array_start = .);
116+
KEEP (*(SORT(.fini_array.*)))
117+
KEEP (*(.fini_array*))
118+
PROVIDE_HIDDEN (__fini_array_end = .);
119+
. = ALIGN(4);
120+
} >FLASH
121+
122+
/* Used by the startup to initialize data */
123+
_sidata = LOADADDR(.data);
124+
125+
/* Initialized data sections into "RAM" Ram type memory */
126+
.data :
127+
{
128+
. = ALIGN(4);
129+
_sdata = .; /* create a global symbol at data start */
130+
*(.data) /* .data sections */
131+
*(.data*) /* .data* sections */
132+
*(.RamFunc) /* .RamFunc sections */
133+
*(.RamFunc*) /* .RamFunc* sections */
134+
135+
. = ALIGN(4);
136+
_edata = .; /* define a global symbol at data end */
137+
138+
} >RAM AT> FLASH
139+
140+
/* Uninitialized data section into "RAM" Ram type memory */
141+
. = ALIGN(4);
142+
.bss :
143+
{
144+
/* This is used by the startup in order to initialize the .bss section */
145+
_sbss = .; /* define a global symbol at bss start */
146+
__bss_start__ = _sbss;
147+
*(.bss)
148+
*(.bss*)
149+
*(COMMON)
150+
151+
. = ALIGN(4);
152+
_ebss = .; /* define a global symbol at bss end */
153+
__bss_end__ = _ebss;
154+
} >RAM
155+
156+
/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
157+
._user_heap_stack :
158+
{
159+
. = ALIGN(8);
160+
PROVIDE ( end = . );
161+
PROVIDE ( _end = . );
162+
. = . + _Min_Heap_Size;
163+
. = . + _Min_Stack_Size;
164+
. = ALIGN(8);
165+
} >RAM
166+
167+
/* Remove information from the compiler libraries */
168+
/DISCARD/ :
169+
{
170+
libc.a ( * )
171+
libm.a ( * )
172+
libgcc.a ( * )
173+
}
174+
175+
.ARM.attributes 0 : { *(.ARM.attributes) }
176+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set(MCU_VARIANT stm32u083xx)
2+
set(JLINK_DEVICE stm32u083mc)
3+
4+
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32U083MCTx_FLASH.ld)
5+
6+
function(update_board TARGET)
7+
target_compile_definitions(${TARGET} PUBLIC
8+
STM32U083xx
9+
)
10+
endfunction()

0 commit comments

Comments
 (0)