Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
DC360_1drap3_xiaoju_V1
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
丁雨邯
DC360_1drap3_xiaoju_V1
Commits
44a8c3e2
提交
44a8c3e2
authored
7月 09, 2020
作者:
wysheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
支持升级与boot启动
上级
d97e947b
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
95 行增加
和
14 行删除
+95
-14
DcPillar.ewp
DcPillar/Projects/DcPillar.ewp
+4
-4
Global.c
DcPillar/Src/Global.c
+79
-2
stm32f407xG.icf
DcPillar/Src/STM32F407/stm32f407xG.icf
+7
-4
system_stm32f4xx.c
DcPillar/Src/STM32F407/system_stm32f4xx.c
+2
-1
main.c
DcPillar/Src/main.c
+3
-3
没有找到文件。
DcPillar/Projects/DcPillar.ewp
浏览文件 @
44a8c3e2
...
@@ -794,7 +794,7 @@
...
@@ -794,7 +794,7 @@
</option>
</option>
<option>
<option>
<name>
DoFill
</name>
<name>
DoFill
</name>
<state>
0
</state>
<state>
1
</state>
</option>
</option>
<option>
<option>
<name>
FillerByte
</name>
<name>
FillerByte
</name>
...
@@ -802,11 +802,11 @@
...
@@ -802,11 +802,11 @@
</option>
</option>
<option>
<option>
<name>
FillerStart
</name>
<name>
FillerStart
</name>
<state>
0x0
</state>
<state>
0x0
8008000
</state>
</option>
</option>
<option>
<option>
<name>
FillerEnd
</name>
<name>
FillerEnd
</name>
<state>
0x0
</state>
<state>
0x0
807FFFF
</state>
</option>
</option>
<option>
<option>
<name>
CrcSize
</name>
<name>
CrcSize
</name>
...
@@ -833,7 +833,7 @@
...
@@ -833,7 +833,7 @@
</option>
</option>
<option>
<option>
<name>
CrcInitialValue
</name>
<name>
CrcInitialValue
</name>
<state>
0x
0
</state>
<state>
0x
FFFF
</state>
</option>
</option>
<option>
<option>
<name>
DoCrc
</name>
<name>
DoCrc
</name>
...
...
DcPillar/Src/Global.c
浏览文件 @
44a8c3e2
...
@@ -31,6 +31,75 @@ u32 GetSystemTick(void)
...
@@ -31,6 +31,75 @@ u32 GetSystemTick(void)
}
}
/* Base address of the Flash sectors */
#define ADDR_FLASH_SECTOR_0 ((uint32_t)0x08000000)
/* Base @ of Sector 0, 16 Kbytes */
#define ADDR_FLASH_SECTOR_1 ((uint32_t)0x08004000)
/* Base @ of Sector 1, 16 Kbytes */
#define ADDR_FLASH_SECTOR_2 ((uint32_t)0x08008000)
/* Base @ of Sector 2, 16 Kbytes */
#define ADDR_FLASH_SECTOR_3 ((uint32_t)0x0800C000)
/* Base @ of Sector 3, 16 Kbytes */
#define ADDR_FLASH_SECTOR_4 ((uint32_t)0x08010000)
/* Base @ of Sector 4, 64 Kbytes */
#define ADDR_FLASH_SECTOR_5 ((uint32_t)0x08020000)
/* Base @ of Sector 5, 128 Kbytes */
#define ADDR_FLASH_SECTOR_6 ((uint32_t)0x08040000)
/* Base @ of Sector 6, 128 Kbytes */
#define ADDR_FLASH_SECTOR_7 ((uint32_t)0x08060000)
/* Base @ of Sector 7, 128 Kbytes */
#define ADDR_FLASH_SECTOR_8 ((uint32_t)0x08080000)
/* Base @ of Sector 8, 128 Kbytes */
#define ADDR_FLASH_SECTOR_9 ((uint32_t)0x080A0000)
/* Base @ of Sector 9, 128 Kbytes */
#define ADDR_FLASH_SECTOR_10 ((uint32_t)0x080C0000)
/* Base @ of Sector 10, 128 Kbytes */
#define ADDR_FLASH_SECTOR_11 ((uint32_t)0x080E0000)
/* Base @ of Sector 11, 128 Kbytes */
uint32_t
GetSector
(
uint32_t
Address
)
{
uint32_t
sector
=
0
;
if
((
Address
<
ADDR_FLASH_SECTOR_1
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_0
))
{
sector
=
FLASH_Sector_0
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_2
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_1
))
{
sector
=
FLASH_Sector_1
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_3
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_2
))
{
sector
=
FLASH_Sector_2
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_4
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_3
))
{
sector
=
FLASH_Sector_3
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_5
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_4
))
{
sector
=
FLASH_Sector_4
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_6
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_5
))
{
sector
=
FLASH_Sector_5
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_7
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_6
))
{
sector
=
FLASH_Sector_6
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_8
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_7
))
{
sector
=
FLASH_Sector_7
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_9
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_8
))
{
sector
=
FLASH_Sector_8
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_10
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_9
))
{
sector
=
FLASH_Sector_9
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_11
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_10
))
{
sector
=
FLASH_Sector_10
;
}
else
/*(Address < FLASH_END_ADDR) && (Address >= ADDR_FLASH_SECTOR_11))*/
{
sector
=
FLASH_Sector_11
;
}
return
sector
;
}
int
CopyCode
(
u32
Des
,
u32
Scr
,
u32
Len
)
int
CopyCode
(
u32
Des
,
u32
Scr
,
u32
Len
)
{
{
u32
DesAddr
;
u32
DesAddr
;
...
@@ -44,7 +113,13 @@ int CopyCode(u32 Des, u32 Scr, u32 Len)
...
@@ -44,7 +113,13 @@ int CopyCode(u32 Des, u32 Scr, u32 Len)
for
(
i
=
0
;
i
<
Len
;
)
for
(
i
=
0
;
i
<
Len
;
)
{
{
if
(
0
==
(
DesAddr
%
McnRomSectionSize
))
if
(
0
==
(
DesAddr
%
McnRomSectionSize
))
FLASH_EraseSector
(
DesAddr
,
VoltageRange_1
);
FLASH_EraseSector
(
GetSector
(
DesAddr
),
VoltageRange_3
);
else
if
(
ADDR_FLASH_SECTOR_2
==
DesAddr
)
FLASH_EraseSector
(
FLASH_Sector_2
,
VoltageRange_3
);
else
if
(
ADDR_FLASH_SECTOR_3
==
DesAddr
)
FLASH_EraseSector
(
FLASH_Sector_3
,
VoltageRange_3
);
else
if
(
ADDR_FLASH_SECTOR_4
==
DesAddr
)
FLASH_EraseSector
(
FLASH_Sector_4
,
VoltageRange_3
);
FLASH_ProgramHalfWord
(
DesAddr
,
*
(
u16
*
)
ScrAddr
);
FLASH_ProgramHalfWord
(
DesAddr
,
*
(
u16
*
)
ScrAddr
);
DesAddr
+=
2
;
DesAddr
+=
2
;
ScrAddr
+=
2
;
ScrAddr
+=
2
;
...
@@ -55,10 +130,11 @@ int CopyCode(u32 Des, u32 Scr, u32 Len)
...
@@ -55,10 +130,11 @@ int CopyCode(u32 Des, u32 Scr, u32 Len)
return
memcmp
((
void
*
)
Des
,
(
void
*
)
Scr
,
Len
);
return
memcmp
((
void
*
)
Des
,
(
void
*
)
Scr
,
Len
);
}
}
int
UpdateFlagSet
(
u32
Status
)
int
UpdateFlagSet
(
u32
Status
)
{
{
FLASH_Unlock
();
/* Flash unlock */
FLASH_Unlock
();
/* Flash unlock */
FLASH_EraseSector
(
UpdateFlagAddr
,
VoltageRange_1
);
FLASH_EraseSector
(
GetSector
(
UpdateFlagAddr
),
VoltageRange_3
);
FLASH_ProgramWord
(
UpdateFlagAddr
,
0x414E4D4D
);
FLASH_ProgramWord
(
UpdateFlagAddr
,
0x414E4D4D
);
FLASH_ProgramWord
(
UpdateFlagAddr
+
4
,
Status
);
FLASH_ProgramWord
(
UpdateFlagAddr
+
4
,
Status
);
FLASH_ProgramWord
(
UpdateFlagAddr
+
8
,
0x414E4C50
);
FLASH_ProgramWord
(
UpdateFlagAddr
+
8
,
0x414E4C50
);
...
@@ -66,6 +142,7 @@ int UpdateFlagSet(u32 Status)
...
@@ -66,6 +142,7 @@ int UpdateFlagSet(u32 Status)
return
0
;
return
0
;
}
}
//*名称:BcDToHex
//*名称:BcDToHex
//*功能: BCD码转16进制
//*功能: BCD码转16进制
//*参数: bcd_data 要转换的BCD码数据(0-100)
//*参数: bcd_data 要转换的BCD码数据(0-100)
...
...
DcPillar/Src/STM32F407/stm32f407xG.icf
浏览文件 @
44a8c3e2
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
/*-Editor annotation file-*/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x0800
00
00;
define symbol __ICFEDIT_intvec_start__ = 0x0800
82
00;
/*-Memory Regions-*/
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x0800
0
000;
define symbol __ICFEDIT_region_ROM_start__ = 0x0800
8
000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF;
define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF;
define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF;
...
@@ -32,4 +32,7 @@ place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
...
@@ -32,4 +32,7 @@ place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in ROM_region { readonly };
place in RAM_region { readwrite,
place in RAM_region { readwrite,
block CSTACK, block HEAP };
block CSTACK, block HEAP };
place in RAM1_region { section .sram };
place in RAM1_region { section .sram };
\ No newline at end of file
place at start of ROM_region { readonly section ProgramStart };
place at end of ROM_region { ro section .checksum };
\ No newline at end of file
DcPillar/Src/STM32F407/system_stm32f4xx.c
浏览文件 @
44a8c3e2
...
@@ -371,7 +371,8 @@ void SystemInit(void)
...
@@ -371,7 +371,8 @@ void SystemInit(void)
#ifdef VECT_TAB_SRAM
#ifdef VECT_TAB_SRAM
SCB
->
VTOR
=
SRAM_BASE
|
VECT_TAB_OFFSET
;
/* Vector Table Relocation in Internal SRAM */
SCB
->
VTOR
=
SRAM_BASE
|
VECT_TAB_OFFSET
;
/* Vector Table Relocation in Internal SRAM */
#else
#else
SCB
->
VTOR
=
FLASH_BASE
|
VECT_TAB_OFFSET
;
/* Vector Table Relocation in Internal FLASH */
//SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
SCB
->
VTOR
=
0x08008000
|
0x200
;
#endif
#endif
}
}
...
...
DcPillar/Src/main.c
浏览文件 @
44a8c3e2
...
@@ -28,10 +28,10 @@ void vApplicationIdleHook( void )
...
@@ -28,10 +28,10 @@ void vApplicationIdleHook( void )
//FeedDog();
//FeedDog();
}
}
//
#pragma section = ".checksum"
#pragma section = ".checksum"
//
extern u16 __checksum;
extern
u16
__checksum
;
//
__root const u32 __aa__ = (u32)&__checksum;
__root
const
u32
__aa__
=
(
u32
)
&
__checksum
;
/*
/*
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论