Skip to content

Commit

Permalink
Merge branch 'stm32u5-basic-support'
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilSzczygiel committed Sep 5, 2024
2 parents 2ab1dd5 + 4ab8d7a commit 1bf7f55
Show file tree
Hide file tree
Showing 45 changed files with 326,130 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ enabled:
- Basic support for *ARMv8-M* (*ARM Cortex-M33*) architecture, for a configuration with *TrustZone* disabled (single
non-secure application).
- Basic support for whole [STM32G0](https://www.st.com/stm32g0) chip family.
- Basic support for [STM32U5](https://www.st.com/stm32u5) chip family, currently with just one chip - *STM32U575ZI* -
available in YAML files.
- Support and test configuration for [NUCLEO-G0B1RE](https://www.st.com/en/evaluation-tools/nucleo-g0b1re.html) board
with *STM32G0* chip.
- Added support and test configuration for [NUCLEO-F767ZI](https://www.st.com/en/evaluation-tools/nucleo-f767zi.html)
board with *STM32F7* chip.
- Support and build configuration for [NUCLEO-U575ZI-Q](https://www.st.com/en/evaluation-tools/nucleo-u575zi-q.html)
board with *STM32U5* chip.
- Added boolean `#define` in `distortosConfiguration.h` which specifies selected board, e.g.
`#define DISTORTOS_BOARD_ST_NUCLEO_F767ZI 1` for *NUCLEO-F767ZI* board.
- Added `distortos::devices::BufferingBlockDevice` class. This class tries to minimize amount of block device operations
Expand Down
489 changes: 489 additions & 0 deletions configurations/ST_NUCLEO-U575ZI-Q/build/distortosConfiguration.cmake

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions source/board/ST_NUCLEO-U575ZI-Q/ST_NUCLEO-U575ZI-Q-buttons.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* \file
* \brief Definition of buttons for ST,NUCLEO-U575ZI-Q
*
* \author Copyright (C) 2014-2020 Kamil Szczygiel https://distortec.com https://freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
* distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* \warning
* Automatically generated file - do not edit!
*/

#include "distortos/board/buttons.hpp"

#if defined(DISTORTOS_BOARD_BUTTONS_ENABLE) && DISTORTOS_BOARD_BUTTONS_COUNT != 0

#include "distortos/chip/InputPin.hpp"

namespace distortos
{

namespace board
{

/*---------------------------------------------------------------------------------------------------------------------+
| global objects
+---------------------------------------------------------------------------------------------------------------------*/

const chip::InputPin buttons[buttonsCount]
{
#ifdef DISTORTOS_BOARD_BUTTONS_B1_ENABLE
chip::InputPin{chip::Pin::pc13, chip::PinPull::none, false},
#endif // def DISTORTOS_BOARD_BUTTONS_B1_ENABLE
};

} // namespace board

} // namespace distortos

#endif // defined(DISTORTOS_BOARD_BUTTONS_ENABLE) && DISTORTOS_BOARD_BUTTONS_COUNT != 0
48 changes: 48 additions & 0 deletions source/board/ST_NUCLEO-U575ZI-Q/ST_NUCLEO-U575ZI-Q-leds.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* \file
* \brief Definition of leds for ST,NUCLEO-U575ZI-Q
*
* \author Copyright (C) 2014-2020 Kamil Szczygiel https://distortec.com https://freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
* distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* \warning
* Automatically generated file - do not edit!
*/

#include "distortos/board/leds.hpp"

#if defined(DISTORTOS_BOARD_LEDS_ENABLE) && DISTORTOS_BOARD_LEDS_COUNT != 0

#include "distortos/chip/OutputPin.hpp"

namespace distortos
{

namespace board
{

/*---------------------------------------------------------------------------------------------------------------------+
| global objects
+---------------------------------------------------------------------------------------------------------------------*/

chip::OutputPin leds[ledsCount]
{
#ifdef DISTORTOS_BOARD_LEDS_LD1_ENABLE
chip::OutputPin{chip::Pin::pc7, false, chip::PinOutputSpeed::low, chip::PinPull::none, false, false},
#endif // def DISTORTOS_BOARD_LEDS_LD1_ENABLE
#ifdef DISTORTOS_BOARD_LEDS_LD2_ENABLE
chip::OutputPin{chip::Pin::pb7, false, chip::PinOutputSpeed::low, chip::PinPull::none, false, false},
#endif // def DISTORTOS_BOARD_LEDS_LD2_ENABLE
#ifdef DISTORTOS_BOARD_LEDS_LD3_ENABLE
chip::OutputPin{chip::Pin::pg2, false, chip::PinOutputSpeed::low, chip::PinPull::none, false, false},
#endif // def DISTORTOS_BOARD_LEDS_LD3_ENABLE
};

} // namespace board

} // namespace distortos

#endif // defined(DISTORTOS_BOARD_LEDS_ENABLE) && DISTORTOS_BOARD_LEDS_COUNT != 0
180 changes: 180 additions & 0 deletions source/board/ST_NUCLEO-U575ZI-Q/ST_NUCLEO-U575ZI-Q-uarts.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/**
* \file
* \brief Definitions of low-level UART drivers for USARTv2 in ST,NUCLEO-U575ZI-Q (ST,STM32U575ZI chip)
*
* \author Copyright (C) 2016-2020 Kamil Szczygiel https://distortec.com https://freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
* distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* \warning
* Automatically generated file - do not edit!
*/

#include "distortos/chip/uarts.hpp"

#include "distortos/chip/ChipUartLowLevel.hpp"
#include "distortos/chip/PinInitializer.hpp"

#include "distortos/BIND_LOW_LEVEL_INITIALIZER.h"

namespace distortos
{

namespace chip
{

#ifdef DISTORTOS_CHIP_LPUART1_ENABLE

/*---------------------------------------------------------------------------------------------------------------------+
| LPUART1
+---------------------------------------------------------------------------------------------------------------------*/

ChipUartLowLevel lpuart1 {ChipUartLowLevel::lpuart1Parameters};

/**
* \brief LPUART1 interrupt handler
*/

extern "C" void LPUART1_IRQHandler()
{
lpuart1.interruptHandler();
}

#endif // def DISTORTOS_CHIP_LPUART1_ENABLE

#ifdef DISTORTOS_CHIP_USART1_ENABLE

/*---------------------------------------------------------------------------------------------------------------------+
| USART1
+---------------------------------------------------------------------------------------------------------------------*/

namespace
{

/// pin initializers for USART1
const PinInitializer usart1PinInitializers[]
{
// USART1 RX
makeAlternateFunctionPinInitializer(Pin::pa10,
PinAlternateFunction::af7,
false,
PinOutputSpeed::veryHigh,
PinPull::up),
// USART1 TX
makeAlternateFunctionPinInitializer(Pin::pa9,
PinAlternateFunction::af7,
false,
PinOutputSpeed::veryHigh,
PinPull::none),
};

/**
* \brief Low-level chip initializer for USART1
*
* This function is called before constructors for global and static objects via BIND_LOW_LEVEL_INITIALIZER().
*/

void usart1LowLevelInitializer()
{
for (auto& pinInitializer : usart1PinInitializers)
pinInitializer();
}

BIND_LOW_LEVEL_INITIALIZER(50, usart1LowLevelInitializer);

} // namespace

ChipUartLowLevel usart1 {ChipUartLowLevel::usart1Parameters};

/**
* \brief USART1 interrupt handler
*/

extern "C" void USART1_IRQHandler()
{
usart1.interruptHandler();
}

#endif // def DISTORTOS_CHIP_USART1_ENABLE

#ifdef DISTORTOS_CHIP_USART2_ENABLE

/*---------------------------------------------------------------------------------------------------------------------+
| USART2
+---------------------------------------------------------------------------------------------------------------------*/

ChipUartLowLevel usart2 {ChipUartLowLevel::usart2Parameters};

/**
* \brief USART2 interrupt handler
*/

extern "C" void USART2_IRQHandler()
{
usart2.interruptHandler();
}

#endif // def DISTORTOS_CHIP_USART2_ENABLE

#ifdef DISTORTOS_CHIP_USART3_ENABLE

/*---------------------------------------------------------------------------------------------------------------------+
| USART3
+---------------------------------------------------------------------------------------------------------------------*/

ChipUartLowLevel usart3 {ChipUartLowLevel::usart3Parameters};

/**
* \brief USART3 interrupt handler
*/

extern "C" void USART3_IRQHandler()
{
usart3.interruptHandler();
}

#endif // def DISTORTOS_CHIP_USART3_ENABLE

#ifdef DISTORTOS_CHIP_UART4_ENABLE

/*---------------------------------------------------------------------------------------------------------------------+
| UART4
+---------------------------------------------------------------------------------------------------------------------*/

ChipUartLowLevel uart4 {ChipUartLowLevel::uart4Parameters};

/**
* \brief UART4 interrupt handler
*/

extern "C" void UART4_IRQHandler()
{
uart4.interruptHandler();
}

#endif // def DISTORTOS_CHIP_UART4_ENABLE

#ifdef DISTORTOS_CHIP_UART5_ENABLE

/*---------------------------------------------------------------------------------------------------------------------+
| UART5
+---------------------------------------------------------------------------------------------------------------------*/

ChipUartLowLevel uart5 {ChipUartLowLevel::uart5Parameters};

/**
* \brief UART5 interrupt handler
*/

extern "C" void UART5_IRQHandler()
{
uart5.interruptHandler();
}

#endif // def DISTORTOS_CHIP_UART5_ENABLE

} // namespace chip

} // namespace distortos
Loading

0 comments on commit 1bf7f55

Please sign in to comment.