Merge pull request #41 from armfly/origin/armfly

升级DAP固件增加离线版RTT Viewer和串口监视功能. 优化部分代码
This commit is contained in:
armfly 2020-12-09 23:58:14 +08:00 committed by GitHub
commit 95e1937722
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 110 additions and 33 deletions

View File

@ -1,3 +1,15 @@
----------------------------------------------------------------------------
2020-12-09 V1.42
1.DAP固件升级到V1.04版本
-增加离线版RTT Viewer功能无需PC机
-增加离线串口监视功能无需PC机
2.APP固件修正bsp_InitHardTimer()函数的bug(运行时间us数错误)
3.00联机界面去掉端口号显示
----------------------------------------------------------------------------
2020-12-06 V1.41b
1.DAP固件升级到V1.03版本,解决低电流板子调试异常问题
----------------------------------------------------------------------------
2020-12-04 V1.41
1.lua接口增加LCD显示函数可以构建图形元素. 新增文件 lua_if_disp.c

View File

@ -185,6 +185,11 @@
<WinNumber>1</WinNumber>
<ItemText>s_DS18B20_TempReg</ItemText>
</Ww>
<Ww>
<count>5</count>
<WinNumber>1</WinNumber>
<ItemText>g_uiTimeHighWord</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow1>
<Mm>
@ -208,7 +213,7 @@
<DebugFlag>
<trace>0</trace>
<periodic>1</periodic>
<aLwin>0</aLwin>
<aLwin>1</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
<aSer2>0</aSer2>
@ -244,6 +249,12 @@
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
<SystemViewers>
<Entry>
<Name>System Viewer\TIM2</Name>
<WinId>35905</WinId>
</Entry>
</SystemViewers>
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>0</EnableFlashSeq>
@ -552,7 +563,7 @@
<Group>
<GroupName>BSP</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -1016,7 +1027,7 @@
<Group>
<GroupName>MDK-ARM</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -1708,7 +1719,7 @@
<Group>
<GroupName>Doc</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -2820,7 +2831,7 @@
<Group>
<GroupName>Programmer</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>

View File

@ -68,7 +68,7 @@ __Vectors DCD __initial_sp ; Top of Stack
DCD MemManage_Handler ; MPU Fault Handler
DCD BusFault_Handler ; Bus Fault Handler
DCD UsageFault_Handler ; Usage Fault Handler
DCD 0x00000141 ; Reserved H7-TOOL APP 固件版本
DCD 0x00000142 ; Reserved H7-TOOL APP 固件版本
DCD 0 ; Reserved 固件小版本
DCD 0 ; Reserved
DCD 0 ; Reserved

Binary file not shown.

View File

@ -21,6 +21,7 @@ enum
MODIFY_PARAM_SYSTEM, /* 系统参数 */
MODIFY_PARAM_NET, /* 网络参数 */
MODIFY_PARAM_PROG, /* 脱机烧录器参数 */
MODIFY_PARAM_DAPLINK, /* DAP-LINK参数 */
};
/* 参数列表结构 */

View File

@ -94,11 +94,10 @@ const PARAM_LIST_T NetParamList[NET_PARAM_COUNT] =
{ 0, "端口号: ", 0, 1024, 65535, 30010},
};
/****** 烧录参数 ******************************************************************************/
#define PROG_PARAM_COUNT 4
const char *ProgParam0[] = {"关闭", "1路", "1-2路", "1-3路", "1-4路"};
//const char *ProgParam1[] = {"缺省", "单路烧录", "多路烧录", "DAP-Link"};
const PARAM_LIST_T ProgParamList[PROG_PARAM_COUNT] =
{
/* 数据类型, 名称 可选列表, 最小值, 最大值, 缺省值 */
@ -108,6 +107,22 @@ const PARAM_LIST_T ProgParamList[PROG_PARAM_COUNT] =
{ 0, "开机启动: ", SysBaseParam3, 0, 3, 0},
};
/****** DAP-Link参数 ******************************************************************************/
#define DAP_PARAM_COUNT 4
const char *DapParam1[] = {"关闭", "1.2V", "1.5V", "1.8V", "2.0V", "2.5V", "2.8V", "3.0V",
"3.3V", "3.6V", "4.2V", "4.5V", "4.8V", "5.0V"};
const char *DapParam2[] = {"关闭", "开启"};
const char *DapParam3[] = {"缺省", "单路烧录", "多路烧录", "DAP-Link"};
const PARAM_LIST_T DapParamList[DAP_PARAM_COUNT] =
{
/* 数据类型, 名称 可选列表, 最小值, 最大值, 缺省值 */
{ 0, "TVCC电压: ", DapParam1, 0, 13, 0},
{ 0, "蜂鸣使能: ", DapParam2, 0, 1, 1},
{ 0, "开机启动: ", DapParam3, 0, 3, 0},
{ 0, "DAP 编号: ", 0, 1, 99, 1},
};
/*
*********************************************************************************************************
* : ModifyParam
@ -334,6 +349,11 @@ void UartMonInitParam(uint16_t _ParamID)
s_pParamList = NetParamList;
s_ParamCount = NET_PARAM_COUNT;
}
else if (_ParamID == MODIFY_PARAM_DAPLINK)
{
s_pParamList = DapParamList;
s_ParamCount = DAP_PARAM_COUNT;
}
}
/*
@ -388,6 +408,13 @@ static int32_t MonDispReadParam(uint8_t _index)
else if (_index == 2) value = g_tParam.ToolSn;
else if (_index == 3) value = g_tParam.StartRun;
}
else if (s_pParamList == DapParamList)
{
if (_index == 0) value = g_tParam.DAP_TVCCVolt;
else if (_index == 1) value = g_tParam.DAP_BeepEn;
else if (_index == 2) value = g_tParam.StartRun;
else if (_index == 3) value = g_tParam.DAP_Sn;
}
return value;
}
@ -442,6 +469,13 @@ static void MonDispWriteParam(uint8_t _index, int32_t _value)
else if (_index == 2) g_tParam.ToolSn = _value;
else if (_index == 3) g_tParam.StartRun = _value;
}
else if (s_pParamList == DapParamList)
{
if (_index == 0) g_tParam.DAP_TVCCVolt = _value;
else if (_index == 1) g_tParam.DAP_BeepEn = _value;
else if (_index == 2) g_tParam.StartRun = _value;
else if (_index == 3) g_tParam.DAP_Sn = _value;
}
}
/*

View File

@ -25,11 +25,11 @@
#define TIME_X 120 - (5 * 16 / 2)
#define TIME_Y DATE_Y + 30
#define RJ45_IP_X 5
#define RJ45_IP_Y TIME_Y + 60
#define RJ45_IP_X (240 - 20 * 8)
#define RJ45_IP_Y TIME_Y + 90
#define WIFI_IP_X 5
#define WIFI_IP_Y RJ45_IP_Y + 20
#define WIFI_IP_X RJ45_IP_X
#define WIFI_IP_Y RJ45_IP_Y + 18
#define UDP_PORT_X 5
#define UDP_PORT_Y WIFI_IP_Y + 20
@ -164,21 +164,21 @@ static void DispLinkStatus(void)
/* 设置字体参数 */
{
tFont.FontCode = FC_ST_16; /* 字体代码 16点阵 */
tFont.FrontColor = INFO_NAME_COLOR; /* 字体颜色 */
tFont.FrontColor = HELP_TEXT_COLOR; /* 字体颜色 */
tFont.BackColor = INFO_BACK_COLOR; /* 文字背景颜色 */
tFont.Space = 0; /* 文字间距,单位 = 像素 */
}
sprintf(buf, "RJ45 IP:%d.%d.%d.%d", g_tParam.LocalIPAddr[0], g_tParam.LocalIPAddr[1],
sprintf(buf, "RJ45 %d.%d.%d.%d", g_tParam.LocalIPAddr[0], g_tParam.LocalIPAddr[1],
g_tParam.LocalIPAddr[2], g_tParam.LocalIPAddr[3]);
LCD_DispStr(RJ45_IP_X, RJ45_IP_Y, buf, &tFont);
sprintf(buf, "WiFi IP:%d.%d.%d.%d", g_tParam.WiFiIPAddr[0], g_tParam.WiFiIPAddr[1],
sprintf(buf, "WiFi %d.%d.%d.%d", g_tParam.WiFiIPAddr[0], g_tParam.WiFiIPAddr[1],
g_tParam.WiFiIPAddr[2], g_tParam.WiFiIPAddr[3]);
LCD_DispStr(WIFI_IP_X, WIFI_IP_Y, buf, &tFont);
sprintf(buf, "端口号:%d", g_tParam.LocalTCPPort);
LCD_DispStr(UDP_PORT_X, UDP_PORT_Y, buf, &tFont);
// sprintf(buf, "端口号:%d", g_tParam.LocalTCPPort);
// LCD_DispStr(UDP_PORT_X, UDP_PORT_Y, buf, &tFont);
/* 显示APP版本 */
tFont.FrontColor = HELP_TEXT_COLOR;

View File

@ -3,8 +3,8 @@
*
* :
* : bsp_timer.c
* : V1.5
* : systick定时器作为系统滴答定时器1ms
* : V1.7
* : systik定时器作为系统滴答定时器1ms
*
* 使(1ms) TMR_COUNT
* ms级别延迟函数1ms us级延迟函数
@ -19,7 +19,9 @@
* V1.4 2015-05-22 armfly bsp_InitHardTimer() TIM2-5
* V1.5 2018-11-26 armfly s_tTmr赋初值0; g_ucEnableSystickISR变量避免HAL提前打开systick中断
*
* V1.6 2020-02-19 armfly g_iRunTime TIMx->CNT 1ms中断丢失导致时长不准
* V1.6 2020-11-19 armfly g_iRunTime TIMx->CNT 1ms中断丢失导致时长不准
* V1.7 2020-12-09 armfly bsp_GetRunTimeUs(),bsp_CheckRunTime()
*
* Copyright (C), 2015-2030, www.armfly.com
*
*********************************************************************************************************
@ -37,6 +39,7 @@
#ifdef USE_TIM2
#define TIM_HARD TIM2
#define RCC_TIM_HARD_CLK_ENABLE() __HAL_RCC_TIM2_CLK_ENABLE()
#define RCC_TIM_HARD_CLK_DISABLE() __HAL_RCC_TIM2_CLK_DISABLE()
#define TIM_HARD_IRQn TIM2_IRQn
#define TIM_HARD_IRQHandler TIM2_IRQHandler
#endif
@ -421,7 +424,9 @@ int32_t bsp_GetRunTime(void)
uint64_t tus;
int32_t ms;
tus = (bsp_GetRunTimeUs() / 1000) & 0x7FFFFFFF; /* 取低4字节 */
tus = bsp_GetRunTimeUs();
tus = (tus / 1000) & 0x7FFFFFFF; /* 取低4字节 */
ms = tus;
return ms;
@ -441,7 +446,8 @@ int32_t bsp_CheckRunTime(int32_t _LastTime)
int32_t now_time;
int32_t time_diff;
tus = bsp_GetRunTimeUs() / 1000;
tus = bsp_GetRunTimeUs();
tus = tus / 1000;
now_time = tus & 0x7FFFFFFF; /* 取低4字节 */
@ -529,7 +535,7 @@ int64_t bsp_CheckRunTimeUs(int64_t _LastTime)
/*
*********************************************************************************************************
* : bsp_DelayNS
* : us级延迟 systick定时器启动后才能调用此函数
* : ns级延迟 systick定时器启动后才能调用此函数
* : n : NS
* :
*********************************************************************************************************
@ -620,6 +626,8 @@ void bsp_InitHardTimer(void)
uint32_t uiTIMxCLK;
TIM_TypeDef* TIMx = TIM_HARD;
RCC_TIM_HARD_CLK_DISABLE(); /* 禁止TIM时钟 */
RCC_TIM_HARD_CLK_ENABLE(); /* 使能TIM时钟 */
/*-----------------------------------------------------------------------
@ -679,12 +687,18 @@ void bsp_InitHardTimer(void)
TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
TimHandle.Init.RepetitionCounter = 0;
TimHandle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
if (HAL_TIM_Base_Init(&TimHandle) != HAL_OK)
{
Error_Handler(__FILE__, __LINE__);
}
/* 必须先清除这些标志,再使能中断 */
TIMx->SR = (uint16_t)~TIM_IT_UPDATE; /* 清除UPDATE中断标志 */
TIMx->SR = (uint16_t)~TIM_IT_CC1; /* 清除CC1中断标志 */
TIMx->SR = (uint16_t)~TIM_IT_CC2; /* 清除CC2中断标志 */
TIMx->SR = (uint16_t)~TIM_IT_CC3; /* 清除CC3中断标志 */
TIMx->SR = (uint16_t)~TIM_IT_CC4; /* 清除CC4中断标志 */
/* 配置定时器中断给CC捕获比较中断使用 */
{
HAL_NVIC_SetPriority(TIM_HARD_IRQn, 0, 2);
@ -694,8 +708,6 @@ void bsp_InitHardTimer(void)
/* 启动定时器 */
HAL_TIM_Base_Start(&TimHandle);
/* 启动溢出中断,用于运行时间计数, us单位 */
TIMx->SR = (uint16_t)~TIM_IT_UPDATE; /* 清除UPDATE中断标志 */
TIMx->DIER |= TIM_IT_UPDATE; /* 使能UPDATE中断 */
}
@ -776,7 +788,7 @@ void TIM_HARD_IRQHandler(void)
timesr = TIMx->SR;
/* 溢出中断用于CPU运行时间计算. 65.535ms进入一次 */
/* 溢出中断用于CPU运行时间计算. */
if (timesr & TIM_IT_UPDATE)
{
TIMx->SR = (uint16_t)~TIM_IT_UPDATE;

View File

@ -1780,4 +1780,11 @@ void UART8_IRQHandler(void)
}
#endif
int stdout_putchar (int ch)
{
(void)ch;
return ch;
}
/***************************** 安富莱电子 www.armfly.com (END OF FILE) *********************************/