Skip to content

Commit 80c42df

Browse files
committed
[variant] Update Generic MP1xx
As STM32MP1 is particular, the generic target have to be customized by end user based on the used device tree. So, currently, generic menu will not be deployed. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 570bf48 commit 80c42df

File tree

9 files changed

+724
-1084
lines changed

9 files changed

+724
-1084
lines changed

Diff for: boards.txt

+6-3
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,6 @@ STM32MP1.build.mcu=cortex-m4
822822
STM32MP1.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
823823
STM32MP1.build.series=STM32MP1xx
824824
STM32MP1.build.cmsis_lib_gcc=arm_cortexM4l_math
825-
STM32MP1.build.variant_h=variant_STM32MP157_DK.h
826825
STM32MP1.build.extra_flags=-DCORE_CM4 -D{build.product_line} {build.enable_virtio} {build.xSerial}
827826

828827
# STM32MP157A-DK1 board
@@ -831,15 +830,19 @@ STM32MP1.menu.pnum.STM32MP157A_DK1.upload.maximum_size=131072
831830
STM32MP1.menu.pnum.STM32MP157A_DK1.upload.maximum_data_size=131072
832831
STM32MP1.menu.pnum.STM32MP157A_DK1.build.board=STM32MP157A_DK1
833832
STM32MP1.menu.pnum.STM32MP157A_DK1.build.product_line=STM32MP157Axx
834-
STM32MP1.menu.pnum.STM32MP157A_DK1.build.variant=STM32MP1xx/STM32MP157_DK
833+
STM32MP1.menu.pnum.STM32MP157A_DK1.build.variant=STM32MP1xx/MP153AAC_MP153CAC_MP153DAC_MP153FAC_MP157AAC_MP157CAC_MP157DAC_MP157FAC
834+
STM32MP1.menu.pnum.STM32MP157A_DK1.build.variant_h=variant_STM32MP157_DK.h
835+
STM32MP1.menu.pnum.STM32MP157A_DK1.build.peripheral_pins=-DCUSTOM_PERIPHERAL_PINS
835836

836837
# STM32MP157C-DK2 board
837838
STM32MP1.menu.pnum.STM32MP157C_DK2=STM32MP157C-DK2
838839
STM32MP1.menu.pnum.STM32MP157C_DK2.upload.maximum_size=131072
839840
STM32MP1.menu.pnum.STM32MP157C_DK2.upload.maximum_data_size=131072
840841
STM32MP1.menu.pnum.STM32MP157C_DK2.build.board=STM32MP157C_DK2
841842
STM32MP1.menu.pnum.STM32MP157C_DK2.build.product_line=STM32MP157Cxx
842-
STM32MP1.menu.pnum.STM32MP157C_DK2.build.variant=STM32MP1xx/STM32MP157_DK
843+
STM32MP1.menu.pnum.STM32MP157C_DK2.build.variant=STM32MP1xx/MP153AAC_MP153CAC_MP153DAC_MP153FAC_MP157AAC_MP157CAC_MP157DAC_MP157FAC
844+
STM32MP1.menu.pnum.STM32MP157C_DK2.build.variant_h=variant_STM32MP157_DK.h
845+
STM32MP1.menu.pnum.STM32MP157C_DK2.build.peripheral_pins=-DCUSTOM_PERIPHERAL_PINS
843846

844847
# Upload menu
845848
STM32MP1.menu.upload_method.MassStorage=Generate run_arduino.sh (You need to copy this manually)

Diff for: variants/STM32MP1xx/MP153AAC_MP153CAC_MP153DAC_MP153FAC_MP157AAC_MP157CAC_MP157DAC_MP157FAC/PeripheralPins_STM32MP157_DK.c

+509
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,64 @@
1-
/*
2-
******************************************************************************
3-
**
4-
** File : LinkerScript.ld
5-
**
6-
** Abstract : Linker script for STM32MP1 series
7-
**
8-
** Set heap size, stack size and stack location according
9-
** to application requirements.
10-
**
11-
** Set memory bank area and size if external memory is used.
12-
**
13-
** Target : STMicroelectronics STM32
14-
**
15-
** Distribution: The file is distributed “as is,” without any warranty
16-
** of any kind.
17-
**
18-
*****************************************************************************
19-
** @attention
20-
**
21-
** <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
22-
** All rights reserved.</center></h2>
23-
**
24-
** This software component is licensed by ST under BSD 3-Clause license,
25-
** the License; You may not use this file except in compliance with the
26-
** License. You may obtain a copy of the License at:
27-
** opensource.org/licenses/BSD-3-Clause
28-
**
29-
*****************************************************************************
30-
*/
1+
/**
2+
******************************************************************************
3+
* @file LinkerScript.ld
4+
* @author Auto-generated by STM32CubeIDE
5+
* @brief Linker script for STM32MP157xAC series
6+
* 128Kbytes FLASH
7+
* 128Kbytes RAM1
8+
* 128Kbytes RAM2
9+
*
10+
* Set heap size, stack size and stack location according
11+
* to application requirements.
12+
*
13+
* Set memory bank area and size if external memory is used
14+
******************************************************************************
15+
* @attention
16+
*
17+
* <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
18+
* All rights reserved.</center></h2>
19+
*
20+
* This software component is licensed by ST under BSD 3-Clause license,
21+
* the "License"; You may not use this file except in compliance with the
22+
* License. You may obtain a copy of the License at:
23+
* opensource.org/licenses/BSD-3-Clause
24+
*
25+
******************************************************************************
26+
*/
3127

3228
/* Entry Point */
3329
ENTRY(Reset_Handler)
3430

3531
/* Highest address of the user mode stack */
36-
_estack = 0x10040000; /* end of RAM */
32+
_estack = ORIGIN(RAM1_data) + LENGTH(RAM1_data); /* end of "RAM1_data" Ram type memory */
3733

38-
_Min_Heap_Size = 0x200; /* required amount of heap */
39-
_Min_Stack_Size = 0x400; /* required amount of stack */
34+
_Min_Heap_Size = 0x200; /* required amount of heap */
35+
_Min_Stack_Size = 0x400; /* required amount of stack */
4036

4137
/* Memories definition */
4238
MEMORY
4339
{
44-
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000298
45-
m_text (RX) : ORIGIN = 0x10000000, LENGTH = 0x00020000
46-
m_data (RW) : ORIGIN = 0x10020000, LENGTH = 0x00020000
47-
m_ipc_shm (RW) : ORIGIN = 0x10040000, LENGTH = 0x00008000
40+
RETRAM_interrupts (xrw) : ORIGIN = 0x00000000, LENGTH = 0x00000298
41+
FLASH_text (rx) : ORIGIN = 0x10000000, LENGTH = 128K
42+
RAM1_data (xrw) : ORIGIN = 0x10020000, LENGTH = 128K
43+
RAM2_ipc_shm (xrw) : ORIGIN = 0x10040000, LENGTH = 0x00008000
4844
}
4945

5046
/* Symbols needed for OpenAMP to enable rpmsg */
51-
__OPENAMP_region_start__ = ORIGIN(m_ipc_shm);
52-
__OPENAMP_region_end__ = ORIGIN(m_ipc_shm)+LENGTH(m_ipc_shm);
47+
__OPENAMP_region_start__ = ORIGIN(RAM2_ipc_shm);
48+
__OPENAMP_region_end__ = ORIGIN(RAM2_ipc_shm)+LENGTH(RAM2_ipc_shm);
5349

5450
/* Sections */
5551
SECTIONS
5652
{
57-
/* The startup code into ROM memory */
53+
/* The startup code into "RETRAM_interrupts" Ram type memory */
5854
.isr_vector :
5955
{
6056
. = ALIGN(4);
6157
KEEP(*(.isr_vector)) /* Startup code */
6258
. = ALIGN(4);
63-
} > m_interrupts
64-
59+
} >RETRAM_interrupts
6560

66-
/* The program code and other data into ROM memory */
61+
/* The program code and other data into "FLASH_text" Rom type memory */
6762
.text :
6863
{
6964
. = ALIGN(4);
@@ -78,30 +73,30 @@ SECTIONS
7873

7974
. = ALIGN(4);
8075
_etext = .; /* define a global symbols at end of code */
81-
} > m_text
76+
} >FLASH_text
8277

83-
/* Constant data into ROM memory*/
78+
/* Constant data into "FLASH_text" Rom type memory */
8479
.rodata :
8580
{
8681
. = ALIGN(4);
8782
*(.rodata) /* .rodata sections (constants, strings, etc.) */
8883
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
8984
. = ALIGN(4);
90-
} > m_text
85+
} >FLASH_text
9186

92-
.ARM.extab : {
87+
.ARM.extab : {
9388
. = ALIGN(4);
9489
*(.ARM.extab* .gnu.linkonce.armextab.*)
9590
. = ALIGN(4);
96-
} > m_text
97-
91+
} >FLASH_text
92+
9893
.ARM : {
9994
. = ALIGN(4);
10095
__exidx_start = .;
10196
*(.ARM.exidx*)
10297
__exidx_end = .;
10398
. = ALIGN(4);
104-
} > m_text
99+
} >FLASH_text
105100

106101
.preinit_array :
107102
{
@@ -110,8 +105,8 @@ SECTIONS
110105
KEEP (*(.preinit_array*))
111106
PROVIDE_HIDDEN (__preinit_array_end = .);
112107
. = ALIGN(4);
113-
} > m_text
114-
108+
} >FLASH_text
109+
115110
.init_array :
116111
{
117112
. = ALIGN(4);
@@ -120,8 +115,8 @@ SECTIONS
120115
KEEP (*(.init_array*))
121116
PROVIDE_HIDDEN (__init_array_end = .);
122117
. = ALIGN(4);
123-
} > m_text
124-
118+
} >FLASH_text
119+
125120
.fini_array :
126121
{
127122
. = ALIGN(4);
@@ -130,13 +125,13 @@ SECTIONS
130125
KEEP (*(.fini_array*))
131126
PROVIDE_HIDDEN (__fini_array_end = .);
132127
. = ALIGN(4);
133-
} > m_text
128+
} >FLASH_text
134129

135130
/* Used by the startup to initialize data */
136131
__DATA_ROM = .;
137132
_sidata = LOADADDR(.data);
138133

139-
/* Initialized data sections */
134+
/* Initialized data sections into "RAM1_data" Ram type memory */
140135
.data : AT(__DATA_ROM)
141136
{
142137
. = ALIGN(4);
@@ -146,21 +141,21 @@ SECTIONS
146141

147142
. = ALIGN(4);
148143
_edata = .; /* define a global symbol at data end */
149-
} > m_data
144+
} >RAM1_data
145+
146+
__DATA_END = __DATA_ROM + (_edata - _sdata);
147+
text_end = ORIGIN(FLASH_text) + LENGTH(FLASH_text);
148+
ASSERT(__DATA_END <= text_end, "region FLASH_text overflowed with text and data")
150149

151-
__DATA_END = __DATA_ROM + (_edata - _sdata);
152-
text_end = ORIGIN(m_text) + LENGTH(m_text);
153-
ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
154150

155151
.resource_table :
156152
{
157153
. = ALIGN(4);
158154
KEEP (*(.resource_table*))
159155
. = ALIGN(4);
160-
} > m_data
161-
156+
} >RAM1_data
162157

163-
/* Uninitialized data section into RAM memory */
158+
/* Uninitialized data section into "RAM1_data" Ram type memory */
164159
. = ALIGN(4);
165160
.bss :
166161
{
@@ -174,9 +169,9 @@ SECTIONS
174169
. = ALIGN(4);
175170
_ebss = .; /* define a global symbol at bss end */
176171
__bss_end__ = _ebss;
177-
} > m_data
172+
} >RAM1_data
178173

179-
/* User_heap_stack section, used to check that there is enough RAM left */
174+
/* User_heap_stack section, used to check that there is enough "RAM1_data" Ram type memory left */
180175
._user_heap_stack :
181176
{
182177
. = ALIGN(8);
@@ -185,9 +180,7 @@ SECTIONS
185180
. = . + _Min_Heap_Size;
186181
. = . + _Min_Stack_Size;
187182
. = ALIGN(8);
188-
} > m_data
189-
190-
183+
} >RAM1_data
191184

192185
/* Remove information from the compiler libraries */
193186
/DISCARD/ :
@@ -198,5 +191,4 @@ SECTIONS
198191
}
199192

200193
.ARM.attributes 0 : { *(.ARM.attributes) }
201-
202194
}

Diff for: variants/STM32MP1xx/STM32MP157_DK/variant_STM32MP157_DK.cpp renamed to variants/STM32MP1xx/MP153AAC_MP153CAC_MP153DAC_MP153FAC_MP157AAC_MP157CAC_MP157DAC_MP157FAC/variant_STM32MP157_DK.cpp

+7-31
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,18 @@
11
/*
22
*******************************************************************************
3-
* Copyright (c) 2017, STMicroelectronics
3+
* Copyright (c) 2021, STMicroelectronics
44
* All rights reserved.
55
*
6-
* Redistribution and use in source and binary forms, with or without
7-
* modification, are permitted provided that the following conditions are met:
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
810
*
9-
* 1. Redistributions of source code must retain the above copyright notice,
10-
* this list of conditions and the following disclaimer.
11-
* 2. Redistributions in binary form must reproduce the above copyright notice,
12-
* this list of conditions and the following disclaimer in the documentation
13-
* and/or other materials provided with the distribution.
14-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15-
* may be used to endorse or promote products derived from this software
16-
* without specific prior written permission.
17-
*
18-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2811
*******************************************************************************
2912
*/
30-
13+
#if defined(ARDUINO_STM32MP157A_DK1) || defined(ARDUINO_STM32MP157C_DK2)
3114
#include "pins_arduino.h"
3215

33-
#ifdef __cplusplus
34-
extern "C" {
35-
#endif
36-
3716
// Pin number
3817
// This array allows to wrap Arduino pin number(Dx or x)
3918
// to STM32 PinName (PX_n)
@@ -122,10 +101,6 @@ const uint32_t analogInputPin[] = {
122101
24 // A5
123102
};
124103

125-
#ifdef __cplusplus
126-
}
127-
#endif
128-
129104
// ----------------------------------------------------------------------------
130105

131106
#ifdef __cplusplus
@@ -282,3 +257,4 @@ void SystemClock_Config(void)
282257
#ifdef __cplusplus
283258
}
284259
#endif
260+
#endif /* ARDUINO_STM32MP157* */

0 commit comments

Comments
 (0)