<?xml version="1.0" encoding="UTF-8"?>
<package schemaVersion="1.7.36" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="https://raw.githubusercontent.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/v1.7.36/schema/PACK.xsd">
  <name>NUCLEO-L152RE_BSP</name>
  <vendor>Keil</vendor>
  <description overview="Documents/OVERVIEW.md">STMicroelectronics STM32L1 Series NUCLEO-L152RE Board Support Pack</description>
  <url>https://www.keil.com/pack/</url>
  <repository type="git">https://github.com/Open-CMSIS-Pack/ST_NUCLEO-L152RE_BSP.git</repository>
  <license>LICENSES</license>
  <licenseSets>
    <licenseSet id="all" default="true" gating="true">
      <license title="Apache-2.0 License for CMSIS add-ons"                  name="LICENSE-Apache-2.0"   spdx="Apache-2.0"/>
      <license title="BSD-3-Clause License for STMicroelectronics STM32 HAL" name="LICENSE-BSD-3-Clause" spdx="BSD-3-Clause"/>
    </licenseSet>
  </licenseSets>

  <releases>
    <release version="1.1.0" date="2025-08-18" tag="v1.1.0">
      CMSIS Driver:
      - VIO: Added support for LED LD2
      Blinky project:
      - Specified thread names using thread attributes
      - Renamed thread IDs
      - Modified app_main_thread (replaced loop forever)
      - Added dbgconf files
      - Added RTE_Components.h files
      - Updated README.md file
      - Added DWARF-5 debug information
      - Added generated output files
      Layers:
      - Modified Default layer (removed SPI1 support)
      - Added SPI1 board layer
    </release>
    <release version="1.0.0" date="2025-05-09" tag="v1.0.0">
      Prepared for new CMSIS-Toolbox CubeMX integration
      Board description for NUCLEO-L152RE
      Blinky example (CMSIS Solution)
      Default Board Layer
      CMSIS Drivers:
      - CMSIS-Driver VIO
    </release>
  </releases>

  <keywords>
    <!-- keywords for indexing -->
    <keyword>ST</keyword>
    <keyword>Board Support Pack</keyword>
    <keyword>STM32L1</keyword>
    <keyword>NUCLEO-L152RE</keyword>
  </keywords>

  <requirements>
    <packages>
      <package vendor="Keil" name="STM32L1xx_DFP"      version="2.0.0-0"/>
      <package vendor="ARM"  name="CMSIS"              version="6.0.0-0"/>
      <package vendor="ARM"  name="CMSIS-Driver_STM32" version="1.0.0-0"/>
    </packages>
  </requirements>

  <conditions>
    <!-- Board Condition -->
    <condition id="NUCLEO-L152RE">
      <description>STMicroelectronics NUCLEO-L152RE Board</description>
      <require Bvendor="STMicroelectronics" Bname="NUCLEO-L152RE"/>
    </condition>

    <!-- Board Condition + CMSIS Driver GPIO-->
    <condition id="NUCLEO-L152RE GPIO">
      <description>STMicroelectronics NUCLEO-L152RE Board with CMSIS Driver GPIO</description>
      <require condition="NUCLEO-L152RE"/>
      <require Cclass="CMSIS Driver" Cgroup="GPIO"/>
    </condition>
  </conditions>

  <components>
    <!-- CMSIS VIO Driver component for NUCLEO-L152RE -->
    <component Cclass="CMSIS Driver" Cgroup="VIO" Csub="Board" Cversion="1.1.0" Capiversion="1.0.0" condition="NUCLEO-L152RE GPIO">
      <description>I/O implementation for NUCLEO-L152RE</description>
      <RTE_Components_h>
        #define RTE_VIO_BOARD
        #define RTE_VIO_NUCLEO_L152RE
      </RTE_Components_h>
      <files>
        <file category="source" name="CMSIS/Driver/vio_NUCLEO-L152RE.c"/>
      </files>
    </component>
  </components>

  <csolution>
    <clayer type="Board" path="Layers/Default" file="Board.clayer.yml" copy-to="Board/NUCLEO-L152RE" condition="NUCLEO-L152RE"/>
    <clayer type="Board" path="Layers/SPI1   " file="Board.clayer.yml" copy-to="Board/NUCLEO-L152RE" condition="NUCLEO-L152RE"/>
  </csolution>

  <boards>
    <!-- NUCLEO-L152RE -->
    <board vendor="STMicroelectronics" name="NUCLEO-L152RE" revision="Rev.C"
           salesContact="https://www.st.com/content/st_com/en/contact-us.html">
      <description>STM32 Nucleo development board with STM32L152RETx MCU</description>
      <image small="Images/nucleo-l152re_small.png"
             large="Images/nucleo-l152re_large.png"/>
      <book category="overview"  name="https://www.st.com/en/evaluation-tools/nucleo-l152re.html" title="NUCLEO-L152RE Board"/>
      <book category="overview"  name="https://www.st.com/en/microcontrollers-microprocessors/stm32l152re.html" title="Data Brief"/>
      <book category="manual"    name="https://www.st.com/resource/en/user_manual/um1724-stm32-nucleo64-boards-mb1136-stmicroelectronics.pdf" title="User Manual"/>
      <book category="schematic" name="https://www.st.com/resource/en/schematic_pack/mb1136-default-c03_schematic.pdf" title="Schematics"/>
      <book category="other"     name="Documents/README.md" title="Guide"/>
      <mountedDevice    deviceIndex="0" Dvendor="STMicroelectronics:13" Dname="STM32L152RETx"/>
      <feature type="ODbg"      n="1"              name="On-board ST-LINK/V2-1"/>
      <feature type="PWR"       n="4"              name="USB VBUS, ext. VIN, ext. 5V, ext +3.3V"/>
      <feature type="CustomFF"  n="2"              name="STMicroelectronics Morpho connector"/>
      <feature type="ArduinoFF" n="2"              name="STMicroelectronics Arduino connector"/>
      <feature type="USB"       n="1"              name="USB re-enumeration capability"/>
      <feature type="Button"    n="2"              name="Push-buttons: User and Reset"/>
      <feature type="LED"       n="3"              name="LEDs: COM, Power, User LEDs"/>
      <feature type="ConnOther" n="1"              name="JP6 (IDD) for current measurement"/>
      <debugInterface adapter="ST-Link" connector="Mini-USB"/>
      <debugProbe connector="Mini-USB" debugClock="10000000" debugLink="swd" name="ST-Link"/>
    </board>
  </boards>

  <examples>
    <example name="Blinky" folder="Examples/Blinky" doc="README.md">
      <description>CMSIS-RTOS2 Blinky example with VIO</description>
      <board name="NUCLEO-L152RE" vendor="STMicroelectronics"/>
      <project>
        <environment name="csolution" load="Blinky.csolution.yml"/>
      </project>
    </example>
  </examples>
</package>
