This commit is contained in:
gaoyuhang 2024-11-27 10:53:28 +08:00
parent 5a1078b82c
commit 2c4a2ab0f4
6 changed files with 1723 additions and 426 deletions

View File

@ -0,0 +1,77 @@
// File: STM32L4x5_4x6.dbgconf
// Version: 1.0.0
// Note: refer to STM32L4x5 and STM32L4x6 Reference manual (RM0351)
// refer to STM32L475xx STM32L476xx STM32L486xx STM32L496xx STM32L4A6xx datasheets
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Debug MCU configuration register (DBGMCU_CR)
// <o.2> DBG_STANDBY <i> Debug Standby mode
// <o.1> DBG_STOP <i> Debug Stop mode
// <o.0> DBG_SLEEP <i> Debug Sleep mode
// </h>
DbgMCU_CR = 0x00000007;
// <h> Debug MCU APB1 freeze register1 (DBGMCU_APB1FZR1)
// <i> Reserved bits must be kept at reset value
// <o.31> DBG_LPTIM1_STOP <i> LPTIM1 counter stopped when core is halted
// <o.26> DBG_CAN2_STOP <i> bxCAN2 stopped when core is halted
// <o.25> DBG_CAN1_STOP <i> bxCAN1 stopped when core is halted
// <o.23> DBG_I2C3_STOP <i> I2C3 SMBUS timeout counter stopped when core is halted
// <o.22> DBG_I2C2_STOP <i> I2C2 SMBUS timeout counter stopped when core is halted
// <o.21> DBG_I2C1_STOP <i> I2C1 SMBUS timeout counter stopped when core is halted
// <o.12> DBG_IWDG_STOP <i> Independent watchdog counter stopped when core is halted
// <o.11> DBG_WWDG_STOP <i> Window watchdog counter stopped when core is halted
// <o.10> DBG_RTC_STOP <i> RTC counter stopped when core is halted
// <o.5> DBG_TIM7_STOP <i> TIM7 counter stopped when core is halted
// <o.4> DBG_TIM6_STOP <i> TIM6 counter stopped when core is halted
// <o.3> DBG_TIM5_STOP <i> TIM5 counter stopped when core is halted
// <o.2> DBG_TIM4_STOP <i> TIM4 counter stopped when core is halted
// <o.1> DBG_TIM3_STOP <i> TIM3 counter stopped when core is halted
// <o.0> DBG_TIM2_STOP <i> TIM2 counter stopped when core is halted
// </h>
DbgMCU_APB1_Fz1 = 0x00000000;
// <h> Debug MCU APB1 freeze register 2 (DBGMCU_APB1FZR2)
// <i> Reserved bits must be kept at reset value
// <o.5> DBG_LPTIM2_STOP <i> LPTIM2 counter stopped when core is halted
// <o.1> DBG_I2C4_STOP <i> I2C4 SMBUS timeout counter stopped when core is halted
// </h>
DbgMCU_APB1_Fz2 = 0x00000000;
// <h> Debug MCU APB2 freeze register (DBGMCU_APB2FZR)
// <i> Reserved bits must be kept at reset value
// <o.18> DBG_TIM17_STOP <i> TIM17 counter stopped when core is halted
// <o.17> DBG_TIM16_STOP <i> TIM16 counter stopped when core is halted
// <o.16> DBG_TIM15_STOP <i> TIM15 counter stopped when core is halted
// <o.13> DBG_TIM8_STOP <i> TIM8 counter stopped when core is halted
// <o.11> DBG_TIM1_STOP <i> TIM1 counter stopped when core is halted
// </h>
DbgMCU_APB2_Fz = 0x00000000;
// <h> TPIU Pin Routing (TRACECLK fixed on Pin PE2)
// <i> TRACECLK: Pin PE2
// <o1> TRACED0
// <i> ETM Trace Data 0
// <0x00040003=> Pin PE3
// <0x00020001=> Pin PC1
// <o2> TRACED1
// <i> ETM Trace Data 1
// <0x00040004=> Pin PE4
// <0x0002000A=> Pin PC10
// <o3> TRACED2
// <i> ETM Trace Data 2
// <0x00040005=> Pin PE5
// <0x00030002=> Pin PD2
// <o4> TRACED3
// <i> ETM Trace Data 3
// <0x00040006=> Pin PE6
// <0x0002000C=> Pin PC12
// </h>
TraceClk_Pin = 0x00040002;
TraceD0_Pin = 0x00040003;
TraceD1_Pin = 0x00040004;
TraceD2_Pin = 0x00040005;
TraceD3_Pin = 0x00040006;
// <<< end of configuration section >>>

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> <ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion> <SchemaVersion>1.0</SchemaVersion>
@ -45,7 +45,7 @@
<PageWidth>79</PageWidth> <PageWidth>79</PageWidth>
<PageLength>66</PageLength> <PageLength>66</PageLength>
<TabStop>8</TabStop> <TabStop>8</TabStop>
<ListingPath /> <ListingPath></ListingPath>
</OPTLEX> </OPTLEX>
<ListingPage> <ListingPage>
<CreateCListing>1</CreateCListing> <CreateCListing>1</CreateCListing>
@ -100,20 +100,17 @@
<tRSysVw>1</tRSysVw> <tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb> <sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime> <sLrtime>0</sLrtime>
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>6</nTsel> <nTsel>6</nTsel>
<sDll /> <sDll></sDll>
<sDllPa /> <sDllPa></sDllPa>
<sDlgDll /> <sDlgDll></sDlgDll>
<sDlgPa /> <sDlgPa></sDlgPa>
<sIfile /> <sIfile></sIfile>
<tDll /> <tDll></tDll>
<tDllPa /> <tDllPa></tDllPa>
<tDlgDll /> <tDlgDll></tDlgDll>
<tDlgPa /> <tDlgPa></tDlgPa>
<tIfile /> <tIfile></tIfile>
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon> <pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
</DebugOpt> </DebugOpt>
<TargetDriverDllRegistry> <TargetDriverDllRegistry>
@ -123,7 +120,7 @@
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC8000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L476VGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</Name> <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC8000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L476VGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</Name>
</SetRegEntry> </SetRegEntry>
</TargetDriverDllRegistry> </TargetDriverDllRegistry>
<Breakpoint /> <Breakpoint/>
<Tracepoint> <Tracepoint>
<THDelay>0</THDelay> <THDelay>0</THDelay>
</Tracepoint> </Tracepoint>
@ -153,22 +150,14 @@
<newCpu>0</newCpu> <newCpu>0</newCpu>
<uProt>0</uProt> <uProt>0</uProt>
</DebugFlag> </DebugFlag>
<LintExecutable /> <LintExecutable></LintExecutable>
<LintConfigFile /> <LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto> <bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD> <Lin2Executable></Lin2Executable>
<LntExFlags>0</LntExFlags> <Lin2ConfigFile></Lin2ConfigFile>
<pMisraName /> <bLin2Auto>0</bLin2Auto>
<pszMrule />
<pSingCmds />
<pMultCmds />
<pMisraNamep />
<pszMrulep />
<pSingCmdsp />
<pMultCmdsp />
<DebugDescription> <DebugDescription>
<Enable>1</Enable> <Enable>1</Enable>
<EnableFlashSeq>1</EnableFlashSeq>
<EnableLog>0</EnableLog> <EnableLog>0</EnableLog>
<Protocol>2</Protocol> <Protocol>2</Protocol>
<DbgClock>10000000</DbgClock> <DbgClock>10000000</DbgClock>
@ -200,7 +189,7 @@
<PageWidth>79</PageWidth> <PageWidth>79</PageWidth>
<PageLength>66</PageLength> <PageLength>66</PageLength>
<TabStop>8</TabStop> <TabStop>8</TabStop>
<ListingPath /> <ListingPath></ListingPath>
</OPTLEX> </OPTLEX>
<ListingPage> <ListingPage>
<CreateCListing>1</CreateCListing> <CreateCListing>1</CreateCListing>
@ -255,20 +244,17 @@
<tRSysVw>1</tRSysVw> <tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb> <sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime> <sLrtime>0</sLrtime>
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>4</nTsel> <nTsel>4</nTsel>
<sDll /> <sDll></sDll>
<sDllPa /> <sDllPa></sDllPa>
<sDlgDll /> <sDlgDll></sDlgDll>
<sDlgPa /> <sDlgPa></sDlgPa>
<sIfile /> <sIfile></sIfile>
<tDll /> <tDll></tDll>
<tDllPa /> <tDllPa></tDllPa>
<tDlgDll /> <tDlgDll></tDlgDll>
<tDlgPa /> <tDlgPa></tDlgPa>
<tIfile /> <tIfile></tIfile>
<pMon>Segger\JL2CM3.dll</pMon> <pMon>Segger\JL2CM3.dll</pMon>
</DebugOpt> </DebugOpt>
<TargetDriverDllRegistry> <TargetDriverDllRegistry>
@ -278,7 +264,7 @@
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC8000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L476VGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</Name> <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC8000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L476VGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</Name>
</SetRegEntry> </SetRegEntry>
</TargetDriverDllRegistry> </TargetDriverDllRegistry>
<Breakpoint /> <Breakpoint/>
<Tracepoint> <Tracepoint>
<THDelay>0</THDelay> <THDelay>0</THDelay>
</Tracepoint> </Tracepoint>
@ -308,22 +294,14 @@
<newCpu>0</newCpu> <newCpu>0</newCpu>
<uProt>0</uProt> <uProt>0</uProt>
</DebugFlag> </DebugFlag>
<LintExecutable /> <LintExecutable></LintExecutable>
<LintConfigFile /> <LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto> <bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD> <Lin2Executable></Lin2Executable>
<LntExFlags>0</LntExFlags> <Lin2ConfigFile></Lin2ConfigFile>
<pMisraName /> <bLin2Auto>0</bLin2Auto>
<pszMrule />
<pSingCmds />
<pMultCmds />
<pMisraNamep />
<pszMrulep />
<pSingCmdsp />
<pMultCmdsp />
<DebugDescription> <DebugDescription>
<Enable>1</Enable> <Enable>1</Enable>
<EnableFlashSeq>1</EnableFlashSeq>
<EnableLog>0</EnableLog> <EnableLog>0</EnableLog>
<Protocol>2</Protocol> <Protocol>2</Protocol>
<DbgClock>10000000</DbgClock> <DbgClock>10000000</DbgClock>
@ -355,7 +333,7 @@
<PageWidth>79</PageWidth> <PageWidth>79</PageWidth>
<PageLength>66</PageLength> <PageLength>66</PageLength>
<TabStop>8</TabStop> <TabStop>8</TabStop>
<ListingPath /> <ListingPath></ListingPath>
</OPTLEX> </OPTLEX>
<ListingPage> <ListingPage>
<CreateCListing>1</CreateCListing> <CreateCListing>1</CreateCListing>
@ -388,6 +366,23 @@
<IsCurrentTarget>1</IsCurrentTarget> <IsCurrentTarget>1</IsCurrentTarget>
</OPTFL> </OPTFL>
<CpuCode>18</CpuCode> <CpuCode>18</CpuCode>
<Books>
<Book>
<Number>0</Number>
<Title>User Manual (STM32L476G-EVAL)</Title>
<Path>D:\Keil\ARM\PACK\Keil\STM32L4xx_DFP\2.1.0\MDK\Boards\ST\STM32L476G-EVAL\Documentation\DM00155732.pdf</Path>
</Book>
<Book>
<Number>1</Number>
<Title>Schematics (STM32L476G-EVAL)</Title>
<Path>D:\Keil\ARM\PACK\Keil\STM32L4xx_DFP\2.1.0\MDK\Boards\ST\STM32L476G-EVAL\Documentation\MB1144B.pdf</Path>
</Book>
<Book>
<Number>2</Number>
<Title>Web Page (STM32L476G-EVAL)</Title>
<Path>http://www.st.com/web/en/catalog/tools/PF261634</Path>
</Book>
</Books>
<DebugOpt> <DebugOpt>
<uSim>0</uSim> <uSim>0</uSim>
<uTrg>1</uTrg> <uTrg>1</uTrg>
@ -410,20 +405,17 @@
<tRSysVw>1</tRSysVw> <tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb> <sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime> <sLrtime>0</sLrtime>
<bEvRecOn>1</bEvRecOn> <nTsel>11</nTsel>
<bSchkAxf>0</bSchkAxf> <sDll></sDll>
<bTchkAxf>0</bTchkAxf> <sDllPa></sDllPa>
<nTsel>6</nTsel> <sDlgDll></sDlgDll>
<sDll /> <sDlgPa></sDlgPa>
<sDllPa /> <sIfile></sIfile>
<sDlgDll /> <tDll></tDll>
<sDlgPa /> <tDllPa></tDllPa>
<sIfile /> <tDlgDll></tDlgDll>
<tDll /> <tDlgPa></tDlgPa>
<tDllPa /> <tIfile></tIfile>
<tDlgDll />
<tDlgPa />
<tIfile />
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon> <pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
</DebugOpt> </DebugOpt>
<TargetDriverDllRegistry> <TargetDriverDllRegistry>
@ -440,7 +432,7 @@
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
<Key>ARMDBGFLAGS</Key> <Key>ARMDBGFLAGS</Key>
<Name /> <Name></Name>
</SetRegEntry> </SetRegEntry>
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
@ -458,7 +450,7 @@
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC8000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L476VGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</Name> <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC8000 -FN1 -FF0STM32L4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32L476VGTx$CMSIS\Flash\STM32L4xx_1024.FLM))</Name>
</SetRegEntry> </SetRegEntry>
</TargetDriverDllRegistry> </TargetDriverDllRegistry>
<Breakpoint /> <Breakpoint/>
<WatchWindow1> <WatchWindow1>
<Ww> <Ww>
<count>0</count> <count>0</count>
@ -500,22 +492,14 @@
<newCpu>0</newCpu> <newCpu>0</newCpu>
<uProt>0</uProt> <uProt>0</uProt>
</DebugFlag> </DebugFlag>
<LintExecutable /> <LintExecutable></LintExecutable>
<LintConfigFile /> <LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto> <bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD> <Lin2Executable></Lin2Executable>
<LntExFlags>0</LntExFlags> <Lin2ConfigFile></Lin2ConfigFile>
<pMisraName /> <bLin2Auto>0</bLin2Auto>
<pszMrule />
<pSingCmds />
<pMultCmds />
<pMisraNamep />
<pszMrulep />
<pSingCmdsp />
<pMultCmdsp />
<DebugDescription> <DebugDescription>
<Enable>1</Enable> <Enable>1</Enable>
<EnableFlashSeq>0</EnableFlashSeq>
<EnableLog>0</EnableLog> <EnableLog>0</EnableLog>
<Protocol>2</Protocol> <Protocol>2</Protocol>
<DbgClock>10000000</DbgClock> <DbgClock>10000000</DbgClock>
@ -1395,6 +1379,14 @@
</File> </File>
</Group> </Group>
<Group>
<GroupName>::CMSIS</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
</Group>
<Group> <Group>
<GroupName>Middlewares/Library/DSP Library/DSP Library</GroupName> <GroupName>Middlewares/Library/DSP Library/DSP Library</GroupName>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -1402,7 +1394,7 @@
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
<File> <File>
<GroupNumber>14</GroupNumber> <GroupNumber>15</GroupNumber>
<FileNumber>65</FileNumber> <FileNumber>65</FileNumber>
<FileType>4</FileType> <FileType>4</FileType>
<tvExp>0</tvExp> <tvExp>0</tvExp>
@ -1415,12 +1407,4 @@
</File> </File>
</Group> </Group>
<Group>
<GroupName>::CMSIS</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
</Group>
</ProjectOpt> </ProjectOpt>

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@ static void mode_autoload_change(uint16_t autoload)
*/ */
static void mode_params_save_cb(void) static void mode_params_save_cb(void)
{ {
fal_execution_sem_update(); storage_write_all(mode_params_storage, (uint8_t *)&mode_params);
} }
/** /**

View File

@ -2550,8 +2550,8 @@ void mode_pwmp_hd_init(mode_interface_req_t *req, uint16_t positioner_model, mod
/*计数最大值*/ /*计数最大值*/
// mode_pwmp_hd->wait_count_max = 100 / ((MODE_DEFAULT_AUTOLOAD + 1) * 0.1); // =10每减一消耗10ms总消耗时间100ms // mode_pwmp_hd->wait_count_max = 100 / ((MODE_DEFAULT_AUTOLOAD + 1) * 0.1); // =10每减一消耗10ms总消耗时间100ms
mode_pwmp_hd->wait_count_max = 2; // 每减一耗时50ms共100ms mode_pwmp_hd->wait_count_max = 2; // 每减一耗时50ms共100ms
/*保存参数*/ // /*保存参数*/
mode_pwmp_hd->params_save_cb(); // mode_pwmp_hd->params_save_cb();
/*更新公共参数*/ /*更新公共参数*/
pwmp_public_params_update(); pwmp_public_params_update();