Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: STM32 H5 support #348

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bc0fd59
add stm32h5 cmsis and config
PhilippMolitor Aug 13, 2024
dfd2b9b
fix kconfig dependency loop
PhilippMolitor Aug 13, 2024
fe36bc3
add test for stm32h503
PhilippMolitor Aug 13, 2024
ee9b939
add stm32h5
PhilippMolitor Aug 13, 2024
8d33af5
fix IP reset for cortex-m33
PhilippMolitor Aug 13, 2024
c83f7de
add h7 spi to h5
PhilippMolitor Aug 13, 2024
de213d3
fix typo
PhilippMolitor Aug 13, 2024
e7ffae1
usb register access for stm32h5
PhilippMolitor Aug 13, 2024
0218b6a
more usb registers for stm32h5
PhilippMolitor Aug 13, 2024
f45f956
more h5 usbfs register fixes
PhilippMolitor Aug 13, 2024
6be2de9
add boilerplate stm32h5 entrypoint
PhilippMolitor Aug 13, 2024
53cca54
add PR to readme
PhilippMolitor Aug 16, 2024
1ef9c47
Merge branch 'DangerKlippers:master' into feature/mcu_support_stm32h503
PhilippMolitor Sep 30, 2024
4ee07fa
simplify define guards for usbfs
PhilippMolitor Sep 30, 2024
578e74a
stm32h5: implement parts of init and basic testing.
mattthebaker Sep 30, 2024
6d0e92b
add h562 cmsis header
PhilippMolitor Oct 1, 2024
96aac68
stm32h5: cleanup, enable pll2 for usb, fix/test internal clk option.
mattthebaker Oct 1, 2024
849fa8c
stm32h5: add hal file with defines for MPU settings.
mattthebaker Oct 1, 2024
ada725b
format and additional info
PhilippMolitor Oct 1, 2024
b81ba47
add stm32 h562 test file
PhilippMolitor Oct 1, 2024
a9f41b8
Merge branch 'main' into feature/mcu_support_stm32h503
PhilippMolitor Dec 7, 2024
2a21e32
Merge branch 'KalicoCrew:main' into feature/mcu_support_stm32h503
PhilippMolitor Dec 23, 2024
009d7f4
fix h562 usb peripheral
PhilippMolitor Dec 23, 2024
1bff7fe
fix usb for h562 again
PhilippMolitor Dec 23, 2024
c317cf5
i fixed it the wrong way
PhilippMolitor Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ See the [Danger Features document](https://docs.kalico.gg/Danger_Features.html)

- [core: rotate log file at every restart](https://github.com/KalicoCrew/kalico/pull/181)

- [core: STM32 H5 support](https://github.com/KalicoCrew/kalico/pull/348)

- [fan: normalising Fan PWM power](https://github.com/KalicoCrew/kalico/pull/44) ([klipper#6307](https://github.com/Klipper3d/klipper/pull/6307))

- [fan: reverse FAN](https://github.com/KalicoCrew/kalico/pull/51) ([klipper#4983](https://github.com/Klipper3d/klipper/pull/4983))
Expand Down
5 changes: 5 additions & 0 deletions lib/README
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ The stm32l4 directory contains code from:
version v1.17.0 (5e1553e07706491bd11f4edd304e093b6e4b83a4). Contents
taken from the Drivers/CMSIS/Device/ST/STM32L4xx/ directory.

The stm32h5 directory contains code from:
https://github.com/STMicroelectronics/STM32CubeH5
version v1.3.0 (a6a936dfaf382c83b73be5e46c3c1c28e8d0caa0). Contents
taken from the Drivers/CMSIS/Device/ST/STM32H5xx/ directory.

The stm32h7 directory contains code from:
https://github.com/STMicroelectronics/STM32CubeH7
version v1.9.0 (ccb11556044540590ca6e45056e6b65cdca2deb2). Contents
Expand Down
40 changes: 25 additions & 15 deletions lib/cmsis-core/core_cm33.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**************************************************************************//**
* @file core_cm33.h
* @brief CMSIS Cortex-M33 Core Peripheral Access Layer Header File
* @version V5.2.0
* @date 27. March 2020
* @version V5.2.3
* @date 13. October 2021
******************************************************************************/
/*
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
* Copyright (c) 2009-2021 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -254,7 +254,7 @@
#define __VTOR_PRESENT 1U
#warning "__VTOR_PRESENT not defined in device header file; using default!"
#endif

#ifndef __NVIC_PRIO_BITS
#define __NVIC_PRIO_BITS 3U
#warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
Expand Down Expand Up @@ -519,7 +519,7 @@ typedef struct
__IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */
__IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */
__IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */
__IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */
__IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */
__IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */
__IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */
__IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */
Expand All @@ -528,7 +528,10 @@ typedef struct
__IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */
__IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */
__IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */
uint32_t RESERVED3[92U];
uint32_t RESERVED7[21U];
__IOM uint32_t SFSR; /*!< Offset: 0x0E4 (R/W) Secure Fault Status Register */
__IOM uint32_t SFAR; /*!< Offset: 0x0E8 (R/W) Secure Fault Address Register */
uint32_t RESERVED3[69U];
__OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */
uint32_t RESERVED4[15U];
__IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */
Expand All @@ -545,6 +548,7 @@ typedef struct
__OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */
__OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */
__OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */
__OM uint32_t BPIALL; /*!< Offset: 0x278 ( /W) Branch Predictor Invalidate All */
} SCB_Type;

/* SCB CPUID Register Definitions */
Expand Down Expand Up @@ -745,22 +749,22 @@ typedef struct
#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */

/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */
#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */
#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */
#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */

#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */
#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */
#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */

#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */
#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */
#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */

#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */
#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */
#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */

#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */
#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */
#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */

#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */
#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */
#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */

/* BusFault Status Register (part of SCB Configurable Fault Status Register) */
Expand Down Expand Up @@ -2255,7 +2259,14 @@ typedef struct
#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
/*@} */


/**
\ingroup CMSIS_core_register
\defgroup CMSIS_register_aliases Backwards Compatibility Aliases
\brief Register alias definitions for backwards compatibility.
@{
*/
#define ID_ADR (ID_AFR) /*!< SCB Auxiliary Feature Register */
/*@} */

/*******************************************************************************
* Hardware Abstraction Layer
Expand Down Expand Up @@ -3007,7 +3018,6 @@ __STATIC_INLINE void TZ_SAU_Disable(void)
@{
*/


/**
\brief Set Debug Authentication Control Register
\details writes to Debug Authentication Control register.
Expand Down Expand Up @@ -3074,7 +3084,7 @@ __STATIC_INLINE uint32_t TZ_DCB_GetAuthCtrl_NS(void)
@{
*/


/**
\brief Get Debug Authentication Status Register
\details Reads Debug Authentication Status register.
Expand Down
1 change: 0 additions & 1 deletion lib/cmsis-core/mpu_armv8.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,3 @@ __STATIC_INLINE void ARM_MPU_Load_NS(uint32_t rnr, ARM_MPU_Region_t const* table
#endif

#endif

Loading
Loading