mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
!arch/stm32: unify and commonize stm32_uid for all STM32 families.
Replace the per-family stm32_get_uniqueid() implementations and the two IP-versioned common variants with a single generic byte-array reader, arch/arm/src/common/stm32/stm32_uid.c. BREAKING CHANGE for STM32 M0 families: stm32_get_uniqueid() now always takes a uint8_t[12] buffer. Out-of-tree Cortex-M0 code that used the previous prototype "void stm32_get_uniqueid(uint32_t *uid)" must change its buffer to "uint8_t uniqueid[12]". Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
parent
fb428899dc
commit
09e4bb45e4
53 changed files with 33 additions and 798 deletions
|
|
@ -32,6 +32,7 @@ set(SRCS)
|
|||
# Architecture-neutral sources used by every STM32 family
|
||||
|
||||
list(APPEND SRCS stm32_waste.c)
|
||||
list(APPEND SRCS stm32_uid.c)
|
||||
|
||||
if(CONFIG_STM32_COMMON_LEGACY)
|
||||
list(
|
||||
|
|
@ -75,10 +76,6 @@ if(CONFIG_STM32_COMMON_LEGACY)
|
|||
list(APPEND SRCS stm32_ccm_m3m4_v1.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_HAVE_IP_UID_M3M4_V1)
|
||||
list(APPEND SRCS stm32_uid_m3m4_v1v2.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_HAVE_IP_DFUMODE_M3M4_V1)
|
||||
list(APPEND SRCS stm32_dfumode_m3m4_v1.c)
|
||||
endif()
|
||||
|
|
@ -369,10 +366,6 @@ if(CONFIG_ARCH_CORTEXM0)
|
|||
list(APPEND SRCS stm32_exti_gpio_m0_v1.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_HAVE_IP_UID_M0_V1)
|
||||
list(APPEND SRCS stm32_uid_m0_v1.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_HAVE_IP_USART_V3)
|
||||
list(APPEND SRCS stm32_lowputc_usart_m0_v3.c stm32_serial_m0_v3.c)
|
||||
elseif(CONFIG_STM32_HAVE_IP_USART_V4)
|
||||
|
|
|
|||
|
|
@ -1114,14 +1114,6 @@ config STM32_HAVE_UART12
|
|||
config STM32_HAVE_USART1
|
||||
bool
|
||||
|
||||
# UID capabilities
|
||||
|
||||
config STM32_HAVE_IP_UID_M0_V1
|
||||
bool
|
||||
|
||||
config STM32_HAVE_IP_UID_M3M4_V1
|
||||
bool
|
||||
|
||||
# USB capabilities
|
||||
|
||||
config STM32_HAVE_USBFS_MODE
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ ARCHXXINCLUDES += ${INCDIR_PREFIX}$(STM32_COMMON_SRCDIR)
|
|||
# Architecture-neutral sources used by every STM32 family
|
||||
|
||||
CHIP_CSRCS += stm32_waste.c
|
||||
CHIP_CSRCS += stm32_uid.c
|
||||
|
||||
ifeq ($(CONFIG_STM32_COMMON_LEGACY),y)
|
||||
|
||||
|
|
@ -88,9 +89,6 @@ endif
|
|||
ifeq ($(CONFIG_STM32_HAVE_IP_CCM_M3M4_V1),y)
|
||||
CHIP_CSRCS += stm32_ccm_m3m4_v1.c
|
||||
endif
|
||||
ifeq ($(CONFIG_STM32_HAVE_IP_UID_M3M4_V1),y)
|
||||
CHIP_CSRCS += stm32_uid_m3m4_v1v2.c
|
||||
endif
|
||||
CHIP_CSRCS += stm32_capture_m3m4_v1.c
|
||||
ifeq ($(CONFIG_STM32_HAVE_IP_DFUMODE_M3M4_V1),y)
|
||||
CHIP_CSRCS += stm32_dfumode_m3m4_v1.c
|
||||
|
|
@ -422,9 +420,6 @@ CHIP_CSRCS += stm32_serial_m0_v3.c
|
|||
else ifeq ($(CONFIG_STM32_HAVE_IP_USART_V4),y)
|
||||
CHIP_CSRCS += stm32_serial_m0_v4.c
|
||||
endif
|
||||
ifeq ($(CONFIG_STM32_HAVE_IP_UID_M0_V1),y)
|
||||
CHIP_CSRCS += stm32_uid_m0_v1.c
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_STM32_RTC_LSECLOCK)$(CONFIG_LCD_LSECLOCK),)
|
||||
CHIP_CSRCS += stm32_lse_m0_v1.c
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32f7/stm32_uid.c
|
||||
* arch/arm/src/common/stm32/stm32_uid.c
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
* SPDX-FileCopyrightText: 2015 Marawan Ragab. All rights reserved.
|
||||
|
|
@ -40,11 +40,10 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "hardware/stm32_memorymap.h"
|
||||
|
||||
#include "chip.h"
|
||||
#include "stm32_uid.h"
|
||||
|
||||
#ifdef STM32_SYSMEM_UID
|
||||
#ifdef STM32_SYSMEM_UID /* Not defined for some STM32 parts */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
|
@ -35,10 +35,10 @@
|
|||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_STM32_HAVE_IP_UID_M0_V1)
|
||||
void stm32_get_uniqueid(uint32_t *uid);
|
||||
#elif defined(CONFIG_STM32_HAVE_IP_UID_M3M4_V1)
|
||||
/* Read the 96-bit STM32 unique device ID into a 12-byte buffer. This
|
||||
* interface is common to all STM32 families.
|
||||
*/
|
||||
|
||||
void stm32_get_uniqueid(uint8_t uniqueid[12]);
|
||||
#endif
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_COMMON_COMPAT_STM32_UID_H */
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/common/stm32/stm32_uid_m0_v1.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/stm32_memorymap.h"
|
||||
|
||||
#include "stm32_uid.h"
|
||||
|
||||
#ifdef STM32_SYSMEM_UID
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_get_uniqueid(uint32_t *uid)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
*(uid + i) = *((uint32_t *)(STM32_SYSMEM_UID) + i);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* STM32_SYSMEM_UID */
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/common/stm32/stm32_uid_m3m4_v1v2.c
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
* SPDX-FileCopyrightText: 2015 Marawan Ragab. All rights reserved.
|
||||
* SPDX-FileContributor: Marawan Ragab <marawan31@gmail.com>
|
||||
*
|
||||
* 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/stm32_memorymap.h"
|
||||
#include "stm32_uid.h"
|
||||
|
||||
#ifdef STM32_SYSMEM_UID /* Not defined for the STM32L */
|
||||
|
||||
/****************************************************************************
|
||||
* 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 */
|
||||
|
|
@ -252,7 +252,6 @@ config STM32_STM32C0
|
|||
select STM32_HAVE_IP_TIMERS_M0_V1
|
||||
select STM32_HAVE_IP_USART_V4
|
||||
select STM32_HAVE_IP_WDG_M0_V1
|
||||
select STM32_HAVE_IP_UID_M0_V1
|
||||
select STM32_HAVE_IP_USBDEV_M0_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_TIM1
|
||||
select STM32_HAVE_TIM2
|
||||
|
|
|
|||
|
|
@ -495,7 +495,6 @@ config STM32_STM32F0
|
|||
select STM32_HAVE_IP_TIMERS_M0_V1
|
||||
select STM32_HAVE_IP_USART_V3
|
||||
select STM32_HAVE_IP_WDG_M0_V1
|
||||
select STM32_HAVE_IP_UID_M0_V1
|
||||
select STM32_HAVE_IP_USBDEV_M0_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_IP_HSI48_M0_V1 if STM32_HAVE_HSI48
|
||||
|
||||
|
|
|
|||
|
|
@ -338,7 +338,6 @@ config STM32_STM32F10XX
|
|||
select STM32_HAVE_IP_SPI_V1
|
||||
select STM32_HAVE_IP_SYSCFG_M3M4_V1
|
||||
select STM32_HAVE_IP_TIMERS_M3M4_V1
|
||||
select STM32_HAVE_IP_UID_M3M4_V1
|
||||
select STM32_HAVE_IP_USART_V1
|
||||
select STM32_HAVE_IP_USBDEV_M3M4_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_IP_USBFS_M3M4_V1 if STM32_HAVE_USBFS
|
||||
|
|
|
|||
|
|
@ -167,7 +167,6 @@ config STM32_STM32F20XX
|
|||
select STM32_HAVE_IP_SPI_V2
|
||||
select STM32_HAVE_IP_SYSCFG_M3M4_V1
|
||||
select STM32_HAVE_IP_TIMERS_M3M4_V1
|
||||
select STM32_HAVE_IP_UID_M3M4_V1
|
||||
select STM32_HAVE_IP_USART_V2
|
||||
select STM32_HAVE_IP_USBDEV_M3M4_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_IP_USBFS_M3M4_V1 if STM32_HAVE_USBFS
|
||||
|
|
|
|||
|
|
@ -449,7 +449,6 @@ config STM32_STM32F30XX
|
|||
select STM32_HAVE_IP_SPI_V3
|
||||
select STM32_HAVE_IP_SYSCFG_M3M4_V1
|
||||
select STM32_HAVE_IP_TIMERS_M3M4_V2
|
||||
select STM32_HAVE_IP_UID_M3M4_V1
|
||||
select STM32_HAVE_IP_USART_V3
|
||||
select STM32_HAVE_IP_USBDEV_M3M4_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_IP_USBFS_M3M4_V1 if STM32_HAVE_USBFS
|
||||
|
|
@ -543,7 +542,6 @@ config STM32_STM32F33XX
|
|||
select STM32_HAVE_IP_SPI_V3
|
||||
select STM32_HAVE_IP_SYSCFG_M3M4_V1
|
||||
select STM32_HAVE_IP_TIMERS_M3M4_V2
|
||||
select STM32_HAVE_IP_UID_M3M4_V1
|
||||
select STM32_HAVE_IP_USART_V3
|
||||
select STM32_HAVE_IP_USBDEV_M3M4_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_IP_USBFS_M3M4_V1 if STM32_HAVE_USBFS
|
||||
|
|
@ -618,7 +616,6 @@ config STM32_STM32F37XX
|
|||
select STM32_HAVE_IP_SDIO_M3M4_V1
|
||||
select STM32_HAVE_IP_SPI_V3
|
||||
select STM32_HAVE_IP_SYSCFG_M3M4_V1
|
||||
select STM32_HAVE_IP_UID_M3M4_V1
|
||||
select STM32_HAVE_IP_USART_V3
|
||||
select STM32_HAVE_IP_USBDEV_M3M4_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_IP_USBFS_M3M4_V1 if STM32_HAVE_USBFS
|
||||
|
|
|
|||
|
|
@ -282,7 +282,6 @@ config STM32_STM32F4XXX
|
|||
select STM32_HAVE_IP_SPI_V2
|
||||
select STM32_HAVE_IP_SYSCFG_M3M4_V1
|
||||
select STM32_HAVE_IP_TIMERS_M3M4_V1
|
||||
select STM32_HAVE_IP_UID_M3M4_V1
|
||||
select STM32_HAVE_IP_USART_V2
|
||||
select STM32_HAVE_IP_USBDEV_M3M4_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_IP_USBFS_M3M4_V1 if STM32_HAVE_USBFS
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ list(
|
|||
stm32_rcc.c
|
||||
stm32_serial.c
|
||||
stm32_start.c
|
||||
stm32_capture.c
|
||||
stm32_uid.c)
|
||||
stm32_capture.c)
|
||||
|
||||
if(CONFIG_STM32_TICKLESS_TIMER)
|
||||
list(APPEND SRCS stm32_tickless.c)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ include common/stm32/Make.defs
|
|||
|
||||
CHIP_CSRCS += stm32_allocateheap.c stm32_exti_gpio.c stm32_gpio.c
|
||||
CHIP_CSRCS += stm32_irq.c stm32_lowputc.c stm32_rcc.c stm32_serial.c
|
||||
CHIP_CSRCS += stm32_start.c stm32_capture.c stm32_uid.c
|
||||
CHIP_CSRCS += stm32_start.c stm32_capture.c
|
||||
|
||||
ifneq ($(CONFIG_SCHED_TICKLESS),y)
|
||||
CHIP_CSRCS += stm32_timerisr.c
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32f7/stm32_uid.h
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
* SPDX-FileCopyrightText: 2015 Marawan Ragab. All rights reserved.
|
||||
* SPDX-FileContributor: Marawan Ragab <marawan31@gmail.com>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STM32F7_STM32_UID_H
|
||||
#define __ARCH_ARM_SRC_STM32F7_STM32_UID_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_get_uniqueid(uint8_t uniqueid[12]);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32F7_STM32_UID_H */
|
||||
|
|
@ -240,7 +240,6 @@ config STM32_STM32G0
|
|||
select STM32_HAVE_IP_TIMERS_M0_V1
|
||||
select STM32_HAVE_IP_USART_V4
|
||||
select STM32_HAVE_IP_WDG_M0_V1
|
||||
select STM32_HAVE_IP_UID_M0_V1
|
||||
select STM32_HAVE_IP_USBDEV_M0_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_TIM1
|
||||
select STM32_HAVE_TIM3
|
||||
|
|
|
|||
|
|
@ -131,7 +131,6 @@ config STM32_STM32G4XXX
|
|||
select STM32_HAVE_IP_SPI_V3
|
||||
select STM32_HAVE_IP_SYSCFG_M3M4_V1
|
||||
select STM32_HAVE_IP_TIMERS_M3M4_V3
|
||||
select STM32_HAVE_IP_UID_M3M4_V1
|
||||
select STM32_HAVE_IP_USART_V4
|
||||
select STM32_HAVE_IP_USBDEV_M3M4_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_IP_USBFS_M3M4_V1 if STM32_HAVE_USBFS
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ list(
|
|||
stm32_pwr.c
|
||||
stm32_timerisr.c
|
||||
stm32_lse.c
|
||||
stm32_lsi.c
|
||||
stm32_uid.c)
|
||||
stm32_lsi.c)
|
||||
|
||||
if(CONFIG_STM32_USART)
|
||||
list(APPEND SRCS stm32_serial.c)
|
||||
|
|
@ -127,3 +126,5 @@ if(CONFIG_STM32_STM32H5XXXX)
|
|||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
|
||||
add_subdirectory(${NUTTX_DIR}/arch/arm/src/common/stm32 stm32_common)
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ HEAD_ASRC =
|
|||
# Common ARM and Cortex-M33 files
|
||||
|
||||
include armv8-m/Make.defs
|
||||
include common/stm32/Make.defs
|
||||
|
||||
ifeq ($(CONFIG_STM32_PROGMEM),y)
|
||||
CHIP_CSRCS += stm32_flash.c
|
||||
|
|
@ -38,7 +39,6 @@ endif
|
|||
CHIP_CSRCS += stm32_gpio.c stm32_irq.c stm32_lowputc.c stm32_rcc.c
|
||||
CHIP_CSRCS += stm32_start.c stm32_pwr.c stm32_timerisr.c
|
||||
CHIP_CSRCS += stm32_lse.c stm32_lsi.c
|
||||
CHIP_CSRCS += stm32_uid.c
|
||||
|
||||
ifneq ($(CONFIG_ARCH_IDLE_CUSTOM),y)
|
||||
CHIP_CSRCS += stm32_idle.c
|
||||
|
|
|
|||
|
|
@ -1,66 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32h5/stm32_uid.c
|
||||
*
|
||||
* Copyright (C) 2015 Marawan Ragab. All rights reserved.
|
||||
* Authors: Marawan Ragab <marawan31@gmail.com>
|
||||
* David Sidrane <david.sirane@nscdg.com>
|
||||
* Modified for STM32H5 by Tyler Bennett <tbennett@2g-eng.com>
|
||||
*
|
||||
* 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/stm32_memorymap.h"
|
||||
|
||||
#include "stm32_uid.h"
|
||||
|
||||
#ifdef STM32_SYSMEM_UID
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_get_uniqueid(uint8_t uniqueid[12])
|
||||
{
|
||||
int i;
|
||||
uint32_t *uid = (uint32_t *) uniqueid;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
*uid = *((uint32_t *)(STM32_SYSMEM_UID) + i);
|
||||
uid++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* STM32_SYSMEM_UID */
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32h5/stm32_uid.h
|
||||
*
|
||||
* Copyright (C) 2015 Marawan Ragab. All rights reserved.
|
||||
* Authors: Marawan Ragab <marawan31@gmail.com>
|
||||
* David Sidrane <david.sirane@nscdg.com>
|
||||
* Modified for STM32H5 by Tyler Bennett <tbennett@2g-eng.com>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STM32H5_STM32_UID_H
|
||||
#define __ARCH_ARM_SRC_STM32H5_STM32_UID_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_get_uniqueid(uint8_t uniqueid[12]);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32H5_STM32_UID_H */
|
||||
|
|
@ -32,8 +32,7 @@ list(
|
|||
stm32_start.c
|
||||
stm32_rcc.c
|
||||
stm32_lowputc.c
|
||||
stm32_serial.c
|
||||
stm32_uid.c)
|
||||
stm32_serial.c)
|
||||
|
||||
if(CONFIG_STM32_PROGMEM)
|
||||
list(APPEND SRCS stm32_flash.c)
|
||||
|
|
@ -225,3 +224,5 @@ if(CONFIG_CRYPTO_CRYPTODEV_HARDWARE AND CONFIG_STM32_HAVE_IP_CRYPTO_H7)
|
|||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
|
||||
add_subdirectory(${NUTTX_DIR}/arch/arm/src/common/stm32 stm32_common)
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
# Common ARM and Cortex-M7 files
|
||||
|
||||
include armv7-m/Make.defs
|
||||
include common/stm32/Make.defs
|
||||
|
||||
ifeq ($(CONFIG_STM32_PROGMEM),y)
|
||||
CHIP_CSRCS += stm32_flash.c
|
||||
|
|
@ -47,7 +48,6 @@ endif
|
|||
|
||||
CHIP_CSRCS += stm32_allocateheap.c stm32_exti_gpio.c stm32_gpio.c stm32_irq.c
|
||||
CHIP_CSRCS += stm32_start.c stm32_rcc.c stm32_lowputc.c stm32_serial.c
|
||||
CHIP_CSRCS += stm32_uid.c
|
||||
|
||||
ifeq ($(CONFIG_SCHED_TICKLESS),y)
|
||||
CHIP_CSRCS += stm32_tickless.c
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32h7/stm32_uid.c
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
* SPDX-FileCopyrightText: 2015 Marawan Ragab. All rights reserved.
|
||||
* SPDX-FileContributor: Marawan Ragab <marawan31@gmail.com>
|
||||
* SPDX-FileContributor: David Sidrane <david.sirane@nscdg.com>
|
||||
*
|
||||
* 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/stm32_memorymap.h"
|
||||
|
||||
#include "stm32_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 */
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32h7/stm32_uid.h
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
* SPDX-FileCopyrightText: 2015 Marawan Ragab. All rights reserved.
|
||||
* SPDX-FileContributor: Marawan Ragab <marawan31@gmail.com>
|
||||
* SPDX-FileContributor: David Sidrane <david.sirane@nscdg.com>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STM32H7_STM32_UID_H
|
||||
#define __ARCH_ARM_SRC_STM32H7_STM32_UID_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_get_uniqueid(uint8_t uniqueid[12]);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32H7_STM32_UID_H */
|
||||
|
|
@ -229,7 +229,6 @@ config STM32_STM32L0
|
|||
select STM32_HAVE_IP_TIMERS_M0_V1
|
||||
select STM32_HAVE_IP_USART_V3
|
||||
select STM32_HAVE_IP_WDG_M0_V1
|
||||
select STM32_HAVE_IP_UID_M0_V1
|
||||
select STM32_HAVE_IP_RNG_M0_V1 if STM32_HAVE_RNG
|
||||
select STM32_HAVE_IP_RTCC_M0_V1
|
||||
select STM32_HAVE_IP_USBDEV_M0_V1 if STM32_HAVE_USBDEV
|
||||
|
|
|
|||
|
|
@ -296,7 +296,6 @@ config STM32_STM32L15XX
|
|||
select STM32_HAVE_IP_SPI_V1
|
||||
select STM32_HAVE_IP_SYSCFG_M3M4_V1
|
||||
select STM32_HAVE_IP_TIMERS_M3M4_V1
|
||||
select STM32_HAVE_IP_UID_M3M4_V1
|
||||
select STM32_HAVE_IP_USART_V2
|
||||
select STM32_HAVE_IP_USBDEV_M3M4_V1 if STM32_HAVE_USBDEV
|
||||
select STM32_HAVE_IP_USBFS_M3M4_V1 if STM32_HAVE_USBFS
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ list(
|
|||
stm32l4_rcc.c
|
||||
stm32l4_serial.c
|
||||
stm32l4_start.c
|
||||
stm32l4_uid.c
|
||||
stm32l4_spi.c
|
||||
stm32l4_i2c.c
|
||||
stm32l4_lse.c
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ include common/stm32/Make.defs
|
|||
|
||||
CHIP_CSRCS += stm32l4_allocateheap.c stm32l4_exti_gpio.c stm32l4_gpio.c
|
||||
CHIP_CSRCS += stm32l4_irq.c stm32l4_lowputc.c stm32l4_rcc.c
|
||||
CHIP_CSRCS += stm32l4_serial.c stm32l4_start.c stm32l4_uid.c
|
||||
CHIP_CSRCS += stm32l4_serial.c stm32l4_start.c
|
||||
CHIP_CSRCS += stm32l4_spi.c stm32l4_i2c.c stm32l4_lse.c stm32l4_lsi.c
|
||||
CHIP_CSRCS += stm32l4_pwr.c stm32l4_tim.c stm32l4_flash.c
|
||||
CHIP_CSRCS += stm32l4_dfumode.c
|
||||
|
|
|
|||
|
|
@ -1,63 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32l4/stm32l4_uid.c
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
* SPDX-FileCopyrightText: 2015 Marawan Ragab. All rights reserved.
|
||||
* SPDX-FileContributor: Marawan Ragab <marawan31@gmail.com>
|
||||
* SPDX-FileContributor: dev@ziggurat9.com
|
||||
*
|
||||
* 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/stm32l4_memorymap.h"
|
||||
#include "stm32l4_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 */
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32l4/stm32l4_uid.h
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
* SPDX-FileCopyrightText: 2015 Marawan Ragab. All rights reserved.
|
||||
* SPDX-FileContributor: Marawan Ragab <marawan31@gmail.com>
|
||||
* SPDX-FileContributor: dev@ziggurat9.com
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STM32L4_STM32L4_UID_H
|
||||
#define __ARCH_ARM_SRC_STM32L4_STM32L4_UID_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_get_uniqueid(uint8_t uniqueid[12]);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32L4_STM32L4_UID_H */
|
||||
|
|
@ -33,7 +33,6 @@ list(
|
|||
stm32l5_rcc.c
|
||||
stm32l5_serial.c
|
||||
stm32l5_start.c
|
||||
stm32l5_uid.c
|
||||
stm32l5_spi.c
|
||||
stm32l5_lse.c
|
||||
stm32l5_lsi.c
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ include common/stm32/Make.defs
|
|||
CHIP_ASRCS =
|
||||
CHIP_CSRCS += stm32l5_allocateheap.c stm32l5_exti_gpio.c stm32l5_gpio.c
|
||||
CHIP_CSRCS += stm32l5_irq.c stm32l5_lowputc.c stm32l5_rcc.c
|
||||
CHIP_CSRCS += stm32l5_serial.c stm32l5_start.c stm32l5_uid.c
|
||||
CHIP_CSRCS += stm32l5_serial.c stm32l5_start.c
|
||||
CHIP_CSRCS += stm32l5_spi.c stm32l5_lse.c stm32l5_lsi.c
|
||||
CHIP_CSRCS += stm32l5_pwr.c stm32l5_tim.c stm32l5_flash.c stm32l5_timerisr.c
|
||||
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32l5/stm32l5_uid.h
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STM32L5_STM32L5_UID_H
|
||||
#define __ARCH_ARM_SRC_STM32L5_STM32L5_UID_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_get_uniqueid(uint8_t uniqueid[12]);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32L5_STM32L5_UID_H */
|
||||
|
|
@ -30,7 +30,6 @@ set(SRCS
|
|||
stm32_i2c.c
|
||||
stm32_serial.c
|
||||
stm32_start.c
|
||||
stm32_uid.c
|
||||
stm32_spi.c
|
||||
stm32_lse.c
|
||||
stm32_lsi.c
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ include common/stm32/Make.defs
|
|||
CHIP_ASRCS =
|
||||
CHIP_CSRCS += stm32_allocateheap.c stm32_exti_gpio.c stm32_gpio.c
|
||||
CHIP_CSRCS += stm32_irq.c stm32_lowputc.c stm32_rcc.c stm32_i2c.c
|
||||
CHIP_CSRCS += stm32_serial.c stm32_start.c stm32_uid.c
|
||||
CHIP_CSRCS += stm32_serial.c stm32_start.c
|
||||
CHIP_CSRCS += stm32_spi.c stm32_lse.c stm32_lsi.c stm32u5xx_rcc.c
|
||||
CHIP_CSRCS += stm32_pwr.c stm32_tim.c stm32_flash.c stm32_timerisr.c
|
||||
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32u5/stm32_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/stm32_memorymap.h"
|
||||
#include "stm32_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 */
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32u5/stm32_uid.h
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STM32U5_STM32_UID_H
|
||||
#define __ARCH_ARM_SRC_STM32U5_STM32_UID_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_get_uniqueid(uint8_t uniqueid[12]);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32U5_STM32_UID_H */
|
||||
|
|
@ -37,8 +37,7 @@ set(SRCS
|
|||
stm32wb_rcc_lsi.c
|
||||
stm32wb_pwr.c
|
||||
stm32wb_tim.c
|
||||
stm32wb_flash.c
|
||||
stm32wb_uid.c)
|
||||
stm32wb_flash.c)
|
||||
|
||||
if(NOT CONFIG_ARCH_IDLE_CUSTOM)
|
||||
list(APPEND SRCS stm32wb_idle.c)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ CHIP_CSRCS += stm32wb_irq.c stm32wb_lowputc.c stm32wb_rcc.c stm32wb_spi.c
|
|||
CHIP_CSRCS += stm32wb_serial.c stm32wb_i2c.c stm32wb_start.c
|
||||
CHIP_CSRCS += stm32wb_rcc_lse.c stm32wb_rcc_lsi.c
|
||||
CHIP_CSRCS += stm32wb_pwr.c stm32wb_tim.c
|
||||
CHIP_CSRCS += stm32wb_flash.c stm32wb_uid.c
|
||||
CHIP_CSRCS += stm32wb_flash.c
|
||||
|
||||
ifneq ($(CONFIG_ARCH_IDLE_CUSTOM),y)
|
||||
CHIP_CSRCS += stm32wb_idle.c
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32wb/stm32wb_uid.h
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STM32WB_STM32WB_UID_H
|
||||
#define __ARCH_ARM_SRC_STM32WB_STM32WB_UID_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_get_uniqueid(uint8_t uniqueid[12]);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32WB_STM32WB_UID_H */
|
||||
|
|
@ -31,7 +31,6 @@ set(SRCS
|
|||
stm32wl5_rcc.c
|
||||
stm32wl5_serial.c
|
||||
stm32wl5_start.c
|
||||
stm32wl5_uid.c
|
||||
stm32wl5_lse.c
|
||||
stm32wl5_lsi.c
|
||||
stm32wl5_idle.c
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ include common/stm32/Make.defs
|
|||
|
||||
CHIP_CSRCS += stm32wl5_allocateheap.c stm32wl5_exti_gpio.c stm32wl5_gpio.c
|
||||
CHIP_CSRCS += stm32wl5_irq.c stm32wl5_lowputc.c stm32wl5_rcc.c
|
||||
CHIP_CSRCS += stm32wl5_serial.c stm32wl5_start.c stm32wl5_uid.c
|
||||
CHIP_CSRCS += stm32wl5_serial.c stm32wl5_start.c
|
||||
CHIP_CSRCS += stm32wl5_lse.c stm32wl5_lsi.c stm32wl5_idle.c
|
||||
CHIP_CSRCS += stm32wl5_pwr.c stm32wl5_tim.c stm32wl5_flash.c stm32wl5_timerisr.c
|
||||
CHIP_CSRCS += stm32wl5_spi.c
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/stm32wl5/stm32wl5_uid.h
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
* SPDX-FileCopyrightText: 2015 Marawan Ragab. All rights reserved.
|
||||
* SPDX-FileContributor: Marawan Ragab <marawan31@gmail.com>
|
||||
* SPDX-FileContributor: dev@ziggurat9.com
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STM32WL5_STM32WL5_UID_H
|
||||
#define __ARCH_ARM_SRC_STM32WL5_STM32WL5_UID_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_get_uniqueid(uint8_t uniqueid[12]);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32WL5_STM32WL5_UID_H */
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "stm32l4_uid.h"
|
||||
#include "stm32_uid.h"
|
||||
#include "nucleo-l432kc.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "stm32l4_uid.h"
|
||||
#include "stm32_uid.h"
|
||||
#include "nucleo-l476rg.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "stm32l4_uid.h"
|
||||
#include "stm32_uid.h"
|
||||
#include "nucleo-144.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
#include "arm_internal.h"
|
||||
#include "stm32.h"
|
||||
#include "stm32l4_uid.h"
|
||||
#include "stm32_uid.h"
|
||||
#include "stm32l476-mdk.h"
|
||||
|
||||
/* Conditional logic in stm32l476-mdk.h will determine if certain features
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include <stm32.h>
|
||||
#include <stm32l4_uart.h>
|
||||
#include <stm32l4_uid.h>
|
||||
#include <stm32_uid.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
#include <arch/board/boardctl.h>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "stm32l4_uid.h"
|
||||
#include "stm32_uid.h"
|
||||
#include "stm32l476vg-disco.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include <stm32.h>
|
||||
#include <stm32l4_uart.h>
|
||||
#include <stm32l4_uid.h>
|
||||
#include <stm32_uid.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
#include <arch/board/boardctl.h>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "stm32l4_uid.h"
|
||||
#include "stm32_uid.h"
|
||||
#include "stm32l4r9ai-disco.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue