Browse Source

update

sound_start
tianjialong 3 years ago
parent
commit
9802a5717d
  1. 7
      app/.mxproject
  2. 3
      app/Core/Inc/FreeRTOSConfig.h
  3. 2
      app/Core/Inc/stm32f4xx_it.h
  4. 18
      app/Core/Src/gpio.c
  5. 25
      app/Core/Src/main.c
  6. 127
      app/Core/Src/stm32f4xx_hal_timebase_tim.c
  7. 40
      app/Core/Src/stm32f4xx_it.c
  8. 9
      app/MDK-ARM/EventRecorderStub.scvd
  9. 1906
      app/MDK-ARM/app.uvguix.29643
  10. 295
      app/MDK-ARM/app.uvoptx
  11. 172
      app/MDK-ARM/app.uvprojx
  12. 96
      app/MDK-ARM/startup_stm32f407xx.lst
  13. 67
      app/app.ioc
  14. 5
      src/hardware_main.c
  15. 4
      src/zboard.h

7
app/.mxproject
File diff suppressed because it is too large
View File

3
app/Core/Inc/FreeRTOSConfig.h

@ -51,7 +51,6 @@
#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
#include <stdint.h> #include <stdint.h>
extern uint32_t SystemCoreClock; extern uint32_t SystemCoreClock;
void xPortSysTickHandler(void);
#endif #endif
#define configENABLE_FPU 0 #define configENABLE_FPU 0
#define configENABLE_MPU 0 #define configENABLE_MPU 0
@ -131,7 +130,7 @@ standard names. */
/* IMPORTANT: This define is commented when used with STM32Cube firmware, when the timebase source is SysTick, /* IMPORTANT: This define is commented when used with STM32Cube firmware, when the timebase source is SysTick,
to prevent overwriting SysTick_Handler defined within STM32Cube HAL */ to prevent overwriting SysTick_Handler defined within STM32Cube HAL */
/* #define xPortSysTickHandler SysTick_Handler */
#define xPortSysTickHandler SysTick_Handler
/* USER CODE BEGIN Defines */ /* USER CODE BEGIN Defines */
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ /* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */

2
app/Core/Inc/stm32f4xx_it.h

@ -52,7 +52,7 @@ void MemManage_Handler(void);
void BusFault_Handler(void); void BusFault_Handler(void);
void UsageFault_Handler(void); void UsageFault_Handler(void);
void DebugMon_Handler(void); void DebugMon_Handler(void);
void SysTick_Handler(void);
void TIM8_UP_TIM13_IRQHandler(void);
void ETH_IRQHandler(void); void ETH_IRQHandler(void);
/* USER CODE BEGIN EFP */ /* USER CODE BEGIN EFP */

18
app/Core/Src/gpio.c

@ -56,6 +56,9 @@ void MX_GPIO_Init(void)
__HAL_RCC_GPIOG_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE();
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOF, GPIO_PIN_9, GPIO_PIN_SET);
/*Configure GPIO pins : PE2 PE3 PE4 PE5 /*Configure GPIO pins : PE2 PE3 PE4 PE5
PE6 PE7 PE8 PE10 PE6 PE7 PE8 PE10
PE11 PE12 PE13 PE14 PE11 PE12 PE13 PE14
@ -82,16 +85,23 @@ void MX_GPIO_Init(void)
/*Configure GPIO pins : PF0 PF1 PF2 PF3 /*Configure GPIO pins : PF0 PF1 PF2 PF3
PF4 PF5 PF6 PF7 PF4 PF5 PF6 PF7
PF8 PF9 PF10 PF11
PF12 PF13 PF14 PF15 */
PF8 PF10 PF11 PF12
PF13 PF14 PF15 */
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7 |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7
|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
|GPIO_PIN_8|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12
|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct); HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
/*Configure GPIO pin : PF9 */
GPIO_InitStruct.Pin = GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
/*Configure GPIO pins : PA0 PA3 PA4 PA5 /*Configure GPIO pins : PA0 PA3 PA4 PA5
PA6 PA8 PA11 PA12 PA6 PA8 PA11 PA12
PA15 */ PA15 */

25
app/Core/Src/main.c

@ -37,7 +37,7 @@
/* Private define ------------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */ /* USER CODE BEGIN PD */
#define HARDWARE_FLAG false
#define HARDWARE_FLAG true
/* USER CODE END PD */ /* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/
@ -91,10 +91,10 @@ int main(void)
/* Initialize all configured peripherals */ /* Initialize all configured peripherals */
MX_GPIO_Init(); MX_GPIO_Init();
MX_IWDG_Init();
MX_USART1_UART_Init(); MX_USART1_UART_Init();
MX_TIM1_Init(); MX_TIM1_Init();
MX_TIM4_Init(); MX_TIM4_Init();
MX_IWDG_Init();
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */
#if !HARDWARE_FLAG #if !HARDWARE_FLAG
extern void user_main(); extern void user_main();
@ -175,6 +175,27 @@ void SystemClock_Config(void)
/* USER CODE END 4 */ /* USER CODE END 4 */
/** /**
* @brief Period elapsed callback in non blocking mode
* @note This function is called when TIM8 interrupt took place, inside
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
* a global variable "uwTick" used as application time base.
* @param htim : TIM handle
* @retval None
*/
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
/* USER CODE BEGIN Callback 0 */
/* USER CODE END Callback 0 */
if (htim->Instance == TIM8) {
HAL_IncTick();
}
/* USER CODE BEGIN Callback 1 */
/* USER CODE END Callback 1 */
}
/**
* @brief This function is executed in case of error occurrence. * @brief This function is executed in case of error occurrence.
* @retval None * @retval None
*/ */

127
app/Core/Src/stm32f4xx_hal_timebase_tim.c

@ -0,0 +1,127 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32f4xx_hal_timebase_TIM.c
* @brief HAL time base based on the hardware TIM.
******************************************************************************
* @attention
*
* Copyright (c) 2023 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_tim.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
TIM_HandleTypeDef htim8;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/**
* @brief This function configures the TIM8 as a time base source.
* The time source is configured to have 1ms time base with a dedicated
* Tick interrupt priority.
* @note This function is called automatically at the beginning of program after
* reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig().
* @param TickPriority: Tick interrupt priority.
* @retval HAL status
*/
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
{
RCC_ClkInitTypeDef clkconfig;
uint32_t uwTimclock = 0U;
uint32_t uwPrescalerValue = 0U;
uint32_t pFLatency;
HAL_StatusTypeDef status;
/* Enable TIM8 clock */
__HAL_RCC_TIM8_CLK_ENABLE();
/* Get clock configuration */
HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
/* Compute TIM8 clock */
uwTimclock = 2*HAL_RCC_GetPCLK2Freq();
/* Compute the prescaler value to have TIM8 counter clock equal to 1MHz */
uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000U) - 1U);
/* Initialize TIM8 */
htim8.Instance = TIM8;
/* Initialize TIMx peripheral as follow:
+ Period = [(TIM8CLK/1000) - 1]. to have a (1/1000) s time base.
+ Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock.
+ ClockDivision = 0
+ Counter direction = Up
*/
htim8.Init.Period = (1000000U / 1000U) - 1U;
htim8.Init.Prescaler = uwPrescalerValue;
htim8.Init.ClockDivision = 0;
htim8.Init.CounterMode = TIM_COUNTERMODE_UP;
htim8.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
status = HAL_TIM_Base_Init(&htim8);
if (status == HAL_OK)
{
/* Start the TIM time Base generation in interrupt mode */
status = HAL_TIM_Base_Start_IT(&htim8);
if (status == HAL_OK)
{
/* Enable the TIM8 global Interrupt */
HAL_NVIC_EnableIRQ(TIM8_UP_TIM13_IRQn);
/* Configure the SysTick IRQ priority */
if (TickPriority < (1UL << __NVIC_PRIO_BITS))
{
/* Configure the TIM IRQ priority */
HAL_NVIC_SetPriority(TIM8_UP_TIM13_IRQn, TickPriority, 0U);
uwTickPrio = TickPriority;
}
else
{
status = HAL_ERROR;
}
}
}
/* Return function status */
return status;
}
/**
* @brief Suspend Tick increment.
* @note Disable the tick increment by disabling TIM8 update interrupt.
* @param None
* @retval None
*/
void HAL_SuspendTick(void)
{
/* Disable TIM8 update Interrupt */
__HAL_TIM_DISABLE_IT(&htim8, TIM_IT_UPDATE);
}
/**
* @brief Resume Tick increment.
* @note Enable the tick increment by Enabling TIM8 update interrupt.
* @param None
* @retval None
*/
void HAL_ResumeTick(void)
{
/* Enable TIM8 Update interrupt */
__HAL_TIM_ENABLE_IT(&htim8, TIM_IT_UPDATE);
}

40
app/Core/Src/stm32f4xx_it.c

@ -20,8 +20,6 @@
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "main.h" #include "main.h"
#include "stm32f4xx_it.h" #include "stm32f4xx_it.h"
#include "FreeRTOS.h"
#include "task.h"
/* Private includes ----------------------------------------------------------*/ /* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */ /* USER CODE BEGIN Includes */
/* USER CODE END Includes */ /* USER CODE END Includes */
@ -58,6 +56,8 @@
/* External variables --------------------------------------------------------*/ /* External variables --------------------------------------------------------*/
extern ETH_HandleTypeDef heth; extern ETH_HandleTypeDef heth;
extern TIM_HandleTypeDef htim8;
/* USER CODE BEGIN EV */ /* USER CODE BEGIN EV */
/* USER CODE END EV */ /* USER CODE END EV */
@ -153,28 +153,6 @@ void DebugMon_Handler(void)
/* USER CODE END DebugMonitor_IRQn 1 */ /* USER CODE END DebugMonitor_IRQn 1 */
} }
/**
* @brief This function handles System tick timer.
*/
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
#if (INCLUDE_xTaskGetSchedulerState == 1 )
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
{
#endif /* INCLUDE_xTaskGetSchedulerState */
xPortSysTickHandler();
#if (INCLUDE_xTaskGetSchedulerState == 1 )
}
#endif /* INCLUDE_xTaskGetSchedulerState */
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */
}
/******************************************************************************/ /******************************************************************************/
/* STM32F4xx Peripheral Interrupt Handlers */ /* STM32F4xx Peripheral Interrupt Handlers */
/* Add here the Interrupt Handlers for the used peripherals. */ /* Add here the Interrupt Handlers for the used peripherals. */
@ -183,6 +161,20 @@ void SysTick_Handler(void)
/******************************************************************************/ /******************************************************************************/
/** /**
* @brief This function handles TIM8 update interrupt and TIM13 global interrupt.
*/
void TIM8_UP_TIM13_IRQHandler(void)
{
/* USER CODE BEGIN TIM8_UP_TIM13_IRQn 0 */
/* USER CODE END TIM8_UP_TIM13_IRQn 0 */
HAL_TIM_IRQHandler(&htim8);
/* USER CODE BEGIN TIM8_UP_TIM13_IRQn 1 */
/* USER CODE END TIM8_UP_TIM13_IRQn 1 */
}
/**
* @brief This function handles Ethernet global interrupt. * @brief This function handles Ethernet global interrupt.
*/ */
void ETH_IRQHandler(void) void ETH_IRQHandler(void)

9
app/MDK-ARM/EventRecorderStub.scvd

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component_viewer schemaVersion="0.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">
<component name="EventRecorderStub" version="1.0.0"/> <!--name and version of the component-->
<events>
</events>
</component_viewer>

1906
app/MDK-ARM/app.uvguix.29643
File diff suppressed because it is too large
View File

295
app/MDK-ARM/app.uvoptx
File diff suppressed because it is too large
View File

172
app/MDK-ARM/app.uvprojx

@ -54,7 +54,7 @@
<CreateLib>0</CreateLib> <CreateLib>0</CreateLib>
<CreateHexFile>1</CreateHexFile> <CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation> <DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<BrowseInformation>0</BrowseInformation>
<ListingPath></ListingPath> <ListingPath></ListingPath>
<HexFormatSelection>1</HexFormatSelection> <HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K> <Merge32K>0</Merge32K>
@ -189,7 +189,7 @@
<hadIRAM2>1</hadIRAM2> <hadIRAM2>1</hadIRAM2>
<hadIROM2>0</hadIROM2> <hadIROM2>0</hadIROM2>
<StupSel>8</StupSel> <StupSel>8</StupSel>
<useUlib>0</useUlib>
<useUlib>1</useUlib>
<EndSel>0</EndSel> <EndSel>0</EndSel>
<uLtcg>0</uLtcg> <uLtcg>0</uLtcg>
<nSecure>0</nSecure> <nSecure>0</nSecure>
@ -211,7 +211,7 @@
<Ra2Chk>0</Ra2Chk> <Ra2Chk>0</Ra2Chk>
<Ra3Chk>0</Ra3Chk> <Ra3Chk>0</Ra3Chk>
<Im1Chk>1</Im1Chk> <Im1Chk>1</Im1Chk>
<Im2Chk>1</Im2Chk>
<Im2Chk>0</Im2Chk>
<OnChipMemories> <OnChipMemories>
<Ocm1> <Ocm1>
<Type>0</Type> <Type>0</Type>
@ -301,19 +301,19 @@
<OCR_RVCT9> <OCR_RVCT9>
<Type>0</Type> <Type>0</Type>
<StartAddress>0x20000000</StartAddress> <StartAddress>0x20000000</StartAddress>
<Size>0x1c000</Size>
<Size>0x20000</Size>
</OCR_RVCT9> </OCR_RVCT9>
<OCR_RVCT10> <OCR_RVCT10>
<Type>0</Type> <Type>0</Type>
<StartAddress>0x2001c000</StartAddress>
<Size>0x4000</Size>
<StartAddress>0x10000000</StartAddress>
<Size>0x10000</Size>
</OCR_RVCT10> </OCR_RVCT10>
</OnChipMemories> </OnChipMemories>
<RvctStartVector></RvctStartVector> <RvctStartVector></RvctStartVector>
</ArmAdsMisc> </ArmAdsMisc>
<Cads> <Cads>
<interw>1</interw> <interw>1</interw>
<Optim>4</Optim>
<Optim>1</Optim>
<oTime>0</oTime> <oTime>0</oTime>
<SplitLS>0</SplitLS> <SplitLS>0</SplitLS>
<OneElfS>1</OneElfS> <OneElfS>1</OneElfS>
@ -412,6 +412,57 @@
<FileName>iwdg.c</FileName> <FileName>iwdg.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>../Core/Src/iwdg.c</FilePath> <FilePath>../Core/Src/iwdg.c</FilePath>
<FileOption>
<CommonProperty>
<UseCPPCompiler>2</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>1</IncludeInBuild>
<AlwaysBuild>2</AlwaysBuild>
<GenerateAssemblyFile>2</GenerateAssemblyFile>
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<FileArmAds>
<Cads>
<interw>2</interw>
<Optim>0</Optim>
<oTime>2</oTime>
<SplitLS>2</SplitLS>
<OneElfS>2</OneElfS>
<Strict>2</Strict>
<EnumInt>2</EnumInt>
<PlainCh>2</PlainCh>
<Ropi>2</Ropi>
<Rwpi>2</Rwpi>
<wLevel>0</wLevel>
<uThumb>2</uThumb>
<uSurpInc>2</uSurpInc>
<uC99>2</uC99>
<uGnu>2</uGnu>
<useXO>2</useXO>
<v6Lang>0</v6Lang>
<v6LangP>0</v6LangP>
<vShortEn>2</vShortEn>
<vShortWch>2</vShortWch>
<v6Lto>2</v6Lto>
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
</File> </File>
<File> <File>
<FileName>tim.c</FileName> <FileName>tim.c</FileName>
@ -484,6 +535,62 @@
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>../Core/Src/stm32f4xx_hal_msp.c</FilePath> <FilePath>../Core/Src/stm32f4xx_hal_msp.c</FilePath>
</File> </File>
<File>
<FileName>stm32f4xx_hal_timebase_tim.c</FileName>
<FileType>1</FileType>
<FilePath>../Core/Src/stm32f4xx_hal_timebase_tim.c</FilePath>
<FileOption>
<CommonProperty>
<UseCPPCompiler>2</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>1</IncludeInBuild>
<AlwaysBuild>2</AlwaysBuild>
<GenerateAssemblyFile>2</GenerateAssemblyFile>
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<FileArmAds>
<Cads>
<interw>2</interw>
<Optim>0</Optim>
<oTime>2</oTime>
<SplitLS>2</SplitLS>
<OneElfS>2</OneElfS>
<Strict>2</Strict>
<EnumInt>2</EnumInt>
<PlainCh>2</PlainCh>
<Ropi>2</Ropi>
<Rwpi>2</Rwpi>
<wLevel>0</wLevel>
<uThumb>2</uThumb>
<uSurpInc>2</uSurpInc>
<uC99>2</uC99>
<uGnu>2</uGnu>
<useXO>2</useXO>
<v6Lang>0</v6Lang>
<v6LangP>0</v6LangP>
<vShortEn>2</vShortEn>
<vShortWch>2</vShortWch>
<v6Lto>2</v6Lto>
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
</File>
</Files> </Files>
</Group> </Group>
<Group> <Group>
@ -593,6 +700,57 @@
<FileName>stm32f4xx_hal_iwdg.c</FileName> <FileName>stm32f4xx_hal_iwdg.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c</FilePath> <FilePath>../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c</FilePath>
<FileOption>
<CommonProperty>
<UseCPPCompiler>2</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>1</IncludeInBuild>
<AlwaysBuild>2</AlwaysBuild>
<GenerateAssemblyFile>2</GenerateAssemblyFile>
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<FileArmAds>
<Cads>
<interw>2</interw>
<Optim>0</Optim>
<oTime>2</oTime>
<SplitLS>2</SplitLS>
<OneElfS>2</OneElfS>
<Strict>2</Strict>
<EnumInt>2</EnumInt>
<PlainCh>2</PlainCh>
<Ropi>2</Ropi>
<Rwpi>2</Rwpi>
<wLevel>0</wLevel>
<uThumb>2</uThumb>
<uSurpInc>2</uSurpInc>
<uC99>2</uC99>
<uGnu>2</uGnu>
<useXO>2</useXO>
<v6Lang>0</v6Lang>
<v6LangP>0</v6LangP>
<vShortEn>2</vShortEn>
<vShortWch>2</vShortWch>
<v6Lto>2</v6Lto>
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
</File> </File>
<File> <File>
<FileName>stm32f4xx_hal_tim.c</FileName> <FileName>stm32f4xx_hal_tim.c</FileName>

96
app/MDK-ARM/startup_stm32f407xx.lst

@ -464,9 +464,9 @@ ARM Macro Assembler Page 8
171 00000000 IMPORT SystemInit 171 00000000 IMPORT SystemInit
172 00000000 IMPORT __main 172 00000000 IMPORT __main
173 00000000 173 00000000
174 00000000 4809 LDR R0, =SystemInit
174 00000000 4806 LDR R0, =SystemInit
175 00000002 4780 BLX R0 175 00000002 4780 BLX R0
176 00000004 4809 LDR R0, =__main
176 00000004 4806 LDR R0, =__main
177 00000006 4700 BX R0 177 00000006 4700 BX R0
178 00000008 ENDP 178 00000008 ENDP
179 00000008 179 00000008
@ -818,42 +818,25 @@ ARM Macro Assembler Page 13
398 0000001C ;******************************************************* 398 0000001C ;*******************************************************
************************ ************************
399 0000001C IF :DEF:__MICROLIB 399 0000001C IF :DEF:__MICROLIB
406 0000001C
407 0000001C IMPORT __use_two_region_memory
408 0000001C EXPORT __user_initial_stackheap
409 0000001C
410 0000001C __user_initial_stackheap
411 0000001C
412 0000001C 4804 LDR R0, = Heap_Mem
413 0000001E 4905 LDR R1, =(Stack_Mem + Stack_Size)
414 00000020 4A05 LDR R2, = (Heap_Mem + Heap_Size)
415 00000022 4B06 LDR R3, = Stack_Mem
416 00000024 4770 BX LR
417 00000026
418 00000026 00 00 ALIGN
419 00000028
420 00000028 ENDIF
421 00000028
422 00000028 END
400 0000001C
401 0000001C EXPORT __initial_sp
402 0000001C EXPORT __heap_base
403 0000001C EXPORT __heap_limit
404 0000001C
405 0000001C ELSE
420 ENDIF
421 0000001C
422 0000001C END
00000000 00000000
00000000 00000000
00000000
00000800
00000200
00000000
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M4.fp.sp --apcs= Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M4.fp.sp --apcs=
interwork --depend=app\startup_stm32f407xx.d -oapp\startup_stm32f407xx.o -I..\C interwork --depend=app\startup_stm32f407xx.d -oapp\startup_stm32f407xx.o -I..\C
ARM Macro Assembler Page 14
ore\Inc -I.\RTE\_app -IC:\Users\29643\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\C ore\Inc -I.\RTE\_app -IC:\Users\29643\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\C
MSIS\Core\Include -IC:\Users\29643\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2 MSIS\Core\Include -IC:\Users\29643\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2
.16.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include --predefine="__UVISION_VERSION
SETA 535" --predefine="_RTE_ SETA 1" --predefine="STM32F407xx SETA 1" --predefi
ne="_RTE_ SETA 1" --list=startup_stm32f407xx.lst startup_stm32f407xx.s
.16.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include --predefine="__MICROLIB SETA 1"
--predefine="__UVISION_VERSION SETA 535" --predefine="_RTE_ SETA 1" --predefin
e="STM32F407xx SETA 1" --predefine="_RTE_ SETA 1" --list=startup_stm32f407xx.ls
t startup_stm32f407xx.s
@ -874,9 +857,8 @@ Symbol: Stack_Mem
Definitions Definitions
At line 35 in file startup_stm32f407xx.s At line 35 in file startup_stm32f407xx.s
Uses Uses
At line 413 in file startup_stm32f407xx.s
At line 415 in file startup_stm32f407xx.s
None
Comment: Stack_Mem unused
__initial_sp 00000800 __initial_sp 00000800
Symbol: __initial_sp Symbol: __initial_sp
@ -884,7 +866,8 @@ Symbol: __initial_sp
At line 36 in file startup_stm32f407xx.s At line 36 in file startup_stm32f407xx.s
Uses Uses
At line 60 in file startup_stm32f407xx.s At line 60 in file startup_stm32f407xx.s
Comment: __initial_sp used once
At line 401 in file startup_stm32f407xx.s
3 symbols 3 symbols
@ -906,25 +889,24 @@ Symbol: Heap_Mem
Definitions Definitions
At line 47 in file startup_stm32f407xx.s At line 47 in file startup_stm32f407xx.s
Uses Uses
At line 412 in file startup_stm32f407xx.s
At line 414 in file startup_stm32f407xx.s
None
Comment: Heap_Mem unused
__heap_base 00000000 __heap_base 00000000
Symbol: __heap_base Symbol: __heap_base
Definitions Definitions
At line 46 in file startup_stm32f407xx.s At line 46 in file startup_stm32f407xx.s
Uses Uses
None
Comment: __heap_base unused
At line 402 in file startup_stm32f407xx.s
Comment: __heap_base used once
__heap_limit 00000200 __heap_limit 00000200
Symbol: __heap_limit Symbol: __heap_limit
Definitions Definitions
At line 48 in file startup_stm32f407xx.s At line 48 in file startup_stm32f407xx.s
Uses Uses
None
Comment: __heap_limit unused
At line 403 in file startup_stm32f407xx.s
Comment: __heap_limit used once
4 symbols 4 symbols
@ -1884,15 +1866,7 @@ Symbol: WWDG_IRQHandler
At line 78 in file startup_stm32f407xx.s At line 78 in file startup_stm32f407xx.s
At line 226 in file startup_stm32f407xx.s At line 226 in file startup_stm32f407xx.s
__user_initial_stackheap 0000001C
Symbol: __user_initial_stackheap
Definitions
At line 410 in file startup_stm32f407xx.s
Uses
At line 408 in file startup_stm32f407xx.s
Comment: __user_initial_stackheap used once
94 symbols
93 symbols
@ -1906,8 +1880,7 @@ Symbol: Heap_Size
At line 43 in file startup_stm32f407xx.s At line 43 in file startup_stm32f407xx.s
Uses Uses
At line 47 in file startup_stm32f407xx.s At line 47 in file startup_stm32f407xx.s
At line 414 in file startup_stm32f407xx.s
Comment: Heap_Size used once
Stack_Size 00000800 Stack_Size 00000800
Symbol: Stack_Size Symbol: Stack_Size
@ -1915,8 +1888,7 @@ Symbol: Stack_Size
At line 32 in file startup_stm32f407xx.s At line 32 in file startup_stm32f407xx.s
Uses Uses
At line 35 in file startup_stm32f407xx.s At line 35 in file startup_stm32f407xx.s
At line 413 in file startup_stm32f407xx.s
Comment: Stack_Size used once
__Vectors_Size 00000188 __Vectors_Size 00000188
Symbol: __Vectors_Size Symbol: __Vectors_Size
@ -1948,13 +1920,5 @@ Symbol: __main
Uses Uses
At line 176 in file startup_stm32f407xx.s At line 176 in file startup_stm32f407xx.s
Comment: __main used once Comment: __main used once
__use_two_region_memory 00000000
Symbol: __use_two_region_memory
Definitions
At line 407 in file startup_stm32f407xx.s
Uses
None
Comment: __use_two_region_memory unused
3 symbols
448 symbols in table
2 symbols
445 symbols in table

67
app/app.ioc

@ -8,7 +8,7 @@ ETH.PHY_Name_RMII=LAN8742A_PHY_ADDRESS
FREERTOS.IPParameters=Tasks01 FREERTOS.IPParameters=Tasks01
FREERTOS.Tasks01=defaultTask,0,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL FREERTOS.Tasks01=defaultTask,0,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL
File.Version=6 File.Version=6
GPIO.groupedBy=
GPIO.groupedBy=Group By Peripherals
KeepUserPlacement=false KeepUserPlacement=false
LWIP.BSP.number=1 LWIP.BSP.number=1
LWIP.Version=v2.1.2_Cube LWIP.Version=v2.1.2_Cube
@ -37,28 +37,29 @@ Mcu.IP9=USART1
Mcu.IPNb=10 Mcu.IPNb=10
Mcu.Name=STM32F407Z(E-G)Tx Mcu.Name=STM32F407Z(E-G)Tx
Mcu.Package=LQFP144 Mcu.Package=LQFP144
Mcu.Pin0=PH0-OSC_IN
Mcu.Pin1=PH1-OSC_OUT
Mcu.Pin10=PB12
Mcu.Pin11=PB13
Mcu.Pin12=PA9
Mcu.Pin13=PA10
Mcu.Pin14=PA13
Mcu.Pin15=PA14
Mcu.Pin16=VP_FREERTOS_VS_CMSIS_V1
Mcu.Pin17=VP_IWDG_VS_IWDG
Mcu.Pin18=VP_LWIP_VS_Enabled
Mcu.Pin19=VP_SYS_VS_Systick
Mcu.Pin2=PC1
Mcu.Pin20=VP_TIM4_VS_ClockSourceINT
Mcu.Pin3=PA1
Mcu.Pin4=PA2
Mcu.Pin5=PA7
Mcu.Pin6=PC4
Mcu.Pin7=PC5
Mcu.Pin8=PE9
Mcu.Pin9=PB11
Mcu.PinsNb=21
Mcu.Pin0=PF9
Mcu.Pin1=PH0-OSC_IN
Mcu.Pin10=PB11
Mcu.Pin11=PB12
Mcu.Pin12=PB13
Mcu.Pin13=PA9
Mcu.Pin14=PA10
Mcu.Pin15=PA13
Mcu.Pin16=PA14
Mcu.Pin17=VP_FREERTOS_VS_CMSIS_V1
Mcu.Pin18=VP_IWDG_VS_IWDG
Mcu.Pin19=VP_LWIP_VS_Enabled
Mcu.Pin2=PH1-OSC_OUT
Mcu.Pin20=VP_SYS_VS_tim8
Mcu.Pin21=VP_TIM4_VS_ClockSourceINT
Mcu.Pin3=PC1
Mcu.Pin4=PA1
Mcu.Pin5=PA2
Mcu.Pin6=PA7
Mcu.Pin7=PC4
Mcu.Pin8=PC5
Mcu.Pin9=PE9
Mcu.PinsNb=22
Mcu.ThirdPartyNb=0 Mcu.ThirdPartyNb=0
Mcu.UserConstants= Mcu.UserConstants=
Mcu.UserName=STM32F407ZGTx Mcu.UserName=STM32F407ZGTx
@ -77,7 +78,10 @@ NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false
NVIC.SavedPendsvIrqHandlerGenerated=true NVIC.SavedPendsvIrqHandlerGenerated=true
NVIC.SavedSvcallIrqHandlerGenerated=true NVIC.SavedSvcallIrqHandlerGenerated=true
NVIC.SavedSystickIrqHandlerGenerated=true NVIC.SavedSystickIrqHandlerGenerated=true
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:true\:false\:true\:false
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true\:false
NVIC.TIM8_UP_TIM13_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true
NVIC.TimeBase=TIM8_UP_TIM13_IRQn
NVIC.TimeBaseIP=TIM8
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
PA1.Mode=RMII PA1.Mode=RMII
PA1.Signal=ETH_REF_CLK PA1.Signal=ETH_REF_CLK
@ -106,6 +110,12 @@ PC4.Signal=ETH_RXD0
PC5.Mode=RMII PC5.Mode=RMII
PC5.Signal=ETH_RXD1 PC5.Signal=ETH_RXD1
PE9.Signal=S_TIM1_CH1 PE9.Signal=S_TIM1_CH1
PF9.GPIOParameters=GPIO_Speed,PinState,GPIO_PuPd
PF9.GPIO_PuPd=GPIO_PULLUP
PF9.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PF9.Locked=true
PF9.PinState=GPIO_PIN_SET
PF9.Signal=GPIO_Output
PH0-OSC_IN.Mode=HSE-External-Oscillator PH0-OSC_IN.Mode=HSE-External-Oscillator
PH0-OSC_IN.Signal=RCC_OSC_IN PH0-OSC_IN.Signal=RCC_OSC_IN
PH1-OSC_OUT.Mode=HSE-External-Oscillator PH1-OSC_OUT.Mode=HSE-External-Oscillator
@ -138,7 +148,7 @@ ProjectManager.StackSize=0x800
ProjectManager.TargetToolchain=MDK-ARM V5.32 ProjectManager.TargetToolchain=MDK-ARM V5.32
ProjectManager.ToolChainLocation= ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_LWIP_Init-LWIP-false-HAL-false,4-MX_IWDG_Init-IWDG-false-HAL-true,5-MX_USART1_UART_Init-USART1-false-HAL-true
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_LWIP_Init-LWIP-false-HAL-false,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_TIM1_Init-TIM1-false-HAL-true,6-MX_TIM4_Init-TIM4-false-HAL-true,7-MX_IWDG_Init-IWDG-false-HAL-true
RCC.48MHZClocksFreq_Value=84000000 RCC.48MHZClocksFreq_Value=84000000
RCC.AHBFreq_Value=168000000 RCC.AHBFreq_Value=168000000
RCC.APB1CLKDivider=RCC_HCLK_DIV4 RCC.APB1CLKDivider=RCC_HCLK_DIV4
@ -155,7 +165,8 @@ RCC.HCLKFreq_Value=168000000
RCC.HSE_VALUE=25000000 RCC.HSE_VALUE=25000000
RCC.HSI_VALUE=16000000 RCC.HSI_VALUE=16000000
RCC.I2SClocksFreq_Value=96000000 RCC.I2SClocksFreq_Value=96000000
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQCLKFreq_Value,PLLSourceVirtual,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQCLKFreq_Value,PLLSourceVirtual,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S
RCC.LSE_VALUE=32768
RCC.LSI_VALUE=32000 RCC.LSI_VALUE=32000
RCC.MCO2PinFreq_Value=168000000 RCC.MCO2PinFreq_Value=168000000
RCC.PLLCLKFreq_Value=168000000 RCC.PLLCLKFreq_Value=168000000
@ -186,8 +197,8 @@ VP_IWDG_VS_IWDG.Mode=IWDG_Activate
VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG
VP_LWIP_VS_Enabled.Mode=Enabled VP_LWIP_VS_Enabled.Mode=Enabled
VP_LWIP_VS_Enabled.Signal=LWIP_VS_Enabled VP_LWIP_VS_Enabled.Signal=LWIP_VS_Enabled
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
VP_SYS_VS_tim8.Mode=TIM8
VP_SYS_VS_tim8.Signal=SYS_VS_tim8
VP_TIM4_VS_ClockSourceINT.Mode=Internal VP_TIM4_VS_ClockSourceINT.Mode=Internal
VP_TIM4_VS_ClockSourceINT.Signal=TIM4_VS_ClockSourceINT VP_TIM4_VS_ClockSourceINT.Signal=TIM4_VS_ClockSourceINT
board=custom board=custom

5
src/hardware_main.c

@ -19,8 +19,9 @@
#define TAG "HARDWARE_MAIN" #define TAG "HARDWARE_MAIN"
void hardware_main() { void hardware_main() {
ZLOGI(TAG, "start hardware test");
// ZLOGI(TAG, "start hardware test");
while (1) { while (1) {
/* code */
port_do_debug_light_state();
HAL_IWDG_Refresh(&hiwdg);
} }
} }

4
src/zboard.h

@ -7,8 +7,8 @@
* =======================================================DEBUG======================================================= * * =======================================================DEBUG======================================================= *
***********************************************************************************************************************/ ***********************************************************************************************************************/
#define DEBUG_UART huart1 //直接使用指令串口作为调试串口 #define DEBUG_UART huart1 //直接使用指令串口作为调试串口
#define DEBUG_LIGHT_PORT GPIOB
#define DEBUG_LIGHT_PIN GPIO_PIN_5
#define DEBUG_LIGHT_PORT GPIOF
#define DEBUG_LIGHT_PIN GPIO_PIN_9
/*********************************************************************************************************************** /***********************************************************************************************************************
* ========================================================================================================= * =========================================================================================================

Loading…
Cancel
Save