aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Common
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-07-09 16:52:02 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-07-09 16:52:02 +0300
commite4eaedb7bcca2276a17bda687d7773dc1540346d (patch)
tree10b63964c75e8a628e3a72138aa36ff1077e6963 /Software/Embedded_SW/Embedded/Common
parent5cf2e060dcb21338d838e103951762b3e7eb4702 (diff)
downloadTango-e4eaedb7bcca2276a17bda687d7773dc1540346d.tar.gz
Tango-e4eaedb7bcca2276a17bda687d7773dc1540346d.zip
improve flash handling
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c2
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c5
-rw-r--r--Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c6
-rw-r--r--Software/Embedded_SW/Embedded/Common/Utilities/Update.c2
-rw-r--r--Software/Embedded_SW/Embedded/Common/report/reportInit.c16
5 files changed, 18 insertions, 13 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
index c424320ff..8682f706a 100644
--- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
+++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
@@ -284,7 +284,7 @@ uint32_t FileChunkDownloadRequestFunc(MessageContainer* requestContainer)
FIL *SentFileHandle; //the system supports a single active file
SentFileHandle = DownloadFileHandle;
- char *Buffer = 0;
+ uint8_t *Buffer = 0;
Buffer = my_malloc (MAX_CHUNK_LENGTH);
if (Buffer != NULL)
{
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c
index 3bae023db..273dfb49d 100644
--- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c
+++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c
@@ -143,21 +143,26 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer)
usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename);
Fresult = f_unlink("//SYSINFO//EMBPARAM.CFG");
Fresult |= f_rename (FullPath, "//SYSINFO//EMBPARAM.CFG");
+ LoadConfigurationParamsFromFile();
+ CurrentRunningFile++;
break;
case VERSION_FILE_DESTINATION__ProcessParams:
usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename);
Fresult = f_unlink("//SYSINFO//PROCESSP.CFG");
Fresult |= f_rename (FullPath, "//SYSINFO//PROCESSP.CFG");
+ CurrentRunningFile++;
break;
case VERSION_FILE_DESTINATION__AlarmParams:
usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename);
Fresult = f_unlink("//SYSINFO//ALARMPRM.CFG");
Fresult |= f_rename (FullPath, "//SYSINFO//ALARMPRM.CFG");
+ CurrentRunningFile++;
break;
case VERSION_FILE_DESTINATION__GeneralHWConfigParams:
usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename);
Fresult = f_unlink("//SYSINFO//GENHWCFG.CFG");
Fresult |= f_rename (FullPath, "//SYSINFO//GENHWCFG.CFG");
+ CurrentRunningFile++;
break;
default:
LOG_ERROR (VersionPackage->filedescriptors[File_i]->destination,"wrong file update Destination");
diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
index 26f867fd1..ba601e283 100644
--- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
+++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c
@@ -43,14 +43,14 @@ uint16_t GetTangoVersion(uint8_t* _buffer)
memcpy(currPtr,_gTangoName,size);
currPtr+= size;
- char time[50];
+ char ttime[50];
int len;
- len = usnprintf(time, 50, "%s %s",__DATE__, __TIME__);
+ len = usnprintf(ttime, 50, "%s %s",__DATE__, __TIME__);
//++len; // added \0
//memcpy(currPtr,&len,2);
//currPtr+= 1;
//--len; // actual string len
- memcpy (currPtr,time,len);
+ memcpy (currPtr,ttime,len);
currPtr += len;
size = (currPtr - _buffer) + size;
//_buffer[size++] = '\0';
diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/Update.c b/Software/Embedded_SW/Embedded/Common/Utilities/Update.c
index 60fee1164..460334b15 100644
--- a/Software/Embedded_SW/Embedded/Common/Utilities/Update.c
+++ b/Software/Embedded_SW/Embedded/Common/Utilities/Update.c
@@ -36,7 +36,7 @@ void UpdateUsb(void)
ROM_IntMasterDisable();
#ifdef WATCHDOG
ROM_WatchdogResetDisable(WATCHDOG0_BASE);
- uint32_t timeout = 120000000*35;
+ uint32_t timeout = 0xFFFFFFFFU;
ROM_WatchdogReloadSet(WATCHDOG0_BASE, timeout);
#endif
ControlStop();
diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c
index bcda9a9be..8fa0f6e20 100644
--- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c
+++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c
@@ -148,14 +148,14 @@ uint32_t ReportInitMessage(MessageContainer* requestContainer)
*/
uint32_t RESC = SysCtlResetCauseGet ();
char ResetMessage[200] = "Reset Reason Register";
- if (RESC & SYSCTL_CAUSE_HSRVREQ) strcat (ResetMessage," Service Req");
- if (RESC & SYSCTL_CAUSE_HIB) strcat (ResetMessage," Hibernate");
- if (RESC & SYSCTL_CAUSE_WDOG1) strcat (ResetMessage," Watchdog 1");
- if (RESC & SYSCTL_CAUSE_SW) strcat (ResetMessage," Software");
- if (RESC & SYSCTL_CAUSE_WDOG0) strcat (ResetMessage," Watchdog 0");
- if (RESC & SYSCTL_CAUSE_BOR) strcat (ResetMessage," Brown-out");
- if (RESC & SYSCTL_CAUSE_POR) strcat (ResetMessage," Power on");
- if (RESC & SYSCTL_CAUSE_EXT) strcat (ResetMessage," External");
+ if (RESC & SYSCTL_CAUSE_HSRVREQ) strcat (ResetMessage,", Service Req");
+ if (RESC & SYSCTL_CAUSE_HIB) strcat (ResetMessage,", Hibernate");
+ if (RESC & SYSCTL_CAUSE_WDOG1) strcat (ResetMessage,", Watchdog 1");
+ if (RESC & SYSCTL_CAUSE_SW) strcat (ResetMessage,", Software");
+ if (RESC & SYSCTL_CAUSE_WDOG0) strcat (ResetMessage,", Watchdog 0");
+ if (RESC & SYSCTL_CAUSE_BOR) strcat (ResetMessage,", Brown-out");
+ if (RESC & SYSCTL_CAUSE_POR) strcat (ResetMessage,", Power on");
+ if (RESC & SYSCTL_CAUSE_EXT) strcat (ResetMessage,", External");
Report(ResetMessage,__FILE__,__LINE__,RESC,RpWarning,status,0);
Task_sleep (100);