未验证 提交 b087b2d9 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #4394 from supperthomas/ci_test

[bsp/max32660] 添加GCC编译环境和去掉Keil的microlib选项
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"cwd": "${workspaceRoot}",
"executable": "rt-thread.elf",
"name": "Debug MAX",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"interface": "swd",
"svdFile": "max32660.svd",
"configFiles": [
"interface/cmsis-dap.cfg",
"target/max32660.cfg"
],
"runToMain": true,
//"preLaunchTask": "build"
},
]
}
\ No newline at end of file
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "scons",
"problemMatcher": [
"$gcc"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "clean",
"type": "shell",
"command": "scons -c",
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true
}
},
]
}
\ No newline at end of file
...@@ -92,11 +92,39 @@ MAX32660-EVSYS开发板常用 **板载资源** 如下: ...@@ -92,11 +92,39 @@ MAX32660-EVSYS开发板常用 **板载资源** 如下:
2. 输入`menuconfig`命令配置工程,配置好之后保存退出。 2. 输入`menuconfig`命令配置工程,配置好之后保存退出。
4. 输入`scons --target=mdk4/mdk5/iar` 命令重新生成工程。 4. 输入`scons --target=mdk5/vsc命令重新生成工程。
## 注意事项 ## 注意事项
目前仅支持keil5环境 目前支持keil和GCC环境
## FAQ
### GCC环境如何调试使用
第一步,需要配置arm-none-eabi-gcc路径到系統环境变量中去或者在rtconfig.py中EXEC_PATH 修改路径
第二步,添加openocd的路径,如果你安装了eclipse,添加以下路径到系统环境变量中
`C:\Maxim\Toolchain\bin`
完成这两部就可以用vscode打开bsp目录了。
快捷键ctrl+shift+b可以执行scons编译命令
快捷键F5可以进入调试命令
如果需要调试之前执行build命令,在luanch.json里面打开注释
```
//"preLaunchTask": "build"
```
## 联系人信息 ## 联系人信息
......
...@@ -40,7 +40,7 @@ void rt_hw_systick_init(void) ...@@ -40,7 +40,7 @@ void rt_hw_systick_init(void)
if (error != E_NO_ERROR) if (error != E_NO_ERROR)
{ {
printf("ERROR: Ticks is not valid"); rt_kprintf("ERROR: Ticks is not valid");
} }
} }
......
...@@ -19,6 +19,33 @@ SECTIONS { ...@@ -19,6 +19,33 @@ SECTIONS {
/* C++ Exception handling */ /* C++ Exception handling */
KEEP(*(.eh_frame*)) KEEP(*(.eh_frame*))
/* section information for finsh shell */
. = ALIGN(4);
__fsymtab_start = .;
KEEP(*(FSymTab))
__fsymtab_end = .;
. = ALIGN(4);
__vsymtab_start = .;
KEEP(*(VSymTab))
__vsymtab_end = .;
/* section information for initial. */
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE(__ctors_end__ = .);
. = ALIGN(4);
_etext = .; _etext = .;
} > FLASH } > FLASH
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -117,26 +117,6 @@ ...@@ -117,26 +117,6 @@
<pMon>BIN\CMSIS_AGDI.dll</pMon> <pMon>BIN\CMSIS_AGDI.dll</pMon>
</DebugOpt> </DebugOpt>
<TargetDriverDllRegistry> <TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMRTXEVENTFLAGS</Key>
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMDBGFLAGS</Key>
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
<Name></Name>
</SetRegEntry>
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
<Key>CMSIS_AGDI</Key> <Key>CMSIS_AGDI</Key>
...@@ -155,12 +135,12 @@ ...@@ -155,12 +135,12 @@
<DebugFlag> <DebugFlag>
<trace>0</trace> <trace>0</trace>
<periodic>0</periodic> <periodic>0</periodic>
<aLwin>1</aLwin> <aLwin>0</aLwin>
<aCover>0</aCover> <aCover>0</aCover>
<aSer1>0</aSer1> <aSer1>0</aSer1>
<aSer2>0</aSer2> <aSer2>0</aSer2>
<aPa>0</aPa> <aPa>0</aPa>
<viewmode>1</viewmode> <viewmode>0</viewmode>
<vrSel>0</vrSel> <vrSel>0</vrSel>
<aSym>0</aSym> <aSym>0</aSym>
<aTbox>0</aTbox> <aTbox>0</aTbox>
...@@ -223,7 +203,7 @@ ...@@ -223,7 +203,7 @@
<Group> <Group>
<GroupName>CPU</GroupName> <GroupName>CPU</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
...@@ -291,7 +271,7 @@ ...@@ -291,7 +271,7 @@
<Group> <Group>
<GroupName>DeviceDrivers</GroupName> <GroupName>DeviceDrivers</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
...@@ -407,7 +387,7 @@ ...@@ -407,7 +387,7 @@
<Group> <Group>
<GroupName>Drivers</GroupName> <GroupName>Drivers</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
...@@ -463,7 +443,7 @@ ...@@ -463,7 +443,7 @@
<Group> <Group>
<GroupName>finsh</GroupName> <GroupName>finsh</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
...@@ -507,7 +487,7 @@ ...@@ -507,7 +487,7 @@
<Group> <Group>
<GroupName>Kernel</GroupName> <GroupName>Kernel</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
......
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
<hadIRAM2>0</hadIRAM2> <hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2> <hadIROM2>0</hadIROM2>
<StupSel>8</StupSel> <StupSel>8</StupSel>
<useUlib>1</useUlib> <useUlib>0</useUlib>
<EndSel>0</EndSel> <EndSel>0</EndSel>
<uLtcg>0</uLtcg> <uLtcg>0</uLtcg>
<nSecure>0</nSecure> <nSecure>0</nSecure>
......
...@@ -13,7 +13,7 @@ if os.getenv('RTT_CC'): ...@@ -13,7 +13,7 @@ if os.getenv('RTT_CC'):
if CROSS_TOOL == 'gcc': if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc' PLATFORM = 'gcc'
EXEC_PATH = r'C:\Users\XXYYZZ' EXEC_PATH = r'.'
elif CROSS_TOOL == 'keil': elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc' PLATFORM = 'armcc'
EXEC_PATH = 'C:/Keil_v5' EXEC_PATH = 'C:/Keil_v5'
...@@ -34,13 +34,14 @@ if PLATFORM == 'gcc': ...@@ -34,13 +34,14 @@ if PLATFORM == 'gcc':
CC = PREFIX + 'gcc' CC = PREFIX + 'gcc'
AS = PREFIX + 'gcc' AS = PREFIX + 'gcc'
AR = PREFIX + 'ar' AR = PREFIX + 'ar'
CXX = PREFIX + 'g++'
LINK = PREFIX + 'gcc' LINK = PREFIX + 'gcc'
TARGET_EXT = 'elf' TARGET_EXT = 'elf'
SIZE = PREFIX + 'size' SIZE = PREFIX + 'size'
OBJDUMP = PREFIX + 'objdump' OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy' OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m4 -mthumb -ffunction-sections -fdata-sections' DEVICE = ' -mcpu=cortex-m4 -mthumb'
CFLAGS = DEVICE CFLAGS = DEVICE
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds' LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
......
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
<hadIRAM2>0</hadIRAM2> <hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2> <hadIROM2>0</hadIROM2>
<StupSel>8</StupSel> <StupSel>8</StupSel>
<useUlib>1</useUlib> <useUlib>0</useUlib>
<EndSel>0</EndSel> <EndSel>0</EndSel>
<uLtcg>0</uLtcg> <uLtcg>0</uLtcg>
<nSecure>0</nSecure> <nSecure>0</nSecure>
......
...@@ -223,7 +223,7 @@ Reset_Handler: ...@@ -223,7 +223,7 @@ Reset_Handler:
blx r0 blx r0
/* Transfer control to users main program */ /* Transfer control to users main program */
ldr r0, =main ldr r0, =entry
blx r0 blx r0
.SPIN: .SPIN:
......
...@@ -95,6 +95,9 @@ __weak void SystemCoreClockUpdate(void) ...@@ -95,6 +95,9 @@ __weak void SystemCoreClockUpdate(void)
__weak int PreInit(void) __weak int PreInit(void)
{ {
/* Do nothing */ /* Do nothing */
#if defined ( __CC_ARM )
SystemInit();
#endif
return 0; return 0;
} }
...@@ -145,23 +148,23 @@ __weak void SystemInit(void) ...@@ -145,23 +148,23 @@ __weak void SystemInit(void)
Board_Init(); Board_Init();
} }
#if defined ( __CC_ARM ) //#if defined ( __CC_ARM )
/* Global variable initialization does not occur until post scatterload in Keil tools.*/ ///* Global variable initialization does not occur until post scatterload in Keil tools.*/
/* External function called after our post scatterload function implementation. */ ///* External function called after our post scatterload function implementation. */
extern void $Super$$__main_after_scatterload(void); //extern void $Super$$__main_after_scatterload(void);
/** ///**
* @brief Initialization function for SystemCoreClock and Board_Init. // * @brief Initialization function for SystemCoreClock and Board_Init.
* @details $Sub$$__main_after_scatterload is called during system startup in the Keil // * @details $Sub$$__main_after_scatterload is called during system startup in the Keil
* toolset. Global variable and static variable space must be set up by the compiler // * toolset. Global variable and static variable space must be set up by the compiler
* prior to using these memory spaces. Setting up the SystemCoreClock and Board_Init // * prior to using these memory spaces. Setting up the SystemCoreClock and Board_Init
* require global memory for variable storage and are called from this function in // * require global memory for variable storage and are called from this function in
* the Keil tool chain. // * the Keil tool chain.
*/ // */
void $Sub$$__main_after_scatterload(void) //void $Sub$$__main_after_scatterload(void)
{ //{
SystemInit(); // SystemInit();
$Super$$__main_after_scatterload(); // $Super$$__main_after_scatterload();
} //}
#endif /* __CC_ARM */ //#endif /* __CC_ARM */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册