Skip to content

Commit

Permalink
hw/bsp/stm32f4: Add CCM region to linker script
Browse files Browse the repository at this point in the history
This adds memory memory_regions.ld.h for device that have CCM.
MCU stack is also placed in CCM memory instead of RAM region.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
  • Loading branch information
kasjer committed Apr 24, 2024
1 parent 1c0cea8 commit 65d208e
Show file tree
Hide file tree
Showing 12 changed files with 348 additions and 0 deletions.
33 changes: 33 additions & 0 deletions hw/bsp/ada_feather_stm32f405/link/include/mcu_config.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/*
* Memory regions placed in CCM
* If stack or core data or other section should be place in RAM
* <target_name>/link/include/target_config.ld.h should just do:
* #undef BSSNZ_RAM
* #undef COREBSS_RAM
* #undef COREDATA_RAM
* #undef STACK_REGION
*/

#define BSSNZ_RAM CCM
#define COREBSS_RAM CCM
#define COREDATA_RAM CCM
#define STACK_REGION CCM
25 changes: 25 additions & 0 deletions hw/bsp/ada_feather_stm32f405/link/include/memory_regions.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#ifdef STACK_REGION
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = (64K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x10010000 - STACK_SIZE, LENGTH = STACK_SIZE
#else
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
#endif
33 changes: 33 additions & 0 deletions hw/bsp/black_vet6/link/include/mcu_config.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/*
* Memory regions placed in CCM
* If stack or core data or other section should be place in RAM
* <target_name>/link/include/target_config.ld.h should just do:
* #undef BSSNZ_RAM
* #undef COREBSS_RAM
* #undef COREDATA_RAM
* #undef STACK_REGION
*/

#define BSSNZ_RAM CCM
#define COREBSS_RAM CCM
#define COREDATA_RAM CCM
#define STACK_REGION CCM
25 changes: 25 additions & 0 deletions hw/bsp/black_vet6/link/include/memory_regions.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#ifdef STACK_REGION
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = (64K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x10010000 - STACK_SIZE, LENGTH = STACK_SIZE
#else
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
#endif
33 changes: 33 additions & 0 deletions hw/bsp/nucleo-f413zh/link/include/mcu_config.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/*
* Memory regions placed in CCM
* If stack or core data or other section should be place in RAM
* <target_name>/link/include/target_config.ld.h should just do:
* #undef BSSNZ_RAM
* #undef COREBSS_RAM
* #undef COREDATA_RAM
* #undef STACK_REGION
*/

#define BSSNZ_RAM CCM
#define COREBSS_RAM CCM
#define COREDATA_RAM CCM
#define STACK_REGION CCM
25 changes: 25 additions & 0 deletions hw/bsp/nucleo-f413zh/link/include/memory_regions.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#ifdef STACK_REGION
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = (64K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x10010000 - STACK_SIZE, LENGTH = STACK_SIZE
#else
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
#endif
33 changes: 33 additions & 0 deletions hw/bsp/nucleo-f439zi/link/include/mcu_config.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/*
* Memory regions placed in CCM
* If stack or core data or other section should be place in RAM
* <target_name>/link/include/target_config.ld.h should just do:
* #undef BSSNZ_RAM
* #undef COREBSS_RAM
* #undef COREDATA_RAM
* #undef STACK_REGION
*/

#define BSSNZ_RAM CCM
#define COREBSS_RAM CCM
#define COREDATA_RAM CCM
#define STACK_REGION CCM
25 changes: 25 additions & 0 deletions hw/bsp/nucleo-f439zi/link/include/memory_regions.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#ifdef STACK_REGION
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = (64K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x10010000 - STACK_SIZE, LENGTH = STACK_SIZE
#else
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
#endif
33 changes: 33 additions & 0 deletions hw/bsp/olimex_stm32-e407_devboard/link/include/mcu_config.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/*
* Memory regions placed in CCM
* If stack or core data or other section should be place in RAM
* <target_name>/link/include/target_config.ld.h should just do:
* #undef BSSNZ_RAM
* #undef COREBSS_RAM
* #undef COREDATA_RAM
* #undef STACK_REGION
*/

#define BSSNZ_RAM CCM
#define COREBSS_RAM CCM
#define COREDATA_RAM CCM
#define STACK_REGION CCM
25 changes: 25 additions & 0 deletions hw/bsp/olimex_stm32-e407_devboard/link/include/memory_regions.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#ifdef STACK_REGION
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = (64K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x10010000 - STACK_SIZE, LENGTH = STACK_SIZE
#else
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
#endif
33 changes: 33 additions & 0 deletions hw/bsp/stm32f429discovery/link/include/mcu_config.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/*
* Memory regions placed in CCM
* If stack or core data or other section should be place in RAM
* <target_name>/link/include/target_config.ld.h should just do:
* #undef BSSNZ_RAM
* #undef COREBSS_RAM
* #undef COREDATA_RAM
* #undef STACK_REGION
*/

#define BSSNZ_RAM CCM
#define COREBSS_RAM CCM
#define COREDATA_RAM CCM
#define STACK_REGION CCM
25 changes: 25 additions & 0 deletions hw/bsp/stm32f429discovery/link/include/memory_regions.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#ifdef STACK_REGION
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = (64K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x10010000 - STACK_SIZE, LENGTH = STACK_SIZE
#else
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
#endif

0 comments on commit 65d208e

Please sign in to comment.