Browse Source

加入uds

CHENJIE-PC\QiXiang_CHENJIE 3 years ago
parent
commit
9893e8c04c

+ 37 - 31
.cproject

@@ -16,14 +16,15 @@
 				<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="com.nxp.s32ds.cle.arm.mbs.arm32.bare.buildArtefact.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=com.nxp.s32ds.cle.arm.mbs.arm32.bare.buildArtefact.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="" id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.exe.debug.222968549" name="Debug_FLASH" parent="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.exe.debug">
 					<folderInfo id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.exe.debug.222968549." name="/" resourcePath="">
 						<toolChain id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.toolchain.debug.1669149124" name="NXP GCC 9.2 for Arm 32-bit Bare-Metal" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.toolchain.debug">
-							<option defaultValue="true" id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.addtools.printsize.1799663837" name="Print size" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.addtools.printsize" valueType="boolean"/>
-							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.option.compiler.path.434372331" name="Path" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.option.compiler.path" value="${S32DS_K1_ARM32_GNU_9_2_TOOLCHAIN_DIR}" valueType="string"/>
-							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.option.target.libraries.933777928" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.option.target.libraries" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
-							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.mcpu.912012235" name="Arm family" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.mcpu" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.mcpu.cortex-m4" valueType="enumerated"/>
-							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.instructionset.775672044" name="Instruction set" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.instructionset" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.instructionset.thumb" valueType="enumerated"/>
-							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.endianness.823522198" name="Endianness" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.endianness" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.endianness.little" valueType="enumerated"/>
-							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.abi.2049331992" name="Float ABI" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.abi" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.abi.hard" valueType="enumerated"/>
-							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.unit.515607088" name="FPU Type" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.unit" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
+							<option defaultValue="true" id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.addtools.printsize.1799663837" name="Print size" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.addtools.printsize" useByScannerDiscovery="false" valueType="boolean"/>
+							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.option.compiler.path.434372331" name="Path" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.option.compiler.path" useByScannerDiscovery="false" value="${S32DS_K1_ARM32_GNU_9_2_TOOLCHAIN_DIR}" valueType="string"/>
+							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.option.target.libraries.933777928" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
+							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.mcpu.912012235" name="Arm family" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.mcpu" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.mcpu.cortex-m4" valueType="enumerated"/>
+							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.instructionset.775672044" name="Instruction set" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.instructionset" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.instructionset.thumb" valueType="enumerated"/>
+							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.endianness.823522198" name="Endianness" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.endianness" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.endianness.little" valueType="enumerated"/>
+							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.abi.2049331992" name="Float ABI" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.abi" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.abi.hard" valueType="enumerated"/>
+							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.unit.515607088" name="FPU Type" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.unit" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
+							<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.unalignedaccess.721888033" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.unalignedaccess" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.option.target.unalignedaccess.default" valueType="enumerated"/>
 							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.64147430" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
 							<builder buildPath="${workspace_loc:/S32K146_4G}/Debug_FLASH" id="com.freescale.s32ds.cross.gnu.builder.466747471" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="FSL Make Builder" superClass="com.freescale.s32ds.cross.gnu.builder"/>
 							<tool id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.tool.c.compiler.1980082058" name="Standard S32DS C Compiler" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.tool.c.compiler">
@@ -71,6 +72,7 @@
 								<option id="gnu.c.compiler.option.optimization.flags.667443811" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-funsigned-char -fstack-usage -fdump-ipa-all -fomit-frame-pointer" valueType="string"/>
 								<option id="com.freescale.s32ds.cross.gnu.tool.c.compiler.option.warnings.other.92445213" name="Other warning flags" superClass="com.freescale.s32ds.cross.gnu.tool.c.compiler.option.warnings.other" useByScannerDiscovery="true" value="-Wstrict-prototypes -Wsign-compare -Werror=implicit-function-declaration -Wundef -Wdouble-promotion" valueType="string"/>
 								<option id="gnu.c.compiler.option.misc.other.1541295530" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fno-short-enums" valueType="string"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.unalignedaccess.1102556800" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.unalignedaccess" useByScannerDiscovery="true" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.unalignedaccess.default" valueType="enumerated"/>
 								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.401747511" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
 							</tool>
 							<tool id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.tool.cpp.compiler.1360480314" name="Standard S32DS C++ Compiler" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.tool.cpp.compiler">
@@ -97,26 +99,28 @@
 								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.endianness.746929375" name="Endianness" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.endianness" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.endianness.little" valueType="enumerated"/>
 								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.fpu.abi.876312129" name="Float ABI" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.fpu.abi" useByScannerDiscovery="true" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.fpu.abi.hard" valueType="enumerated"/>
 								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.fpu.unit.237850730" name="FPU Type" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.fpu.unit" useByScannerDiscovery="true" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.unalignedaccess.973410709" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.unalignedaccess" useByScannerDiscovery="true" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.compiler.option.target.unalignedaccess.default" valueType="enumerated"/>
 							</tool>
 							<tool id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.tool.c.linker.1997644081" name="Standard S32DS C Linker" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.tool.c.linker">
-								<option id="com.freescale.s32ds.cross.gnu.tool.c.linker.option.gcsections.1484145597" name="Remove unused sections (-Xlinker --gc-sections)" superClass="com.freescale.s32ds.cross.gnu.tool.c.linker.option.gcsections" value="false" valueType="boolean"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.libraries.1478856746" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.libraries" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.sysroot.87857832" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.sysroot" value="--sysroot=&quot;${S32DS_ARM32_NEWLIB_DIR}&quot;" valueType="string"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.mcpu.225477617" name="Arm family" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.mcpu" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.mcpu.cortex-m4" valueType="enumerated"/>
-								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.freescale.s32ds.cross.gnu.tool.c.linker.option.scriptfile.1071620537" name="Script files (-T)" superClass="com.freescale.s32ds.cross.gnu.tool.c.linker.option.scriptfile" valueType="stringList">
+								<option id="com.freescale.s32ds.cross.gnu.tool.c.linker.option.gcsections.1484145597" name="Remove unused sections (-Xlinker --gc-sections)" superClass="com.freescale.s32ds.cross.gnu.tool.c.linker.option.gcsections" useByScannerDiscovery="false" value="false" valueType="boolean"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.libraries.1478856746" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.sysroot.87857832" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot=&quot;${S32DS_ARM32_NEWLIB_DIR}&quot;" valueType="string"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.mcpu.225477617" name="Arm family" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.mcpu" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.mcpu.cortex-m4" valueType="enumerated"/>
+								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.freescale.s32ds.cross.gnu.tool.c.linker.option.scriptfile.1071620537" name="Script files (-T)" superClass="com.freescale.s32ds.cross.gnu.tool.c.linker.option.scriptfile" useByScannerDiscovery="false" valueType="stringList">
 									<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/Project_Settings/Linker_Files/linker_flash_s32k146.ld&quot;"/>
 								</option>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.instructionset.1152158946" name="Instruction set" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.instructionset" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.instructionset.thumb" valueType="enumerated"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.endianness.991000104" name="Endianness" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.endianness" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.endianness.little" valueType="enumerated"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.abi.1989513358" name="Float ABI" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.abi" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.abi.hard" valueType="enumerated"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.unit.1468430786" name="FPU Type" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.unit" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
-								<option id="gnu.c.link.option.ldflags.1002666294" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="--entry=Reset_Handler -ggdb3" valueType="string"/>
-								<option id="gnu.c.link.option.nostart.970867213" name="Do not use standard start files (-nostartfiles)" superClass="gnu.c.link.option.nostart" value="true" valueType="boolean"/>
-								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.link.option.libs.2096560342" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs">
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.instructionset.1152158946" name="Instruction set" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.instructionset" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.instructionset.thumb" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.endianness.991000104" name="Endianness" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.endianness" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.endianness.little" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.abi.1989513358" name="Float ABI" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.abi" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.abi.hard" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.unit.1468430786" name="FPU Type" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.unit" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
+								<option id="gnu.c.link.option.ldflags.1002666294" name="Linker flags" superClass="gnu.c.link.option.ldflags" useByScannerDiscovery="false" value="--entry=Reset_Handler -ggdb3" valueType="string"/>
+								<option id="gnu.c.link.option.nostart.970867213" name="Do not use standard start files (-nostartfiles)" superClass="gnu.c.link.option.nostart" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.link.option.libs.2096560342" name="Libraries (-l)" superClass="gnu.c.link.option.libs" useByScannerDiscovery="false" valueType="libs">
 									<listOptionValue builtIn="false" value="c"/>
 									<listOptionValue builtIn="false" value="m"/>
 									<listOptionValue builtIn="false" value="gcc"/>
 								</option>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.unalignedaccess.1492541325" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.unalignedaccess" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.target.unalignedaccess.default" valueType="enumerated"/>
 								<inputType id="com.freescale.s32ds.cross.gnu.tool.c.linker.inputType.scriptfile.223205338" superClass="com.freescale.s32ds.cross.gnu.tool.c.linker.inputType.scriptfile"/>
 							</tool>
 							<tool id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.tool.cpp.linker.2010049876" name="Standard S32DS C++ Linker" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.gnu.9.2.tool.cpp.linker">
@@ -128,14 +132,15 @@
 								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.endianness.395475268" name="Endianness" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.endianness" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.endianness.little" valueType="enumerated"/>
 								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.fpu.abi.1916612348" name="Float ABI" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.fpu.abi" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.fpu.abi.hard" valueType="enumerated"/>
 								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.fpu.unit.437003658" name="FPU Type" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.fpu.unit" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.unalignedaccess.763111437" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.unalignedaccess" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.option.target.unalignedaccess.default" valueType="enumerated"/>
 							</tool>
 							<tool id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.archiver.50914677" name="Standard S32DS Archiver" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.archiver"/>
 							<tool id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.339533218" name="Standard S32DS Assembler" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler">
-								<option id="com.freescale.s32ds.cross.gnu.tool.assembler.usepreprocessor.608521688" name="Use preprocessor" superClass="com.freescale.s32ds.cross.gnu.tool.assembler.usepreprocessor" value="true" valueType="boolean"/>
-								<option defaultValue="gnu.c.debugging.level.max" id="com.freescale.s32ds.cross.gnu.tool.assembler.option.debugging.level.935781758" name="Debug Level" superClass="com.freescale.s32ds.cross.gnu.tool.assembler.option.debugging.level" valueType="enumerated"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.2115819142" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot.1519150514" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot" value="--sysroot=&quot;${S32DS_ARM32_NEWLIB_DIR}&quot;" valueType="string"/>
-								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.763521555" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+								<option id="com.freescale.s32ds.cross.gnu.tool.assembler.usepreprocessor.608521688" name="Use preprocessor" superClass="com.freescale.s32ds.cross.gnu.tool.assembler.usepreprocessor" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option defaultValue="gnu.c.debugging.level.max" id="com.freescale.s32ds.cross.gnu.tool.assembler.option.debugging.level.935781758" name="Debug Level" superClass="com.freescale.s32ds.cross.gnu.tool.assembler.option.debugging.level" useByScannerDiscovery="false" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.2115819142" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot.1519150514" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot=&quot;${S32DS_ARM32_NEWLIB_DIR}&quot;" valueType="string"/>
+								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.763521555" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
 									<listOptionValue builtIn="false" value="../FreeRTOS/Source/include"/>
 									<listOptionValue builtIn="false" value="../RTD/include"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS/Source/portable/GCC/ARM_CM4F}&quot;"/>
@@ -149,11 +154,12 @@
 									<listOptionValue builtIn="false" value="&quot;${PLATFORMSDK_S32K1_2021_08_S32K146_M4F_1.0.0_PATH}/SW32K1_RTD_4_4_1_0_0_D2108/Platform_TS_T40D2M10I0R0/include&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${PLATFORMSDK_S32K1_2021_08_S32K146_M4F_1.0.0_PATH}/SW32K1_RTD_4_4_1_0_0_D2108/Platform_TS_T40D2M10I0R0/startup/include&quot;"/>
 								</option>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.mcpu.1538908586" name="Arm family" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.mcpu" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.mcpu.cortex-m4" valueType="enumerated"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.instructionset.1659079625" name="Instruction set" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.instructionset" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.instructionset.thumb" valueType="enumerated"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.endianness.246218978" name="Endianness" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.endianness" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.endianness.little" valueType="enumerated"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.abi.1586904906" name="Float ABI" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.abi" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.abi.hard" valueType="enumerated"/>
-								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.unit.1665512193" name="FPU Type" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.unit" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.mcpu.1538908586" name="Arm family" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.mcpu" useByScannerDiscovery="true" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.mcpu.cortex-m4" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.instructionset.1659079625" name="Instruction set" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.instructionset" useByScannerDiscovery="true" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.instructionset.thumb" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.endianness.246218978" name="Endianness" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.endianness" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.endianness.little" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.abi.1586904906" name="Float ABI" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.abi" useByScannerDiscovery="true" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.abi.hard" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.unit.1665512193" name="FPU Type" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.unit" useByScannerDiscovery="true" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
+								<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.unalignedaccess.423767230" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.unalignedaccess" useByScannerDiscovery="true" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.unalignedaccess.default" valueType="enumerated"/>
 								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1966293971" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
 								<inputType id="com.freescale.s32ds.cross.gnu.tool.assembler.inputType.asmfile.1184782747" superClass="com.freescale.s32ds.cross.gnu.tool.assembler.inputType.asmfile"/>
 							</tool>
@@ -166,7 +172,7 @@
 								<option id="com.freescale.s32ds.cross.gnu.option.createlisting.wide.1276236855" name="Wide lines (--wide|-w)" superClass="com.freescale.s32ds.cross.gnu.option.createlisting.wide" value="true" valueType="boolean"/>
 							</tool>
 							<tool id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.printsize.1466716249" name="Standard S32DS Print Size" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.printsize">
-								<option id="com.freescale.s32ds.cross.gnu.option.printsize.format.1897015732" name="Size format" superClass="com.freescale.s32ds.cross.gnu.option.printsize.format"/>
+								<option id="com.freescale.s32ds.cross.gnu.option.printsize.format.1897015732" name="Size format" superClass="com.freescale.s32ds.cross.gnu.option.printsize.format" useByScannerDiscovery="false"/>
 							</tool>
 							<tool id="com.freescale.s32ds.cross.gnu.c.preprocessor.179719808" name="Standard S32DS C Preprocessor" superClass="com.freescale.s32ds.cross.gnu.c.preprocessor"/>
 							<tool id="com.freescale.s32ds.cross.gnu.cpp.preprocessor.2124652268" name="Standard S32DS C++ Preprocessor" superClass="com.freescale.s32ds.cross.gnu.cpp.preprocessor"/>

+ 4 - 4
Project_Settings/Debugger/S32K146_4G_Debug_FLASH_PNE.launch

@@ -47,7 +47,7 @@
 <stringAttribute key="com.pemicro.debug.gdbjtag.pne.cyc_ser.CYCLONE_IP" value=""/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.cyc_ser.DO_RESET_DELAY" value="false"/>
 <intAttribute key="com.pemicro.debug.gdbjtag.pne.cyc_ser.INTERFACE_PORT" value="0"/>
-<stringAttribute key="com.pemicro.debug.gdbjtag.pne.cyc_ser.INTERFACE_PORT_STRING" value="COM1"/>
+<stringAttribute key="com.pemicro.debug.gdbjtag.pne.cyc_ser.INTERFACE_PORT_STRING" value=""/>
 <stringAttribute key="com.pemicro.debug.gdbjtag.pne.cyc_ser.NETWORK_CARD_IP" value=""/>
 <stringAttribute key="com.pemicro.debug.gdbjtag.pne.cyc_ser.POWER_DOWN_DELAY" value="250"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.cyc_ser.POWER_OFF" value="false"/>
@@ -77,7 +77,7 @@
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.cyc_usb.STARTUP_USE_SWD" value="true"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.doContinue" value="true"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.doGdbServerAllocateSemihostingConsole" value="true"/>
-<booleanAttribute key="com.pemicro.debug.gdbjtag.pne.doPartitioning" value="false"/>
+<booleanAttribute key="com.pemicro.debug.gdbjtag.pne.doPartitioning" value="true"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.enableSemihosting" value="true"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.enableSemihostingIoclientGdbClient" value="false"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.enableSemihostingIoclientTelnet" value="true"/>
@@ -112,7 +112,7 @@
 <stringAttribute key="com.pemicro.debug.gdbjtag.pne.ml.SWO_BAUDRATE_SWITCH_MULTILINK_VALUE" value="-1.000000"/>
 <stringAttribute key="com.pemicro.debug.gdbjtag.pne.ml.SWO_BAUDRATE_SWITCH_TARGET_VALUE" value="-1.000000"/>
 <stringAttribute key="com.pemicro.debug.gdbjtag.pne.otherRunCommands" value=""/>
-<intAttribute key="com.pemicro.debug.gdbjtag.pne.partitionParam" value="0"/>
+<intAttribute key="com.pemicro.debug.gdbjtag.pne.partitionParam" value="523"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.preserveMemory0" value="false"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.preserveMemory1" value="false"/>
 <booleanAttribute key="com.pemicro.debug.gdbjtag.pne.preserveMemory2" value="false"/>
@@ -216,5 +216,5 @@
 </listAttribute>
 <stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;&gt;&#13;&#10;&lt;gdbmemoryBlockExpression address=&quot;536806032&quot; label=&quot;RX_Buffer[UART_LPUART2]&quot;/&gt;&#13;&#10;&lt;gdbmemoryBlockExpression address=&quot;536823956&quot; label=&quot;GpsBufferGet&quot;/&gt;&#13;&#10;&lt;gdbmemoryBlockExpression address=&quot;255&quot; label=&quot;SocketId&quot;/&gt;&#13;&#10;&lt;/memoryBlockExpressionList&gt;&#13;&#10;"/>
 <stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
-<stringAttribute key="saved_expressions&lt;seperator&gt;Unknown" value="0x1fff0100,0x1fff08d0,0x1fff4b48,0x1fff4b50,0x1fff0103,1fff3798,0x1fff3798,0x1fffab2c,0x1fffa82c,0x1fff01f3,0x1fff050e,0,0x14200,0x14000,0x0"/>
+<stringAttribute key="saved_expressions&lt;seperator&gt;Unknown" value="1fff3798,0x1fff3798,0x1fffab2c,0x1fffa82c,0x1fff01f3,0x1fff050e,0,0x14200,0x14000,0x0,0x1fffb21c,0x1fffb600,0x1fff04e8,14000000,0x14000000"/>
 </launchConfiguration>

+ 7 - 0
Project_Settings/Linker_Files/linker_flash_s32k146.ld.bak2

@@ -34,6 +34,9 @@ MEMORY
     int_flash_interrupts    : ORIGIN = 0x00014200, LENGTH = 0x00000400    /* 1K */    /* Do not change this section */
    /* int_flash_config        : ORIGIN = 0x00000400, LENGTH = 0x00000010    /* 16bytes */ /* Do not change this section */
     int_flash               : ORIGIN = 0x00014600, LENGTH = 0x000EBA00    /* ~1.0MB */ 
+    
+    m_flexram        		: ORIGIN = 0x10000000, LENGTH = 0x00001000
+    
     int_sram_results        : ORIGIN = 0x1FFF0000, LENGTH = 0x00000100    /* 256bytes */
     int_sram                : ORIGIN = 0x1FFF0100, LENGTH = 0x0001DF00    /* ~120K */
     int_sram_stack_c0       : ORIGIN = 0x2000E000, LENGTH = 0x00001000 - 0x10    /* 4K  */
@@ -48,6 +51,10 @@ ENTRY(Reset_Handler)
 
 SECTIONS
 {
+	.eeeprom (NOLOAD):  
+    {      
+     	*(.eeprom)   
+    } >m_flexram 
     
 	.flash_interrupts :
 	{

+ 126 - 130
generate/src/IntCtrl_Ip_Cfg.c

@@ -1,7 +1,7 @@
 /*==================================================================================================
 *   Project              : RTD AUTOSAR 4.4
 *   Platform             : CORTEXM
-*   Peripheral           : 
+*   Peripheral           :
 *   Dependencies         : none
 *
 *   Autosar Version      : 4.4.0
@@ -22,9 +22,9 @@
 *   activate or otherwise use the software.
 ==================================================================================================*/
 
-
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 /*==================================================================================================
@@ -34,24 +34,23 @@ extern "C" {
 /*==================================================================================================
 *                              SOURCE FILE VERSION INFORMATION
 ==================================================================================================*/
-#define PLATFORM_INTCTRL_IP_CFG_VENDOR_ID_C                          43
-#define PLATFORM_INTCTRL_IP_CFG_SW_MAJOR_VERSION_C                   1
-#define PLATFORM_INTCTRL_IP_CFG_SW_MINOR_VERSION_C                   0
-#define PLATFORM_INTCTRL_IP_CFG_SW_PATCH_VERSION_C                   0
+#define PLATFORM_INTCTRL_IP_CFG_VENDOR_ID_C 43
+#define PLATFORM_INTCTRL_IP_CFG_SW_MAJOR_VERSION_C 1
+#define PLATFORM_INTCTRL_IP_CFG_SW_MINOR_VERSION_C 0
+#define PLATFORM_INTCTRL_IP_CFG_SW_PATCH_VERSION_C 0
 /*==================================================================================================
                                       FILE VERSION CHECKS
 ==================================================================================================*/
 /* Check if current file and IntCtrl_Ip_Cfg header file are of the same vendor */
 #if (PLATFORM_INTCTRL_IP_CFG_VENDOR_ID_C != PLATFORM_INTCTRL_IP_CFG_VENDOR_ID)
-    #error "IntCtrl_Ip_Cfg.c and IntCtrl_Ip_Cfg.h have different vendor ids"
+#error "IntCtrl_Ip_Cfg.c and IntCtrl_Ip_Cfg.h have different vendor ids"
 #endif
 
 /* Check if current file and IntCtrl_Ip_Cfg header file are of the same Software version */
 #if ((PLATFORM_INTCTRL_IP_CFG_SW_MAJOR_VERSION_C != PLATFORM_INTCTRL_IP_CFG_SW_MAJOR_VERSION) || \
      (PLATFORM_INTCTRL_IP_CFG_SW_MINOR_VERSION_C != PLATFORM_INTCTRL_IP_CFG_SW_MINOR_VERSION) || \
-     (PLATFORM_INTCTRL_IP_CFG_SW_PATCH_VERSION_C != PLATFORM_INTCTRL_IP_CFG_SW_PATCH_VERSION) \
-    )
-    #error "Software Version Numbers of IntCtrl_Ip_Cfg.c and IntCtrl_Ip_Cfg.h are different"
+     (PLATFORM_INTCTRL_IP_CFG_SW_PATCH_VERSION_C != PLATFORM_INTCTRL_IP_CFG_SW_PATCH_VERSION))
+#error "Software Version Numbers of IntCtrl_Ip_Cfg.c and IntCtrl_Ip_Cfg.h are different"
 #endif
 /*==================================================================================================
                                        GLOBAL VARIABLES
@@ -59,120 +58,119 @@ extern "C" {
 #define PLATFORM_START_SEC_CONFIG_DATA_UNSPECIFIED
 #include "Platform_MemMap.h"
 
-/* List of configurations for interrupts */
-static const IntCtrl_Ip_IrqConfigType aIrqConfiguration[] = {
-    {DMA0_IRQn, (boolean)TRUE, 6U},
-    {DMA1_IRQn, (boolean)TRUE, 6U},
-    {DMA2_IRQn, (boolean)TRUE, 6U},
-    {DMA3_IRQn, (boolean)TRUE, 7U},
-    {DMA4_IRQn, (boolean)TRUE, 7U},
-    {DMA5_IRQn, (boolean)TRUE, 7U},
-    {DMA6_IRQn, (boolean)FALSE, 0U},
-    {DMA7_IRQn, (boolean)FALSE, 0U},
-    {DMA8_IRQn, (boolean)FALSE, 0U},
-    {DMA9_IRQn, (boolean)FALSE, 0U},
-    {DMA10_IRQn, (boolean)FALSE, 0U},
-    {DMA11_IRQn, (boolean)FALSE, 0U},
-    {DMA12_IRQn, (boolean)FALSE, 0U},
-    {DMA13_IRQn, (boolean)FALSE, 0U},
-    {DMA14_IRQn, (boolean)FALSE, 0U},
-    {DMA15_IRQn, (boolean)FALSE, 0U},
-    {DMA_Error_IRQn, (boolean)FALSE, 0U},
-    {MCM_IRQn, (boolean)FALSE, 0U},
-    {FTFC_CMD_IRQn, (boolean)FALSE, 0U},
-    {FTFC_Read_Collision_IRQn, (boolean)FALSE, 0U},
-    {LVD_LVW_IRQn, (boolean)FALSE, 0U},
-    {FTFC_Fault_IRQn, (boolean)FALSE, 0U},
-    {WDOG_EWM_IRQn, (boolean)TRUE, 5U},
-    {RCM_IRQn, (boolean)FALSE, 0U},
-    {LPI2C0_Master_IRQn, (boolean)FALSE, 0U},
-    {LPI2C0_Slave_IRQn, (boolean)FALSE, 0U},
-    {LPSPI0_IRQn, (boolean)FALSE, 0U},
-    {LPSPI1_IRQn, (boolean)FALSE, 0U},
-    {LPSPI2_IRQn, (boolean)TRUE, 6U},
-    {LPUART0_RxTx_IRQn, (boolean)TRUE, 6U},
-    {LPUART1_RxTx_IRQn, (boolean)TRUE, 6U},
-    {LPUART2_RxTx_IRQn, (boolean)TRUE, 6U},
-    {ADC0_IRQn, (boolean)FALSE, 0U},
-    {ADC1_IRQn, (boolean)TRUE, 7U},
-    {CMP0_IRQn, (boolean)FALSE, 0U},
-    {ERM_single_fault_IRQn, (boolean)FALSE, 0U},
-    {ERM_double_fault_IRQn, (boolean)FALSE, 0U},
-    {RTC_IRQn, (boolean)FALSE, 0U},
-    {RTC_Seconds_IRQn, (boolean)FALSE, 0U},
-    {LPIT0_Ch0_IRQn, (boolean)TRUE, 5U},
-    {LPIT0_Ch1_IRQn, (boolean)FALSE, 0U},
-    {LPIT0_Ch2_IRQn, (boolean)FALSE, 0U},
-    {LPIT0_Ch3_IRQn, (boolean)FALSE, 0U},
-    {PDB0_IRQn, (boolean)FALSE, 0U},
-    {SCG_IRQn, (boolean)FALSE, 0U},
-    {LPTMR0_IRQn, (boolean)FALSE, 0U},
-    {PORTA_IRQn, (boolean)FALSE, 0U},
-    {PORTB_IRQn, (boolean)FALSE, 0U},
-    {PORTC_IRQn, (boolean)FALSE, 0U},
-    {PORTD_IRQn, (boolean)FALSE, 0U},
-    {PORTE_IRQn, (boolean)FALSE, 0U},
-    {SWI_IRQn, (boolean)FALSE, 0U},
-    {PDB1_IRQn, (boolean)FALSE, 0U},
-    {FLEXIO_IRQn, (boolean)FALSE, 0U},
-    {CAN0_ORed_IRQn, (boolean)TRUE, 7U},
-    {CAN0_Error_IRQn, (boolean)TRUE, 7U},
-    {CAN0_Wake_Up_IRQn, (boolean)TRUE, 7U},
-    {CAN0_ORed_0_15_MB_IRQn, (boolean)TRUE, 7U},
-    {CAN0_ORed_16_31_MB_IRQn, (boolean)TRUE, 7U},
-    {CAN1_ORed_IRQn, (boolean)TRUE, 7U},
-    {CAN1_Error_IRQn, (boolean)TRUE, 7U},
-    {CAN1_ORed_0_15_MB_IRQn, (boolean)TRUE, 7U},
-    {CAN1_ORed_16_31_MB_IRQn, (boolean)TRUE, 7U},
-    {CAN2_ORed_IRQn, (boolean)FALSE, 0U},
-    {CAN2_Error_IRQn, (boolean)FALSE, 0U},
-    {CAN2_ORed_0_15_MB_IRQn, (boolean)FALSE, 0U},
-    {FTM0_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
-    {FTM0_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
-    {FTM0_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
-    {FTM0_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
-    {FTM0_Fault_IRQn, (boolean)FALSE, 0U},
-    {FTM0_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
-    {FTM1_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
-    {FTM1_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
-    {FTM1_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
-    {FTM1_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
-    {FTM1_Fault_IRQn, (boolean)FALSE, 0U},
-    {FTM1_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
-    {FTM2_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
-    {FTM2_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
-    {FTM2_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
-    {FTM2_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
-    {FTM2_Fault_IRQn, (boolean)FALSE, 0U},
-    {FTM2_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
-    {FTM3_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
-    {FTM3_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
-    {FTM3_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
-    {FTM3_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
-    {FTM3_Fault_IRQn, (boolean)FALSE, 0U},
-    {FTM3_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
-    {FTM4_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
-    {FTM4_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
-    {FTM4_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
-    {FTM4_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
-    {FTM4_Fault_IRQn, (boolean)FALSE, 0U},
-    {FTM4_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
-    {FTM5_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
-    {FTM5_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
-    {FTM5_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
-    {FTM5_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
-    {FTM5_Fault_IRQn, (boolean)FALSE, 0U},
-    {FTM5_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
-};
+    /* List of configurations for interrupts */
+    static const IntCtrl_Ip_IrqConfigType aIrqConfiguration[] = {
+        {DMA0_IRQn, (boolean)TRUE, 6U},
+        {DMA1_IRQn, (boolean)TRUE, 6U},
+        {DMA2_IRQn, (boolean)TRUE, 6U},
+        {DMA3_IRQn, (boolean)TRUE, 7U},
+        {DMA4_IRQn, (boolean)TRUE, 7U},
+        {DMA5_IRQn, (boolean)TRUE, 7U},
+        {DMA6_IRQn, (boolean)FALSE, 0U},
+        {DMA7_IRQn, (boolean)FALSE, 0U},
+        {DMA8_IRQn, (boolean)FALSE, 0U},
+        {DMA9_IRQn, (boolean)FALSE, 0U},
+        {DMA10_IRQn, (boolean)FALSE, 0U},
+        {DMA11_IRQn, (boolean)FALSE, 0U},
+        {DMA12_IRQn, (boolean)FALSE, 0U},
+        {DMA13_IRQn, (boolean)FALSE, 0U},
+        {DMA14_IRQn, (boolean)FALSE, 0U},
+        {DMA15_IRQn, (boolean)FALSE, 0U},
+        {DMA_Error_IRQn, (boolean)FALSE, 0U},
+        {MCM_IRQn, (boolean)FALSE, 0U},
+        {FTFC_CMD_IRQn, (boolean)FALSE, 0U},
+        {FTFC_Read_Collision_IRQn, (boolean)FALSE, 0U},
+        {LVD_LVW_IRQn, (boolean)FALSE, 0U},
+        {FTFC_Fault_IRQn, (boolean)FALSE, 0U},
+        {WDOG_EWM_IRQn, (boolean)TRUE, 5U},
+        {RCM_IRQn, (boolean)FALSE, 0U},
+        {LPI2C0_Master_IRQn, (boolean)FALSE, 0U},
+        {LPI2C0_Slave_IRQn, (boolean)FALSE, 0U},
+        {LPSPI0_IRQn, (boolean)FALSE, 0U},
+        {LPSPI1_IRQn, (boolean)FALSE, 0U},
+        {LPSPI2_IRQn, (boolean)TRUE, 6U},
+        {LPUART0_RxTx_IRQn, (boolean)TRUE, 6U},
+        {LPUART1_RxTx_IRQn, (boolean)TRUE, 6U},
+        {LPUART2_RxTx_IRQn, (boolean)TRUE, 6U},
+        {ADC0_IRQn, (boolean)FALSE, 0U},
+        {ADC1_IRQn, (boolean)TRUE, 7U},
+        {CMP0_IRQn, (boolean)FALSE, 0U},
+        {ERM_single_fault_IRQn, (boolean)FALSE, 0U},
+        {ERM_double_fault_IRQn, (boolean)FALSE, 0U},
+        {RTC_IRQn, (boolean)FALSE, 0U},
+        {RTC_Seconds_IRQn, (boolean)FALSE, 0U},
+        {LPIT0_Ch0_IRQn, (boolean)TRUE, 5U},
+        {LPIT0_Ch1_IRQn, (boolean)FALSE, 0U},
+        {LPIT0_Ch2_IRQn, (boolean)FALSE, 0U},
+        {LPIT0_Ch3_IRQn, (boolean)FALSE, 0U},
+        {PDB0_IRQn, (boolean)FALSE, 0U},
+        {SCG_IRQn, (boolean)FALSE, 0U},
+        {LPTMR0_IRQn, (boolean)FALSE, 0U},
+        {PORTA_IRQn, (boolean)FALSE, 0U},
+        {PORTB_IRQn, (boolean)FALSE, 0U},
+        {PORTC_IRQn, (boolean)FALSE, 0U},
+        {PORTD_IRQn, (boolean)FALSE, 0U},
+        {PORTE_IRQn, (boolean)FALSE, 0U},
+        {SWI_IRQn, (boolean)FALSE, 0U},
+        {PDB1_IRQn, (boolean)FALSE, 0U},
+        {FLEXIO_IRQn, (boolean)FALSE, 0U},
+        {CAN0_ORed_IRQn, (boolean)TRUE, 7U},
+        {CAN0_Error_IRQn, (boolean)TRUE, 7U},
+        {CAN0_Wake_Up_IRQn, (boolean)TRUE, 7U},
+        {CAN0_ORed_0_15_MB_IRQn, (boolean)TRUE, 7U},
+        {CAN0_ORed_16_31_MB_IRQn, (boolean)TRUE, 7U},
+        {CAN1_ORed_IRQn, (boolean)TRUE, 7U},
+        {CAN1_Error_IRQn, (boolean)TRUE, 7U},
+        {CAN1_ORed_0_15_MB_IRQn, (boolean)TRUE, 7U},
+        {CAN1_ORed_16_31_MB_IRQn, (boolean)TRUE, 7U},
+        {CAN2_ORed_IRQn, (boolean)FALSE, 0U},
+        {CAN2_Error_IRQn, (boolean)FALSE, 0U},
+        {CAN2_ORed_0_15_MB_IRQn, (boolean)FALSE, 0U},
+        {FTM0_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
+        {FTM0_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
+        {FTM0_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
+        {FTM0_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
+        {FTM0_Fault_IRQn, (boolean)FALSE, 0U},
+        {FTM0_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
+        {FTM1_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
+        {FTM1_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
+        {FTM1_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
+        {FTM1_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
+        {FTM1_Fault_IRQn, (boolean)FALSE, 0U},
+        {FTM1_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
+        {FTM2_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
+        {FTM2_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
+        {FTM2_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
+        {FTM2_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
+        {FTM2_Fault_IRQn, (boolean)FALSE, 0U},
+        {FTM2_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
+        {FTM3_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
+        {FTM3_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
+        {FTM3_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
+        {FTM3_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
+        {FTM3_Fault_IRQn, (boolean)FALSE, 0U},
+        {FTM3_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
+        {FTM4_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
+        {FTM4_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
+        {FTM4_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
+        {FTM4_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
+        {FTM4_Fault_IRQn, (boolean)FALSE, 0U},
+        {FTM4_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
+        {FTM5_Ch0_Ch1_IRQn, (boolean)FALSE, 0U},
+        {FTM5_Ch2_Ch3_IRQn, (boolean)FALSE, 0U},
+        {FTM5_Ch4_Ch5_IRQn, (boolean)FALSE, 0U},
+        {FTM5_Ch6_Ch7_IRQn, (boolean)FALSE, 0U},
+        {FTM5_Fault_IRQn, (boolean)FALSE, 0U},
+        {FTM5_Ovf_Reload_IRQn, (boolean)FALSE, 0U},
+    };
+
+    /* Configuration structure for interrupt controller */
+    const IntCtrl_Ip_CtrlConfigType intCtrlConfig = {
+        102U,
+        aIrqConfiguration};
 
-/* Configuration structure for interrupt controller */
-const IntCtrl_Ip_CtrlConfigType intCtrlConfig = {
-    102U,
-    aIrqConfiguration
-};
-    
-/* List of configurations for routing interrupts */
-static const IntCtrl_Ip_IrqRouteConfigType aIrqRouteConfig[] = {
+    /* List of configurations for routing interrupts */
+    static const IntCtrl_Ip_IrqRouteConfigType aIrqRouteConfig[] = {
         {DMA0_IRQn, 0U, Dma0_Ch0_IRQHandler},
         {DMA1_IRQn, 0U, Dma0_Ch1_IRQHandler},
         {DMA2_IRQn, 0U, Dma0_Ch2_IRQHandler},
@@ -276,12 +274,10 @@ static const IntCtrl_Ip_IrqRouteConfigType aIrqRouteConfig[] = {
         {FTM5_Fault_IRQn, 0U, undefined_handler},
         {FTM5_Ovf_Reload_IRQn, 0U, undefined_handler},
     };
-/* Configuration structure for routing interrupt */
-const IntCtrl_Ip_GlobalRouteConfigType intRouteConfig = {
-    102U,
-    aIrqRouteConfig
-};
-
+    /* Configuration structure for routing interrupt */
+    const IntCtrl_Ip_GlobalRouteConfigType intRouteConfig = {
+        102U,
+        aIrqRouteConfig};
 
 #define PLATFORM_STOP_SEC_CONFIG_DATA_UNSPECIFIED
 #include "Platform_MemMap.h"

+ 4 - 21
src/AppGlobalVar.c

@@ -18,7 +18,6 @@
 //测试
 
 //*全局变量*//
-uint8 TcpbattSN[17] = {0x31}; //上传的SN编号
 uint8 VIN[17] = {0};
 volatile uint32 TimerCounter = 0; // ms单位
 /*GPS*/
@@ -32,35 +31,19 @@ boolean CanIf_bRxFlag = false;
 QueueHandle_t CanRecvQueueHandle;
 
 /*TCP相关变量*/
+uint8 TcpbattSN[17] = {0x00}; //上传的SN编号
 char ImeiNum[15] = {0};
 char IccidNum[20] = {0};
 uint8 CSQValue = 0;
-sint8 SocketId = -1;
+sint8 SocketId = -1;//联网状态
+sint8 RegChkRet = 0;//驻网状态
 char WebSiteIp[15] = {0};
 const char WebSiteName[] = "\"iotp.fast-fun.cn\"";
 const uint16 WebSitePort = 8712;
 
 #define EEP_START_SEC_VAR_INIT_8_NO_CACHEABLE
 #include "Eep_MemMap.h"
-VAR_ALIGN(uint8 dataWrTestPatt[EEP_WRTESTPATT_SIZE],4)
-VAR_ALIGN(uint8 BufferRead[EEP_WRTESTPATT_SIZE],4)
-VAR_ALIGN(uint8 EolDoneFlg,1)
-/* Data write to eeprom device */
-uint8 EolDoneFlg = 0;
-uint8 dataWrTestPatt[EEP_WRTESTPATT_SIZE]=
-{
-    0x01, 0x02, 0x03, 0x04,
-    0x11, 0x12, 0x13, 0x14,
-    0x21, 0x22, 0x23, 0x24,
-    0x31, 0x32, 0x33, 0x34,
-    0x41, 0x42, 0x43, 0x44,
-    0x51, 0x52, 0x53, 0x54,
-    0x61, 0x62, 0x63, 0x64,
-    0x71, 0x72, 0x73, 0x74,0x23
-};
-
-uint8 BufferRead[EEP_WRTESTPATT_SIZE] = {0};
-
+AppConfigBody AppConfigInfo={false,false,{defaultSn},{0}};
 #define EEP_STOP_SEC_VAR_INIT_8_NO_CACHEABLE
 #include "Eep_MemMap.h"
 

+ 10 - 4
src/AppGlobalVar.h

@@ -53,15 +53,21 @@ extern QueueHandle_t CanRecvQueueHandle;
 /*以下变量均为TCP相关变量*/
 extern uint8 CSQValue;
 extern sint8 SocketId;
+extern sint8 RegChkRet;
 extern char WebSiteIp[15];
 extern const char WebSiteName[];
 extern const uint16 WebSitePort;
 extern char ImeiNum[15];
 extern char IccidNum[20];
 
-VAR_ALIGN(extern uint8 dataWrTestPatt[EEP_WRTESTPATT_SIZE],4)
-VAR_ALIGN(extern uint8 BufferRead[EEP_WRTESTPATT_SIZE],4)
-VAR_ALIGN(extern uint8 EolDoneFlg,1)
+typedef struct _AppConfigType
+{
+	bool appSaveFlg;
+	bool eolFlg;
+	uint8 deviceSn[17];
+	uint8 re[20];
+} AppConfigBody;
+extern AppConfigBody AppConfigInfo;
 
 /*以下变量均为串口协议相关变量*/
 #define BMS_CELLNUM 120
@@ -106,6 +112,6 @@ extern uint8 battSeparateEnable ;
 extern uint8 battSeparateEnableState ;
 extern uint16 ErrorArray[5];
 
-//test
+
 extern uint32 BattTempR[4];
 #endif /* APPGLOBALVAR_H_ */

+ 387 - 30
src/AppTaskCan.c

@@ -6,6 +6,10 @@
  */
 #include "AppTaskCan.h"
 uint32 timerCounterNow = 0;
+static uint8 BattSendFlg = 0;
+static void UDSAnsFunc(uint8 *rawData);
+static void UdsAns(bool PosFlg,uint8 UdsService,uint8 UdsSubService,uint8 Idx,uint8 *AnsData,uint8 AnsDataLen);
+static void BattSendFunc(void);
 static void vCanRxCallback(TimerHandle_t pxTimer)
 {
 	uint32 ulTimerID;
@@ -25,6 +29,7 @@ void CanTask(void *pvParameters)
 	monitorTimer1ms = xTimerCreate("monitor1ms",1,pdTRUE,(void *)0,vCanRxCallback);
 	xTimerStart(monitorTimer1ms,0);
 	BaseType_t ret = pdFALSE;
+	GsensorInit();
 	while(1)
 	{
 
@@ -47,43 +52,395 @@ void CanTask(void *pvParameters)
 				}
 			}
 		}while(ret == pdPASS);
-		if(TimerCounter%1000==0&&timerCounterNow!=TimerCounter)
+		SL_SC7A20_Read_XYZ_Data(xyzData);
+		if(BattSendFlg)
+		{
+			BattSendFunc();
+		}
+		if((TimerCounter - timerCounterNow)>100)
 		{
 			timerCounterNow = TimerCounter;
-
 			//温度采集
-			for (ADC_TP_Channel_Type channel = 0; channel < ChannelCounter; channel++)
-			{
-				//ADC_ReadValue(channel, &BattTempR[channel]);
-			}
+			ADC_ReadValue();
+		}
+		if(BattTempR[1]<=0xFF)
+		{
+			Dio_WriteChannel(DioConf_DioChannel_PTD15_GPIO_OUT_MCU_BUZ_EN, STD_ON);
+		}
+		else
+		{
+			Dio_WriteChannel(DioConf_DioChannel_PTD15_GPIO_OUT_MCU_BUZ_EN, STD_OFF);
+		}
+		if(BattTempR[2]<=0xFF)
+		{
+			Dio_WriteChannel(DioConf_DioChannel_PTD16_GPIO_OUT_MCU_RELAY_POW_EN, STD_ON);
+		}
+		else
+		{
+			Dio_WriteChannel(DioConf_DioChannel_PTD16_GPIO_OUT_MCU_RELAY_POW_EN, STD_OFF);
+		}
+		if(BattTempR[3]<=0xFF)
+		{
+			Dio_WriteChannel(DioConf_DioChannel_PTA11_GPIO_OUT_MCU_BMS_WAKEUP_EN, STD_ON);
+		}
+		else
+		{
+			Dio_WriteChannel(DioConf_DioChannel_PTA11_GPIO_OUT_MCU_BMS_WAKEUP_EN, STD_OFF);
 		}
-//		if(BattTempR[1]==0x00)
-//		{
-//			Dio_WriteChannel(DioConf_DioChannel_PTD15_GPIO_OUT_MCU_BUZ_EN, STD_ON);
-//		}
-//		else
-//		{
-//			Dio_WriteChannel(DioConf_DioChannel_PTD15_GPIO_OUT_MCU_BUZ_EN, STD_OFF);
-//		}
-//		if(BattTempR[2]==0x00)
-//		{
-//			Dio_WriteChannel(DioConf_DioChannel_PTD16_GPIO_OUT_MCU_RELAY_POW_EN, STD_ON);
-//		}
-//		else
-//		{
-//			Dio_WriteChannel(DioConf_DioChannel_PTD16_GPIO_OUT_MCU_RELAY_POW_EN, STD_OFF);
-//		}
-//		if(BattTempR[3]==0x00)
-//		{
-//			Dio_WriteChannel(DioConf_DioChannel_PTA11_GPIO_OUT_MCU_BMS_WAKEUP_EN, STD_ON);
-//		}
-//		else
-//		{
-//			Dio_WriteChannel(DioConf_DioChannel_PTA11_GPIO_OUT_MCU_BMS_WAKEUP_EN, STD_OFF);
-//		}
 	}
 }
 //注意解码超限问题
 void BcuDecodeFunction(uint32 ID, uint8 *rawData)
 {
+	switch(ID)
+		{
+		case 0x1C00EDEA:
+		{
+			UDSAnsFunc(rawData);
+			break;
+		}
+		}
+}
+static void UDSAnsFunc(uint8 *rawData)
+{
+	static uint8 UdsStates = 1;
+	uint8 Data[8] = {0};
+	memcpy(Data,rawData,8);
+	uint8 UdsService = 0;
+	uint8 UdsSubService = 0;
+	UdsService = Data[0];
+	UdsSubService = Data[1];
+	uint8 AnsData[24]={0};
+	static uint8 deviceSnRecvFlg = 0;
+	switch(UdsService)
+	{
+	case 0x10://模式切换
+	{
+		if(UdsSubService==0x01)
+		{
+			UdsStates = 0x01;//关闭UDS诊断
+			UdsAns(true,UdsService,UdsSubService,0x00,NULL,0);
+		}
+		else if(UdsSubService==0x02)
+		{
+			if(UdsStates==0x01||UdsStates==0x02)
+			{
+				UdsStates = 0x02;//打开UDS诊断
+				UdsAns(true,UdsService,UdsSubService,0x00,NULL,0);
+			}
+			else
+			{
+				UdsAns(false,UdsService,UdsSubService,0x00,NULL,0);
+			}
+		}
+		break;
+	}
+	case 0x22://查询
+	{
+		if(UdsStates==0x02)
+		{
+			switch(UdsSubService)
+			{
+			case 0x01://版本号查询
+			{
+				AnsData[0] = APPSWVERSION>>24;
+				AnsData[1] = APPSWVERSION>>16;
+				AnsData[2] = APPSWVERSION>>8;
+				AnsData[3] = APPSWVERSION>>0;
+				UdsAns(true,UdsService,UdsSubService,0x00,AnsData,4);
+				break;
+			}
+			case 0x02://SN号码查询
+			{
+				memcpy(AnsData,AppConfigInfo.deviceSn,17);
+				for(uint8 i=0;i<5;i++)
+				{
+					UdsAns(true,UdsService,UdsSubService,i,&AnsData[i*4],4);
+				}
+				break;
+			}
+			case 0x03://ICCID查询
+			{
+				memcpy(AnsData,IccidNum,20);
+				for(uint8 i=0;i<5;i++)
+				{
+					UdsAns(true,UdsService,UdsSubService,i,&AnsData[i*4],4);
+				}
+				break;
+			}
+			case 0x04://IMEI查询
+			{
+				memcpy(AnsData,ImeiNum,15);
+				for(uint8 i=0;i<4;i++)
+				{
+					UdsAns(true,UdsService,UdsSubService,i,&AnsData[i*4],4);
+				}
+				break;
+			}
+			case 0x05://驻网状态查询
+			{
+				AnsData[0]= RegChkRet;
+				UdsAns(true,UdsService,UdsSubService,0x00,AnsData,1);
+				break;
+			}
+			case 0x06://联网状态查询
+			{
+				AnsData[0]= SocketId;
+				UdsAns(true,UdsService,UdsSubService,0x00,AnsData,1);
+				break;
+			}
+			case 0x07://定位信息查询
+			{
+				GPSInfo GpsRecvData;
+				if (xQueuePeek(GpsDataQueueHandle, &GpsRecvData, 0) == pdPASS)
+				{
+					AnsData[0] = GpsRecvData.locateMark;
+					AnsData[4] = GpsRecvData.longitude[0];
+					AnsData[5] = GpsRecvData.longitude[1];
+					AnsData[6] = GpsRecvData.longitude[2];
+					AnsData[7] = GpsRecvData.longitude[3];
+					AnsData[8] = GpsRecvData.latitude[0];
+					AnsData[9] = GpsRecvData.latitude[1];
+					AnsData[10] = GpsRecvData.latitude[2];
+					AnsData[11] = GpsRecvData.latitude[3];
+					AnsData[12] = GpsRecvData.altitude[0];
+					AnsData[13] = GpsRecvData.altitude[1];
+					AnsData[14] = GpsRecvData.satelliteNum;
+					for(uint8 i=0;i<4;i++)
+					{
+						UdsAns(true,UdsService,UdsSubService,i,&AnsData[i*4],4);
+					}
+					break;
+				}
+				else
+				{
+					AnsData[0]=0xFF;
+					UdsAns(true,UdsService,UdsSubService,0x00,AnsData,1);
+				}
+				break;
+			}
+			case 0x08://温度检测查询
+			{
+				UdsAns(true,UdsService,UdsSubService,0x00,AnsData,1);
+				break;
+			}
+			case 0x09://电池信息查询
+			{
+				UdsAns(true,UdsService,UdsSubService,0x00,AnsData,1);
+				BattSendFlg = 1;
+				break;
+			}
+			case 0x0A://三轴数据查询
+			{
+				AnsData[0] = xyzData[0]>>8;
+				AnsData[1] = xyzData[0]>>0;
+				AnsData[2] = xyzData[1]>>8;
+				AnsData[3] = xyzData[1]>>0;
+				AnsData[4] = xyzData[2]>>8;
+				AnsData[5] = xyzData[2]>>0;
+				for(uint8 i=0;i<2;i++)
+				{
+					UdsAns(true,UdsService,UdsSubService,i,&AnsData[i*4],4);
+				}
+				break;
+			}
+			}//switch
+		}//if
+		else
+		{
+			UdsAns(false,UdsService,UdsSubService,0x00,NULL,0);
+		}
+		break;
+	}
+	case 0x27://控制
+	{
+		if(UdsStates==0x02)
+		{
+
+		}
+		else
+		{
+			UdsAns(false,UdsService,UdsSubService,0x00,NULL,0);
+		}
+		break;
+	}
+	case 0x2E://写入
+	{
+		if(UdsStates==0x02)
+		{
+			switch(UdsSubService)
+			{
+			case 0x01:
+			{
+				setbit(deviceSnRecvFlg,Data[3]);
+				if(Data[3]<0x04)
+				{
+					memcpy(&AppConfigInfo.deviceSn[Data[3]*4],&Data[4],4);
+					UdsAns(true,UdsService,UdsSubService,0x00,&Data[3],1);
+				}
+				else if(Data[3]==0x04)
+				{
+					memcpy(&AppConfigInfo.deviceSn[Data[3]*4],&Data[4],1);
+					UdsAns(true,UdsService,UdsSubService,0x00,&Data[3],1);
+				}
+				if(deviceSnRecvFlg==0x1F)
+				{
+					deviceSnRecvFlg = 0;
+					AppConfigInfo.appSaveFlg = true;
+				}
+				break;
+			}
+			}
+		}
+		else
+		{
+			UdsAns(false,UdsService,UdsSubService,0x00,NULL,0);
+		}
+		break;
+	}
+	default:
+		break;
+	}
+	return;
+}
+static void UdsAns(bool PosFlg,uint8 UdsService,uint8 UdsSubService,uint8 Idx,uint8 *AnsData,uint8 AnsDataLen)
+{
+	Can_Msg_Type CanTxMsg;
+	uint32 CanAnsId = 0x1C00EAED;
+	uint8 SendData[8] = {0};
+	if(PosFlg)
+	{
+		SendData[0] = 0x78;
+		SendData[1] = UdsService;
+		SendData[2] = UdsSubService;
+		SendData[3] = Idx;
+		if(AnsData!=NULL&&AnsDataLen!=0x00)
+		{
+			memcpy(&SendData[4],AnsData,AnsDataLen);
+		}
+	}
+	else
+	{
+		SendData[0] = 0x7F;
+		SendData[1] = UdsService;
+		SendData[2] = UdsSubService;
+		SendData[3] = 0x00;
+	}
+	CanTxMsg.id = CanAnsId;
+	CanTxMsg.idFrame = CAN_EXTENDED_ID_TYPE;
+	CanTxMsg.sdu = SendData;
+	CanTxMsg.length = 8;
+	CanIf_SendMessage(CAN1, CanTxMsg);
+}
+static void BattSendFunc(void)
+{
+	Can_Msg_Type CanTxMsg;
+	uint32 CanAnsId = 0;
+	uint8 SendData[8] = {0};
+	static uint8 SendStep = 0;
+	static uint8 SendCounter = 0;
+	switch(SendStep)
+	{
+	case 0x00:
+	{
+		SendStep++;
+		return;
+		break;
+	}
+	case 0x01:
+	{
+		CanAnsId = 0x1C01EAED;
+		SendData[0] =  battHeatState;
+		SendData[1] =  battFanState;
+		SendData[2] =  battRelayState;
+		SendData[3] =  battConverState;
+		SendStep++;
+		break;
+	}
+	case 0x02:
+	{
+		uint16 ErrorTemp ;
+		ErrorTemp = GetErrorNum(ErrorArray,sizeof(ErrorArray)/2);
+		CanAnsId = 0x1C09EAED;
+		SendData[0] =  battWorkState;
+		SendData[1] =  ErrorTemp>>8;
+		SendData[2] =  ErrorTemp;
+		SendData[3] =  0;
+		SendData[4] =  0;
+		SendData[5] =  0;
+		SendData[6] =  0;
+		SendData[7] =  0;
+		SendStep++;
+		break;
+	}
+	case 0x03:
+	{
+		CanAnsId = 0x1C0AEAED;
+		uint16 SocTemp = battSOC*10;
+		SendData[0] =  battI>>8;
+		SendData[1] =  battI;
+		SendData[2] =  battPackVol>>8;
+		SendData[3] =  battPackVol;
+		SendData[4] =  SocTemp>>8;
+		SendData[5] =  SocTemp;
+		SendData[6] =  battSOH;
+		SendData[7] =  battMOSSwitchState;
+		SendStep++;
+		break;
+	}
+	case 0x04:
+	{
+		CanAnsId = 0x1C10EAED + (SendCounter<<16);
+		if((SendCounter*8 + 7)>BMS_TEMPNUM)
+		{
+			SendCounter = 0;
+			SendStep++;
+			return;
+			break;
+		}
+		SendData[0] =  battCellTemp[SendCounter*8 + 0];
+		SendData[1] =  battCellTemp[SendCounter*8 + 1];
+		SendData[2] =  battCellTemp[SendCounter*8 + 2];
+		SendData[3] =  battCellTemp[SendCounter*8 + 3];
+		SendData[4] =  battCellTemp[SendCounter*8 + 4];
+		SendData[5] =  battCellTemp[SendCounter*8 + 5];
+		SendData[6] =  battCellTemp[SendCounter*8 + 6];
+		SendData[7] =  battCellTemp[SendCounter*8 + 7];
+		SendCounter++;
+		break;
+	}
+	case 0x05:
+	{
+		CanAnsId = 0x1CA0EAED + (SendCounter<<16);
+		if((SendCounter*4 + 3)>BMS_CELLNUM)
+		{
+			SendCounter = 0;
+			SendStep++;
+			return;
+			break;
+		}
+		SendData[0] =  battCellU[SendCounter*4 + 0]>>8;
+		SendData[1] =  battCellU[SendCounter*4 + 0];
+		SendData[2] =  battCellU[SendCounter*4 + 1]>>8;
+		SendData[3] =  battCellU[SendCounter*4 + 1];
+		SendData[4] =  battCellU[SendCounter*4 + 2]>>8;
+		SendData[5] =  battCellU[SendCounter*4 + 2];
+		SendData[6] =  battCellU[SendCounter*4 + 3]>>8;
+		SendData[7] =  battCellU[SendCounter*4 + 3];
+		SendCounter++;
+		break;
+	}
+	default:
+	{
+		SendStep = 0;
+		BattSendFlg = 0;
+		return;
+		break;
+	}
+	}
+	CanTxMsg.id = CanAnsId;
+	CanTxMsg.idFrame = CAN_EXTENDED_ID_TYPE;
+	CanTxMsg.sdu = SendData;
+	CanTxMsg.length = 8;
+	CanIf_SendMessage(CAN1, CanTxMsg);
 }

+ 1 - 0
src/AppTaskCan.h

@@ -12,6 +12,7 @@
 #include "AppFuncLib.h"
 #include "UDSTask.h"
 #include "Hal_Wdg.h"
+#include "AppTaskGps.h"
 void BcuDecodeFunction(uint32 ID, uint8 *rawData);
 void CanTask(void *pvParameters);
 #endif /* APPTASKCAN_H_ */

+ 1 - 4
src/AppTaskGps.c

@@ -14,18 +14,15 @@ void GpsTask(void *pvParameters)
 	GpsDataQueueHandle = xQueueCreate(1, sizeof(GPSInfo));//长度为1才可以允许覆写
 	Dio_WriteChannel(DioConf_DioChannel_PTD1_GPIO_OUT_MCU_GPS_POW_EN, STD_ON);//GPS开机
 	uint16 pReadLen = 0;
-	GsensorInit();
-	sint16 SL_SC7A20_Data_XYZ_Buf[3];
 	while(1)
 	{
-		vTaskDelay(pdMS_TO_TICKS(100));
+		vTaskDelay(pdMS_TO_TICKS(10));
 		memset(RX_Buffer[UART_LPUART2],0x00,sizeof(RX_Buffer[UART_LPUART2]));
 		UART_Receive_Data(UART_LPUART2,RX_Buffer[UART_LPUART2],&pReadLen,1000);
 		if(pReadLen>0)
 		{
 			GpsDataDecode(RX_Buffer[UART_LPUART2]);
 		}
-		SL_SC7A20_Read_XYZ_Data(SL_SC7A20_Data_XYZ_Buf);
 	}
 }
 void GpsDataDecode(uint8 *msg)

+ 11 - 0
src/AppTaskMain.c

@@ -16,6 +16,12 @@ void MainTask(void *pvParameters)
 	TimerHandle_t monitorTimer1ms;
 	monitorTimer1ms = xTimerCreate("monitor1ms",1,pdTRUE,(void *)0,vTimer1msCallback);
 	xTimerStart(monitorTimer1ms,0);
+	uint32 *eppromAddStart = 0x14000000;
+	if(*(uint8 *)(eppromAddStart)==0xff)
+	{
+		HAL_EEP_Write(0,(uint8 *)&AppConfigInfo,sizeof(AppConfigInfo));
+	}
+	HAL_EEP_Read(0,(uint8 *)&AppConfigInfo,sizeof(AppConfigInfo));
 	while(1)
 	{
 		vTaskDelay(pdMS_TO_TICKS(10));
@@ -26,6 +32,11 @@ void MainTask(void *pvParameters)
 				WATCHDOG_HAL_Feed();
 			}
 		}
+		if(AppConfigInfo.appSaveFlg)
+		{
+			AppConfigInfo.appSaveFlg = false;
+			HAL_EEP_Write(0,(uint8 *)&AppConfigInfo,sizeof(AppConfigInfo));
+		}
 	}
 }
 static void vTimerCallback(TimerHandle_t pxTimer)

+ 6 - 6
src/AppTaskUart1.c

@@ -50,7 +50,7 @@ void Uart_4G_Task(void *pvParameters)
 	_4G_Status = Dio_ReadChannel(DioConf_DioChannel_PTB1_GPIO_IN_MCU_4G_STATUS);
 	// LED测试
 	Dio_WriteChannel(DioConf_DioChannel_PTE0_GPIO_OUT_MCU_LED1, STD_OFF);
-	vTaskDelay(pdMS_TO_TICKS(5000));
+	vTaskDelay(pdMS_TO_TICKS(1000));
 	uint8 pReadLen = 0;
 	InitFunc(); // 4G模块初始化,注:AT同步不通过,没有进行次数判定及跳转
 	uint32 SendTimerCounter = 0;
@@ -65,7 +65,7 @@ void Uart_4G_Task(void *pvParameters)
 			{
 				PROC_TCP_STATE_SWITCH(PROCESS_TCP_REGCHK);
 			}
-			else if ((TimerCounter -SendTimerCounter)>1000 && EolDoneFlg==1)
+			else if ((TimerCounter -SendTimerCounter)>1000 && AppConfigInfo.eolFlg==1)
 			{
 				SendTimerCounter = TimerCounter;
 				PROC_TCP_STATE_SWITCH(PROCESS_TCP_SEND);
@@ -93,7 +93,6 @@ void Uart_4G_Task(void *pvParameters)
 		}
 		case PROCESS_TCP_REGCHK: //驻网检查,包括SIM,CPIN检查,ICCID获取
 		{
-			sint8 RegChkRet = 0;
 			RegChkRet = TcpRegisterChkFunc();
 			if (RegChkRet > 0) //检查通过,SIM卡已就绪,已进行驻网
 			{
@@ -172,7 +171,7 @@ sint8 TcpDataSendFunc(sint8 ConnectId)
 	sint8 outValue = -1;
 	uint32 pSendDataAddr = 0;
 	uint16 DataSendLen = 0;
-	memcpy(TcpbattSN, defaultSn, 17);
+	memcpy(TcpbattSN, AppConfigInfo.deviceSn, 17);
 	TcpDataEncode(&pSendDataAddr, &DataSendLen); //数据组包,malloc申请在里面,pSendData指向申请的地址
 	if (DataSendLen == 0)
 	{
@@ -248,7 +247,6 @@ sint8 TcpConnectFunc(sint8 *ConnectId)
 			else
 			{
 				ConnectStep++;
-				*ConnectId = 0;
 			}
 			break;
 		}
@@ -276,6 +274,7 @@ sint8 TcpConnectFunc(sint8 *ConnectId)
 		{
 			char AtCmdSend[20] = {0};
 			uint8 AtCmdSendTotalLen = 0;
+			*ConnectId = 0;
 			sprintf(AtCmdSend, "%d,\"TCP\",%s,%d\r\n", *ConnectId, WebSiteIp, WebSitePort); //此处需要优化
 			AtCmdSendTotalLen = mstrlen(AtCmdSend);
 			AtcmdTransmit(AT_CONNECT, AtCmdSend, AtCmdSendTotalLen, &ATRet);
@@ -286,6 +285,7 @@ sint8 TcpConnectFunc(sint8 *ConnectId)
 			else
 			{
 				ChkState = -ConnectStep;
+				*ConnectId = -1;
 				return ChkState;
 			}
 			break;
@@ -493,7 +493,7 @@ static void AtcmdTransmit(sint8 CmdIdx, uint8 *SetValuePtr, uint16 SetValueLen,
 	}
 	memset(RX_Buffer[UART_LPUART1], 0x00, sizeof(RX_Buffer[UART_LPUART1]));
 
-	UART_Query_Data(UART_LPUART1, UART_LPUART1, PtrATCmdSend, ATCmdTotalLen, RX_Buffer[UART_LPUART1], &ReadLen, 100);
+	UART_Query_Data(UART_LPUART1, UART_LPUART1, PtrATCmdSend, ATCmdTotalLen, RX_Buffer[UART_LPUART1], &ReadLen, 1000);
 
 	*retFunc = Atcmdfunc[CmdIdx].cb(PtrATCmdSend, RX_Buffer[UART_LPUART1], CmdIdx, ReadLen);
 	if (PtrATCmdSend != NULL)

+ 21 - 47
src/hal_adapter.c

@@ -6,11 +6,13 @@
  */
 #include "hal_adapter.h"
 #include "AppGlobalVar.h"
-
  uint8_t __attribute__((section(".non_cacheable_data"))) RX_Buffer[3][BUFFER_SIZE];
  uint32_t bufferIdx[3] = {0};
  volatile uint32 VarNotification_0 = 0;
  volatile uint32 VarNotification_1 = 0;
+ TP_Value_Type    ConvertedBuffer[NUM_RESULTS];
+ Adc_ValueGroupType    ResultBuffer[NUM_RESULTS];
+ Std_ReturnType  ADC_Converter(Adc_ValueGroupType* Buffer, TP_Value_Type* ConvertedValueR);
  Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, const uint8 *txBuffer, uint32 sendLength, uint8 *rxBuffer, uint16 *rxlen,uint32 T_timeout)
  {
      volatile Std_ReturnType R_Uart_Status;
@@ -79,8 +81,6 @@
 
 	 } while (((UART_STATUS_NO_ERROR != Uart_TransmitStatus || UART_STATUS_NO_ERROR != Uart_ReceiveStatus) && 0 < --timeout));
 //	 Dio_WriteChannel(DioConf_DioChannel_PTE1_GPIO_OUT_MCU_LED2, STD_OFF);
-
-
 	 if ((UART_STATUS_NO_ERROR != Uart_TransmitStatus))
 	 {
 		 Uart_Abort(transChannel, UART_SEND);
@@ -367,7 +367,9 @@
 
  void Notification_0(void)
  {
-     VarNotification_0++;
+	 ADC_Converter(ResultBuffer,ConvertedBuffer);
+	 memcpy(BattTempR,&ConvertedBuffer[3],4*sizeof(uint32));
+//     VarNotification_0++;
  }
 
  void Notification_1(void)
@@ -400,60 +402,35 @@
 	 }
  }
 
- Std_ReturnType  ADC_ReadValue(ADC_TP_Channel_Type channel, TP_Value_Type* value)
+ Std_ReturnType  ADC_ReadValue()
  {
 	 Std_ReturnType ret = E_NOT_OK;
-
-	 Adc_ValueGroupType    ResultBuffer[NUM_RESULTS];
 	 Adc_ValueGroupType    AdcReadGroupBuffer[NUM_RESULTS];
-
-	 TP_Value_Type    ConvertedBuffer[NUM_RESULTS];
 	 volatile Std_ReturnType Status = TRUE;
-
 	 for(int i = 0; i<NUM_RESULTS; i++)
 	 {
 		 ResultBuffer[i] = 0xFFFF;
 		 AdcReadGroupBuffer[i] = 0xFFFE;
 		 ConvertedBuffer[i] = 0x00;
 	 }
-
 	 Adc_SetupResultBuffer(AdcGroupSoftwareOneShot, ResultBuffer);
 	 Adc_EnableGroupNotification(AdcGroupSoftwareOneShot);
 	 VarNotification_0 = 0;
 	 Adc_StartGroupConversion(AdcGroupSoftwareOneShot);
-
-	 while(VarNotification_0 == 0 && VarNotification_1==0)
-	 {}
-	 Status = Adc_ReadGroup(AdcGroupSoftwareOneShot, AdcReadGroupBuffer);
-	 if(Status == E_NOT_OK)
-	 {
-		 return Status;
-	 }
-	 else
-	 {
-		 ret = E_OK;
-	 }
-
-	 ADC_Converter(ResultBuffer,ConvertedBuffer);
-	 switch(channel)
-	 {
-		 case SystemTPChannel:
-			 *value = ConvertedBuffer[3];
-			 break;
-		 case SlowChargeTPChannel:
-			 *value = ConvertedBuffer[4];
-			 break;
-		 case QuickChargeTPChannel:
-			 *value = ConvertedBuffer[5];
-			 break;
-		 case CC1TPChannel:
-			 *value = ConvertedBuffer[6];
-			 break;
-		 default:
-			 *value = 0xFFF;
-			 Status = E_NOT_OK;
-			 break;
-	 }
+//	 uint32 TimeOut = 0;
+//	 while(VarNotification_0 == 0 && VarNotification_1==0 && TimeOut<0xFFFF)
+//	 {
+//		 TimeOut++;
+//	 }
+//	 AdcStates = Adc_ReadGroup(AdcGroupSoftwareOneShot, AdcReadGroupBuffer);
+//	 if(AdcStates == E_NOT_OK)
+//	 {
+//		 return AdcStates;
+//	 }
+//	 else
+//	 {
+//		 ret = E_OK;
+//	 }
 	 return ret;
  }
 
@@ -627,9 +604,6 @@
      return E_OK;
  }
 
-
-
-
  /* Compares a eeprom memory area with an application data buffer */
  Std_ReturnType HAL_EEP_Compare(uint32 eepCompareStartAddr,uint8* pDataNeedtoCompare,uint32 dataSize)
  {

+ 4 - 1
src/hal_adapter.h

@@ -39,6 +39,9 @@
  #include "Adc.h"
  #include "Eep.h"
  #include "SL_Sc7a20_Driver.h"
+#define CAN0 0
+#define CAN1 1
+
 #ifndef min
 #define min(A,B) ((A) <= (B) ? (A) : (B))
 #endif
@@ -73,7 +76,7 @@
  }ADC_TP_Channel_Type;
 
  typedef uint32 TP_Value_Type;
- Std_ReturnType  ADC_ReadValue(ADC_TP_Channel_Type channel, TP_Value_Type* value);
+ Std_ReturnType  ADC_ReadValue(void);
 // extern uint8 GpsBufferGet[GPSBUFFER_SIZE];
  Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, const uint8 *txBuffer, uint32 sendLength, uint8 *rxBuffer, uint16 *rxlen,uint32 T_timeout);
  Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8 *txBuffer, uint32 sendLength, uint32 T_timeout);

+ 2 - 6
src/main.c

@@ -117,7 +117,7 @@ int main(void)
 #endif /* ADC_PRECOMPILE_SUPPORT == STD_ON */
 
     /* Partition only if it was not partitioned before for EERAM with code 0x4 */
-    Eep_DepartParitition(T_EEEPROM_SIZE);
+//    Eep_DepartParitition(T_EEEPROM_SIZE);
     /* Initialize Eep driver */
 #if defined (EEP_PRECOMPILE_SUPPORT)
     Eep_Init(NULL_PTR);
@@ -131,11 +131,7 @@ int main(void)
 	{
 		// if so, the adc is failed to Calibrate;
 	}
-	for (ADC_TP_Channel_Type channel = 0; channel < ChannelCounter; channel++)
-	{
-		ADC_ReadValue(channel, &BattTempR[channel]);
-	}
-
+	ADC_ReadValue();
 	Boot_CheckDownlaodAPPStatus();
 
 	Spi_Init(NULL_PTR);