This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 4ab0b39e5d9f539daf9d78bd8ac6364cbc99aa9e Author: raiden00pl <[email protected]> AuthorDate: Sun Aug 16 16:21:21 2026 +0200 arch/arm/stm32: remove sources that are never built The unification commits moved the UID, waste and pulse count logic into common/stm32 and dropped the build rules for the per family copies, but left the files behind. The stm32wl5 MPU init and userspace sources were never listed in any build rule at all. Remove them. Signed-off-by: raiden00pl <[email protected]> Assisted-by: Claude Code --- arch/arm/src/stm32l5/stm32l5_uid.c | 48 --------------- arch/arm/src/stm32l5/stm32l5_waste.c | 44 -------------- arch/arm/src/stm32wb/stm32wb_uid.c | 48 --------------- arch/arm/src/stm32wb/stm32wb_waste.c | 46 --------------- arch/arm/src/stm32wl5/stm32wl5_mpuinit.c | 91 ----------------------------- arch/arm/src/stm32wl5/stm32wl5_uid.c | 63 -------------------- arch/arm/src/stm32wl5/stm32wl5_userspace.c | 93 ------------------------------ arch/arm/src/stm32wl5/stm32wl5_waste.c | 44 -------------- 8 files changed, 477 deletions(-) diff --git a/arch/arm/src/stm32l5/stm32l5_uid.c b/arch/arm/src/stm32l5/stm32l5_uid.c deleted file mode 100644 index 762f4e0c631..00000000000 --- a/arch/arm/src/stm32l5/stm32l5_uid.c +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32l5/stm32l5_uid.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include "hardware/stm32l5_memorymap.h" -#include "stm32l5_uid.h" - -#ifdef STM32_SYSMEM_UID - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -void stm32_get_uniqueid(uint8_t uniqueid[12]) -{ - int i; - - for (i = 0; i < 12; i++) - { - uniqueid[i] = *((uint8_t *)(STM32_SYSMEM_UID) + i); - } -} - -#endif /* STM32_SYSMEM_UID */ diff --git a/arch/arm/src/stm32l5/stm32l5_waste.c b/arch/arm/src/stm32l5/stm32l5_waste.c deleted file mode 100644 index 5d0055c04bb..00000000000 --- a/arch/arm/src/stm32l5/stm32l5_waste.c +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32l5/stm32l5_waste.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> -#include <stdint.h> -#include "stm32l5_waste.h" - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -uint32_t idle_wastecounter = 0; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -void stm32_waste(void) -{ - idle_wastecounter++; -} diff --git a/arch/arm/src/stm32wb/stm32wb_uid.c b/arch/arm/src/stm32wb/stm32wb_uid.c deleted file mode 100644 index da688a44086..00000000000 --- a/arch/arm/src/stm32wb/stm32wb_uid.c +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32wb/stm32wb_uid.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include "hardware/stm32wb_memorymap.h" -#include "stm32wb_uid.h" - -#ifdef STM32_SYSMEM_UID - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -void stm32_get_uniqueid(uint8_t uniqueid[12]) -{ - int i; - - for (i = 0; i < 12; i++) - { - uniqueid[i] = *((uint8_t *)(STM32_SYSMEM_UID) + i); - } -} - -#endif /* STM32_SYSMEM_UID */ diff --git a/arch/arm/src/stm32wb/stm32wb_waste.c b/arch/arm/src/stm32wb/stm32wb_waste.c deleted file mode 100644 index a3660b4ee5b..00000000000 --- a/arch/arm/src/stm32wb/stm32wb_waste.c +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32wb/stm32wb_waste.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include <stdint.h> - -#include "stm32wb_waste.h" - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -uint32_t g_waste_counter; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -void stm32_waste(void) -{ - g_waste_counter++; -} diff --git a/arch/arm/src/stm32wl5/stm32wl5_mpuinit.c b/arch/arm/src/stm32wl5/stm32wl5_mpuinit.c deleted file mode 100644 index 07fe40f5aef..00000000000 --- a/arch/arm/src/stm32wl5/stm32wl5_mpuinit.c +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32wl5/stm32wl5_mpuinit.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include <assert.h> -#include <sys/param.h> - -#include <nuttx/userspace.h> - -#include "mpu.h" -#include "stm32wl5_mpuinit.h" - -#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_mpuinitialize - * - * Description: - * Configure the MPU to permit user-space access to only restricted SAM3U - * resources. - * - ****************************************************************************/ - -void stm32_mpuinitialize(void) -{ - uintptr_t datastart = MIN(USERSPACE->us_datastart, USERSPACE->us_bssstart); - uintptr_t dataend = MAX(USERSPACE->us_dataend, USERSPACE->us_bssend); - - DEBUGASSERT(USERSPACE->us_textend >= USERSPACE->us_textstart && - dataend >= datastart); - - /* Show MPU information */ - - mpu_showtype(); - - /* Configure user flash and SRAM space */ - - mpu_user_flash(USERSPACE->us_textstart, - USERSPACE->us_textend - USERSPACE->us_textstart); - - mpu_user_intsram(datastart, dataend - datastart); - - /* Then enable the MPU */ - - mpu_control(true, false, true); -} - -/**************************************************************************** - * Name: stm32_mpu_uheap - * - * Description: - * Map the user-heap region. - * - * This logic may need an extension to handle external SDRAM). - * - ****************************************************************************/ - -void stm32_mpu_uheap(uintptr_t start, size_t size) -{ - mpu_user_intsram(start, size); -} - -#endif /* CONFIG_BUILD_PROTECTED && CONFIG_ARM_MPU */ diff --git a/arch/arm/src/stm32wl5/stm32wl5_uid.c b/arch/arm/src/stm32wl5/stm32wl5_uid.c deleted file mode 100644 index 1bd3fa1ce94..00000000000 --- a/arch/arm/src/stm32wl5/stm32wl5_uid.c +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32wl5/stm32wl5_uid.c - * - * SPDX-License-Identifier: BSD-3-Clause - * SPDX-FileCopyrightText: 2015 Marawan Ragab. All rights reserved. - * SPDX-FileContributor: Marawan Ragab <[email protected]> - * SPDX-FileContributor: [email protected] - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include "hardware/stm32wl5_memorymap.h" -#include "stm32wl5_uid.h" - -#ifdef STM32_SYSMEM_UID - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -void stm32_get_uniqueid(uint8_t uniqueid[12]) -{ - int i; - - for (i = 0; i < 12; i++) - { - uniqueid[i] = *((uint8_t *)(STM32_SYSMEM_UID)+i); - } -} - -#endif /* STM32_SYSMEM_UID */ diff --git a/arch/arm/src/stm32wl5/stm32wl5_userspace.c b/arch/arm/src/stm32wl5/stm32wl5_userspace.c deleted file mode 100644 index 23a8bfe9bba..00000000000 --- a/arch/arm/src/stm32wl5/stm32wl5_userspace.c +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32wl5/stm32wl5_userspace.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include <stdint.h> -#include <assert.h> - -#include <nuttx/userspace.h> - -#include "stm32wl5_mpuinit.h" -#include "stm32wl5_userspace.h" - -#ifdef CONFIG_BUILD_PROTECTED - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_userspace - * - * Description: - * For the case of the separate user-/kernel-space build, perform whatever - * platform specific initialization of the user memory is required. - * Normally this just means initializing the user space .data and .bss - * segments. - * - ****************************************************************************/ - -void stm32_userspace(void) -{ - uint8_t *src; - uint8_t *dest; - uint8_t *end; - - /* Clear all of user-space .bss */ - - DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && - USERSPACE->us_bssstart <= USERSPACE->us_bssend); - - dest = (uint8_t *)USERSPACE->us_bssstart; - end = (uint8_t *)USERSPACE->us_bssend; - - while (dest != end) - { - *dest++ = 0; - } - - /* Initialize all of user-space .data */ - - DEBUGASSERT(USERSPACE->us_datasource != 0 && - USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && - USERSPACE->us_datastart <= USERSPACE->us_dataend); - - src = (uint8_t *)USERSPACE->us_datasource; - dest = (uint8_t *)USERSPACE->us_datastart; - end = (uint8_t *)USERSPACE->us_dataend; - - while (dest != end) - { - *dest++ = *src++; - } - - /* Configure the MPU to permit user-space access to its FLASH and RAM */ - - stm32_mpuinitialize(); -} - -#endif /* CONFIG_BUILD_PROTECTED */ diff --git a/arch/arm/src/stm32wl5/stm32wl5_waste.c b/arch/arm/src/stm32wl5/stm32wl5_waste.c deleted file mode 100644 index c2da5213d4c..00000000000 --- a/arch/arm/src/stm32wl5/stm32wl5_waste.c +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32wl5/stm32wl5_waste.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> -#include <stdint.h> -#include "stm32wl5_waste.h" - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -uint32_t idle_wastecounter = 0; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -void stm32_waste(void) -{ - idle_wastecounter++; -}
