Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
6262acb5
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
6262acb5
编写于
10月 11, 2018
作者:
lymzzyh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[BSP][STM32F1xx-HAL] fix hse when hse no trigger
修复当选择HSE 而HSE不起振时 assert的问题,并优化模拟器参数
上级
d7b70ee9
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
126 addition
and
233 deletion
+126
-233
bsp/stm32f10x-HAL/drivers/board.c
bsp/stm32f10x-HAL/drivers/board.c
+47
-1
bsp/stm32f10x-HAL/project.uvprojx
bsp/stm32f10x-HAL/project.uvprojx
+66
-220
bsp/stm32f10x-HAL/template.uvprojx
bsp/stm32f10x-HAL/template.uvprojx
+13
-12
未找到文件。
bsp/stm32f10x-HAL/drivers/board.c
浏览文件 @
6262acb5
...
...
@@ -47,6 +47,7 @@ void HAL_MspInit(void)
__HAL_AFIO_REMAP_SWJ_NOJTAG
();
}
void
SystemClock_Config
(
void
)
{
rt_err_t
ret
=
RT_EOK
;
...
...
@@ -63,7 +64,19 @@ void SystemClock_Config(void)
RCC_OscInitStruct
.
PLL
.
PLLSource
=
RCC_PLLSOURCE_HSE
;
RCC_OscInitStruct
.
PLL
.
PLLMUL
=
RCC_PLL_MUL9
;
ret
=
HAL_RCC_OscConfig
(
&
RCC_OscInitStruct
);
RT_ASSERT
(
ret
==
HAL_OK
);
if
(
ret
==
HAL_TIMEOUT
)
{
/* HSE timeout switch to HSI */
rt_memset
(
&
RCC_OscInitStruct
,
0
,
sizeof
(
RCC_OscInitStruct
));
RCC_OscInitStruct
.
OscillatorType
=
RCC_OSCILLATORTYPE_HSI
;
RCC_OscInitStruct
.
HSIState
=
RCC_HSI_ON
;
RCC_OscInitStruct
.
HSICalibrationValue
=
16
;
RCC_OscInitStruct
.
PLL
.
PLLState
=
RCC_PLL_ON
;
RCC_OscInitStruct
.
PLL
.
PLLSource
=
RCC_PLLSOURCE_HSI_DIV2
;
RCC_OscInitStruct
.
PLL
.
PLLMUL
=
RCC_PLL_MUL16
;
ret
=
HAL_RCC_OscConfig
(
&
RCC_OscInitStruct
);
RT_ASSERT
(
ret
==
HAL_OK
);
}
/* Initializes the CPU, AHB and APB busses clocks */
RCC_ClkInitStruct
.
ClockType
=
RCC_CLOCKTYPE_HCLK
|
RCC_CLOCKTYPE_SYSCLK
|
...
...
@@ -103,6 +116,38 @@ void SystemClock_Config(void)
#endif
}
static
void
m3_m4_delay_us
(
rt_uint32_t
us
)
{
int
i
=
(
HAL_RCC_GetHCLKFreq
()
/
4000000
*
us
);
while
(
i
)
{
i
--
;
}
}
void
HAL_Delay
(
__IO
uint32_t
Delay
)
{
m3_m4_delay_us
(
Delay
*
10
);
}
extern
__IO
uint32_t
uwTick
;
uint32_t
HAL_GetTick
(
void
)
{
HAL_Delay
(
1
);
uwTick
++
;
return
uwTick
;
}
void
HAL_SuspendTick
(
void
)
{
/* we should not suspend tick */
}
void
HAL_ResumeTick
(
void
)
{
/* we should not resume tick */
}
/**
* This is the timer interrupt service routine.
*
...
...
@@ -111,6 +156,7 @@ void SysTick_Handler(void)
{
/* enter interrupt */
rt_interrupt_enter
();
HAL_IncTick
();
rt_tick_increase
();
/* leave interrupt */
...
...
bsp/stm32f10x-HAL/project.uvprojx
浏览文件 @
6262acb5
此差异已折叠。
点击以展开。
bsp/stm32f10x-HAL/template.uvprojx
浏览文件 @
6262acb5
...
...
@@ -14,16 +14,16 @@
<uAC6>
0
</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>
STM32F103R
B
</Device>
<Device>
STM32F103R
C
</Device>
<Vendor>
STMicroelectronics
</Vendor>
<PackID>
Keil.STM32F1xx_DFP.2.2.0
</PackID>
<PackURL>
http://www.keil.com/pack/
</PackURL>
<Cpu>
IRAM(0x20000000,0x
5000) IROM(0x08000000,0x2
0000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE
</Cpu>
<Cpu>
IRAM(0x20000000,0x
C000) IROM(0x08000000,0x4
0000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE
</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashDriverDll>
UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_
128 -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128
.FLM))
</FlashDriverDll>
<FlashDriverDll>
UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_
512 -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512
.FLM))
</FlashDriverDll>
<DeviceId>
0
</DeviceId>
<RegisterFile>
$$Device:STM32F103R
B
$Device\Include\stm32f10x.h
</RegisterFile>
<RegisterFile>
$$Device:STM32F103R
C
$Device\Include\stm32f10x.h
</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
...
...
@@ -33,7 +33,7 @@
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile>
$$Device:STM32F103R
B
$SVD\STM32F103xx.svd
</SFDFile>
<SFDFile>
$$Device:STM32F103R
C
$SVD\STM32F103xx.svd
</SFDFile>
<bCustSvd>
0
</bCustSvd>
<UseEnv>
0
</UseEnv>
<BinPath></BinPath>
...
...
@@ -111,8 +111,8 @@
<DllOption>
<SimDllName>
SARMCM3.DLL
</SimDllName>
<SimDllArguments>
-REMAP
</SimDllArguments>
<SimDlgDll>
D
C
M.DLL
</SimDlgDll>
<SimDlgDllArguments>
-p
CM3
</SimDlgDllArguments>
<SimDlgDll>
D
ARMST
M.DLL
</SimDlgDll>
<SimDlgDllArguments>
-p
STM32F103RC
</SimDlgDllArguments>
<TargetDllName>
SARMCM3.DLL
</TargetDllName>
<TargetDllArguments></TargetDllArguments>
<TargetDlgDll>
TCM.DLL
</TargetDlgDll>
...
...
@@ -138,7 +138,7 @@
</Flash1>
<bUseTDR>
1
</bUseTDR>
<Flash2>
BIN\UL2CM3.DLL
</Flash2>
<Flash3>
"" ()
</Flash3>
<Flash3></Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
...
...
@@ -244,12 +244,12 @@
<IRAM>
<Type>
0
</Type>
<StartAddress>
0x20000000
</StartAddress>
<Size>
0x
5
000
</Size>
<Size>
0x
c
000
</Size>
</IRAM>
<IROM>
<Type>
1
</Type>
<StartAddress>
0x8000000
</StartAddress>
<Size>
0x
2
0000
</Size>
<Size>
0x
4
0000
</Size>
</IROM>
<XRAM>
<Type>
0
</Type>
...
...
@@ -274,7 +274,7 @@
<OCR_RVCT4>
<Type>
1
</Type>
<StartAddress>
0x8000000
</StartAddress>
<Size>
0x
2
0000
</Size>
<Size>
0x
4
0000
</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>
1
</Type>
...
...
@@ -299,7 +299,7 @@
<OCR_RVCT9>
<Type>
0
</Type>
<StartAddress>
0x20000000
</StartAddress>
<Size>
0x
5
000
</Size>
<Size>
0x
c
000
</Size>
</OCR_RVCT9>
<OCR_RVCT10>
<Type>
0
</Type>
...
...
@@ -324,6 +324,7 @@
<uThumb>
0
</uThumb>
<uSurpInc>
0
</uSurpInc>
<uC99>
1
</uC99>
<uGnu>
0
</uGnu>
<useXO>
0
</useXO>
<v6Lang>
1
</v6Lang>
<v6LangP>
1
</v6LangP>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录