-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e1a8aa
commit 41998c9
Showing
234 changed files
with
1,213,596 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## STM32CubeIDE | ||
*.launch | ||
.settings | ||
Debug | ||
Release | ||
|
||
## VS | ||
.vs | ||
*.vcxproj* | ||
*.sln | ||
|
||
## Workspaces | ||
.metadata | ||
RemoteSystemsTempFiles/ | ||
|
||
## Generated Files | ||
output.txt | ||
|
||
## Application binaries | ||
*.bin | ||
*.sfb | ||
*.sfbp | ||
*.sfu | ||
*.sign | ||
Binary/ | ||
|
||
## Include the cipher key | ||
!Cipher_Key_AES_CBC.bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[submodule "Bootloader"] | ||
path = Bootloader | ||
url = https://github.com/firmwaremodules/stm32-secure-patching-bootloader | ||
[submodule "Drivers/STM32L0xx_HAL_Driver"] | ||
path = Drivers/STM32L0xx_HAL_Driver | ||
url = https://github.com/STMicroelectronics/stm32l0xx_hal_driver | ||
[submodule "Drivers/BSP/STM32L0xx_Nucleo"] | ||
path = Drivers/BSP/STM32L0xx_Nucleo | ||
url = https://github.com/STMicroelectronics/stm32l0xx-nucleo | ||
[submodule "Drivers/STM32F7xx_HAL_Driver"] | ||
path = Drivers/STM32F7xx_HAL_Driver | ||
url = https://github.com/STMicroelectronics/stm32f7xx_hal_driver | ||
[submodule "Drivers/BSP/STM32F769I-Discovery"] | ||
path = Drivers/BSP/STM32F769I-Discovery | ||
url = https://github.com/STMicroelectronics/32f769idiscovery | ||
[submodule "Drivers/BSP/Components/mx25l512"] | ||
path = Drivers/BSP/Components/mx25l512 | ||
url = https://github.com/STMicroelectronics/stm32-mx25l512 | ||
[submodule "Drivers/STM32F4xx_HAL_Driver"] | ||
path = Drivers/STM32F4xx_HAL_Driver | ||
url = https://github.com/STMicroelectronics/stm32f4xx_hal_driver | ||
[submodule "Drivers/STM32L4xx_HAL_Driver"] | ||
path = Drivers/STM32L4xx_HAL_Driver | ||
url = https://github.com/STMicroelectronics/stm32l4xx_hal_driver | ||
[submodule "Drivers/BSP/STM32L496G-Discovery"] | ||
path = Drivers/BSP/STM32L496G-Discovery | ||
url = https://github.com/STMicroelectronics/32l496gdiscovery | ||
[submodule "Drivers/BSP/STM32F4xx_Nucleo_144"] | ||
path = Drivers/BSP/STM32F4xx_Nucleo_144 | ||
url = https://github.com/STMicroelectronics/stm32f4xx-nucleo-144 | ||
[submodule "Drivers/BSP/Components/mx25r6435f"] | ||
path = Drivers/BSP/Components/mx25r6435f | ||
url = https://github.com/STMicroelectronics/stm32-mx25r6435f | ||
[submodule "Drivers/BSP/Components/mfxstm32l152"] | ||
path = Drivers/BSP/Components/mfxstm32l152 | ||
url = https://github.com/STMicroelectronics/stm32-mfxstm32l152 | ||
[submodule "Drivers/BSP/Components/st7789h2"] | ||
path = Drivers/BSP/Components/st7789h2 | ||
url = https://github.com/STMicroelectronics/stm32-st7789h2 | ||
[submodule "Drivers/BSP/Components/Common"] | ||
path = Drivers/BSP/Components/Common | ||
url = https://github.com/STMicroelectronics/stm32-bsp-common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
/* | ||
* Copyright (c) 2021 Firmware Modules Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files(the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and /or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions : | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE | ||
* OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
#include "main.h" | ||
|
||
/*----------------------------------------------------------------------------*/ | ||
|
||
|
||
/*----------------------------------------------------------------------------*/ | ||
|
||
|
||
/* Note: this clocking config is setup for USB MSC flash loader support */ | ||
|
||
/** | ||
* @brief System Clock Configuration | ||
* The system Clock is configured as follow : | ||
* System Clock source = PLL (HSE) | ||
* SYSCLK(Hz) = 168000000 | ||
* HCLK(Hz) = 168000000 | ||
* AHB Prescaler = 1 | ||
* APB1 Prescaler = 4 | ||
* APB2 Prescaler = 2 | ||
* HSE Frequency(Hz) = 8000000 | ||
* PLL_M = 8 | ||
* PLL_N = 336 | ||
* PLL_P = 2 | ||
* PLL_Q = 7 | ||
* VDD(V) = 3.3 | ||
* Main regulator output voltage = Scale1 mode | ||
* Flash Latency(WS) = 5 | ||
* @param None | ||
* @retval None | ||
*/ | ||
static void SystemClock_Config(void) | ||
{ | ||
RCC_ClkInitTypeDef RCC_ClkInitStruct; | ||
RCC_OscInitTypeDef RCC_OscInitStruct; | ||
|
||
/* Enable Power Control clock */ | ||
__HAL_RCC_PWR_CLK_ENABLE(); | ||
|
||
/* The voltage scaling allows optimizing the power consumption when the device is | ||
clocked below the maximum system frequency, to update the voltage scaling value | ||
regarding system frequency refer to product datasheet. */ | ||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); | ||
|
||
/* Enable HSE Oscillator and activate PLL with HSE as source */ | ||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; | ||
RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; | ||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; | ||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; | ||
RCC_OscInitStruct.PLL.PLLM = 8; | ||
RCC_OscInitStruct.PLL.PLLN = 336; | ||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; | ||
RCC_OscInitStruct.PLL.PLLQ = 7; | ||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) | ||
{ | ||
/* Initialization Error */ | ||
while (1); | ||
} | ||
|
||
|
||
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 | ||
clocks dividers */ | ||
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); | ||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; | ||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; | ||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; | ||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; | ||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) | ||
{ | ||
/* Initialization Error */ | ||
while (1); | ||
} | ||
} | ||
|
||
|
||
|
||
void board_specific_init(void) | ||
{ | ||
SystemClock_Config(); | ||
} | ||
|
||
|
||
|
||
void board_led_toggle(void) | ||
{ | ||
BSP_LED_Toggle(BOARD_LED_STATUS); | ||
} | ||
|
||
void board_led_on(void) | ||
{ | ||
BSP_LED_On(BOARD_LED_STATUS); | ||
} | ||
|
||
void board_led_off(void) | ||
{ | ||
BSP_LED_Off(BOARD_LED_STATUS); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
/* | ||
* Copyright (c) 2021 Firmware Modules Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files(the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and /or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions : | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE | ||
* OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
#ifndef __BOARD_H | ||
#define __BOARD_H | ||
|
||
#include "stm32f4xx_hal.h" | ||
#include "stm32f4xx_nucleo_144.h" | ||
#include "board-f4.h" | ||
/* This board file for F769I-DISCO contains elements common to the | ||
* Demonstration projects. | ||
*/ | ||
|
||
#define BOARD_NAME_STRING "F429ZI-NUCLEO" | ||
|
||
/* Button --------------------------------------------------------------------*/ | ||
|
||
#define BUTTON_INIT() BSP_PB_Init(BUTTON_USER,BUTTON_MODE_GPIO); | ||
#define BUTTON_PUSHED() (BSP_PB_GetState(BUTTON_USER) == GPIO_PIN_SET) | ||
|
||
/* Trace and YMODEM updater UART ---------------------------------------------*/ | ||
|
||
/* | ||
* | ||
* UART2 - PD5 | ||
CN11 CN12 | ||
1 2 CN8 CN7 - 1 2 | ||
3 4 3 4 | ||
5 6 1 2 1 2 5 6 | ||
7 8 3 4 3 4 7 8 | ||
9 10 5 6 5 6 9 10 | ||
11 12 7 8 7 8 11 12 | ||
13 14 9 10 9 10 13 14 | ||
15 16 11 12 11 12 15 16 | ||
17 18 13 14 13 14 17 18 | ||
19 20 15 16 15 16 19 20 | ||
21 22 17 18 21 22 | ||
23 24 19 20 23 24 | ||
25 26 25 26 | ||
27 28 CN9 CN10 27 28 | ||
29 30 29 30 | ||
1 2 1 2 31 32 | ||
3 4 3 4 - 33 34 | ||
5 6 - PD5 USART2 TX 5 6 35 36 | ||
7 8 7 8 | ||
9 10 9 10 | ||
11 12 11 12 | ||
13 14 13 14 | ||
15 16 15 16 | ||
17 18 17 18 | ||
19 20 19 20 | ||
21 22 21 22 | ||
23 24 25 26 | ||
27 28 27 28 | ||
29 30 29 30 | ||
31 32 | ||
33 34 | ||
*/ | ||
|
||
/* ST-LINK UART */ | ||
#define COM_UART USART3 | ||
#define COM_UART_CLK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE() | ||
#define COM_UART_CLK_DISABLE() __HAL_RCC_USART3_CLK_DISABLE() | ||
|
||
#define COM_UART_TX_AF GPIO_AF7_USART3 | ||
#define COM_UART_TX_GPIO_PORT GPIOD | ||
#define COM_UART_TX_PIN GPIO_PIN_8 | ||
#define COM_UART_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE() | ||
#define COM_UART_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE() | ||
|
||
#define COM_UART_RX_AF GPIO_AF7_USART3 | ||
#define COM_UART_RX_GPIO_PORT GPIOD | ||
#define COM_UART_RX_PIN GPIO_PIN_9 | ||
#define COM_UART_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE() | ||
#define COM_UART_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE() | ||
|
||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
/* Uncomment to enable the adaquate Clock Source */ | ||
//#define RTC_CLOCK_SOURCE_LSI | ||
#define RTC_CLOCK_SOURCE_LSE /* F429ZI-NUCLEO LSE available by default */ | ||
|
||
#ifdef RTC_CLOCK_SOURCE_LSI | ||
#define RTC_ASYNCH_PREDIV 0x7FU | ||
#define RTC_SYNCH_PREDIV 0x0130U | ||
#endif | ||
|
||
#ifdef RTC_CLOCK_SOURCE_LSE | ||
#define RTC_ASYNCH_PREDIV 0x7FU | ||
#define RTC_SYNCH_PREDIV 0x00FFU | ||
#endif | ||
|
||
|
||
/* LEDs ----------------------------------------------------------------------*/ | ||
|
||
#define BOARD_LED_STATUS LED_GREEN | ||
|
||
|
||
#endif |
Oops, something went wrong.