From acde7cb0b985195042696cc9eb91f11e1941fc77 Mon Sep 17 00:00:00 2001 From: sourland Date: Mon, 8 Jan 2024 14:00:05 +0200 Subject: [PATCH 1/4] fetch mram settings --- AutoGenerated.X/nbproject/Makefile-default.mk | 128 +++++++------- .../nbproject/Makefile-local-default.mk | 12 +- AutoGenerated.X/nbproject/configurations.xml | 22 +-- CMakeLists.txt | 2 + README.md | 153 +++++++++++----- atmel_samv71_xplained_ultra.cfg | 3 +- conanfile.py | 5 +- inc/FreeRTOSTasks/NANDTask.hpp | 2 +- lib/atsam-component-drivers | 2 +- src/FreeRTOSTasks/NANDTask.cpp | 165 +++++++++--------- src/config/default/default.mhc/settings.yml | 2 +- src/config/default/default.mhc/smc.yml | 19 +- src/config/default/definitions.h | 2 +- .../default/harmony-manifest-failure.yml | 16 +- src/config/default/initialization.c | 4 +- src/config/default/peripheral/smc/plib_smc.c | 8 +- src/main.cpp | 4 +- 17 files changed, 320 insertions(+), 229 deletions(-) diff --git a/AutoGenerated.X/nbproject/Makefile-default.mk b/AutoGenerated.X/nbproject/Makefile-default.mk index 52f23e7..8ab9e6c 100644 --- a/AutoGenerated.X/nbproject/Makefile-default.mk +++ b/AutoGenerated.X/nbproject/Makefile-default.mk @@ -44,6 +44,12 @@ else COMPARISON_BUILD= endif +ifdef SUB_IMAGE_ADDRESS + +else +SUB_IMAGE_ADDRESS_COMMAND= +endif + # Object Directory OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} @@ -64,7 +70,7 @@ OBJECTFILES=${OBJECTDIR}/_ext/1865065685/plib_afec0.o ${OBJECTDIR}/_ext/60165520 SOURCEFILES=../src/config/default/peripheral/afec/plib_afec0.c ../src/config/default/peripheral/clk/plib_clk.c ../src/config/default/peripheral/efc/plib_efc.c ../src/config/default/peripheral/mcan/plib_mcan1.c ../src/config/default/peripheral/mcan/plib_mcan0.c ../src/config/default/peripheral/mpu/plib_mpu.c ../src/config/default/peripheral/nvic/plib_nvic.c ../src/config/default/peripheral/pio/plib_pio.c ../src/config/default/peripheral/pwm/plib_pwm0.c ../src/config/default/peripheral/rtc/plib_rtc.c ../src/config/default/peripheral/smc/plib_smc.c ../src/config/default/peripheral/systick/plib_systick.c ../src/config/default/peripheral/twihs/master/plib_twihs1_master.c ../src/config/default/peripheral/uart/plib_uart0.c ../src/config/default/peripheral/wdt/plib_wdt.c ../src/config/default/peripheral/xdmac/plib_xdmac.c ../src/config/default/stdio/gcc_monitor.c ../src/config/default/stdio/xc32_monitor.c ../src/config/default/system/cache/sys_cache.c ../src/config/default/system/int/src/sys_int.c ../src/config/default/system/time/src/sys_time.c ../src/config/default/initialization.c ../src/config/default/interrupts.c ../src/config/default/exceptions.c ../src/config/default/libc_syscalls.c ../src/config/default/tasks.c ../src/config/default/startup_gcc.c ../src/config/default/startup_xc32.c ../src/main.c ../src/app.c # Pack Options -PACK_COMMON_OPTIONS=-I "${DFP_DIR}/samv71b/include" -I "${CMSIS_DIR}/CMSIS/Core/Include" +PACK_COMMON_OPTIONS= @@ -103,362 +109,362 @@ endif # ------------------------------------------------------------------------------------ # Rules for buildStep: compile ifeq ($(TYPE_IMAGE), DEBUG_RUN) -${OBJECTDIR}/_ext/1865065685/plib_afec0.o: ../src/config/default/peripheral/afec/plib_afec0.c .generated_files/flags/default/856ac8f2b1683a285049bdc82c9e79fa5b9048a2 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1865065685/plib_afec0.o: ../src/config/default/peripheral/afec/plib_afec0.c .generated_files/flags/default/cfd6f815e5c35a4ef8b6d1218d939eded7de1e40 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1865065685" @${RM} ${OBJECTDIR}/_ext/1865065685/plib_afec0.o.d @${RM} ${OBJECTDIR}/_ext/1865065685/plib_afec0.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1865065685/plib_afec0.o.d" -o ${OBJECTDIR}/_ext/1865065685/plib_afec0.o ../src/config/default/peripheral/afec/plib_afec0.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60165520/plib_clk.o: ../src/config/default/peripheral/clk/plib_clk.c .generated_files/flags/default/eca14de26d7b8161ba8484fff3ed99e69244806e .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60165520/plib_clk.o: ../src/config/default/peripheral/clk/plib_clk.c .generated_files/flags/default/37df53916f7b28f5f8179e99da4b109560836503 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60165520" @${RM} ${OBJECTDIR}/_ext/60165520/plib_clk.o.d @${RM} ${OBJECTDIR}/_ext/60165520/plib_clk.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60165520/plib_clk.o.d" -o ${OBJECTDIR}/_ext/60165520/plib_clk.o ../src/config/default/peripheral/clk/plib_clk.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60167248/plib_efc.o: ../src/config/default/peripheral/efc/plib_efc.c .generated_files/flags/default/cfbdfa70b1b8cb36e88f106b4a067e375268b93b .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60167248/plib_efc.o: ../src/config/default/peripheral/efc/plib_efc.c .generated_files/flags/default/2c979bdd5310089a630e4f438aca7551974e26a2 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60167248" @${RM} ${OBJECTDIR}/_ext/60167248/plib_efc.o.d @${RM} ${OBJECTDIR}/_ext/60167248/plib_efc.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60167248/plib_efc.o.d" -o ${OBJECTDIR}/_ext/60167248/plib_efc.o ../src/config/default/peripheral/efc/plib_efc.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1865420181/plib_mcan1.o: ../src/config/default/peripheral/mcan/plib_mcan1.c .generated_files/flags/default/fa1a10440f571b7288d81994a052ee232b136583 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1865420181/plib_mcan1.o: ../src/config/default/peripheral/mcan/plib_mcan1.c .generated_files/flags/default/e23d63005fdd29984d352ff8d96ca6afa6781230 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1865420181" @${RM} ${OBJECTDIR}/_ext/1865420181/plib_mcan1.o.d @${RM} ${OBJECTDIR}/_ext/1865420181/plib_mcan1.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1865420181/plib_mcan1.o.d" -o ${OBJECTDIR}/_ext/1865420181/plib_mcan1.o ../src/config/default/peripheral/mcan/plib_mcan1.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1865420181/plib_mcan0.o: ../src/config/default/peripheral/mcan/plib_mcan0.c .generated_files/flags/default/8df678a5fd589fb111fe3b044e591c4dc8bc63d5 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1865420181/plib_mcan0.o: ../src/config/default/peripheral/mcan/plib_mcan0.c .generated_files/flags/default/2909460ef55667e2c5913daa7f61ed23597f4aa1 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1865420181" @${RM} ${OBJECTDIR}/_ext/1865420181/plib_mcan0.o.d @${RM} ${OBJECTDIR}/_ext/1865420181/plib_mcan0.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1865420181/plib_mcan0.o.d" -o ${OBJECTDIR}/_ext/1865420181/plib_mcan0.o ../src/config/default/peripheral/mcan/plib_mcan0.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60175264/plib_mpu.o: ../src/config/default/peripheral/mpu/plib_mpu.c .generated_files/flags/default/21ce48e030511a40ce9386627e942d9a2ea30dc8 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60175264/plib_mpu.o: ../src/config/default/peripheral/mpu/plib_mpu.c .generated_files/flags/default/3ec5f93cd859b84ee8de4ea113fc5e3e7e510431 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60175264" @${RM} ${OBJECTDIR}/_ext/60175264/plib_mpu.o.d @${RM} ${OBJECTDIR}/_ext/60175264/plib_mpu.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60175264/plib_mpu.o.d" -o ${OBJECTDIR}/_ext/60175264/plib_mpu.o ../src/config/default/peripheral/mpu/plib_mpu.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1865468468/plib_nvic.o: ../src/config/default/peripheral/nvic/plib_nvic.c .generated_files/flags/default/d9b443bb5052f5b8929c3556fc5f2adc28fe674c .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1865468468/plib_nvic.o: ../src/config/default/peripheral/nvic/plib_nvic.c .generated_files/flags/default/d201da034569b7bf5843c78ea777f0f398f9e9f2 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1865468468" @${RM} ${OBJECTDIR}/_ext/1865468468/plib_nvic.o.d @${RM} ${OBJECTDIR}/_ext/1865468468/plib_nvic.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1865468468/plib_nvic.o.d" -o ${OBJECTDIR}/_ext/1865468468/plib_nvic.o ../src/config/default/peripheral/nvic/plib_nvic.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60177924/plib_pio.o: ../src/config/default/peripheral/pio/plib_pio.c .generated_files/flags/default/cdfbb2945f08f0f47d0efbceb1cda7048c8fb3d5 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60177924/plib_pio.o: ../src/config/default/peripheral/pio/plib_pio.c .generated_files/flags/default/cd3f7cb7168e47f3861e5883c10aad0ea10112fa .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60177924" @${RM} ${OBJECTDIR}/_ext/60177924/plib_pio.o.d @${RM} ${OBJECTDIR}/_ext/60177924/plib_pio.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60177924/plib_pio.o.d" -o ${OBJECTDIR}/_ext/60177924/plib_pio.o ../src/config/default/peripheral/pio/plib_pio.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60178356/plib_pwm0.o: ../src/config/default/peripheral/pwm/plib_pwm0.c .generated_files/flags/default/6c04650904e8bc9a99f53783f9818a54baaa63b9 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60178356/plib_pwm0.o: ../src/config/default/peripheral/pwm/plib_pwm0.c .generated_files/flags/default/16328a37dd8c944198d85078d53ab2e749c26046 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60178356" @${RM} ${OBJECTDIR}/_ext/60178356/plib_pwm0.o.d @${RM} ${OBJECTDIR}/_ext/60178356/plib_pwm0.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60178356/plib_pwm0.o.d" -o ${OBJECTDIR}/_ext/60178356/plib_pwm0.o ../src/config/default/peripheral/pwm/plib_pwm0.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60180175/plib_rtc.o: ../src/config/default/peripheral/rtc/plib_rtc.c .generated_files/flags/default/440d36384478caa760571447e66eca1f49313028 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60180175/plib_rtc.o: ../src/config/default/peripheral/rtc/plib_rtc.c .generated_files/flags/default/dd0cfba75bae814ca9437d5d75fdc67e548ec596 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60180175" @${RM} ${OBJECTDIR}/_ext/60180175/plib_rtc.o.d @${RM} ${OBJECTDIR}/_ext/60180175/plib_rtc.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60180175/plib_rtc.o.d" -o ${OBJECTDIR}/_ext/60180175/plib_rtc.o ../src/config/default/peripheral/rtc/plib_rtc.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60180919/plib_smc.o: ../src/config/default/peripheral/smc/plib_smc.c .generated_files/flags/default/f04241d7dae35eb2bd7d5d13d4732ed1ee795dc2 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60180919/plib_smc.o: ../src/config/default/peripheral/smc/plib_smc.c .generated_files/flags/default/1dc3dbc3995efdff7dd05b41eeb194897f011c0 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60180919" @${RM} ${OBJECTDIR}/_ext/60180919/plib_smc.o.d @${RM} ${OBJECTDIR}/_ext/60180919/plib_smc.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60180919/plib_smc.o.d" -o ${OBJECTDIR}/_ext/60180919/plib_smc.o ../src/config/default/peripheral/smc/plib_smc.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1827571544/plib_systick.o: ../src/config/default/peripheral/systick/plib_systick.c .generated_files/flags/default/d99a382a7fd224b6e46aba16a7b3e961d6f3eda9 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1827571544/plib_systick.o: ../src/config/default/peripheral/systick/plib_systick.c .generated_files/flags/default/ae990134387d221195d3a171c9ece3e6d7c53f2e .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1827571544" @${RM} ${OBJECTDIR}/_ext/1827571544/plib_systick.o.d @${RM} ${OBJECTDIR}/_ext/1827571544/plib_systick.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1827571544/plib_systick.o.d" -o ${OBJECTDIR}/_ext/1827571544/plib_systick.o ../src/config/default/peripheral/systick/plib_systick.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o: ../src/config/default/peripheral/twihs/master/plib_twihs1_master.c .generated_files/flags/default/dfa95ae3931c64eea4021fc9603507b5644c65ec .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o: ../src/config/default/peripheral/twihs/master/plib_twihs1_master.c .generated_files/flags/default/a0269656790a566b81bb4342dbb80bf7f6942ff5 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/621496242" @${RM} ${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o.d @${RM} ${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o.d" -o ${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o ../src/config/default/peripheral/twihs/master/plib_twihs1_master.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1865657120/plib_uart0.o: ../src/config/default/peripheral/uart/plib_uart0.c .generated_files/flags/default/577a7e478ddc2aa139d19a8380f495574f947b0a .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1865657120/plib_uart0.o: ../src/config/default/peripheral/uart/plib_uart0.c .generated_files/flags/default/f5e70ade1b71e663902610dfc73fce5e2b534241 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1865657120" @${RM} ${OBJECTDIR}/_ext/1865657120/plib_uart0.o.d @${RM} ${OBJECTDIR}/_ext/1865657120/plib_uart0.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1865657120/plib_uart0.o.d" -o ${OBJECTDIR}/_ext/1865657120/plib_uart0.o ../src/config/default/peripheral/uart/plib_uart0.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60184501/plib_wdt.o: ../src/config/default/peripheral/wdt/plib_wdt.c .generated_files/flags/default/7c294b5da4051d716259e0d22a8b95c72a4b5bd8 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60184501/plib_wdt.o: ../src/config/default/peripheral/wdt/plib_wdt.c .generated_files/flags/default/a4d629452e58362ac6d4a6d7b95c3297708e5a72 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60184501" @${RM} ${OBJECTDIR}/_ext/60184501/plib_wdt.o.d @${RM} ${OBJECTDIR}/_ext/60184501/plib_wdt.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60184501/plib_wdt.o.d" -o ${OBJECTDIR}/_ext/60184501/plib_wdt.o ../src/config/default/peripheral/wdt/plib_wdt.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/2003650513/plib_xdmac.o: ../src/config/default/peripheral/xdmac/plib_xdmac.c .generated_files/flags/default/21574e18144b9b1cd3e02e1a7113e5c258c3be49 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/2003650513/plib_xdmac.o: ../src/config/default/peripheral/xdmac/plib_xdmac.c .generated_files/flags/default/df138deeb0595a895d04b35e41fec7aa40536ce2 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/2003650513" @${RM} ${OBJECTDIR}/_ext/2003650513/plib_xdmac.o.d @${RM} ${OBJECTDIR}/_ext/2003650513/plib_xdmac.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/2003650513/plib_xdmac.o.d" -o ${OBJECTDIR}/_ext/2003650513/plib_xdmac.o ../src/config/default/peripheral/xdmac/plib_xdmac.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/163028504/gcc_monitor.o: ../src/config/default/stdio/gcc_monitor.c .generated_files/flags/default/94a1fb7ffe4ec41b09433a81800986fdca65718b .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/163028504/gcc_monitor.o: ../src/config/default/stdio/gcc_monitor.c .generated_files/flags/default/29b906cb5f29c80f5e15f4681b107aff8827d4ae .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/163028504" @${RM} ${OBJECTDIR}/_ext/163028504/gcc_monitor.o.d @${RM} ${OBJECTDIR}/_ext/163028504/gcc_monitor.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/163028504/gcc_monitor.o.d" -o ${OBJECTDIR}/_ext/163028504/gcc_monitor.o ../src/config/default/stdio/gcc_monitor.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/163028504/xc32_monitor.o: ../src/config/default/stdio/xc32_monitor.c .generated_files/flags/default/6b6c631eecfcc9b94b3b5c9eb9faf1f8310b7a2e .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/163028504/xc32_monitor.o: ../src/config/default/stdio/xc32_monitor.c .generated_files/flags/default/219c7fcdda4f66958dbb5ea422f6ac2eed5e361d .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/163028504" @${RM} ${OBJECTDIR}/_ext/163028504/xc32_monitor.o.d @${RM} ${OBJECTDIR}/_ext/163028504/xc32_monitor.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/163028504/xc32_monitor.o.d" -o ${OBJECTDIR}/_ext/163028504/xc32_monitor.o ../src/config/default/stdio/xc32_monitor.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1014039709/sys_cache.o: ../src/config/default/system/cache/sys_cache.c .generated_files/flags/default/788276c53499918394d0190961532ab102453cc5 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1014039709/sys_cache.o: ../src/config/default/system/cache/sys_cache.c .generated_files/flags/default/6b5286c341909d6e08d5072c84e9a6d6d72316ea .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1014039709" @${RM} ${OBJECTDIR}/_ext/1014039709/sys_cache.o.d @${RM} ${OBJECTDIR}/_ext/1014039709/sys_cache.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1014039709/sys_cache.o.d" -o ${OBJECTDIR}/_ext/1014039709/sys_cache.o ../src/config/default/system/cache/sys_cache.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1881668453/sys_int.o: ../src/config/default/system/int/src/sys_int.c .generated_files/flags/default/9669656104ba4cfaf46599aa45c6bfb06b93ba5d .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1881668453/sys_int.o: ../src/config/default/system/int/src/sys_int.c .generated_files/flags/default/e2257f9e4541ad43b1c783abe82bc19784e55bb3 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1881668453" @${RM} ${OBJECTDIR}/_ext/1881668453/sys_int.o.d @${RM} ${OBJECTDIR}/_ext/1881668453/sys_int.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1881668453/sys_int.o.d" -o ${OBJECTDIR}/_ext/1881668453/sys_int.o ../src/config/default/system/int/src/sys_int.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/101884895/sys_time.o: ../src/config/default/system/time/src/sys_time.c .generated_files/flags/default/7d08b663f12937f390d6d4b00d1f9d2e9dc8d192 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/101884895/sys_time.o: ../src/config/default/system/time/src/sys_time.c .generated_files/flags/default/a3d79734d63c33215348254f7514b44418906ada .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/101884895" @${RM} ${OBJECTDIR}/_ext/101884895/sys_time.o.d @${RM} ${OBJECTDIR}/_ext/101884895/sys_time.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/101884895/sys_time.o.d" -o ${OBJECTDIR}/_ext/101884895/sys_time.o ../src/config/default/system/time/src/sys_time.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/initialization.o: ../src/config/default/initialization.c .generated_files/flags/default/ebec2c7380889c3405e1ae628c6978b21777d783 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/initialization.o: ../src/config/default/initialization.c .generated_files/flags/default/730f9e99e4cf0c5b158b4bde5021ada66fa7de14 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/initialization.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/initialization.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/initialization.o.d" -o ${OBJECTDIR}/_ext/1171490990/initialization.o ../src/config/default/initialization.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/interrupts.o: ../src/config/default/interrupts.c .generated_files/flags/default/b7f2fd2a876664ae3720511be3477717b29189c .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/interrupts.o: ../src/config/default/interrupts.c .generated_files/flags/default/3f940f503ea493f31589fae986f9a776c573b85f .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/interrupts.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/interrupts.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/interrupts.o.d" -o ${OBJECTDIR}/_ext/1171490990/interrupts.o ../src/config/default/interrupts.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/exceptions.o: ../src/config/default/exceptions.c .generated_files/flags/default/b9bdd71c05801ca68e17f78861a6a42d6b82001 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/exceptions.o: ../src/config/default/exceptions.c .generated_files/flags/default/3c00cff5fa2b89a5d4068a572ce4920f191a6bef .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/exceptions.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/exceptions.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/exceptions.o.d" -o ${OBJECTDIR}/_ext/1171490990/exceptions.o ../src/config/default/exceptions.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/libc_syscalls.o: ../src/config/default/libc_syscalls.c .generated_files/flags/default/e8090c38b81e97e855728848be565ded0133811c .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/libc_syscalls.o: ../src/config/default/libc_syscalls.c .generated_files/flags/default/735746682d3e7d2ddd8e8908ee4183d77ce5ad3d .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/libc_syscalls.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/libc_syscalls.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/libc_syscalls.o.d" -o ${OBJECTDIR}/_ext/1171490990/libc_syscalls.o ../src/config/default/libc_syscalls.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/tasks.o: ../src/config/default/tasks.c .generated_files/flags/default/27d12583d52deaedfd9df239add2681e1c2bdb2c .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/tasks.o: ../src/config/default/tasks.c .generated_files/flags/default/13dc22dcfa7ee1191fc26ac323e89ba7e70fe6a1 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/tasks.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/tasks.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/tasks.o.d" -o ${OBJECTDIR}/_ext/1171490990/tasks.o ../src/config/default/tasks.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/startup_gcc.o: ../src/config/default/startup_gcc.c .generated_files/flags/default/29174ce4014587440211fb5753a8f929f085ce50 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/startup_gcc.o: ../src/config/default/startup_gcc.c .generated_files/flags/default/b4ff8e7cada4f4148e20d01496a906083ae6559f .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/startup_gcc.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/startup_gcc.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/startup_gcc.o.d" -o ${OBJECTDIR}/_ext/1171490990/startup_gcc.o ../src/config/default/startup_gcc.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/startup_xc32.o: ../src/config/default/startup_xc32.c .generated_files/flags/default/76f26e96bbd34f33413502a9dfca2c55ca01e98c .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/startup_xc32.o: ../src/config/default/startup_xc32.c .generated_files/flags/default/de8dc0d10d93ef339ec87a16e76c184e75e0232c .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/startup_xc32.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/startup_xc32.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/startup_xc32.o.d" -o ${OBJECTDIR}/_ext/1171490990/startup_xc32.o ../src/config/default/startup_xc32.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1360937237/main.o: ../src/main.c .generated_files/flags/default/475526cf2ae0617b3d0541e3addc4338bdff7073 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1360937237/main.o: ../src/main.c .generated_files/flags/default/5a15880261247ef9b23ee405dacc09d3c013087 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/main.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/main.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1360937237/main.o.d" -o ${OBJECTDIR}/_ext/1360937237/main.o ../src/main.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1360937237/app.o: ../src/app.c .generated_files/flags/default/167f1c07471cdcbb60d10a0d0490ffa21d899ab1 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1360937237/app.o: ../src/app.c .generated_files/flags/default/4660dddfe18015a356511c5f4570ea4925b459be .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/app.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/app.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1360937237/app.o.d" -o ${OBJECTDIR}/_ext/1360937237/app.o ../src/app.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) else -${OBJECTDIR}/_ext/1865065685/plib_afec0.o: ../src/config/default/peripheral/afec/plib_afec0.c .generated_files/flags/default/af6e02fe4e7ca32c07ba16e17698b42d618d9e38 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1865065685/plib_afec0.o: ../src/config/default/peripheral/afec/plib_afec0.c .generated_files/flags/default/1bb0805e9a2370285177a24ef3898609a93b3e6d .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1865065685" @${RM} ${OBJECTDIR}/_ext/1865065685/plib_afec0.o.d @${RM} ${OBJECTDIR}/_ext/1865065685/plib_afec0.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1865065685/plib_afec0.o.d" -o ${OBJECTDIR}/_ext/1865065685/plib_afec0.o ../src/config/default/peripheral/afec/plib_afec0.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60165520/plib_clk.o: ../src/config/default/peripheral/clk/plib_clk.c .generated_files/flags/default/253ac2cbc016813bcc1b5621b88a1b3eb47f975a .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60165520/plib_clk.o: ../src/config/default/peripheral/clk/plib_clk.c .generated_files/flags/default/3d8547732477a8c42f4cd5783f61e66fa75f7659 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60165520" @${RM} ${OBJECTDIR}/_ext/60165520/plib_clk.o.d @${RM} ${OBJECTDIR}/_ext/60165520/plib_clk.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60165520/plib_clk.o.d" -o ${OBJECTDIR}/_ext/60165520/plib_clk.o ../src/config/default/peripheral/clk/plib_clk.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60167248/plib_efc.o: ../src/config/default/peripheral/efc/plib_efc.c .generated_files/flags/default/88848133fac46f9d26fbae6493ed0b59272aeb6a .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60167248/plib_efc.o: ../src/config/default/peripheral/efc/plib_efc.c .generated_files/flags/default/c2e7651707ace2b48ab0c18ff770a61fc4a8608c .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60167248" @${RM} ${OBJECTDIR}/_ext/60167248/plib_efc.o.d @${RM} ${OBJECTDIR}/_ext/60167248/plib_efc.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60167248/plib_efc.o.d" -o ${OBJECTDIR}/_ext/60167248/plib_efc.o ../src/config/default/peripheral/efc/plib_efc.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1865420181/plib_mcan1.o: ../src/config/default/peripheral/mcan/plib_mcan1.c .generated_files/flags/default/cdc83945514c1e7cf6c7e0e0ded5fee5718666c1 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1865420181/plib_mcan1.o: ../src/config/default/peripheral/mcan/plib_mcan1.c .generated_files/flags/default/5b419b40fff0abb7507d1b1b62d285a9b601e0c6 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1865420181" @${RM} ${OBJECTDIR}/_ext/1865420181/plib_mcan1.o.d @${RM} ${OBJECTDIR}/_ext/1865420181/plib_mcan1.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1865420181/plib_mcan1.o.d" -o ${OBJECTDIR}/_ext/1865420181/plib_mcan1.o ../src/config/default/peripheral/mcan/plib_mcan1.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1865420181/plib_mcan0.o: ../src/config/default/peripheral/mcan/plib_mcan0.c .generated_files/flags/default/b1ba5c5a9aeae83a05ba4c14baf69490de02e98e .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1865420181/plib_mcan0.o: ../src/config/default/peripheral/mcan/plib_mcan0.c .generated_files/flags/default/bb5cdbe91dec261e3a4cf64b386a82d6feb6197e .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1865420181" @${RM} ${OBJECTDIR}/_ext/1865420181/plib_mcan0.o.d @${RM} ${OBJECTDIR}/_ext/1865420181/plib_mcan0.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1865420181/plib_mcan0.o.d" -o ${OBJECTDIR}/_ext/1865420181/plib_mcan0.o ../src/config/default/peripheral/mcan/plib_mcan0.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60175264/plib_mpu.o: ../src/config/default/peripheral/mpu/plib_mpu.c .generated_files/flags/default/60c7595541d5d7935bd6e4bc272089d0bde73e3a .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60175264/plib_mpu.o: ../src/config/default/peripheral/mpu/plib_mpu.c .generated_files/flags/default/43ce3f5dbd0e60f95afbfd430a7de219352ac898 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60175264" @${RM} ${OBJECTDIR}/_ext/60175264/plib_mpu.o.d @${RM} ${OBJECTDIR}/_ext/60175264/plib_mpu.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60175264/plib_mpu.o.d" -o ${OBJECTDIR}/_ext/60175264/plib_mpu.o ../src/config/default/peripheral/mpu/plib_mpu.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1865468468/plib_nvic.o: ../src/config/default/peripheral/nvic/plib_nvic.c .generated_files/flags/default/fb50daab4c99a8614f9be266fa873a4a42bc09e4 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1865468468/plib_nvic.o: ../src/config/default/peripheral/nvic/plib_nvic.c .generated_files/flags/default/bcf9aac3ad0cf34980c39d731919891c264a9651 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1865468468" @${RM} ${OBJECTDIR}/_ext/1865468468/plib_nvic.o.d @${RM} ${OBJECTDIR}/_ext/1865468468/plib_nvic.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1865468468/plib_nvic.o.d" -o ${OBJECTDIR}/_ext/1865468468/plib_nvic.o ../src/config/default/peripheral/nvic/plib_nvic.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60177924/plib_pio.o: ../src/config/default/peripheral/pio/plib_pio.c .generated_files/flags/default/a9b473d70d19bab997485a06518ca437159db235 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60177924/plib_pio.o: ../src/config/default/peripheral/pio/plib_pio.c .generated_files/flags/default/1d620e67b44fc706a081601130862a03df115124 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60177924" @${RM} ${OBJECTDIR}/_ext/60177924/plib_pio.o.d @${RM} ${OBJECTDIR}/_ext/60177924/plib_pio.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60177924/plib_pio.o.d" -o ${OBJECTDIR}/_ext/60177924/plib_pio.o ../src/config/default/peripheral/pio/plib_pio.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60178356/plib_pwm0.o: ../src/config/default/peripheral/pwm/plib_pwm0.c .generated_files/flags/default/8fbeb7730c049216c0f0e6ea5a9d9246a18f1444 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60178356/plib_pwm0.o: ../src/config/default/peripheral/pwm/plib_pwm0.c .generated_files/flags/default/5480d1d19c685d1fd029c07a9dd360779826cc0c .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60178356" @${RM} ${OBJECTDIR}/_ext/60178356/plib_pwm0.o.d @${RM} ${OBJECTDIR}/_ext/60178356/plib_pwm0.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60178356/plib_pwm0.o.d" -o ${OBJECTDIR}/_ext/60178356/plib_pwm0.o ../src/config/default/peripheral/pwm/plib_pwm0.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60180175/plib_rtc.o: ../src/config/default/peripheral/rtc/plib_rtc.c .generated_files/flags/default/76e4c0f2842a125ce3fdc4b50d4f23b2743ed7f9 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60180175/plib_rtc.o: ../src/config/default/peripheral/rtc/plib_rtc.c .generated_files/flags/default/11913a656c15b81a7cb6893b60ac81744eb1b975 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60180175" @${RM} ${OBJECTDIR}/_ext/60180175/plib_rtc.o.d @${RM} ${OBJECTDIR}/_ext/60180175/plib_rtc.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60180175/plib_rtc.o.d" -o ${OBJECTDIR}/_ext/60180175/plib_rtc.o ../src/config/default/peripheral/rtc/plib_rtc.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60180919/plib_smc.o: ../src/config/default/peripheral/smc/plib_smc.c .generated_files/flags/default/165e5c9cf0f81ca71766c7b9fe57630d07e6944f .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60180919/plib_smc.o: ../src/config/default/peripheral/smc/plib_smc.c .generated_files/flags/default/b85ceb4ea96319eab828ebe69692b881046d395d .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60180919" @${RM} ${OBJECTDIR}/_ext/60180919/plib_smc.o.d @${RM} ${OBJECTDIR}/_ext/60180919/plib_smc.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60180919/plib_smc.o.d" -o ${OBJECTDIR}/_ext/60180919/plib_smc.o ../src/config/default/peripheral/smc/plib_smc.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1827571544/plib_systick.o: ../src/config/default/peripheral/systick/plib_systick.c .generated_files/flags/default/ed98e8bb197924f92f717c2634c5f31527103e .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1827571544/plib_systick.o: ../src/config/default/peripheral/systick/plib_systick.c .generated_files/flags/default/b40202aef2fc7bfd89214bb6da6ec92071d3ea66 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1827571544" @${RM} ${OBJECTDIR}/_ext/1827571544/plib_systick.o.d @${RM} ${OBJECTDIR}/_ext/1827571544/plib_systick.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1827571544/plib_systick.o.d" -o ${OBJECTDIR}/_ext/1827571544/plib_systick.o ../src/config/default/peripheral/systick/plib_systick.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o: ../src/config/default/peripheral/twihs/master/plib_twihs1_master.c .generated_files/flags/default/8e32975a6ae0f6003933d33fbb269fea212b793a .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o: ../src/config/default/peripheral/twihs/master/plib_twihs1_master.c .generated_files/flags/default/f0429ec672544f922701c3aa3e82231ef33b370c .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/621496242" @${RM} ${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o.d @${RM} ${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o.d" -o ${OBJECTDIR}/_ext/621496242/plib_twihs1_master.o ../src/config/default/peripheral/twihs/master/plib_twihs1_master.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1865657120/plib_uart0.o: ../src/config/default/peripheral/uart/plib_uart0.c .generated_files/flags/default/e37c278e76f0aff80e4daf9cc13d1c5973fc50ea .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1865657120/plib_uart0.o: ../src/config/default/peripheral/uart/plib_uart0.c .generated_files/flags/default/f17fe9ad15064c4d162b437870747692efae4c0a .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1865657120" @${RM} ${OBJECTDIR}/_ext/1865657120/plib_uart0.o.d @${RM} ${OBJECTDIR}/_ext/1865657120/plib_uart0.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1865657120/plib_uart0.o.d" -o ${OBJECTDIR}/_ext/1865657120/plib_uart0.o ../src/config/default/peripheral/uart/plib_uart0.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/60184501/plib_wdt.o: ../src/config/default/peripheral/wdt/plib_wdt.c .generated_files/flags/default/dd0d6d574740f15efe56df1e2b0e7af76866929f .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/60184501/plib_wdt.o: ../src/config/default/peripheral/wdt/plib_wdt.c .generated_files/flags/default/a19e3303202022e464a80865a1cbfa98800d610b .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/60184501" @${RM} ${OBJECTDIR}/_ext/60184501/plib_wdt.o.d @${RM} ${OBJECTDIR}/_ext/60184501/plib_wdt.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/60184501/plib_wdt.o.d" -o ${OBJECTDIR}/_ext/60184501/plib_wdt.o ../src/config/default/peripheral/wdt/plib_wdt.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/2003650513/plib_xdmac.o: ../src/config/default/peripheral/xdmac/plib_xdmac.c .generated_files/flags/default/5c1b44b4e625f2c76ac69a0e861f818864099ae7 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/2003650513/plib_xdmac.o: ../src/config/default/peripheral/xdmac/plib_xdmac.c .generated_files/flags/default/db8272b8257547efd67f4ee290ad2117b7ca22bd .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/2003650513" @${RM} ${OBJECTDIR}/_ext/2003650513/plib_xdmac.o.d @${RM} ${OBJECTDIR}/_ext/2003650513/plib_xdmac.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/2003650513/plib_xdmac.o.d" -o ${OBJECTDIR}/_ext/2003650513/plib_xdmac.o ../src/config/default/peripheral/xdmac/plib_xdmac.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/163028504/gcc_monitor.o: ../src/config/default/stdio/gcc_monitor.c .generated_files/flags/default/3f39130237b579b60588f8292eedccee19503396 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/163028504/gcc_monitor.o: ../src/config/default/stdio/gcc_monitor.c .generated_files/flags/default/165b0918bac2092aa267f3a49543cfdffc4da3a .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/163028504" @${RM} ${OBJECTDIR}/_ext/163028504/gcc_monitor.o.d @${RM} ${OBJECTDIR}/_ext/163028504/gcc_monitor.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/163028504/gcc_monitor.o.d" -o ${OBJECTDIR}/_ext/163028504/gcc_monitor.o ../src/config/default/stdio/gcc_monitor.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/163028504/xc32_monitor.o: ../src/config/default/stdio/xc32_monitor.c .generated_files/flags/default/f1b1092b49203f38623898e3b26cc396f567026 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/163028504/xc32_monitor.o: ../src/config/default/stdio/xc32_monitor.c .generated_files/flags/default/f1f62185b1d77a2516458e852b7ecea815213fb5 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/163028504" @${RM} ${OBJECTDIR}/_ext/163028504/xc32_monitor.o.d @${RM} ${OBJECTDIR}/_ext/163028504/xc32_monitor.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/163028504/xc32_monitor.o.d" -o ${OBJECTDIR}/_ext/163028504/xc32_monitor.o ../src/config/default/stdio/xc32_monitor.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1014039709/sys_cache.o: ../src/config/default/system/cache/sys_cache.c .generated_files/flags/default/11af903e2c005f72618803e08ecf70b594776cb0 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1014039709/sys_cache.o: ../src/config/default/system/cache/sys_cache.c .generated_files/flags/default/efc95f1e5b6fa7342564333802fbec247fc36af .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1014039709" @${RM} ${OBJECTDIR}/_ext/1014039709/sys_cache.o.d @${RM} ${OBJECTDIR}/_ext/1014039709/sys_cache.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1014039709/sys_cache.o.d" -o ${OBJECTDIR}/_ext/1014039709/sys_cache.o ../src/config/default/system/cache/sys_cache.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1881668453/sys_int.o: ../src/config/default/system/int/src/sys_int.c .generated_files/flags/default/56717e9c34487e556b310d041a819ab19862a754 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1881668453/sys_int.o: ../src/config/default/system/int/src/sys_int.c .generated_files/flags/default/40a22bb09f112818554818556819656fac5fda77 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1881668453" @${RM} ${OBJECTDIR}/_ext/1881668453/sys_int.o.d @${RM} ${OBJECTDIR}/_ext/1881668453/sys_int.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1881668453/sys_int.o.d" -o ${OBJECTDIR}/_ext/1881668453/sys_int.o ../src/config/default/system/int/src/sys_int.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/101884895/sys_time.o: ../src/config/default/system/time/src/sys_time.c .generated_files/flags/default/23b5612ca8061dcf87c15fbe97f940a8dc50efa .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/101884895/sys_time.o: ../src/config/default/system/time/src/sys_time.c .generated_files/flags/default/77d6d29b22012fb4ca75c4c3820857bc2e63493f .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/101884895" @${RM} ${OBJECTDIR}/_ext/101884895/sys_time.o.d @${RM} ${OBJECTDIR}/_ext/101884895/sys_time.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/101884895/sys_time.o.d" -o ${OBJECTDIR}/_ext/101884895/sys_time.o ../src/config/default/system/time/src/sys_time.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/initialization.o: ../src/config/default/initialization.c .generated_files/flags/default/69a33438811ad461fbb6f99dae1c67d481bea934 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/initialization.o: ../src/config/default/initialization.c .generated_files/flags/default/46ec4f096fc30d4f136aa76a7aaec8c4bfb456fa .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/initialization.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/initialization.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/initialization.o.d" -o ${OBJECTDIR}/_ext/1171490990/initialization.o ../src/config/default/initialization.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/interrupts.o: ../src/config/default/interrupts.c .generated_files/flags/default/f9705166529cd804c0693778c99736694730deca .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/interrupts.o: ../src/config/default/interrupts.c .generated_files/flags/default/4f1e2379df8196a1600414bc9c5e12b34f881e2b .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/interrupts.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/interrupts.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/interrupts.o.d" -o ${OBJECTDIR}/_ext/1171490990/interrupts.o ../src/config/default/interrupts.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/exceptions.o: ../src/config/default/exceptions.c .generated_files/flags/default/da33c62fff7c2ea6108e5bd367844932461eda91 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/exceptions.o: ../src/config/default/exceptions.c .generated_files/flags/default/cee5a94c9b43bb95e460ef4ec0aa5147f30008cb .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/exceptions.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/exceptions.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/exceptions.o.d" -o ${OBJECTDIR}/_ext/1171490990/exceptions.o ../src/config/default/exceptions.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/libc_syscalls.o: ../src/config/default/libc_syscalls.c .generated_files/flags/default/dcef4d9933915516951148cdd5b19419288a6754 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/libc_syscalls.o: ../src/config/default/libc_syscalls.c .generated_files/flags/default/e4fa41bf748ecff97bc083a9fc7e72c14e575051 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/libc_syscalls.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/libc_syscalls.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/libc_syscalls.o.d" -o ${OBJECTDIR}/_ext/1171490990/libc_syscalls.o ../src/config/default/libc_syscalls.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/tasks.o: ../src/config/default/tasks.c .generated_files/flags/default/2c14e2077a532a7e48d8b9e6ece4bcc1d846a885 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/tasks.o: ../src/config/default/tasks.c .generated_files/flags/default/5b2cb169af4985703c0b60e8bbbe4e4a4821595c .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/tasks.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/tasks.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/tasks.o.d" -o ${OBJECTDIR}/_ext/1171490990/tasks.o ../src/config/default/tasks.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/startup_gcc.o: ../src/config/default/startup_gcc.c .generated_files/flags/default/4b01e0bd5cf781f8c735f57c765ce28514c5f079 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/startup_gcc.o: ../src/config/default/startup_gcc.c .generated_files/flags/default/8a36da1eceb5a6441f31f2081bb689c8b376572a .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/startup_gcc.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/startup_gcc.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/startup_gcc.o.d" -o ${OBJECTDIR}/_ext/1171490990/startup_gcc.o ../src/config/default/startup_gcc.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1171490990/startup_xc32.o: ../src/config/default/startup_xc32.c .generated_files/flags/default/55abd96ece1393b68ecd10b455ee9d098bcbba72 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1171490990/startup_xc32.o: ../src/config/default/startup_xc32.c .generated_files/flags/default/fd4931703a9feaac59a8f1d8c7faf62e98fd3456 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1171490990" @${RM} ${OBJECTDIR}/_ext/1171490990/startup_xc32.o.d @${RM} ${OBJECTDIR}/_ext/1171490990/startup_xc32.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1171490990/startup_xc32.o.d" -o ${OBJECTDIR}/_ext/1171490990/startup_xc32.o ../src/config/default/startup_xc32.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1360937237/main.o: ../src/main.c .generated_files/flags/default/9656e3365c1c01b072d7b477ef01ff4ed68999e2 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1360937237/main.o: ../src/main.c .generated_files/flags/default/8494f00e0a31fa354a6adfabc17f227a7b7bc1e .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/main.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/main.o ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m7 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../src" -I "../src/config/default" -I "../src/packs/ATSAMV71Q21B_DFP" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1360937237/main.o.d" -o ${OBJECTDIR}/_ext/1360937237/main.o ../src/main.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -${OBJECTDIR}/_ext/1360937237/app.o: ../src/app.c .generated_files/flags/default/946eed79f95dee9af452b30ce57d4b7326a7d305 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 +${OBJECTDIR}/_ext/1360937237/app.o: ../src/app.c .generated_files/flags/default/bf7e83f4aa5b44cd64bff53d22b5e83eeecb1db6 .generated_files/flags/default/49b7bfe10dcf6079d79f4fef45d6fc682c6e5b92 @${MKDIR} "${OBJECTDIR}/_ext/1360937237" @${RM} ${OBJECTDIR}/_ext/1360937237/app.o.d @${RM} ${OBJECTDIR}/_ext/1360937237/app.o diff --git a/AutoGenerated.X/nbproject/Makefile-local-default.mk b/AutoGenerated.X/nbproject/Makefile-local-default.mk index 8bd3cfc..51862f4 100644 --- a/AutoGenerated.X/nbproject/Makefile-local-default.mk +++ b/AutoGenerated.X/nbproject/Makefile-local-default.mk @@ -14,11 +14,11 @@ # You can invoke make with the values of the macros: # $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ... # -PATH_TO_IDE_BIN=/opt/microchip/mplabx/v6.05/mplab_platform/platform/../mplab_ide/modules/../../bin/ +PATH_TO_IDE_BIN=/opt/microchip/mplabx/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/ # Adding MPLAB X bin directory to path. -PATH:=/opt/microchip/mplabx/v6.05/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH) +PATH:=/opt/microchip/mplabx/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH) # Path to java used to run MPLAB X when this makefile was created -MP_JAVA_PATH="/opt/microchip/mplabx/v6.05/sys/java/zulu8.64.0.19-ca-fx-jre8.0.345-linux_x64/bin/" +MP_JAVA_PATH="/opt/microchip/mplabx/v6.00/sys/java/zulu8.54.0.21-ca-fx-jre8.0.292-linux_x64/bin/" OS_CURRENT="$(shell uname -s)" MP_CC="/usr/bin/arm-none-eabi-gcc" MP_CPPC="/usr/bin/arm-none-eabi-g++" @@ -26,12 +26,12 @@ MP_CPPC="/usr/bin/arm-none-eabi-g++" MP_AS="/usr/bin/arm-none-eabi-as" MP_LD="/usr/bin/arm-none-eabi-ld" MP_AR="/usr/bin/arm-none-eabi-ar" -DEP_GEN=${MP_JAVA_PATH}java -jar "/opt/microchip/mplabx/v6.05/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar" +DEP_GEN=${MP_JAVA_PATH}java -jar "/opt/microchip/mplabx/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar" MP_CC_DIR="/usr/bin" MP_CPPC_DIR="/usr/bin" # MP_BC_DIR is not defined MP_AS_DIR="/usr/bin" MP_LD_DIR="/usr/bin" MP_AR_DIR="/usr/bin" -DFP_DIR=/opt/microchip/mplabx/v6.05/packs/Microchip/SAMV71_DFP/4.9.117 -CMSIS_DIR=/opt/microchip/mplabx/v6.05/packs/arm/CMSIS/5.4.0 +# MP_BC_DIR is not defined +CMSIS_DIR=/opt/microchip/mplabx/v6.00/packs/arm/CMSIS/5.4.0 diff --git a/AutoGenerated.X/nbproject/configurations.xml b/AutoGenerated.X/nbproject/configurations.xml index 8ffe43e..1d3a67a 100644 --- a/AutoGenerated.X/nbproject/configurations.xml +++ b/AutoGenerated.X/nbproject/configurations.xml @@ -320,23 +320,23 @@ displayName="Important Files" projectFiles="false"> - ../src/config/default/default.mhc/settings.yml ../src/config/default/default.mhc/HarmonyCore.yml - ../src/config/default/default.mhc/afec0.yml - ../src/config/default/default.mhc/cmsis.yml - ../src/config/default/default.mhc/smc.yml + ../src/config/default/default.mhc/project.yml + ../src/config/default/default.mhc/GraphSettings.yml + ../src/config/default/default.mhc/uart0.yml + ../src/config/default/default.mhc/core.yml ../src/config/default/default.mhc/mcan1.yml - ../src/config/default/default.mhc/efc.yml + ../src/config/default/default.mhc/dfp.yml ../src/config/default/default.mhc/sys_time.yml + ../src/config/default/default.mhc/afec0.yml ../src/config/default/default.mhc/rtc.yml + ../src/config/default/default.mhc/settings.yml + ../src/config/default/default.mhc/twihs1.yml + ../src/config/default/default.mhc/efc.yml + ../src/config/default/default.mhc/smc.yml ../src/config/default/default.mhc/pwm0.yml - ../src/config/default/default.mhc/core.yml - ../src/config/default/default.mhc/uart0.yml - ../src/config/default/default.mhc/GraphSettings.yml ../src/config/default/default.mhc/mcan0.yml - ../src/config/default/default.mhc/twihs1.yml - ../src/config/default/default.mhc/dfp.yml - ../src/config/default/default.mhc/project.yml + ../src/config/default/default.mhc/cmsis.yml Makefile ../src/config/default/harmony-manifest-success.yml diff --git a/CMakeLists.txt b/CMakeLists.txt index 19e81c0..acc5767 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,8 @@ include_directories(lib/atsam-component-drivers/SMC/inc) include_directories(lib/atsam-component-drivers/MRAM/inc) include_directories(lib/atsam-component-drivers/LCL/inc) include_directories(lib/atsam-component-drivers/NANDFlash/inc) +include_directories(lib/atsam-component-drivers/NANDFlash/MT29F_Nand_Driver_Micron) +include_directories(lib/atsam-component-drivers/NANDFlash/src) include_directories(lib/cross-platform-software) add_subdirectory(lib/cross-platform-software) diff --git a/README.md b/README.md index 31a2a67..6f4c2e0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# OBC Software Repository +# OBC Software EQM Repository -In this repository is where all of the OBC Software is housed. This is the final version that will be used on the satellite. +In this repository is where all of the OBC EQM Software is housed. This is the final version that will be used on the satellite. The software runs on the Microchip ATSAMV71Q21B Microcontroller Unit, which is a 32-bit ARM Cortex-M7 core. We use FreeRTOS to handle the tasking of the MCU. More information regarding OBC can be found [here](https://gitlab.com/groups/acubesat/obc/-/wikis/home). @@ -8,42 +8,68 @@ More information regarding OBC can be found [here](https://gitlab.com/groups/acu There is the `env-tests` branch that contains the test code, to be used in the Environmental Tests campaign. ## Build +The `eqm` repository can be built without any access to specialised hardware. We provide build +instructions for Linux (or WSL) command-line, and the CLion IDE. + +The dependencies of this repository are managed through the [conan](https://conan.io/) package manager, with repositories +from [ConanCenter](https://conan.io/center/) and [SpaceDot's packages](https://artifactory.spacedot.gr). + +For more detailed installation instructions, including how to integrate with a microcontroller, visit the +[corresponding documentation page](https://acubesat.gitlab.io/obc/ecss-services/docs/md_docs_installation.html). + +### From the Command Line (CLI) + +1. Install a modern C++ compiler, CMake, and Conan. + CMake >= 3.23 and Conan >= 2.0 are recommended. +
+ Getting conan + + You can install [conan](https://conan.io/) following the instructions [from here](https://docs.conan.io/2/installation.html). +
+2. Clone the repository and enter the directory: + ```shell + git clone git@gitlab.com:acubesat/obc/environmental-campaign/obc-eqm-software.git + cd obc-eqm-software + ``` +3. (If you haven't already) create a conan profile for your system: + ```shell + conan profile detect + ``` +4. (If you haven't already) add the SpaceDot repository to conan: + ```shell + conan remote add spacedot https://artifactory.spacedot.gr/artifactory/api/conan/conan + ``` +5. Download all dependencies and build the project through conan: + ```shell + conan install . --output-folder=cmake-build-debug --build="*" -u -pr conan-arm-profile + ``` +6. Download all submodules: + ```shell + conan source . + ``` +7. Add CMake flags: + ```shell + cmake -B cmake-build-debug/build/Debug -DCMAKE_TOOLCHAIN_FILE=cmake-build-debug/build/Debug/generators/conan_toolchain.cmake -DCMAKE_CXX_COMPILER="/usr/bin/arm-none-eabi-g++" -DCMAKE_C_COMPILER="/usr/bin/arm-none-eabi-gcc" -DCMAKE_BUILD_TYPE=Debug . + ``` +8. Build the project: + ```shell + cd cmake-build-debug/build/Debug + make + ``` +### From CLion + +CLion will automatically try to set up a CMake project for you. However, without the conan packages installed, this +will quickly fail. Follow these steps to set up the conan project: + +1. Follow steps 1-6 from the CLI instructions above. +2. Add the following to the CMake Options (File -> Settings -> Build, Execution, Deployment -> CMake -> CMake Options): + ``` + -DCMAKE_TOOLCHAIN_FILE=cmake-build-debug/build/Debug/generators/conan_toolchain.cmake -DCMAKE_CXX_COMPILER="/usr/bin/arm-none-eabi-g++" -DCMAKE_C_COMPILER="/usr/bin/arm-none-eabi-gcc" + ``` +3. If your CMake project doesn't reload automatically, reload it manually (Tools -> CMake -> Reload CMake Project). + +We do not recommend using a Conan plugin for your IDE, as it may tamper with the default configuration for this repository. -After cloning the repo, run the command `conan source .` to clone the needed repositories, which currently are: -- [cross-platform-software](https://gitlab.com/acubesat/obc/cross-platform-software) -- [atsam-component-drivers](https://gitlab.com/acubesat/obc/atsam-component-drivers) - If cloning `COBS` throws a permission/access error, setup an SSH key in GitHub to fix it. - -If you're using CLion, you need to add in CMake options (File -> Settings -> Build, Execution, Deployment -> CMake -> -CMake Options) this `-DCMAKE_TOOLCHAIN_FILE=cmake-build-debug/build/Debug/generators/conan_toolchain.cmake -DCMAKE_CXX_COMPILER="/usr/bin/arm-none-eabi-g++" -DCMAKE_C_COMPILER="/usr/bin/arm-none-eabi-gcc"`. - -If you just cmake from cli, just add the same flags in your command. - -To be able to build, however, you need to install the required `conan` packages. See the `Conan` section for more info. - -### Conan -This repository uses [conan 2.0](https://conan.io/) to manage dependencies. - -#### AcubeSAT Conan Packages -Some of the Conan packages ([logger](https://gitlab.com/acubesat/obc/logger) and [ecss-services](https://gitlab.com/acubesat/obc/ecss-services)) are hosted on a private repository, so you -need to either: -- have access to the [repository](https://artifactory.spacedot.gr) (if you're already on GitLab, it's the same - credentials, and you should login at least once) and add the - remote to your conan remotes. To do that run the following two commands - `conan remote add conan https://artifactory.spacedot.gr/artifactory/api/conan/conan` and - `conan remote login conan $YOUR_USERNAME`, which will prompt you to add your password. -- or, clone the repo on your own, and package it locally use `conan create . --build=missing` in the root of the repo. This way, you don't need to add the remote repository, as conan will add it in local cache. -- or, clone the repo on your own and add it as a submodule in the `lib` folder, and make the necessary CMakeLists. - txt changes to include it in the build. - -To install the necessary packages, you need to follow these steps: -- Make sure you performed one of the `AcubeSAT Conan Packages` sections teps -- Run `conan profile detect --force`: Generates default profile detecting GCC. However, for this project, you need to set up - the correct architecture. Find where `conan` sets up profiles (probably `~/.conan2/profiles`) and run `cp conan-arm-profile ~/.conan2/profiles` (or another directory if conan2 stores the profiles elsewhere) in this project's folder. -- Then run `conan install . --output-folder=cmake-build-debug --build="*" -u -pr conan-arm-profile`. If you're using CLion and don't see `cmake-build-debug`, you have to `Reload CMake project` to have it generated. - After you've run `conan install...` you can `Reload CMake project` and build as per usual. -- Make sure you followed the steps under the `Build` section -- If the *Imported target "common" included non-existent path* appears, just delete the `cmake-build-debug` folder and redo the `conan install...` command
Getting conan @@ -52,7 +78,6 @@ You can install [conan](https://conan.io/) following the instructions from [here](https://docs.conan.io/2/installation.html).:
- ## Implemented Software Prototypes of ECSS Services @@ -69,7 +94,57 @@ Peripherals: - UART with DMA - Parameter updating of ST[20] -## Note +## Using Minicom to monitor the U(S)ART of ATSAM + +#### Downloading Minicom + +`minicom` is found in almost all package managers for Linux and macOS. For Linux you can use: + +For Pop/Ubuntu/Debian derivatives +```shell +sudo apt install minicom +``` + +For Fedora +```shell +sudo dnf install minicom +``` + +For Arch +```shell +sudo pacman -S minicom +``` + +#### Running minicom + +`minicom` is a program that displays the serial input of a port on your computer. To run it, you must specify such a port. + +On Linux systems, the serial ports for connected embedded devices are `/dev/ttyACMX`, where X is a number. The first device you connect will start at 0, and each new device increases the number by 1. Note that removing a device "frees" the port, so if you have two devices connnected and you remove the first, `/dev/ttyACM0` will be disconnected while `/dev/ttyACM1` will be connected to the remaining target device. When using `UART-to-USB` devices such as an `FTDI`, the naming scheme changes and the devices will be at `/dev/ttyUSBX`, however the above scheme remains the same. + +You can use the command `ls /dev/ttyACM*` to view all connected devices on the `/dev/ttyACMX` spectrum. +If a device is connected to port `/dev/ttyACM0`, you can use: +```shell +minicom -D /dev/ttyACM0 +``` +to get its ouput. + +#### Using minicom + +All actions inside the program require pressing the `Meta` key first. If you want to exit the program, you need to press `Meta`, then `x`. On Linux the `Meta` key is `CTRL+A`, while on macOS it is `Escape`. You can use `Meta`, then `z` to view a list of shortcuts. + +#### Line Feeds + +Our embedded devices send only a `\n` delimiter on the end of each log message. Thus, when you open the `minicom` instance, you will see that each line starts at the end of the previous line. After a couple of log messages, the new lines will start at the right edge of the screen and the messages will be invisible. To control this, you can press `Meta`, then `u` to toggle interpreting `\n` as `\r\n`. Each new message will now start at the beginning of the next line. + +#### Saving output to file + +In case you need to save the output of a session to a file, use the option `-C filename.txt` when opening the program. For example: +```shell +minicom -D /dev/ttyACM0 -C output.txt +``` +will save the logs to the file `output.txt` in your current directory. + +## Watchdog The internal watchdog has been disabled for debugging reasons. diff --git a/atmel_samv71_xplained_ultra.cfg b/atmel_samv71_xplained_ultra.cfg index b3cba41..a7dfadc 100644 --- a/atmel_samv71_xplained_ultra.cfg +++ b/atmel_samv71_xplained_ultra.cfg @@ -1,5 +1,4 @@ set CHIPNAME samv71 source [find interface/stlink.cfg] -source [find target/atsamv.cfg] - +source [find target/atsamv.cfg] \ No newline at end of file diff --git a/conanfile.py b/conanfile.py index b2f0532..679b7be 100644 --- a/conanfile.py +++ b/conanfile.py @@ -39,7 +39,10 @@ def source(self): self.run("cd lib/cross-platform-software && git checkout campaign-obc") git = Git(self) git.clone(url="git@gitlab.com:acubesat/obc/atsam-component-drivers.git", target=join(str(self.source_folder), "lib/atsam-component-drivers")) - self.run("cd lib/atsam-component-drivers && git checkout NAND-implementation") + self.run("cd lib/atsam-component-drivers") + self.run("git checkout NAND-partial-implementation") + self.run("git clean -fdx") + self.run("git reset --hard HEAD") def layout(self): cmake_layout(self) diff --git a/inc/FreeRTOSTasks/NANDTask.hpp b/inc/FreeRTOSTasks/NANDTask.hpp index 9c4507b..d31db15 100644 --- a/inc/FreeRTOSTasks/NANDTask.hpp +++ b/inc/FreeRTOSTasks/NANDTask.hpp @@ -1,7 +1,7 @@ #pragma once #include "Task.hpp" -#include "NANDFlash.h" +#include "NANDFlash.hpp" class NANDTask : public Task { diff --git a/lib/atsam-component-drivers b/lib/atsam-component-drivers index 38d35da..d71108e 160000 --- a/lib/atsam-component-drivers +++ b/lib/atsam-component-drivers @@ -1 +1 @@ -Subproject commit 38d35da414e7a52e5cb079b66f082506173fffc2 +Subproject commit d71108e88a78e421a9a9d1b9198a86fed23dca09 diff --git a/src/FreeRTOSTasks/NANDTask.cpp b/src/FreeRTOSTasks/NANDTask.cpp index bfd61d8..296cab8 100644 --- a/src/FreeRTOSTasks/NANDTask.cpp +++ b/src/FreeRTOSTasks/NANDTask.cpp @@ -7,7 +7,7 @@ void NANDTask::execute() { - MT29F mt29f(SMC::NCS3, MEM_NAND_BUSY_1_PIN, MEM_NAND_WR_ENABLE_PIN); + MT29F blabla(SMC::NCS3, MEM_NAND_BUSY_1_PIN, MEM_NAND_WR_ENABLE_PIN); LCL &nandLCL = LCLDefinitions::lclArray[LCLDefinitions::NANDFlash]; @@ -18,7 +18,7 @@ void NANDTask::execute() { /* INITIALIZE & STATUS */ for (failedTries = 0; failedTries < 3;) { uint8_t status = 1; - status = mt29f.resetNAND(); + status = blabla.resetNAND(); if (status != 0) { LOG_DEBUG << "The status of the 1st LUN (die) is: " << status; break; @@ -31,13 +31,13 @@ void NANDTask::execute() { while (true) { /* ID */ for (failedTries = 0; failedTries < 3;) { - if (mt29f.isNANDAlive()) { + if (blabla.isNANDAlive()) { uint8_t id[8]; etl::array etlArray; for (size_t i = 0; i < 8; i++) { etlArray[i] = static_cast(id[i]); } - mt29f.readNANDID(etlArray); + blabla.readNANDID(etlArray); etl::string<32> stringID = ""; for (uint8_t i = 0; i < 8; i++) { etl::to_string(id[i], stringID, true); @@ -47,75 +47,75 @@ void NANDTask::execute() { break; } else { LOG_DEBUG << "Wrong NAND ID"; - mt29f.resetNAND(); + blabla.resetNAND(); failedTries++; } } - /* WRITE */ - etl::array dataWrite = {}; + uint8_t dataWrite[20] = {}; for (uint8_t i = 0; i < 20; i++) { dataWrite[i] = i + 1; } - uint32_t writePosition = rand() % (1105920 * 10); LOG_DEBUG << "Write address is: " << writePosition; + uint8_t LUN = 1; + uint8_t BLOCK = writePosition / 1105920; + uint32_t PAGE = BLOCK/8640; + uint32_t COLUMN = PAGE/8; -// for (failedTries = 0; failedTries < 3;) { -// bool success = mt29f.writeNAND(dataWrite, sizeof(dataWrite)); -// if (!success) { -// LOG_DEBUG << "Failed to write NAND"; -// if (mt29f.errorHandler()) { -// LOG_DEBUG << "NAND is alive"; -// } else { -// LOG_DEBUG << "NAND is not responding"; -// nandLCL.enableLCL(); -// } -// failedTries++; -// } else { -// vTaskDelay(pdMS_TO_TICKS(10)); -// break; -// } -// } - + for (failedTries = 0; failedTries < 3;) { + bool success = blabla.writeNAND(LUN, PAGE, COLUMN,dataWrite); + if (!success) { + LOG_DEBUG << "Failed to write NAND"; + if (blabla.errorHandler()) { + LOG_DEBUG << "NAND is alive"; + } else { + LOG_DEBUG << "NAND is not responding"; + nandLCL.enableLCL(); + } + failedTries++; + } else { + vTaskDelay(pdMS_TO_TICKS(10)); + break; + } + } /* READ */ - uint8_t dataRead[20] = {}; - -// for (failedTries = 0; failedTries < 3;) { -// bool success = mt29f.readNAND(dataRead, 0, writePosition, 20); -// if (success) { -// etl::string<100> stringReadWrite = ""; -// for (uint8_t i = 0; i < 20; i++) { -// etl::to_string(dataRead[i], stringReadWrite, true); -// stringReadWrite.append(" "); -// } -// -// // check if write-read was correct -// if (std::equal(std::begin(dataRead), std::end(dataRead), dataWrite)) { -// LOG_INFO << "NAND read and write test succeeded"; -// } else { -// LOG_INFO << "NAND read and write test failed"; -// LOG_DEBUG << "NAND read: " << stringReadWrite.c_str(); -// } -// -// break; -// } else { -// LOG_ERROR << "Failed to read NAND"; -// if (mt29f.errorHandler()) { -// LOG_INFO << "NAND is alive"; -// } else { -// LOG_INFO << "NAND is not responding"; -// nandLCL.enableLCL(); -// } -// failedTries++; -// } -// } -// /* ERASE */ - uint8_t block = writePosition / 1105920; + etl::array dataRead = {}; + + for (failedTries = 0; failedTries < 3;) { + bool success = blabla.readNAND(LUN, PAGE, COLUMN,dataRead); + if (success) { + etl::string<100> stringReadWrite = ""; + for (uint8_t i = 0; i < 20; i++) { + etl::to_string(dataRead[i], stringReadWrite, true); + stringReadWrite.append(" "); + } + + // check if write-read was correct + if (std::equal(std::begin(dataRead), std::end(dataRead), dataWrite)) { + LOG_INFO << "NAND read and write test succeeded"; + } else { + LOG_INFO << "NAND read and write test failed"; + LOG_DEBUG << "NAND read: " << stringReadWrite.c_str(); + } + + break; + } else { + LOG_ERROR << "Failed to read NAND"; + if (blabla.errorHandler()) { + LOG_INFO << "NAND is alive"; + } else { + LOG_INFO << "NAND is not responding"; + nandLCL.enableLCL(); + } + failedTries++; + } + } + /* ERASE */ for (failedTries = 0; failedTries < 3;) { - uint8_t success = mt29f.eraseBlock(0, block); + uint8_t success = blabla.eraseBlock(0, BLOCK); if (!success) { LOG_ERROR << "Failed to erase NAND block"; failedTries++; @@ -129,30 +129,29 @@ void NANDTask::execute() { for (uint8_t i = 0; i < 20; i++) { dataErase[i] = 255; } - -// /* READ */ -// for (failedTries = 0; failedTries < 3;) { -// bool success = mt29f.readNAND(dataRead, 0, writePosition, 20); -// if (success) { -// etl::string<100> stringReadErase = ""; -// for (uint8_t i = 0; i < 20; i++) { -// etl::to_string(dataRead[i], stringReadErase, true); -// stringReadErase.append(" "); -// } -// if (std::equal(std::begin(dataRead), std::end(dataRead), dataWrite)) { -// LOG_INFO << "NAND erase test failed"; -// } else if (!std::equal(std::begin(dataRead), std::end(dataRead), dataErase)) { -// LOG_INFO << "NAND erase test failed"; -// LOG_DEBUG << "Read NAND after erasing: " << stringReadErase.c_str(); -// } else { -// LOG_INFO << "NAND erase test succeeded"; -// } -// break; -// } else { -// LOG_ERROR << "Failed to read NAND"; -// failedTries++; -// } -// } + /* READ */ + for (failedTries = 0; failedTries < 3;) { + bool success = blabla.readNAND(LUN, PAGE, COLUMN, dataRead); + if (success) { + etl::string<100> stringReadErase = ""; + for (uint8_t i = 0; i < 20; i++) { + etl::to_string(dataRead[i], stringReadErase, true); + stringReadErase.append(" "); + } + if (std::equal(std::begin(dataRead), std::end(dataRead), dataWrite)) { + LOG_INFO << "NAND erase test failed"; + } else if (!std::equal(std::begin(dataRead), std::end(dataRead), dataErase)) { + LOG_INFO << "NAND erase test failed"; + LOG_DEBUG << "Read NAND after erasing: " << stringReadErase.c_str(); + } else { + LOG_INFO << "NAND erase test succeeded"; + } + break; + } else { + LOG_ERROR << "Failed to read NAND"; + failedTries++; + } + } vTaskResume(MRAMTask::mramTaskHandle); vTaskSuspend(NULL); diff --git a/src/config/default/default.mhc/settings.yml b/src/config/default/default.mhc/settings.yml index 9a00c70..5dcca20 100644 --- a/src/config/default/default.mhc/settings.yml +++ b/src/config/default/default.mhc/settings.yml @@ -5,7 +5,7 @@ frameworkPath: ../../Harmony3 processor: ATSAMV71Q21B projectName: AutoGenerated settings: - PackageFilter: bsp;dev_packs;harmony-services;quick_docs;core;csp + PackageFilter: bsp;dev_packs;harmony-services;core;quick_docs;csp FORCE_OPTIMIZATION: 'false' GENERATE_BACKUP: 'true' TRUSTZONE: 'false' diff --git a/src/config/default/default.mhc/smc.yml b/src/config/default/default.mhc/smc.yml index 5ca22df..5b3a446 100644 --- a/src/config/default/default.mhc/smc.yml +++ b/src/config/default/default.mhc/smc.yml @@ -103,7 +103,7 @@ children: - type: Values children: - type: User - attributes: {value: '9'} + attributes: {value: '14'} - type: Integer attributes: {id: SMC_NCS_RD_SETUP_CS0} children: @@ -131,7 +131,7 @@ children: - type: Values children: - type: User - attributes: {value: '9'} + attributes: {value: '14'} - type: Integer attributes: {id: SMC_NCS_WR_SETUP_CS0} children: @@ -159,7 +159,7 @@ children: - type: Values children: - type: User - attributes: {value: '17'} + attributes: {value: '22'} - type: Integer attributes: {id: SMC_NRD_PULSE_CS0} children: @@ -187,7 +187,7 @@ children: - type: Values children: - type: User - attributes: {value: '2'} + attributes: {value: '4'} - type: KeyValueSet attributes: {id: SMC_NWAIT_MODE_CS0} children: @@ -216,13 +216,20 @@ children: children: - type: Dynamic attributes: {id: smc, value: '0'} + - type: Integer + attributes: {id: SMC_NWE_CYCLE_CS0} + children: + - type: Values + children: + - type: User + attributes: {value: '10'} - type: Integer attributes: {id: SMC_NWE_CYCLE_CS3} children: - type: Values children: - type: User - attributes: {value: '17'} + attributes: {value: '22'} - type: Integer attributes: {id: SMC_NWE_PULSE_CS0} children: @@ -250,7 +257,7 @@ children: - type: Values children: - type: User - attributes: {value: '2'} + attributes: {value: '4'} - type: Boolean attributes: {id: SMC_PMEN_CS0} children: diff --git a/src/config/default/definitions.h b/src/config/default/definitions.h index 2ffe774..2d622ea 100644 --- a/src/config/default/definitions.h +++ b/src/config/default/definitions.h @@ -63,8 +63,8 @@ #include "peripheral/smc/plib_smc.h" #include "peripheral/uart/plib_uart0.h" #include "peripheral/mcan/plib_mcan0.h" -#include "peripheral/twihs/master/plib_twihs1_master.h" #include "peripheral/mcan/plib_mcan1.h" +#include "peripheral/twihs/master/plib_twihs1_master.h" #include "system/int/sys_int.h" #include "system/cache/sys_cache.h" #include "osal/osal.h" diff --git a/src/config/default/harmony-manifest-failure.yml b/src/config/default/harmony-manifest-failure.yml index 486246e..bb6eda6 100644 --- a/src/config/default/harmony-manifest-failure.yml +++ b/src/config/default/harmony-manifest-failure.yml @@ -1,19 +1,19 @@ # This file has been autogenerated by MPLAB Harmony Configurator. Please do not edit this file. -# Project "obc-eqm-software" has been created by using mentioned Harmony 3 packages +# Project "CLionProjects" has been created by using mentioned Harmony 3 packages -project: obc-eqm-software -creation_date: 2023-03-22T12:25:10.781+02:00[Europe/Athens] # ISO 8601 format: https://www.w3.org/TR/NOTE-datetime +project: CLionProjects +creation_date: 2023-12-21T20:09:43.527+02:00[Europe/Athens] # ISO 8601 format: https://www.w3.org/TR/NOTE-datetime operating_system: Linux mhc_mode: IDE # [IDE|Standalone|Headless] mhc_version: v3.8.5 -mplabx_version: v6.05 # if MPLAB X plugin only -plugin_version: v3.6.3 # if MPLAB X plugin only +mplabx_version: v6.00 # if MPLAB X plugin only +plugin_version: v3.6.4 # if MPLAB X plugin only compiler: ARM (10.3.1) modules: - - {name: "csp", version: "v3.14.0"} - - {name: "core", version: "v3.11.1"} - - {name: "dev_packs", version: "v3.14.0"} + - {name: "csp", version: "v3.16.0"} + - {name: "core", version: "v3.12.0"} + - {name: "dev_packs", version: "v3.16.0"} diff --git a/src/config/default/initialization.c b/src/config/default/initialization.c index 04fd838..e7c13e5 100644 --- a/src/config/default/initialization.c +++ b/src/config/default/initialization.c @@ -161,10 +161,10 @@ void SYS_Initialize ( void* data ) MCAN0_Initialize(); - TWIHS1_Initialize(); - MCAN1_Initialize(); + TWIHS1_Initialize(); + sysObj.sysTime = SYS_TIME_Initialize(SYS_TIME_INDEX_0, (SYS_MODULE_INIT *)&sysTimeInitData); diff --git a/src/config/default/peripheral/smc/plib_smc.c b/src/config/default/peripheral/smc/plib_smc.c index 9965d8f..a7fedd7 100644 --- a/src/config/default/peripheral/smc/plib_smc.c +++ b/src/config/default/peripheral/smc/plib_smc.c @@ -65,7 +65,7 @@ void SMC_Initialize( void ) SMC_REGS->SMC_CS_NUMBER[0].SMC_SETUP= SMC_SETUP_NWE_SETUP(2U) | SMC_SETUP_NCS_WR_SETUP(1U) | SMC_SETUP_NRD_SETUP(3U) | SMC_SETUP_NCS_RD_SETUP(1U); /* Setup SMC CYCLE register */ - SMC_REGS->SMC_CS_NUMBER[0].SMC_CYCLE= SMC_CYCLE_NWE_CYCLE(3U) | SMC_CYCLE_NRD_CYCLE(8U); + SMC_REGS->SMC_CS_NUMBER[0].SMC_CYCLE= SMC_CYCLE_NWE_CYCLE(10U) | SMC_CYCLE_NRD_CYCLE(8U); /* Setup SMC_PULSE register */ SMC_REGS->SMC_CS_NUMBER[0].SMC_PULSE= SMC_PULSE_NWE_PULSE(6U) | SMC_PULSE_NCS_WR_PULSE(8U) | SMC_PULSE_NRD_PULSE(3U) | SMC_PULSE_NCS_RD_PULSE(6U); @@ -79,13 +79,13 @@ void SMC_Initialize( void ) /* Chip Select CS3 Timings */ /* Setup SMC SETUP register */ - SMC_REGS->SMC_CS_NUMBER[3].SMC_SETUP= SMC_SETUP_NWE_SETUP(2U) | SMC_SETUP_NCS_WR_SETUP(2U) | SMC_SETUP_NRD_SETUP(2U) | SMC_SETUP_NCS_RD_SETUP(2U); + SMC_REGS->SMC_CS_NUMBER[3].SMC_SETUP= SMC_SETUP_NWE_SETUP(4U) | SMC_SETUP_NCS_WR_SETUP(2U) | SMC_SETUP_NRD_SETUP(4U) | SMC_SETUP_NCS_RD_SETUP(2U); /* Setup SMC CYCLE register */ - SMC_REGS->SMC_CS_NUMBER[3].SMC_CYCLE= SMC_CYCLE_NWE_CYCLE(17U) | SMC_CYCLE_NRD_CYCLE(17U); + SMC_REGS->SMC_CS_NUMBER[3].SMC_CYCLE= SMC_CYCLE_NWE_CYCLE(22U) | SMC_CYCLE_NRD_CYCLE(22U); /* Setup SMC_PULSE register */ - SMC_REGS->SMC_CS_NUMBER[3].SMC_PULSE= SMC_PULSE_NWE_PULSE(9U) | SMC_PULSE_NCS_WR_PULSE(9U) | SMC_PULSE_NRD_PULSE(9U) | SMC_PULSE_NCS_RD_PULSE(9U); + SMC_REGS->SMC_CS_NUMBER[3].SMC_PULSE= SMC_PULSE_NWE_PULSE(9U) | SMC_PULSE_NCS_WR_PULSE(14U) | SMC_PULSE_NRD_PULSE(9U) | SMC_PULSE_NCS_RD_PULSE(14U); /* Setup SMC MODE register */ SMC_REGS->SMC_CS_NUMBER[3].SMC_MODE= SMC_MODE_EXNW_MODE_DISABLED | SMC_MODE_PMEN_Msk | SMC_MODE_PS_32_BYTE \ diff --git a/src/main.cpp b/src/main.cpp index 3a77333..678b1aa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,14 +39,14 @@ extern "C" void main_cpp() { housekeepingTask.emplace(); canGatekeeperTask.emplace(); canTestTask.emplace(); - //nandTask.emplace(); + nandTask.emplace(); mramTask.emplace(); tcHandlingTask->createTask(); housekeepingTask->createTask(); canGatekeeperTask->createTask(); canTestTask->createTask(); - //nandTask->createTask(); + nandTask->createTask(); mramTask->createTask(); vTaskStartScheduler(); From d82467e18be8756fd1410ce6660ed299a656bd0a Mon Sep 17 00:00:00 2001 From: sourland Date: Thu, 18 Jan 2024 10:35:05 +0200 Subject: [PATCH 2/4] remove cross platform --- .gitignore | 2 +- .gitmodules | 4 - .idea/vcs.xml | 3 +- CMakeLists.txt | 10 +- conanfile.py | 14 +- inc/FreeRTOSTasks/AmbientTemperatureTask.hpp | 53 + inc/FreeRTOSTasks/CANGatekeeperTask.hpp | 158 +++ inc/FreeRTOSTasks/CANTestTask.hpp | 27 + inc/FreeRTOSTasks/MCUTemperatureTask.hpp | 28 + inc/FreeRTOSTasks/Task.hpp | 54 + inc/FreeRTOSTasks/TimeKeepingTask.hpp | 47 + inc/FreeRTOSTasks/UARTGatekeeperTask.hpp | 51 + inc/FreeRTOSTasks/WatchdogTask.hpp | 32 + inc/Helpers/COBS.hpp | 40 + inc/Helpers/FreeRTOSHandlers.hpp | 8 + inc/Platform/CAN/ApplicationLayer.hpp | 214 ++++ inc/Platform/CAN/Driver.hpp | 218 ++++ inc/Platform/CAN/Frame.hpp | 51 + inc/Platform/CAN/TPMessage.hpp | 52 + inc/Platform/CAN/TPProtocol.hpp | 61 + .../Parameters/AcubeSATParameters.hpp | 1051 +++++++++++++++++ inc/Platform/Parameters/BootCounter.hpp | 48 + inc/Platform/Parameters/Definitions.hpp | 80 ++ inc/Platform/TaskInitialization.hpp | 13 + lib/atsam-component-drivers | 2 +- lib/cross-platform-software | 1 - src/FreeRTOSTasks/AmbientTemperatureTask.cpp | 35 + src/FreeRTOSTasks/CANGatekeeperTask.cpp | 40 + src/FreeRTOSTasks/CANTestTask.cpp | 15 + src/FreeRTOSTasks/MCUTemperatureTask.cpp | 16 + src/FreeRTOSTasks/TimeKeepingTask.cpp | 46 + src/FreeRTOSTasks/UARTGatekeeperTask.cpp | 23 + src/FreeRTOSTasks/WatchdogTask.cpp | 9 + src/Platform/CAN/ApplicationLayer.cpp | 262 ++++ src/Platform/CAN/Driver.cpp | 212 ++++ src/Platform/CAN/TPProtocol.cpp | 156 +++ src/Platform/Logger.cpp | 78 ++ src/Platform/Parameters/BootCounter.cpp | 25 + src/Platform/TaskInitialization.cpp | 15 + src/Platform/TimeGetter.cpp | 10 + 40 files changed, 3241 insertions(+), 23 deletions(-) create mode 100644 inc/FreeRTOSTasks/AmbientTemperatureTask.hpp create mode 100644 inc/FreeRTOSTasks/CANGatekeeperTask.hpp create mode 100644 inc/FreeRTOSTasks/CANTestTask.hpp create mode 100644 inc/FreeRTOSTasks/MCUTemperatureTask.hpp create mode 100644 inc/FreeRTOSTasks/Task.hpp create mode 100644 inc/FreeRTOSTasks/TimeKeepingTask.hpp create mode 100644 inc/FreeRTOSTasks/UARTGatekeeperTask.hpp create mode 100644 inc/FreeRTOSTasks/WatchdogTask.hpp create mode 100644 inc/Helpers/COBS.hpp create mode 100644 inc/Helpers/FreeRTOSHandlers.hpp create mode 100644 inc/Platform/CAN/ApplicationLayer.hpp create mode 100644 inc/Platform/CAN/Driver.hpp create mode 100644 inc/Platform/CAN/Frame.hpp create mode 100644 inc/Platform/CAN/TPMessage.hpp create mode 100644 inc/Platform/CAN/TPProtocol.hpp create mode 100644 inc/Platform/Parameters/AcubeSATParameters.hpp create mode 100644 inc/Platform/Parameters/BootCounter.hpp create mode 100644 inc/Platform/Parameters/Definitions.hpp create mode 100644 inc/Platform/TaskInitialization.hpp delete mode 160000 lib/cross-platform-software create mode 100644 src/FreeRTOSTasks/AmbientTemperatureTask.cpp create mode 100644 src/FreeRTOSTasks/CANGatekeeperTask.cpp create mode 100644 src/FreeRTOSTasks/CANTestTask.cpp create mode 100644 src/FreeRTOSTasks/MCUTemperatureTask.cpp create mode 100644 src/FreeRTOSTasks/TimeKeepingTask.cpp create mode 100644 src/FreeRTOSTasks/UARTGatekeeperTask.cpp create mode 100644 src/FreeRTOSTasks/WatchdogTask.cpp create mode 100644 src/Platform/CAN/ApplicationLayer.cpp create mode 100644 src/Platform/CAN/Driver.cpp create mode 100644 src/Platform/CAN/TPProtocol.cpp create mode 100644 src/Platform/Logger.cpp create mode 100644 src/Platform/Parameters/BootCounter.cpp create mode 100644 src/Platform/TaskInitialization.cpp create mode 100644 src/Platform/TimeGetter.cpp diff --git a/.gitignore b/.gitignore index 5a7a724..309f969 100644 --- a/.gitignore +++ b/.gitignore @@ -99,4 +99,4 @@ CMakeUserPresets.json # These folders are cloned by conan, so there isn't a need to track them. lib/atsam-component-drivers -lib/cross-platform-software +lib/cobs-c diff --git a/.gitmodules b/.gitmodules index 7bbed01..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "lib/cobs-c"] - path = lib/cobs-c - url = git@github.com:cmcqueen/cobs-c.git - diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 21d1130..55a96ca 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -3,7 +3,6 @@ - - + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index acc5767..c6729ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,9 +13,10 @@ find_package(ecss-services CONFIG REQUIRED COMPONENTS common) include_directories(.) include_directories(inc) -include_directories(inc/Platform) include_directories(inc/FreeRTOSTasks) +include_directories(inc/Platform) include_directories(inc/Platform/Parameters) +include_directories(inc/Platform/CAN) include_directories(inc/Helpers) include_directories(src) include_directories(src/config) @@ -67,8 +68,7 @@ include_directories(lib/atsam-component-drivers/LCL/inc) include_directories(lib/atsam-component-drivers/NANDFlash/inc) include_directories(lib/atsam-component-drivers/NANDFlash/MT29F_Nand_Driver_Micron) include_directories(lib/atsam-component-drivers/NANDFlash/src) -include_directories(lib/cross-platform-software) -add_subdirectory(lib/cross-platform-software) +include_directories(lib/cobs-c) file(GLOB_RECURSE DRIVER_SOURCES "lib/atsam-component-drivers/MCP9808/*.cpp" "lib/atsam-component-drivers/LCL/*.cpp" "lib/atsam-component-drivers/NANDFlash/*.cpp") @@ -76,9 +76,9 @@ file(GLOB_RECURSE SOURCES "src/*.c" "src/*.cpp" "lib/SEGGER/RTT/*.c" "AutoGenera file(GLOB_RECURSE FREERTOS_SOURCES "lib/FreeRTOS/*.c") file(GLOB_RECURSE EXTRA_SOURCES "lib/cobs-c/cobs.c" "lib/cobs-c/cobsr.c") -add_executable(${PROJECT_NAME}.elf ${SOURCES} ${LINKER_SCRIPT} ${FREERTOS_SOURCES} ${DRIVER_SOURCES}) +add_executable(${PROJECT_NAME}.elf ${SOURCES} ${LINKER_SCRIPT} ${FREERTOS_SOURCES} ${DRIVER_SOURCES} ${EXTRA_SOURCES}) -target_link_libraries(${PROJECT_NAME}.elf PRIVATE common common_cross etl log_common) +target_link_libraries(${PROJECT_NAME}.elf PRIVATE common etl log_common) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} -Wl,-Map=${PROJECT_BINARY_DIR}/${PROJECT_NAME}.map") diff --git a/conanfile.py b/conanfile.py index 679b7be..c93e9cf 100644 --- a/conanfile.py +++ b/conanfile.py @@ -8,16 +8,16 @@ class EQMSoftwareRecipe(ConanFile): - name = "obc-adcs-eqm-sw" + name = "obc-eqm-sw" version = "1.0" revision_mode = "scm" # Optional metadata license = "MIT" author = "SpaceDot - AcubeSAT, acubesat.obc@spacedot.gr" - url = "https://gitlab.com/acubesat/obc/environmental-campaign/obc-eqm-software/" - description = "EQM Software for OBC-ADCS campaign test" - topics = ("satellite", "acubesat", "obc", "obc-software") + url = "https://github.com/PeakSat/OBC-EQM-Software" + description = "EQM Software for OBCcampaign test" + topics = ("satellite", "peaksat", "obc", "obc-software") # Binary configuration settings = "os", "compiler", "build_type", "arch" @@ -34,15 +34,11 @@ def config_options(self): def source(self): git = Git(self) - git.clone(url="git@gitlab.com:acubesat/obc/cross-platform-software.git", target=join(str(self.source_folder), "lib/cross-platform-software")) - self.run("cd lib/cross-platform-software && git submodule update --init --recursive") - self.run("cd lib/cross-platform-software && git checkout campaign-obc") + git.clone(url="git@github.com:cmcqueen/cobs-c.git", target=join(str(self.source_folder), "lib/cobs-c")) git = Git(self) git.clone(url="git@gitlab.com:acubesat/obc/atsam-component-drivers.git", target=join(str(self.source_folder), "lib/atsam-component-drivers")) self.run("cd lib/atsam-component-drivers") self.run("git checkout NAND-partial-implementation") - self.run("git clean -fdx") - self.run("git reset --hard HEAD") def layout(self): cmake_layout(self) diff --git a/inc/FreeRTOSTasks/AmbientTemperatureTask.hpp b/inc/FreeRTOSTasks/AmbientTemperatureTask.hpp new file mode 100644 index 0000000..3e57237 --- /dev/null +++ b/inc/FreeRTOSTasks/AmbientTemperatureTask.hpp @@ -0,0 +1,53 @@ +#pragma once + +#include "Task.hpp" +#include "MCP9808.hpp" + +/** + * FreeRTOS task for periodically printing the value of the MCP9808 external temperature sensor. + */ +class AmbientTemperatureTask : public Task { +private: + const uint16_t DelayMs = 1000; + + /** + * Number of sensors on the PCB + */ + static inline constexpr uint8_t NumberOfTemperatureSensors = 2; + + /** + * The I2C addresses of the sensors based on the pin configuration of the physical devices + */ + inline static constexpr etl::array + SensorI2CAddress = {0, 1}; + + /** + * The driver for the MCP9808 temperature sensor + */ + etl::array sensors = {MCP9808(SensorI2CAddress[0]), + MCP9808(SensorI2CAddress[1])}; + + /** + * The value of the temperature, measured in Celsius + */ + etl::array ambientTemperature = {0, 0}; + + const static inline uint16_t TaskStackDepth = 2000; + + StackType_t taskStack[TaskStackDepth]; + +public: + void execute(); + + AmbientTemperatureTask() : Task("ExternalTemperatureSensors") {} + + void createTask() { + taskHandle = xTaskCreateStatic(vClassTask < AmbientTemperatureTask > , this->TaskName, + AmbientTemperatureTask::TaskStackDepth, this, + tskIDLE_PRIORITY + 2, this->taskStack, + &(this->taskBuffer)); + } + +}; + +inline std::optional ambientTemperatureTask; diff --git a/inc/FreeRTOSTasks/CANGatekeeperTask.hpp b/inc/FreeRTOSTasks/CANGatekeeperTask.hpp new file mode 100644 index 0000000..ad1fbe6 --- /dev/null +++ b/inc/FreeRTOSTasks/CANGatekeeperTask.hpp @@ -0,0 +1,158 @@ +#pragma once + +#include "CAN/ApplicationLayer.hpp" +#include "CAN/Frame.hpp" +#include "Task.hpp" +#include "queue.h" +#include "Peripheral_Definitions.hpp" +#ifdef OBC_EQM_LCL +#include "LCLDefinitions.hpp" +#endif + +/** + * Contains functionality of a Gatekeeper Task for the CAN Bus. It has the sole access to CAN, to avoid any + * deadlocks that might be caused by simultaneous requests of access to the same resource. It works by having anyone + * needing to access CAN, send the data in a queue. Then this task receives queue elements and sends them via CAN. + * + * @example @code + * uint32_t id = 0x4; // Specify the sending Node ID. + * etl::vector data = {0,1,2,3,4,5,6,7}; // Specify an array of data, up to 64 bytes. + * CAN::Frame message = {id, data}; // Create a CAN::Frame object. + * canGatekeeperTask->addToQueue(message); // Add the message to the outgoing queue. + * @endcode + */ +class CANGatekeeperTask : public Task { +private: + /** + * A freeRTOS queue to handle outgoing messages, to keep order in case tasks interrupt each other. + */ + QueueHandle_t outgoingQueue; + + /** + * The variable used to hold the queue's data structure. + */ + static inline StaticQueue_t outgoingQueueBuffer; + + /** + * Storage area given to freeRTOS to manage the queue items. + */ + static inline uint8_t outgoingQueueStorageArea[CAN::FrameQueueSize * sizeof(CAN::Frame)]; + + /** + * A freeRTOS queue to handle incoming frames part of a CAN-TP message, since they need to be parsed as a whole. + */ + QueueHandle_t incomingQueue; + + /** + * The variable used to hold the queue's data structure. + */ + static inline StaticQueue_t incomingQueueBuffer; + + /** + * Storage area given to freeRTOS to manage the queue items. + */ + static inline uint8_t incomingQueueStorageArea[CAN::FrameQueueSize * sizeof(CAN::Frame)]; + + const static inline uint16_t TaskStackDepth = 1300; + + StackType_t taskStack[TaskStackDepth]; + +public: + TickType_t lastTransmissionTime = 0; + + void execute(); + + /** + * The constructor calls the initialize() function of the CAN::Driver. It also initializes the FreeRTOS queues for + * incoming/outgoing messages. + */ + CANGatekeeperTask(); + + /** + * Adds an CAN::Frame to the CAN Gatekeeper's queue. + * + * This function was added as an extra abstraction layer to house the `xQueueSendToBack` function. + * It can be used from anywhere in the code to get access to the CAN queue/CAN Gatekeeper task, without having to + * know the low level details of the queue. + * + * If the queue is full, the message is not added to the queue and an error is logged. + * + * @param message the CAN::Frame to be added in the queue of the CAN Gatekeeper task. + * @param isISR indicating if the message is a response to another CAN Message, thus composed through an ISR + */ + inline void send(const CAN::Frame &message, bool isISR = false) { + BaseType_t status; + + if (isISR) { + BaseType_t taskShouldYield = pdFALSE; + + status = xQueueSendToBackFromISR(outgoingQueue, &message, &taskShouldYield); + + if (taskShouldYield) { + taskYIELD(); + } + } else { + status = xQueueSendToBack(outgoingQueue, &message, 0); + } + + if (status == errQUEUE_FULL) { + LOG_ERROR << "Tried sending CAN Message while outgoing queue is full!"; + } + } + + /** + * Adds a CAN::Frame to the incomingQueue. + * If the queue is full the message is lost. + * + * @note This function is designed to be used from within the ISR of a CAN Message Receipt. Thus, it uses + * freeRTOS's ISR-Specific functions. + * + * @param message The incoming CAN::Frame. + */ + inline void addToIncoming(const CAN::Frame &message) { + BaseType_t taskShouldYield = pdFALSE; + + xQueueSendToBackFromISR(incomingQueue, &message, &taskShouldYield); + + if (taskShouldYield) { + taskYIELD(); + } + } + + /** + * An abstraction layer over the freeRTOS queue API to get the number of messages in the incoming queue. + * @return The number of messages in the queue. + */ + inline uint8_t getIncomingMessagesCount() { + return uxQueueMessagesWaiting(incomingQueue); + } + + /** + * Receives a CAN::Frame from the CAN Gatekeeper's incoming queue. + * + * This function was added as an extra abstraction layer to house the `xQueueReceive` function. + * It can be used from anywhere in the code to get access to the CAN queue/CAN Gatekeeper task, without having to + * know the low level details of the queue. + * + * If the queue is empty, the returned message is empty. + */ + inline CAN::Frame getFromQueue() { + CAN::Frame message; + xQueueReceive(incomingQueue, &message, 0); + return message; + } + + /** + * Deletes all items present in the incoming queue. + */ + void emptyIncomingQueue() { + xQueueReset(incomingQueue); + } + + void createTask() { + xTaskCreateStatic(vClassTask < CANGatekeeperTask > , this->TaskName, CANGatekeeperTask::TaskStackDepth, this, + tskIDLE_PRIORITY + 2, this->taskStack, &(this->taskBuffer)); + } +}; + +inline std::optional canGatekeeperTask; diff --git a/inc/FreeRTOSTasks/CANTestTask.hpp b/inc/FreeRTOSTasks/CANTestTask.hpp new file mode 100644 index 0000000..39d3f0d --- /dev/null +++ b/inc/FreeRTOSTasks/CANTestTask.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include "CAN/Driver.hpp" +#include "Task.hpp" + +class CANTestTask : public Task { +private: + +public: + const static inline uint16_t TaskStackDepth = 2300; + + StackType_t taskStack[TaskStackDepth]; + + void execute(); + + CANTestTask() : Task("CAN Test") {} + + /** + * Create freeRTOS Task + */ + void createTask() { + xTaskCreateStatic(vClassTask < CANTestTask > , this->TaskName, CANTestTask::TaskStackDepth, this, + configMAX_PRIORITIES - 1, this->taskStack, &(this->taskBuffer)); + } +}; + +inline std::optional canTestTask; diff --git a/inc/FreeRTOSTasks/MCUTemperatureTask.hpp b/inc/FreeRTOSTasks/MCUTemperatureTask.hpp new file mode 100644 index 0000000..5b1dcab --- /dev/null +++ b/inc/FreeRTOSTasks/MCUTemperatureTask.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include "Task.hpp" + +/** + * FreeRTOS task for periodically printing the value of the internal temperature sensor. + */ +class MCUTemperatureTask : public Task { +private: + const uint16_t delayMs = 10000; + + const static inline uint16_t TaskStackDepth = 1000; + + StackType_t taskStack[TaskStackDepth]; + +public: + void execute(); + + MCUTemperatureTask() : Task("MCUTemperatureSensor") {} + + void createTask() { + xTaskCreateStatic(vClassTask, this->TaskName, MCUTemperatureTask::TaskStackDepth, this, + tskIDLE_PRIORITY + 2, this->taskStack, &(this->taskBuffer)); + } + +}; + +inline std::optional mcuTemperatureTask; diff --git a/inc/FreeRTOSTasks/Task.hpp b/inc/FreeRTOSTasks/Task.hpp new file mode 100644 index 0000000..5c5a267 --- /dev/null +++ b/inc/FreeRTOSTasks/Task.hpp @@ -0,0 +1,54 @@ +#pragma once + +#include "FreeRTOS.h" +#include "task.h" +#include "ServicePool.hpp" +#include "BootCounter.hpp" +#include "definitions.h" +#include "Logger.hpp" +#include "AcubeSATParameters.hpp" +#include "CommonParameters.hpp" +#include "Definitions.hpp" + +/** + * Base class, whose method 'execute' is meant to be inherited by each and every individual FreeRTOS task. + */ +class Task { +public: + /** + * taskBuffer parameter of each FreeRTOS task that holds the new task's data structures + */ + StaticTask_t taskBuffer; + + /** + * A native FreeRTOS task that calls the `->execute()` function of a C++ Task. + * + * Useful for converting between native C-style tasks, and tasks defined as C++ classes. + * + * @tparam T A class with an `execute()` function that represent the state of a FreeRTOS task + * @param pvParameters This argument is passed by FreeRTOS and should contain a pointer to the Task object + */ + template + static void vClassTask(void *pvParameters) { + (static_cast(pvParameters))->execute(); + } + +public: + /** + * Name of each task. + */ + const char *TaskName; + + /** + * Handle of each FreeRTOS task. + */ + TaskHandle_t taskHandle; + + /** + * The stack depth of each FreeRTOS task, defined as the number of words the stack can hold. For example, in an + * architecture with 4 byte stack, assigning 100 to the usStackDepth argument, will allocate 4x100=400 bytes. + */ + const uint16_t TaskStackDepth = 1000; + + Task(const char *TaskName) : TaskName(TaskName) {} +}; diff --git a/inc/FreeRTOSTasks/TimeKeepingTask.hpp b/inc/FreeRTOSTasks/TimeKeepingTask.hpp new file mode 100644 index 0000000..95d642c --- /dev/null +++ b/inc/FreeRTOSTasks/TimeKeepingTask.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include "Task.hpp" + +class TimeKeepingTask : public Task { +private: + const uint16_t DelayMs = 1100; + + const static inline uint16_t TaskStackDepth = 2000; + + StackType_t taskStack[TaskStackDepth]; + +public: + void execute(); + + /** + * Sets the year base, used to acquire the current time from a tm structure. + */ + uint16_t yearBase = 1900; + + /** + * This function sets the epoch time. + * @param dateTime is a tm struct witch keeps the time from MCU. + */ + void setEpoch(tm &dateTime); + + /** + * This function sets the AcubeSAT's time parameters using a tm struct. + * @param dateTime is a tm struct witch keeps the time from MCU. + */ + void setTimePlatformParameters(tm &dateTime); + + /** + * This function prints the on-board time. + */ + void printOnBoardTime(); + + TimeKeepingTask() : Task("Timekeeping") {} + + void createTask() { + xTaskCreateStatic(vClassTask, this->TaskName, TimeKeepingTask::TaskStackDepth, this, + tskIDLE_PRIORITY + 1, this->taskStack, &(this->taskBuffer)); + } + +}; + +inline std::optional timeKeepingTask; diff --git a/inc/FreeRTOSTasks/UARTGatekeeperTask.hpp b/inc/FreeRTOSTasks/UARTGatekeeperTask.hpp new file mode 100644 index 0000000..1ce6cf7 --- /dev/null +++ b/inc/FreeRTOSTasks/UARTGatekeeperTask.hpp @@ -0,0 +1,51 @@ +#pragma once + +#include "COBS.hpp" +#include "Task.hpp" +#include "queue.h" +#include "Peripheral_Definitions.hpp" + +/** + * Contains functionality of a Gatekeeper Task for the UART resource. It has the sole access to UART, to avoid any + * deadlocks that might be caused by simultaneous requests of access to the same resource. It works by having anyone + * needing to access UART, send the data in a queue. Then, this task receives queue elements and sends them to UART. + */ +class UARTGatekeeperTask : public Task { +private: + QueueHandle_t xUartQueue; + + StaticQueue_t xStaticQueue; + + uint8_t ucQueueStorageArea[UARTQueueSize * sizeof(etl::string)]; + + const static inline uint16_t TaskStackDepth = 2000; + + StackType_t taskStack[TaskStackDepth]; + +public: + void execute(); + + UARTGatekeeperTask(); + + /** + * Adds an etl::string to the UART Gatekeeper's queue. + * + * This function was added as an extra abstraction layer to house the `xQueueSendToBack` function. + * It can be used from anywhere in the code to get access to the UART queue/UART Gatekeeper task, without having to + * know the low level details of the queue. + * + * If the queue is full, the string is not added to the queue and is lost. + * @param message the etl::string to be added in the queue of the UART Gatekeeper task. + */ + void addToQueue(const etl::string &message) { + xQueueSendToBack(xUartQueue, &message, 0); + } + + void createTask() { + xTaskCreateStatic(vClassTask < UARTGatekeeperTask > , this->TaskName, UARTGatekeeperTask::TaskStackDepth, this, + tskIDLE_PRIORITY + 2, this->taskStack, &(this->taskBuffer)); + } + +}; + +inline std::optional uartGatekeeperTask; diff --git a/inc/FreeRTOSTasks/WatchdogTask.hpp b/inc/FreeRTOSTasks/WatchdogTask.hpp new file mode 100644 index 0000000..41afe75 --- /dev/null +++ b/inc/FreeRTOSTasks/WatchdogTask.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include "Task.hpp" + +class WatchdogTask : public Task { +private: + /** + * The delay in milliseconds between each watchdog reset. It is set to 14000ms, since the + * maximum timeout is 16000ms, so the timer needs to clear before the next reset. + * @see config/default/peripheral/wdt.c for the specific configuration. + * Do not change this value, without also modifying the value in Harmony configurator. + */ + const uint16_t WatchdogWindow = 14000; + + const static inline uint16_t TaskStackDepth = 1000; + + StackType_t taskStack[TaskStackDepth]; + +public: + void execute(); + + WatchdogTask() : Task("Watchdog") {} + + void createTask() { + xTaskCreateStatic(vClassTask, this->TaskName, WatchdogTask::TaskStackDepth, this, + tskIDLE_PRIORITY, this->taskStack, &(this->taskBuffer)); + } + +}; + +inline std::optional watchdogTask; + diff --git a/inc/Helpers/COBS.hpp b/inc/Helpers/COBS.hpp new file mode 100644 index 0000000..1493623 --- /dev/null +++ b/inc/Helpers/COBS.hpp @@ -0,0 +1,40 @@ +#pragma once + +#include +#include "cobs.h" + +template +etl::string COBSencode(const uint8_t* input, uint16_t length) { + char output[MaxLength]; + + auto cobsOutput = cobs_encode(output, MaxLength, input, length); + + return { output, cobsOutput.out_len }; +} + +template +etl::string COBSencode(const etl::string& input) { + char output[MaxLength]; + + auto cobsOutput = cobs_encode(output, MaxLength, input.data(), input.length()); + + return { output, cobsOutput.out_len }; +} + +template +etl::string COBSdecode(const uint8_t* input, uint16_t length) { + char output[MaxLength]; + + auto cobsOutput = cobs_decode(output, MaxLength, input, length); + + return { output, cobsOutput.out_len }; +} + +template +etl::string COBSdecode(const etl::string& input) { + char output[MaxLength]; + + auto cobsOutput = cobs_decode(output, MaxLength, input.data(), input.length()); + + return { output, cobsOutput.out_len }; +} diff --git a/inc/Helpers/FreeRTOSHandlers.hpp b/inc/Helpers/FreeRTOSHandlers.hpp new file mode 100644 index 0000000..107e978 --- /dev/null +++ b/inc/Helpers/FreeRTOSHandlers.hpp @@ -0,0 +1,8 @@ +#pragma once + +#include "FreeRTOS.h" +#include "Logger.hpp" + +extern "C" void vApplicationStackOverflowHook(TaskHandle_t xTask, char *pcTaskName) { + LOG_DEBUG << "Stack overflow on task " << pcTaskName; +} diff --git a/inc/Platform/CAN/ApplicationLayer.hpp b/inc/Platform/CAN/ApplicationLayer.hpp new file mode 100644 index 0000000..0b33552 --- /dev/null +++ b/inc/Platform/CAN/ApplicationLayer.hpp @@ -0,0 +1,214 @@ +#pragma once + +#include "Driver.hpp" +#include "etl/map.h" +#include "etl/array.h" +#include "etl/String.hpp" +#include "Frame.hpp" +#include "Logger_Definitions.hpp" +#include "Message.hpp" +#include "Peripheral_Definitions.hpp" +#include "AcubeSATParameters.hpp" +#include "TPMessage.hpp" +#include "Definitions.hpp" + +namespace CAN::Application { + /** + * Entity that maps subsystem names to strings for use in logging functions. + */ + inline etl::map, LogSource::NumberOfLogSources> nodeIdToString = { + {OBC, "OBC"}, + {COMMS, "COMMS"}, + {ADCS, "ADCS"}, + {SU, "SU"}, + {ExternalMCU, "External"} + }; + + /** + * CAN-TP message IDs, as specified in DDJF_OBDH. + */ + enum MessageIDs : uint16_t { + SendParameters = 0x01, + RequestParameters = 0x02, + PerformFunction = 0x03, + EventReport = 0x10, + TMPacket = 0x20, + TCPacket = 0x21, + CCSDSPacket = 0x022, + Ping = 0x30, + Pong = 0x31, + LogMessage = 0x40, + UTCTime = 0x200, + BusSwitchover = 0x400, + Heartbeat = 0x700 + }; + + /** + * Toggles the active CAN Bus. + * @param bus A default argument that uses the currentBus member variable if a value is not provided. + * @return The ID of the bus to be switched to. + */ + CAN::Driver::ActiveBus switchBus(CAN::Driver::ActiveBus newBus); + + /** + * The available Event Report Types, for an Event Report CAN-TP Message. + */ + enum EventReportType : uint8_t { + Informative = 0x0, LowSeverity = 0x1, MediumSeverity = 0x2, HighSeverity = 0x3 + }; + + /** + * The size in bytes for the function ID required in Perform Function Messages. + */ + static constexpr uint8_t FunctionIdSize = 6; + + /** + * Milliseconds per day. + */ + inline constexpr uint64_t millisecondsPerDay = 24 * 60 * 60 * 1000; + + + /** + * Removes the ID of the sender in an incoming CAN Message. + * @param id The ID to be filtered. + * @return The filtered ID. + */ + inline uint32_t filterMessageID(uint32_t id) { + return id & 0x700; + } + + /** + * Adds a Ping message to the outgoing queue, according to DDJF_OBDH. + */ + void sendPingMessage(NodeIDs destinationAddress, bool isMulticast); + + /** + * Adds a Pong message to the outgoing queue, to be sent in response to a Ping message, according to DDJF_OBDH. + */ + void sendPongMessage(); + + /** + * Adds a Heartbeat message to the outgoing queue, to be called periodically, according to DDJF_OBDH. + */ + void sendHeartbeatMessage(); + + /** + * Creates a CAN Bus switchover message to be sent whenever the FDIR responsible determines the bus quality + * is not satisfactory, according to DDJF_OBDH. + */ + void sendBusSwitchoverMessage(); + + /** + * Creates a CAN Bus switchover message to be sent whenever the FDIR responsible determines the bus quality + * is not satisfactory, according to DDJF_OBDH. + * @param newBus The Bus to switch to. + */ + void sendBusSwitchoverMessage(Driver::ActiveBus newBus); + + /** + * Adds a message to the outgoing queue with the current UTC Time, according to DDJF_OBDH. + */ + void sendUTCTimeMessage(); + + /** + * Sends a Send Parameters CAN-TP Message as described in DDJF_OBDH. + * @param destinationAddress The ID of the destination node. + * @param isMulticast Whether the message is to be sent to a multicast group. + * @param parameterIDs The IDs of the parameters to be sent. + */ + void createSendParametersMessage(NodeIDs destinationAddress, bool isMulticast, + const etl::array ¶meterIDs, + bool isISR); + + /** + * Sends a Request Parameters CAN-TP Message as described in DDJF_OBDH. + * @param destinationAddress The ID of the destination node. + * @param isMulticast Whether the message is to be sent to a multicast group. + * @param parameterIDs The IDs of the parameters to be requested. + */ + void createRequestParametersMessage(NodeIDs destinationAddress, bool isMulticast, + const etl::array ¶meterIDs, + bool isISR); + + /** + * Sends a Request Parameters CAN-TP Message as described in DDJF_OBDH. + * @param destinationAddress The ID of the destination node. + * @param isMulticast Whether the message is to be sent to a multicast group. + * @param functionId The ID of the function to be called. + * @param arguments The map containing the arguments of the function to be called. + * @TODO This map should be changed to accommodate arguments of differing types, not just uint64_t + * */ + void createPerformFunctionMessage(NodeIDs destinationAddress, bool isMulticast, + const etl::string &functionId, + const etl::map &arguments, + bool isISR); + + /** + * Sends a Event Report CAN-TP Message as described in DDJF_OBDH. + * @param destinationAddress The ID of the destination node. + * @param isMulticast Whether the message is to be sent to a multicast group. + * @param type The event report type. + * @param eventID The ID of the event. + * @param payload An array of the event data. + */ + void createEventReportMessage(NodeIDs destinationAddress, bool isMulticast, EventReportType type, uint16_t eventID, + const Message &eventData, bool isISR); + + /** + * Creates an ECSS-E-ST-70-41C Services TM/TC packet to be sent. After creation the packet is split into CAN-TP + * Protocol frames to be transmitted. + * @param destinationAddress The ID of the destination node. + * @param isMulticast Whether the message is to be sent to a multicast group. + * @param message An ECSS Message. + */ + void createPacketMessage(NodeIDs destinationAddress, bool isMulticast, const etl::string<128> &incomingMessage, Message::PacketType packetType, bool isISR); + + /** + * Creates a CCSDS packet to be sent. After creation the packet is split into CAN-TP + * Protocol frames to be transmitted. + * @param destinationAddress The ID of the destination node. + * @param isMulticast Whether the message is to be sent to a multicast group. + * @param message An ECSS Message. + */ + void + createCCSDSPacketMessage(NodeIDs destinationAddress, bool isMulticast, const Message &message, bool isISR); + + /** + * Sends a Log CAN-TP Message as described in DDJF_OBDH. + * @param destinationAddress The ID of the destination node. + * @param isMulticast Whether the message is to be sent to a multicast group. + * @param log A LogEntry to be sent. + */ + void createLogMessage(NodeIDs destinationAddress, bool isMulticast, const String &log, + bool isISR); + + /** + * Parses an incoming non-TP frame for the appropriate response. + * @param message The incoming CAN::Frame. + */ + void parseMessage(const CAN::Frame &message); + + /** + * Parses an incoming Send Parameters Message and updates the according parameters + * @param message An incoming TPMessage + */ + void parseSendParametersMessage(TPMessage &message); + + /** + * Parses an incoming Request Parameters Message and sends the according parameters back, if they exist. + * @param message An incoming TPMessage + */ + void parseRequestParametersMessage(TPMessage &message); + + /** + * Parses an incoming TM Packet and logs it. + * @param message An incoming TMPacket + */ + void parseTMMessage(TPMessage &message); + + /** + * Parses an incoming TC Packet and executes it. + * @param message An incoming TCPacket + */ + void parseTCMessage(TPMessage &message); +} diff --git a/inc/Platform/CAN/Driver.hpp b/inc/Platform/CAN/Driver.hpp new file mode 100644 index 0000000..e92763c --- /dev/null +++ b/inc/Platform/CAN/Driver.hpp @@ -0,0 +1,218 @@ +#ifndef OBC_SOFTWARE_CANDRIVER_H +#define OBC_SOFTWARE_CANDRIVER_H + +#include +#include "ECSS_Definitions.hpp" +#include "Frame.hpp" +#include "peripheral/mcan/plib_mcan1.h" +#include "peripheral/mcan/plib_mcan0.h" + +namespace CAN { + /** + * A basic driver for the CAN Peripherals of the SAMV71 family of processors. This driver includes encoding/decoding + * functions for the Data Length Code as well as the ID when used in normal addressing mode. There are two interrupt + * callback functions, one for registering a transmission plus logging an error if needed, and one for passing the + * incoming CAN::Frames to the higher level services in the application. This driver handles both peripherals, + * while keeping only one active through a parameter for transmission, and disabling interrupts for receipt. + * + * @note CAN Normal Addressing requires the NodeID to be at most 11 bits long. + * + * @note There are two peripherals for the CAN Bus. The main bus is considered as MCAN1, since that is the one + * available on the development board. + * + * @example @code + * uint32_t id = 0x4; // Specify the sending Node ID. + * etl::vector data = {0,1,2,3,4,5,6,7}; // Specify an array of data, up to 64 bytes. + * CAN::Frame message = {id, data}; // Create a CAN::Frame object. + * CAN::Driver::send(message, Application::Main); // Use the included send function to send a message on the Main bus. + * @endcode + */ + class Driver { + private: + /** + * Buffer that stores a message that is ready to be sent + */ + static inline MCAN_TX_BUFFER txFifo; + + /** + * Buffer that stores a received message that is to be processed. + * In this setup, rxFifo0 is used to store TP Messages that usually span across multiple CAN::Frames + */ + static inline MCAN_RX_BUFFER rxFifo0; + + /** + * Buffer that stores a received message that is to be processed. + * In this setup, rxFifo1 is used to store normal messages that are contained in a single CAN::Frame + */ + static inline MCAN_RX_BUFFER rxFifo1; + + public: + /** + * An area of memory the HAL uses to house incoming/outgoing buffers for the peripheral. + */ + static inline uint8_t mcan0MessageRAM[MCAN0_MESSAGE_RAM_CONFIG_SIZE] __attribute__((aligned (32))) __attribute__((section (".ram_nocache"))); + + /** + * An area of memory the HAL uses to house incoming/outgoing buffers for the peripheral. + */ + static inline uint8_t mcan1MessageRAM[MCAN1_MESSAGE_RAM_CONFIG_SIZE] __attribute__((aligned (32))) __attribute__((section (".ram_nocache"))); + + /** + * Possible states for the peripheral, to be used as arguments in the callback functions. + */ + enum AppStates : uint8_t { + Receive, Transmit, + }; + + /** + * The available buses to use. + */ + enum ActiveBus : uint8_t { + Redundant = 0x0, Main = 0x1 + }; + + /** + * Sets the appropriate interrupt handlers, configures the storage area for incoming/outgoing buffers and + * keeps only a single peripheral's interrupts active. + */ + static void initialize(); + + /** + * Logs a successful CAN Bus transmission. + * It is registered as a callback to be automatically called by Microchip's HAL whenever + * there is a message transmission on TX FIFO. + * + * @param context The state of the peripheral when the function is called. + * The above parameter is a uintptr_t type for compatibility with the HAL, and is casted to APPStates. + */ + static void mcan0TxFifoCallback(uintptr_t context); + + /** + * Initiates a message receipt from the peripheral to the processor. + * It is registered as a callback to be automatically called by Microchip's HAL whenever + * there is a message receipt on RX FIFO 0. + * + * In this setup, messages using the TP Protocol will be moved to RX FIFO 0, requiring further parsing + * using the gatekeeper task. + * + * @param numberOfMessages The number of messages to be received from the peripheral + * @param context The state of the peripheral when the function is called. + * The above parameter is a uintptr_t type for compatibility with the HAL, and is casted to APPStates. + */ + static void mcan0RxFifo0Callback(uint8_t numberOfMessages, uintptr_t context); + + /** + * Initiates a message receipt from the peripheral to the processor. + * It is registered as a callback to be automatically called by Microchip's HAL whenever + * there is a message receipt on RX FIFO 1. + * + * In this setup, all received messages are contained in a single frame and will immediately be processed + * in this callback. + * + * @param numberOfMessages The number of messages to be received from the peripheral + * @param context The state of the peripheral when the function is called. + * The above parameter is a uintptr_t type for compatibility with the HAL, and is casted to APPStates. + */ + static void mcan0RxFifo1Callback(uint8_t numberOfMessages, uintptr_t context); + + /** + * Logs a successful CAN Bus transmission. + * It is registered as a callback to be automatically called by Microchip's HAL whenever + * there is a message transmission on TX FIFO. + * + * @param context The state of the peripheral when the function is called. + * The above parameter is a uintptr_t type for compatibility with the HAL, and is casted to APPStates. + */ + static void mcan1TxFifoCallback(uintptr_t context); + + /** + * Initiates a message receipt from the peripheral to the processor. + * It is registered as a callback to be automatically called by Microchip's HAL whenever + * there is a message receipt on RX FIFO 0. + * + * In this setup, messages using the TP Protocol will be moved to RX FIFO 0, requiring further parsing + * using the gatekeeper task. + * + * @param numberOfMessages The number of messages to be received from the peripheral + * @param context The state of the peripheral when the function is called. + * The above parameter is a uintptr_t type for compatibility with the HAL, and is casted to APPStates. + */ + static void mcan1RxFifo0Callback(uint8_t numberOfMessages, uintptr_t context); + + /** + * Initiates a message receipt from the peripheral to the processor. + * It is registered as a callback to be automatically called by Microchip's HAL whenever + * there is a message receipt on RX FIFO 1. + * + * In this setup, all received messages are contained in a single frame and will immediately be processed + * in this callback. + * + * @param numberOfMessages The number of messages to be received from the peripheral + * @param context The state of the peripheral when the function is called. + * The above parameter is a uintptr_t type for compatibility with the HAL, and is casted to APPStates. + */ + static void mcan1RxFifo1Callback(uint8_t numberOfMessages, uintptr_t context); + + /** + * Logs messages that are in the Rx buffer + * @param rxBuf The RX Buffer that the messages are stored + */ + static void logMessage(const MCAN_RX_BUFFER &rxBuf, ActiveBus incomingBus); + + /** + * Decodes the data length code to get the largest expected size of the message. + * + * @param dlc The data length code + * @return The length of the message in bytes + */ + static uint8_t convertDlcToLength(uint8_t dlc); + + /** + * Encodes the length of the message body to the smallest data length code that it fits in. + * + * @param length The length of the message in bytes + * @return The data length code + */ + static uint8_t convertLengthToDLC(uint8_t length); + + /** + * Transforms a frame ID to conform to the CAN Standard. + * The implementation shifts non-extended IDs by 18 bits to ease debugging with example projects. + * @param id The ID as specified in the standard. + * @return The ID that's sent over the network. + * + * @note All IDs should be at most 11 bits long as the non-extended ID scheme is used. The function gets/returns + * a 32-bit ID to accomodate the shift. + */ + static inline uint32_t writeId(uint32_t id) { + return id << 18; + } + + /** + * Transforms the ID from the CAN Standard to match a frame ID. + * @param id The ID that was received from the network. + * @return The ID as specified in the standard. + * + * @note All IDs should be at most 11 bits long as the non-extended ID scheme is used. The function gets/returns + * a 32-bit ID to accomodate the shift. + */ + static inline uint32_t readId(uint32_t id) { + return id >> 18; + } + + /** + * Immediately ends a CAN Message + * @param message The message to be sent. + */ + static void send(const CAN::Frame &message); + + /** + * Converts an MCAN_RX_BUFFER object into a CAN::Frame. + * @param rxBuffer The incoming buffer. + * @return A CAN::Frame. + */ + static CAN::Frame getFrame(const MCAN_RX_BUFFER &rxBuffer); + }; +} + +#endif //OBC_SOFTWARE_CANDRIVER_H diff --git a/inc/Platform/CAN/Frame.hpp b/inc/Platform/CAN/Frame.hpp new file mode 100644 index 0000000..e58aa06 --- /dev/null +++ b/inc/Platform/CAN/Frame.hpp @@ -0,0 +1,51 @@ +#pragma once + +#include "etl/array.h" +#include "Peripheral_Definitions.hpp" + +namespace CAN { + /** + * A CAN::Frame is a single message that is going to be sent over the CAN Bus. It could be part of collection of + * CAN::Frames composing a CAN::TPMessage, a Single Frame TP Message, or a non-TP Message. + * + * It consists of an ID which specifies the message's function, as in DDJF_OBDH + an etl::array that contains the + * message payload. A CAN::Frame is merely a carrier of information and has no functionality. + */ + class Frame { + public: + /** + * The maximum data length that is currently configured in the peripheral. + */ + static constexpr uint8_t MaxDataLength = 64; + + /** + * The right aligned ID of the message to be sent. Since the protocol doesn't make use of extended IDs, + * they should be at most 11 bits long. + * + * @note The ID here must match one of the IDs found in DDJF_OBDH. + */ + uint32_t id = 0; + + /** + * A array containing the message payload. + * + * @note Users should use data.push_back() instead of data[i] while adding items to avoid errors caused by + * copying the array to the gatekeeper queue. + */ + etl::array data = {}; + + Frame() = default; + + Frame(uint32_t id) : id(id) {}; + + Frame(uint32_t id, const etl::array &data) : id(id), data(data) {}; + + /** + * Zeroes out the current frame. Use this if you're using a single static object in a recurring function. + */ + inline void empty() { + id = 0; + data.fill(0); + } + }; +} diff --git a/inc/Platform/CAN/TPMessage.hpp b/inc/Platform/CAN/TPMessage.hpp new file mode 100644 index 0000000..ff3d605 --- /dev/null +++ b/inc/Platform/CAN/TPMessage.hpp @@ -0,0 +1,52 @@ +#pragma once + +#include "Message.hpp" + +namespace CAN { + class TPMessage : public Message { + public: + /** + * The ID information of a CAN-TP Message, as specified in DDJF_OBDH. + */ + struct IdInfo { + NodeIDs sourceAddress; + NodeIDs destinationAddress; + bool isMulticast: 1; + }; + + IdInfo idInfo = {}; + + TPMessage() = default; + + TPMessage(IdInfo _idInfo) : idInfo(_idInfo) {}; + + TPMessage(IdInfo _idInfo, bool _isResponse) : idInfo(_idInfo) {}; + + /** + * Decodes the ID of a CAN-TP Message, and sets the idInfo field of the current message. + * @param canID The received ID. + * @return A struct containing the ID information. + */ + [[maybe_unused]] inline IdInfo decodeId(uint32_t canID) { + idInfo.sourceAddress = static_cast((canID >> 4) & 0b111); + idInfo.destinationAddress = static_cast((canID >> 1) & 0b111); + idInfo.isMulticast = canID & 0b1; + + return idInfo; + } + + /** + * Encodes the ID of a CAN-TP Message, using the already set idInfo member. + * @return The encoded ID. + */ + inline uint32_t encodeId() const { + uint16_t id = 0b0111 << 7; + + id |= idInfo.sourceAddress << 4; + id |= idInfo.destinationAddress << 1; + id |= idInfo.isMulticast; + + return id; + } + }; +} diff --git a/inc/Platform/CAN/TPProtocol.hpp b/inc/Platform/CAN/TPProtocol.hpp new file mode 100644 index 0000000..53cc960 --- /dev/null +++ b/inc/Platform/CAN/TPProtocol.hpp @@ -0,0 +1,61 @@ +#pragma once + +#include "CAN/ApplicationLayer.hpp" +#include "CAN/Frame.hpp" +#include "CAN/TPMessage.hpp" + +namespace CAN::TPProtocol { + /** + * Types of CAN-TP protocol frames. + */ + enum Frame : uint8_t { + Single = 0x00, First = 0x01, Consecutive = 0x02, Final = 0x03 + }; + + /** + * How many bytes of information are contained in a consecutive frame + */ + static constexpr uint8_t BytesInConsecutiveFrame = 6; + + /** + * A pointer indicating the information starting point. + */ + static constexpr uint8_t BytesStartingPoint = 2; + + /** + * The usable data length for a consecutive message. + */ + static constexpr uint8_t UsableDataLength = CAN::Frame::MaxDataLength - 1; + + /** + * Creates a TPMessage object from a single frame, and passes it over to the parse function. + * @param message A received CAN::Frame. + */ + void processSingleFrame(const CAN::Frame &message); + + /** + * Receives a collection of messages from the Gatekeeper Task's incomingQueue, and processes them. + */ + void processMultipleFrames(); + + /** + * Processes the stored messages received and acts on their content accordingly. + * @param message the complete CAN-TP message. + */ + void parseMessage(TPMessage &message); + + /** + * Splits a CAN-TP Message into a collection of CAN frames according to the TP protocol and adds them to the CAN + * Gatekeeper Task queue. + * For more information about the CAN-TP Protocol check + * https://piembsystech.com/can-tp-protocol/ + * @param message A CAN-TP message. + * @param isISR Whether the function is called from an Interrupt Service Routine. The function is simply passed to + * canGatekeeperTask->send(). + * + * @note For the consecutive frame fill loop idx + 1 is used since the first byte of each frame is already filled, + * however idx only reaches a maximum value of 62 which makes the position in the consecutiveFrame array valid. + * The message.data[] part reaches the maximum index of 62 for the first frame, continues from 63 up to 125 etc. + */ + void createCANTPMessage(const TPMessage &message, bool isISR); +} diff --git a/inc/Platform/Parameters/AcubeSATParameters.hpp b/inc/Platform/Parameters/AcubeSATParameters.hpp new file mode 100644 index 0000000..4e1b9d0 --- /dev/null +++ b/inc/Platform/Parameters/AcubeSATParameters.hpp @@ -0,0 +1,1051 @@ +#pragma once + +#include "Helpers/Parameter.hpp" +#include "CAN/Driver.hpp" + +namespace AcubeSATParameters { + /** + * ID enumeration of OBDH subsystem's specific parameters. + */ + enum ParameterID : uint16_t { + OBCUseRTT = 8, + OBCUseUART = 9, + OBCUseCAN = 10, + + /* OBDH Parameters */ + OBCPCBTemperature1 = 5000, + OBCPCBTemperature2 = 5001, + OBCMCUTemperature = 5002, + OBCMCUInputVoltage = 5003, + OBCMCUBootCounter = 5004, + OBCFlashInt = 5005, + OBCSRAMInt = 5006, + OBCAvailableMRAM = 5007, + OBCAvailableNAND = 5008, + OBCSpacecraftTimeRef = 5009, ///< which subsystem holds the correct time + OBCOnBoardTime = 5010, + OBCOperationalMode = 5011, + OBCMemoryPartition = 5012, + OBCReconfigurationTimer = 5013, ///< timer responsible to reset the spacecraft to a known working state unless it has been + ///< reset by a ground station pass. + OBCLastFailedEvent = 5014, + OBCMCUSystick = 5015, + OBCCANBUSLoad1 = 5016, ///< the CAN bus load is based on the used capacity (bandwidth) divided by maximum capacity + OBCCANBUSLoad2 = 5017, + OBCCANBUSActive = 5018, + OBCMCUFDIR = 5019, + OBCMCURestartSafeModeThreshold = 5020, + OBCNANDFLASHLCLThreshold = 5021, + OBCMRAMLCLThreshold = 5022, + OBCNANDFLASHON = 5023, + OBCMRAMON = 5024, + OBCNANDFLASHScrubbingFrequency = 5025, + OBCRAMScrubbingFrequency = 5026, + OBCProgramFlashScrubbingFrequency = 5027, + + /* SU */ + SUPCBTemperature1 = 4000, + SUPCBTemperature2 = 4001, + SUPCBTemperatureControlValves = 4002, + SUPCBTemperatureFlowValves = 4003, + SUPDMSTemperature = 4004, + SUGrowthMediumTemperature = 4005, + SULEDIntensity1 = 4006, + SULEDIntensity2 = 4007, + SULEDIntensity3 = 4008, + SULEDIntensity4 = 4009, + SUPressureLevelSensor1 = 4010, + SUPressureLevelSensor2 = 4011, + SUHumidityLevelSensor1 = 4012, + SUHumidityLevelSensor2 = 4013, + SUNumberOfPhotosTaken = 4014, + SUPumpFlowRate1 = 4015, + SUPumpFlowRate2 = 4016, + SUControlChamberValve1 = 4017, + SUControlChamberValve2 = 4018, + SUControlChamberValve3 = 4019, + SUControlSandwitchValve1 = 4020, + SUControlSandwitchValve2 = 4021, + SUControlSandwitchValve3 = 4022, + SUFlowValveInlet1 = 4023, + SUFlowValveInlet2 = 4024, + SUFlowValveInlet3 = 4025, + SUFlowValveOutlet1 = 4026, + SUFlowValveOutlet2 = 4027, + SUFlowValveOutlet3 = 4028, + SUFlowValveTest1 = 4029, + SUFlowValveTest2 = 4030, + SUPhotoExposureTime = 4031, + SUPhotoInterval = 4032, + SUPhotoCroppedResolution = 4033, + SUPhotoCompressionRate = 4034, + SUExperimentNumber = 4035, + SURADFET = 4036, + SUCameraTemperature = 4037, + SUMCUTemperature = 4038, + SUMCUInputVoltage = 4039, + SUMCUBootCounter = 4040, + SUFlashIntUsedPercentage = 4041, + SUFlashUsedPercentage = 4042, + SUSRAMUsedPercentage = 4043, + SUOnBoardTime = 4044, + SUNANDCurrentlyUsedPartition = 4045, + SULastFailedEvent = 4046, + SUMCUSysTick = 4047, + SUNANDFlashLCLThreshold = 4048, + SUFlowPumpFlashLCLThreshold = 4049, + SUControlPumpFlashLCLThreshold = 4050, + SUCameraLCLThreshold = 4051, + SUNANDFlashLCLOn = 4052, + SUFlowPumpFlashOn = 4053, + SUControlPumpFlashLCLOn = 4054, + SUCameraON = 4055, + SUNANDFlashScrubbingFrequency = 4056, + SURAMScrubbingFrequency = 4057, + SUProgramFlashScrubbingFrequency = 4058, + SUTemperatureFromHumiditySensor1 = 4059, + SUTemperatureFromHumiditySensor2 = 4060, + + + /* ADCS */ + ADCSUseRTT = 11, + ADCSUseUART = 12, + ADCSUseCAN = 13, + + ADCSXBodyFrameRegardingOrbitFrame = 1000, + ADCSYBodyFrameRegardingOrbitFrame = 1001, + ADCSZBodyFrameRegardingOrbitFrame = 1002, + ADCSAngularVelocityOnX = 1003, + ADCSAngularVelocityOnY = 1004, + ADCSAngularVelocityOnZ = 1005, + ADCSBDotXAxis = 1006, + ADCSBDotYAxis = 1007, + ADCSBDotZAxis = 1008, + ADCSQuaternionOrbitFrameToBodyScalar = 1009, + ADCSQuaternionOrbitFrameToBodyVectorElem1 = 1010, + ADCSQuaternionOrbitFrameToBodyVectorElem2 = 1011, + ADCSQuaternionOrbitFrameToBodyVectorElem3 = 1012, + + ADCSMagnetometerRawX = 1013, + ADCSMagnetometerRawY = 1014, + ADCSMagnetometerRawZ = 1015, + ADCSMagnetometerFrequency = 1016, + ADCSMagnetometerCycleCountX = 1017, + ADCSMagnetometerCycleCountY = 1018, + ADCSMagnetometerCycleCountZ = 1019, + ADCSMagnetometerSelfTest = 1020, + + ADCSMagnetometerISISCalibratedXAxis = 1021, + ADCSMagnetometerISISCalibratedYAxis = 1022, + ADCSMagnetometerISISCalibratedZAxis = 1023, + ADCSMagnetometerISISFilteredXAxis = 1024, + ADCSMagnetometerISISFilteredYAxis = 1025, + ADCSMagnetometerISISFilteredZAxis = 1026, + ADCSMagnetometerISISRawXAxis = 1027, + ADCSMagnetometerISISRawYAxis = 1028, + ADCSMagnetometerISISRawZAxis = 1029, + ADCSFineSunSensorRawTopLeft = 1030, + ADCSFineSunSensorRawTopRight = 1031, + ADCSFineSunSensorRawBottomLeft = 1032, + ADCSFineSunSensorRawBottomRight = 1033, + ADCSFineSunSensorFilteredTopLeft = 1034, + ADCSFineSunSensorFilteredTopRight = 1035, + ADCSFineSunSensorFilteredBottomLeft = 1036, + ADCSFineSunSensorFilteredBottomRight = 1037, + ADCSFineSunSensorAngularAlphaAngle = 1038, + ADCSFineSunSensorAngularBetaAngle = 1039, + ADCSFineSunSensorCalculatedX = 1040, + ADCSFineSunSensorCalculatedY = 1041, + ADCSFineSunSensorCalculatedZ = 1042, + + ADCSGyroscopeRateX = 1043, + ADCSGyroscopeRateY = 1044, + ADCSGyroscopeRateZ = 1045, + ADCSGyroXLOCSTRegister = 1046, + ADCSGyroXHICSTRegister = 1047, + ADCSGyroXQUADRegister = 1048, + ADCSGyroXFAULTRegister = 1049, + ADCSGyroYLOCSTRegister = 1050, + ADCSGyroYHICSTRegister = 1051, + ADCSGyroYQUADRegister = 1052, + ADCSGyroYFAULTRegister = 1053, + ADCSGyroZLOCSTRegister = 1054, + ADCSGyroZHICSTRegister = 1055, + ADCSGyroZQUADRegister = 1056, + ADCSGyroZFAULTRegister = 1057, + + ADCSMagnetorquerOnXAxisHBridgePolarity = 1058, + ADCSMagnetorquerOnYAxisHBridgePolarity = 1059, + ADCSMagnetorquerOnZAxisHBridgePolarity = 1060, + ADCSMagnetorquerOnXAxisOnOff = 1061, + ADCSMagnetorquerOnYAxisOnOff = 1062, + ADCSMagnetorquerOnZAxisOnOff = 1063, + ADCSGainBdotXAxis = 1064, + ADCSGainBdotYAxis = 1065, + ADCSGainBdotZAxis = 1066, + ADCSGainProportionalPDXAxis = 1067, + ADCSGainProportionalPDYAxis = 1068, + ADCSGainProportionalPDZAxis = 1069, + ADCSGainDerivativePDXAxis = 1070, + ADCSGainDerivativePDYAxis = 1071, + ADCSGainDerivativePDZAxis = 1072, + ADCSiMQTBoardCoilXTemperatureSensor = 1073, + ADCSiMQTBoardCoilYTemperatureSensor = 1074, + ADCSiMQTBoardCoilZTemperatureSensor = 1075, + ADCSiMQTBoardExtraTemperatureSensor = 1076, + + ADCSGyroscopeXTemperature = 1077, + ADCSGyroscopeYTemperature = 1078, + ADCSGyroscopeZTemperature = 1079, + ADCSBoardTemperature1 = 1080, + ADCSBoardTemperature2 = 1081, + + ADCSMode = 1082, + ADCSTLE = 1083, + ADCSInitialKalmanQuaternionECIFrameToBodyScalar = 1084, + ADCSInitialKalmanQuaternionECIFrameToBodyVectorElem1 = 1085, + ADCSInitialKalmanQuaternionECIFrameToBodyVectorElem2 = 1086, + ADCSInitialKalmanQuaternionECIFrameToBodyVectorElem3 = 1087, + ADCSTLEOrbitalElementsArgumentPerigee = 1088, + ADCSTLEOrbitalElementsRAAN = 1089, + ADCSTLEOrbitalElementsInclination = 1090, + ADCSTLEOrbitalElementsEccentricity = 1091, + ADCSTLEOrbitalElementsMeanAnomaly = 1092, + ADCSSGP4OrbitalElementsArgumentPerigee = 1093, + ADCSSGP4OrbitalElementsRAAN = 1094, + ADCSSGP4OrbitalElementsInclination = 1095, + ADCSSGP4OrbitalElementsMeanAnomaly = 1096, + ADCSTimeGST_JD = 1097, + ADCSDeterminationInitialMatricesQ1 = 1098, + ADCSDeterminationInitialMatricesQ2 = 1099, + ADCSDeterminationInitialMatricesQ3 = 1100, + ADCSDeterminationInitialMatricesQ4 = 1101, + ADCSDeterminationInitialMatricesQ5 = 1102, + ADCSDeterminationInitialMatricesQ6 = 1103, + ADCSDeterminationInitialMatricesQ7 = 1104, + ADCSDeterminationInitialMatricesQ8 = 1105, + ADCSDeterminationInitialMatricesQ9 = 1106, + ADCSDeterminationInitialMatricesQ10 = 1107, + ADCSDeterminationInitialMatricesR1 = 1108, + ADCSDeterminationInitialMatricesR2 = 1109, + ADCSDeterminationInitialMatricesR3 = 1110, + ADCSDeterminationInitialMatricesR4 = 1111, + ADCSDeterminationInitialMatricesR5 = 1112, + ADCSDeterminationInitialMatricesR6 = 1113, + ADCSDeterminationInitialMatricesR7 = 1114, + ADCSDeterminationInitialMatricesR8 = 1115, + ADCSDeterminationInitialMatricesR9 = 1116, + ADCSDeterminationInitialMatricesPInitial1 = 1117, + ADCSDeterminationInitialMatricesPInitial2 = 1118, + ADCSDeterminationInitialMatricesPInitial3 = 1119, + ADCSDeterminationInitialMatricesPInitial4 = 1120, + ADCSDeterminationInitialMatricesPInitial5 = 1121, + ADCSDeterminationInitialMatricesPInitial6 = 1122, + ADCSDeterminationInitialMatricesPInitial7 = 1123, + ADCSDeterminationInitialMatricesPInitial8 = 1124, + ADCSDeterminationInitialMatricesPInitial9 = 1125, + ADCSDeterminationInitialMatricesPInitial10 = 1126, + ADCSReactionWheelOn = 1127, + ADCSReactionWheelAngularVelocity = 1128, + ADCSMagnetorquerAxisAssignment = 1129, + ADCSControlProfileSwitching = 1130, + ADCSTransformationAxisXAssignment = 1131, + ADCSTransformationAxisYAssignment = 1132, + ADCSTransformationAxisZAssignment = 1133, + ADCSMagnetometerAxisAssignment = 1134, + ADCSSunSensorAxisAssignment = 1135, + ADCSGyroscopeAxisAssignment = 1136, + ADCSFrameAxisSignECIToECEF_X = 1137, + ADCSFrameAxisSignECIToECEF_Y = 1138, + ADCSFrameAxisSignECIToECEF_Z = 1139, + ADCSFrameAxisSignECIToOrbit_X = 1140, + ADCSFrameAxisSignECIToOrbit_Y = 1141, + ADCSFrameAxisSignECIToOrbit_Z = 1142, + ADCSFrameAxisSignNEDToECEF_X = 1143, + ADCSFrameAxisSignNEDToECEF_Y = 1144, + ADCSFrameAxisSignNEDToECEF_Z = 1145, + + ADCSMagnetometerSignX = 1146, + ADCSMagnetometerSignY = 1147, + ADCSMagnetometerSignZ = 1148, + + ADCSSunSensorXAxisSign = 1149, + ADCSSunSensorYAxisSign = 1150, + ADCSSunSensorZAxisSign = 1151, + + ADCSGyroSignX = 1152, + ADCSGyroSignY = 1153, + ADCSGyroSignZ = 1154, + + ADCSDetumblingNominalThresholds = 1155, + ADCSNominalDetumblingThresholds = 1156, + ADCSStandByDetumblingThresholds = 1157, + ADCSDetumblingStandByThresholds = 1158, + ADCSNominalStandByThresholds = 1159, + ADCSMagnetorquerMagneticDipoleX = 1160, + ADCSMagnetorquerMagneticDipoleY = 1161, + ADCSMagnetorquerMagneticDipoleZ = 1162, + ADCSMagnetorquerDutyCycle = 1163, + ADCSMagnetorquerCurrentX = 1164, + ADCSMagnetorquerCurrentY = 1165, + ADCSMagnetorquerCurrentZ = 1166, + ADCSMagnetorquerBDot = 1167, + ADCSReactionWheelTorque = 1168, + ADCSReactionWheelAngularAcceleration = 1169, + ADCSDesiredQuaternionOrbitToBodyScalar = 1170, + ADCSDesiredQuaternionVectorElem1 = 1171, + ADCSDesiredQuaternionVectorElem2 = 1172, + ADCSDesiredQuaternionVectorElem3 = 1173, + ADCSAngularVelocityDesiredX = 1174, + ADCSAngularVelocityDesiredY = 1175, + ADCSAngularVelocityDesiredZ = 1176, + + ADCSGyroBiasX = 1177, + ADCSGyroBiasY = 1178, + ADCSGyroBiasZ = 1179, + + ADCSSatellitePositionLatitude = 1180, + ADCSSatellitePositionLongitude = 1181, + ADCSSatellitePositionHeight = 1182, + ADCSSatellitePositionECIX = 1183, + ADCSSatellitePositionECIY = 1184, + ADCSSatellitePositionECIZ = 1185, + ADCSSatelliteLinearVelocityECIX = 1186, + ADCSSatelliteLinearVelocityECIY = 1187, + ADCSSatelliteLinearVelocityECIZ = 1188, + ADCSMagneticFieldNEDX = 1189, + ADCSMagneticFieldNEDY = 1190, + ADCSMagneticFieldNEDZ = 1191, + ADCSMagneticFieldECIX = 1192, + ADCSMagneticFieldECIY = 1193, + ADCSMagneticFieldECIZ = 1194, + ADCSSunPositionECIX = 1195, + ADCSSunPositionECIY = 1196, + ADCSSunPositionECIZ = 1197, + ADCSEclipse = 1198, + ADCSDesaturationPecentageParameter = 1199, + ADCSISISMTQModes = 1200, + ADCSMagnetorquerActuationMethod = 1201, + ADCSDutyCycleDetermination = 1202, + ADCSDutyCycleControl = 1203, + ADCSDutyCycleOther = 1204, + ADCSDesatInitialAngularVelocityParam = 1205, + + ADCSMCUTemperature = 1206, + + ADCSMCUInputVoltage = 1207, + + ADCSBootCounter = 1208, + ADCSOnBoardTime = 1209, + + ADCSMemoryPartition = 1210, + ADCSLastFailedEvent = 1211, + + ADCSSystick = 1212, + + ADCSRAMScrubbingFrequency = 1213, + ADCSProgramFlashScrubbingFrequency = 1214, + ADCSFLASHInt = 1215, + ADCSSRAMInt = 1216, + + /* EPS Parameters */ + EPSSwitch3V1 = 3000, + EPSSwitch3V2 = 3001, + EPSSwitch3V3 = 3002, + EPSSwitch3V4 = 3003, + EPSSwitch5V1 = 3004, + EPSSwitch5V2 = 3005, + EPSSwitch5V3 = 3006, + EPSSwitch5V4 = 3007, + EPSSwitch1 = 3008, + EPSSwitch2 = 3009, + EPSSwitch3 = 3010, + EPSSwitch4 = 3011, + EPSSwitch5 = 3012, + EPSCurrentForRail3V1 = 3013, + EPSCurrentForRail3V2 = 3014, + EPSCurrentForRail3V3 = 3015, + EPSCurrentForRail3V4 = 3016, + EPSCurrentForRail5V1 = 3017, + EPSCurrentForRail5V2 = 3018, + EPSCurrentForRail5V3 = 3019, + EPSCurrentForRail5V4 = 3020, + EPSCurrentForRail1 = 3021, + EPSCurrentForRail2 = 3022, + EPSCurrentForRail3 = 3023, + EPSCurrentForRail4 = 3024, + EPSCurrentForRail5 = 3025, + EPSVoltageForEachRail3V1 = 3026, + EPSVoltageForEachRail3V2 = 3027, + EPSVoltageForEachRail3V3 = 3028, + EPSVoltageForEachRail3V4 = 3029, + EPSVoltageForEachRail5V1 = 3030, + EPSVoltageForEachRail5V2 = 3031, + EPSVoltageForEachRail5V3 = 3032, + EPSVoltageForEachRail5V4 = 3033, + EPSVoltageForEachRail12V1 = 3034, + EPSVoltageForEachRail12V2 = 3035, + EPSVoltageForEachRail12V3 = 3036, + EPSVoltageForEachRail12V4 = 3037, + EPSPanelVoltageXPlus = 3038, + EPSPanelVoltageXMinus = 3039, + EPSPanelVoltageYPlus = 3040, + EPSPanelVoltageYMinus = 3041, + EPSPanelVoltageZ = 3042, + EPSPanelCurrentXPlus = 3043, + EPSPanelCurrentXMinus = 3044, + EPSPanelCurrentYPlus = 3045, + EPSPanelCurrentYMinus = 3046, + EPSPanelCurrentZ = 3047, + EPSBatteryPackVoltage = 3048, + EPSPanelTemperatureXPlus = 3049, + EPSPanelTemperatureXMinus = 3050, + EPSPanelTemperatureYPlus = 3051, + EPSPanelTemperatureYMinus = 3052, + EPSPanelTemperatureZ = 3053, + EPSPCBTemperatureSensor1 = 3054, + EPSPCBTemperatureSensor2 = 3055, + EPSBatteryTemperatureSensor1 = 3056, + EPSBatteryTemperatureSensor2 = 3057, + + /* COMMS Parameters */ + COMMSUHFBandPATemperature = 2000, + COMMSSBandPATemperature = 2001, + COMMSPCBTemperature = 2002, + COMMSAntennaDeploymentStatus = 2003, + COMMSDataRateUHFTX = 2004, + COMMSDataRateUHFRX = 2005, + COMMSSymbolRateSBand = 2006, + COMMSCWInterval = 2007, + COMMSGMSKBeaconInterval = 2008, + COMMSUHFBandTXPower = 2009, + COMMSSBandTXPower = 2010, + COMMSChannelNumberUHFBand = 2011, + COMMSChannelNumberSBand = 2012, + COMMSLNAGain = 2013, + COMMSPAGainUHFBand = 2014, + COMMSPAGainSBand = 2015, + COMMSVGAGain = 2016, + COMMSRSSI = 2017, + COMMSUHFBandTXOnOff = 2018, + COMMSUHFBandRXOnOff = 2019, + COMMSSBandTXOnOff = 2020, + COMMSPacketsRejectedCOMMS = 2021, + COMMSInvalidHMAC = 2022, + COMMSInvalidPacketStructure = 2023, + COMMSInvalidSpacecraftID = 2024, + COMMSFrameSequenceCounter = 2025, + COMMSPCBTemperature1 = 2026, + COMMSPCBTemperature2 = 2027, + COMMSMCUTemperature = 2028, + COMMSMCUInputVoltage = 2029, + COMMSMCUBootCounter = 2030, + COMMSOnBoardTime = 2031, + COMMSNANDCurrentlyUsedMemoryPartition = 2032, + COMMSLastFailedEvent = 2033, + COMMSMCUSystick = 2034, + COMMSFlashInt = 2035, + COMMSSRAMInt = 2036 + }; + + /******************* OBDH ENUMS *******************/ + enum SpacecraftTimeRef : uint8_t { + Spacecraft = 0, + GroundStation = 1 + }; + + enum OperationalMode : uint8_t { + CommissioningMode = 0, + NominalMode = 1, + ScienceMode = 2, + SafeMode = 3 + }; + + enum MemoryPartition : uint8_t { + First = 0, + Second = 1 + }; + + enum CANBUSActive : uint8_t { + Main = 0, + Reductant = 1 + }; + + enum MCUFDIR : uint8_t { + OBC = 0, + ADCS = 1 + }; + + /******************* ADCS ENUMS *******************/ + enum ADCSModeOfOperation : uint8_t { + StandByModeADCS = 0, + DetumbingModeADCS = 1, + NominalModeADCS = 2 + }; + + enum AxisAssignment : uint8_t { + Xaxis = 0, + Yaxis = 1, + Zaxis = 2 + }; + + enum MangetorquerDutyCycle : uint8_t { + VeryHigh = 0, + High = 1, + Medium = 2, + Low = 3 + }; + + enum MagnetorquerModes : uint8_t { + Idle = 0, + SelfTest = 1, + Detumbling =2 + }; + + enum MagnetorquerActuationMethod : uint8_t { + Current = 0, + Dipole = 1, + PWM =2 + }; + + /******************* SU ENUMS *******************/ + enum CroppingResolution : uint64_t { + Default = 0 + }; + + enum CompressionRate : uint32_t { + None = 0 + }; + + enum ExprerimentNumber : uint8_t { + FirstExperiment = 0, + SecondExperiment = 1, + ThirdExperiment = 2 + }; + + /******************* COMMS ENUMS *******************/ + enum AntennaDeploymentStatus : uint8_t { + Closed = 0, + OneDoorOpen = 1, + TwoDoorOpen = 2, + ThreeDoorOpen = 3, + FullyDeployed = 4 + }; + + enum SampleRateUHFTX : uint8_t { + Rate = 0 + }; + + enum AntennaGains : uint8_t { + Gain = 0 + }; + + /******************* OBDH PARAMETERS *******************/ + inline Parameter obcUseRTT(true); + inline Parameter obcUseUART(true); + inline Parameter obcUseCAN(false); + + inline Parameter obcPCBTemperature1(0); + inline Parameter obcPCBTemperature2(0); + inline Parameter obcMCUTemperature(0); + inline Parameter obcMCUInputVoltage(0); + + inline Parameter obcMCUBootCounter(0); + inline Parameter obcFlashInt(0); + inline Parameter obcSRAMInt(0); + inline Parameter obcAvailableMRAM(0); + inline Parameter obcAvailableNAND(0); + + inline Parameter obcOnBoardTime(Time::DefaultCUC(0)); + + inline Parameter obcSpacecraftTimeRef(Spacecraft); // enum + inline Parameter obcOperationalMode(NominalMode); // enum + inline Parameter obcMemoryPartition(First); // enum + + inline Parameter obcReconfigurationTimer(0); + inline Parameter obcLastFailedEvent(0); + inline Parameter obcMCUSystick(0); + + inline Parameter obcCANBUSLoad1(0); + inline Parameter obcCANBUSLoad2(0); + + inline Parameter obcCANBUSActive(CAN::Driver::Main); // enum + inline Parameter obcMCUFDIR(OBC); // enum + + inline Parameter obcMCURestartSafeModeThreshold(0); + inline Parameter obcNANDFLASHLCLThreshold(0); + inline Parameter obcMRAMLCLThreshold(0); + inline Parameter obcNANDFLASHON(0); + inline Parameter obcNANDFlashScrubbingFrequency(0); + inline Parameter obcMRAMON(0); + inline Parameter obcRAMScrubbingFrequency(0); + inline Parameter obcProgramFlashScrubbingFrequency(0); + + /******************* SU PARAMETERS *******************/ + // MCU + inline Parameter suMCUBootCounter(0); + inline Parameter suMCUSysTick(0); + + inline Parameter suMCUTemperature(0); + inline Parameter suMCUInputVoltage(0); + + // Memory + inline Parameter suFlashIntUsedPercentage(0); + inline Parameter suFlashUsedPercentage(0); + inline Parameter suSRAMUsedPercentage(0); + + inline Parameter suNANDCurrentlyUsedPartition(First); // enum + inline Parameter suNANDFlashLclOn(0); + inline Parameter suNANDFlashLclThreshold(0); + + inline Parameter suNANDFlashScrubbingFrequency(0); + inline Parameter suRAMScrubbingFrequency(0); + inline Parameter suProgramFlashScrubbingFrequency(0); + + // Components + inline Parameter suControlPumpFlashLclOn(0); + inline Parameter suControlPumpFlashLclThreshold(0); + + inline Parameter suFlowPumpFlashOn(0); + inline Parameter suFlowPumpFlashLclThreshold(0); + + inline Parameter suCameraOn(0); + inline Parameter suCameraLCLThreshold(0); + + // Temperatures + inline Parameter suPCBTemperature1(0); + inline Parameter suPCBTemperature2(0); + + inline Parameter suPCBTemperatureControlValves(0); + inline Parameter suPCBTemperatureFlowValves(0); + + inline Parameter suCameraTemperature(0); + inline Parameter suPDMSTemperature(0); + inline Parameter suGrowthMediumTemperature(0); + + // Sensors + inline Parameter suPressureLevelSensor1(0); + inline Parameter suPressureLevelSensor2(0); + + inline Parameter suHumidityLevelSensor1(0); + inline Parameter suHumidityLevelSensor2(0); + + inline Parameter suRadfet(0); + + // Components + inline Parameter suPumpFlowRate1(0); + inline Parameter suPumpFlowRate2(0); + + inline Parameter suCcontrolChamberValve1(0); + inline Parameter suControlChamberValve2(0); + inline Parameter suControlChamberValve3(0); + + inline Parameter suControlSandwitchValve1(0); + inline Parameter suControlSandwitchValve2(0); + inline Parameter suControlSandwitchValve3(0); + + inline Parameter suFlowValveInlet1(0); + inline Parameter suFlowValveInlet2(0); + inline Parameter suFlowValveInlet3(0); + + inline Parameter suFlowValveOutlet1(0); + inline Parameter suFlowValveOutlet2(0); + inline Parameter suFlowValveOutlet3(0); + + inline Parameter suFlowValveTest1(0); + inline Parameter suFlowValveTest2(0); + + inline Parameter suLEDIntensity1(0); + inline Parameter suLEDIntensity2(0); + inline Parameter suLEDIntensity3(0); + inline Parameter suLEDIntensity4(0); + + // Photos + inline Parameter suNumberOfPhotosTaken(0); + inline Parameter suPhotoExposureTime(0); + inline Parameter suPhotoInterval(0); + inline Parameter suPhotoCroppedResolution(Default); // enum + inline Parameter suPhotoCompressionRate(None); // enum + + // Misc + inline Parameter suExperimentNumber(FirstExperiment); // enum + inline Parameter suOnBoardTime(Time::DefaultCUC(0)); + inline Parameter suLastFailedEvent(0); + + inline Parameter suTemperatureFromHumiditySensor1(0); + inline Parameter suTemperatureFromHumiditySensor2(0); + + /******************* ADCS PARAMETERS *******************/ + inline Parameter adcsUseRTT(false); + inline Parameter adcsUseUART(true); + inline Parameter adcsUseCAN(false); + + inline Parameter adcsXBodyFrameRegardingOrbitFrame(0); + inline Parameter adcsYBodyFrameRegardingOrbitFrame(0); + inline Parameter adcsZBodyFrameRegardingOrbitFrame(0); + inline Parameter adcsAngularVelocityOnX(0); + inline Parameter adcsAngularVelocityOnY(0); + inline Parameter adcsAngularVelocityOnZ(0); + inline Parameter adcsBDotXAxis(0); + inline Parameter adcsBDotYAxis(0); + inline Parameter adcsBDotZAxis(0); + inline Parameter adcsQuaternionOrbitFrameToBodyScalar(0); + inline Parameter adcsQuaternionOrbitFrameToBodyVectorElem1(0); + inline Parameter adcsQuaternionOrbitFrameToBodyVectorElem2(0); + inline Parameter adcsQuaternionOrbitFrameToBodyVectorElem3(0); + + inline Parameter adcsMagnetometerRawX(0); + inline Parameter adcsMagnetometerRawY(0); + inline Parameter adcsMagnetometerRawZ(0); + inline Parameter adcsMagnetometerFrequency(0); + inline Parameter adcsMagnetometerCycleCountX(0); + inline Parameter adcsMagnetometerCycleCountY(0); + inline Parameter adcsMagnetometerCycleCountZ(0); + inline Parameter adcsMagnetometerSelfTest(0); + + inline Parameter adcsMagnetometerISISCalibratedXAxis(0); + inline Parameter adcsMagnetometerISISCalibratedYAxis(0); + inline Parameter adcsMagnetometerISISCalibratedZAxis(0); + inline Parameter adcsMagnetometerISISFilteredXAxis(0); + inline Parameter adcsMagnetometerISISFilteredYAxis(0); + inline Parameter adcsMagnetometerISISFilteredZAxis(0); + inline Parameter adcsMagnetometerISISRawXAxis(0); + inline Parameter adcsMagnetometerISISRawYAxis(0); + inline Parameter adcsMagnetometerISISRawZAxis(0); + + inline Parameter adcsFineSunSensorRawTopLeft(0); + inline Parameter adcsFineSunSensorRawTopRight(0); + inline Parameter adcsFineSunSensorRawBottomLeft(0); + inline Parameter adcsFineSunSensorRawBottomRight(0); + inline Parameter adcsFineSunSensorFilteredTopLeft(0); + inline Parameter adcsFineSunSensorFilteredTopRight(0); + inline Parameter adcsFineSunSensorFilteredBottomLeft(0); + inline Parameter adcsFineSunSensorFilteredBottomRight(0); + inline Parameter adcsFineSunSensorAngularAlphaAngle(0); + inline Parameter adcsFineSunSensorAngularBetaAngle(0); + inline Parameter adcsFineSunSensorCalculatedX(0); + inline Parameter adcsFineSunSensorCalculatedY(0); + inline Parameter adcsFineSunSensorCalculatedZ(0); + + inline Parameter adcsGyroscopeRateX(0); + inline Parameter adcsGyroscopeRateY(0); + inline Parameter adcsGyroscopeRateZ(0); + + inline Parameter adcsGyroXLOCSTRegister(0); + inline Parameter adcsGyroXHICSTRegister(0); + inline Parameter adcsGyroXQUADRegister(0); + inline Parameter adcsGyroXFAULTRegister(0); + + inline Parameter adcsGyroYLOCSTRegister(0); + inline Parameter adcsGyroYHICSTRegister(0); + inline Parameter adcsGyroYQUADRegister(0); + inline Parameter adcsGyroYFAULTRegister(0); + + inline Parameter adcsGyroZLOCSTRegister(0); + inline Parameter adcsGyroZHICSTRegister(0); + inline Parameter adcsGyroZQUADRegister(0); + inline Parameter adcsGyroZFAULTRegister(0); + + inline Parameter adcsMagnetorquerOnXAxisHBridgePolarity(0); + inline Parameter adcsMagnetorquerOnYAxisHBridgePolarity(0); + inline Parameter adcsMagnetorquerOnZAxisHBridgePolarity(0); + inline Parameter adcsMagnetorquerOnXAxisOnOff(0); + inline Parameter adcsMagnetorquerOnYAxisOnOff(0); + inline Parameter adcsMagnetorquerOnZAxisOnOff(0); + + inline Parameter adcsGainBdotXAxis(0); + inline Parameter adcsGainBdotYAxis(0); + inline Parameter adcsGainBdotZAxis(0); + inline Parameter adcsGainProportionalPDXAxis(0); + inline Parameter adcsGainProportionalPDYAxis(0); + inline Parameter adcsGainProportionalPDZAxis(0); + inline Parameter adcsGainDerivativePDXAxis(0); + inline Parameter adcsGainDerivativePDYAxis(0); + inline Parameter adcsGainDerivativePDZAxis(0); + + inline Parameter adcsiMQTBoardCoilXTemperatureSensor(0); + inline Parameter adcsiMQTBoardCoilYTemperatureSensor(0); + inline Parameter adcsiMQTBoardCoilZTemperatureSensor(0); + inline Parameter adcsiMQTBoardExtraTemperatureSensor(0); + + inline Parameter adcsGyroscopeXTemperature(0); + inline Parameter adcsGyroscopeYTemperature(0); + inline Parameter adcsGyroscopeZTemperature(0); + + inline Parameter adcsBoardTemperature1(0); + inline Parameter adcsBoardTemperature2(0); + + inline Parameter adcsMode(StandByModeADCS); // enum + inline Parameter adcsTLE(0); + + inline Parameter adcsInitialKalmanQuaternionECIFrameToBodyScalar(0); + inline Parameter adcsInitialKalmanQuaternionECIFrameToBodyVectorElem1(0); + inline Parameter adcsInitialKalmanQuaternionECIFrameToBodyVectorElem2(0); + inline Parameter adcsInitialKalmanQuaternionECIFrameToBodyVectorElem3(0); + inline Parameter adcsTLEOrbitalElementsArgumentPerigee(0); + inline Parameter adcsTLEOrbitalElementsRAAN(0); + inline Parameter adcsTLEOrbitalElementsInclination(0); + inline Parameter adcsTLEOrbitalElementsEccentricity(0); + inline Parameter adcsTLEOrbitalElementsMeanAnomaly(0); + + inline Parameter adcsSGP4OrbitalElementsArgumentPerigee(0); + inline Parameter adcsSGP4OrbitalElementsRAAN(0); + inline Parameter adcsSGP4OrbitalElementsInclination(0); + inline Parameter adcsSGP4OrbitalElementsMeanAnomaly(0); + inline Parameter adcsTimeGST_JD(0); ///< Greenwich Sidereal Time + + inline Parameter adcsDeterminationInitialMatricesQ1(0); + inline Parameter adcsDeterminationInitialMatricesQ2(0); + inline Parameter adcsDeterminationInitialMatricesQ3(0); + inline Parameter adcsDeterminationInitialMatricesQ4(0); + inline Parameter adcsDeterminationInitialMatricesQ5(0); + inline Parameter adcsDeterminationInitialMatricesQ6(0); + inline Parameter adcsDeterminationInitialMatricesQ7(0); + inline Parameter adcsDeterminationInitialMatricesQ8(0); + inline Parameter adcsDeterminationInitialMatricesQ9(0); + inline Parameter adcsDeterminationInitialMatricesQ10(0); + inline Parameter adcsDeterminationInitialMatricesR1(0); + inline Parameter adcsDeterminationInitialMatricesR2(0); + inline Parameter adcsDeterminationInitialMatricesR3(0); + inline Parameter adcsDeterminationInitialMatricesR4(0); + inline Parameter adcsDeterminationInitialMatricesR5(0); + inline Parameter adcsDeterminationInitialMatricesR6(0); + inline Parameter adcsDeterminationInitialMatricesR7(0); + inline Parameter adcsDeterminationInitialMatricesR8(0); + inline Parameter adcsDeterminationInitialMatricesR9(0); + inline Parameter adcsDeterminationInitialMatricesPInitial1(0); + inline Parameter adcsDeterminationInitialMatricesPInitial2(0); + inline Parameter adcsDeterminationInitialMatricesPInitial3(0); + inline Parameter adcsDeterminationInitialMatricesPInitial4(0); + inline Parameter adcsDeterminationInitialMatricesPInitial5(0); + inline Parameter adcsDeterminationInitialMatricesPInitial6(0); + inline Parameter adcsDeterminationInitialMatricesPInitial7(0); + inline Parameter adcsDeterminationInitialMatricesPInitial8(0); + inline Parameter adcsDeterminationInitialMatricesPInitial9(0); + inline Parameter adcsDeterminationInitialMatricesPInitial10(0); + + inline Parameter adcsReactionWheelOn(0); + inline Parameter adcsReactionWheelAngularVelocity(0); + inline Parameter adcsControlProfileSwitching(0); + + inline Parameter adcsMagnetorquerAxisAssignment(Xaxis); // enum + inline Parameter adcsTransformationAxisXAssignment(Xaxis); // enum + inline Parameter adcsTransformationAxisYAssignment(Xaxis); // enum + inline Parameter adcsTransformationAxisZAssignment(Xaxis); // enum + inline Parameter adcsMagnetometerAxisAssignment(Xaxis); // enum + inline Parameter adcsSunSensorAxisAssignment(Xaxis); // enum + inline Parameter adcsGyroscopeAxisAssignment(Xaxis); // enum + + inline Parameter adcsFrameAxisSignECIToECEF_X(0); + inline Parameter adcsFrameAxisSignECIToECEF_Y(0); + inline Parameter adcsFrameAxisSignECIToECEF_Z(0); + inline Parameter adcsFrameAxisSignECIToOrbit_X(0); + inline Parameter adcsFrameAxisSignECIToOrbit_Y(0); + inline Parameter adcsFrameAxisSignECIToOrbit_Z(0); + inline Parameter adcsFrameAxisSignNEDToECEF_X(0); + inline Parameter adcsFrameAxisSignNEDToECEF_Y(0); + inline Parameter adcsFrameAxisSignNEDToECEF_Z(0); + + inline Parameter adcsMagnetometerSignX(0); + inline Parameter adcsMagnetometerSignY(0); + inline Parameter adcsMagnetometerSignZ(0); + + inline Parameter adcsSunSensorXAxisSign(0); + inline Parameter adcsSunSensorYAxisSign(0); + inline Parameter adcsSunSensorZAxisSign(0); + + inline Parameter adcsGyroSignX(0); + inline Parameter adcsGyroSignY(0); + inline Parameter adcsGyroSignZ(0); + + inline Parameter adcsDetumblingNominalThresholds(0); + inline Parameter adcsNominalDetumblingThresholds(0); + inline Parameter adcsStandByDetumblingThresholds(0); + inline Parameter adcsDetumblingStandByThresholds(0); + inline Parameter adcsNominalStandByThresholds(0); + inline Parameter adcsMagnetorquerMagneticDipoleX(0); + inline Parameter adcsMagnetorquerMagneticDipoleY(0); + inline Parameter adcsMagnetorquerMagneticDipoleZ(0); + + inline Parameter adcsMagnetorquerDutyCycle(Low); // enum + + inline Parameter adcsMagnetorquerCurrentX(0); + inline Parameter adcsMagnetorquerCurrentY(0); + inline Parameter adcsMagnetorquerCurrentZ(0); + + inline Parameter adcsMagnetorquerBDot(0); + inline Parameter adcsReactionWheelTorque(0); + inline Parameter adcsReactionWheelAngularAcceleration(0); + inline Parameter adcsDesiredQuaternionOrbitToBodyScalar(0); + inline Parameter adcsDesiredQuaternionVectorElem1(0); + inline Parameter adcsDesiredQuaternionVectorElem2(0); + inline Parameter adcsDesiredQuaternionVectorElem3(0); + inline Parameter adcsAngularVelocityDesiredX(0); + inline Parameter adcsAngularVelocityDesiredY(0); + inline Parameter adcsAngularVelocityDesiredZ(0); + + inline Parameter adcsGyroBiasX(0); + inline Parameter adcsGyroBiasY(0); + inline Parameter adcsGyroBiasZ(0); + + inline Parameter adcsSatellitePositionLatitude(0); + inline Parameter adcsSatellitePositionLongitude(0); + inline Parameter adcsSatellitePositionHeight(0); + + inline Parameter adcsSatellitePositionECIX(0); + inline Parameter adcsSatellitePositionECIY(0); + inline Parameter adcsSatellitePositionECIZ(0); + inline Parameter adcsSatelliteLinearVelocityECIX(0); + inline Parameter adcsSatelliteLinearVelocityECIY(0); + inline Parameter adcsSatelliteLinearVelocityECIZ(0); + inline Parameter adcsMagneticFieldNEDX(0); + inline Parameter adcsMagneticFieldNEDY(0); + inline Parameter adcsMagneticFieldNEDZ(0); + inline Parameter adcsMagneticFieldECIX(0); + inline Parameter adcsMagneticFieldECIY(0); + inline Parameter adcsMagneticFieldECIZ(0); + inline Parameter adcsSunPositionECIX(0); + inline Parameter adcsSunPositionECIY(0); + inline Parameter adcsSunPositionECIZ(0); + + inline Parameter adcsEclipse(0); + + inline Parameter adcsDesaturationPecentageParameter(0); + + inline Parameter adcsISISMTQModes(Idle); // enum + inline Parameter adcsMagnetorquerActuationMethod(Current); // enum + + inline Parameter adcsDutyCycleDetermination(0); + inline Parameter adcsDutyCycleControl(0); + inline Parameter adcsDutyCycleOther(0); + inline Parameter adcsDesatInitialAngularVelocityParam(0); + + inline Parameter adcsMCUTemperature(0); + inline Parameter adcsMCUInputVoltage(0); + inline Parameter adcsBootCounter(0); + inline Parameter adcsOnBoardTime(Time::DefaultCUC(0)); + inline Parameter adcsMemoryPartition(First); // enum + inline Parameter adcsLastFailedEvent(0); + inline Parameter adcsSystick(0); + inline Parameter adcsRAMScrubbingFrequency(0); + inline Parameter adcsProgramFlashScrubbingFrequency(0); + inline Parameter adcsSRAMInt(0); + inline Parameter adcsFlashInt(0); + + /****************** EPS PARAMETERS *******************/ + inline Parameter epsSwitch3V1(0); + inline Parameter epsSwitch3V2(0); + inline Parameter epsSwitch3V3(0); + inline Parameter epsSwitch3V4(0); + inline Parameter epsSwitch5V1(0); + inline Parameter epsSwitch5V2(0); + inline Parameter epsSwitch5V3(0); + inline Parameter epsSwitch5V4(0); + inline Parameter epsSwitch1(0); + inline Parameter epsSwitch2(0); + inline Parameter epsSwitch3(0); + inline Parameter epsSwitch4(0); + inline Parameter epsSwitch5(0); + + inline Parameter epsCurrentForRail3V1(0); + inline Parameter epsCurrentForRail3V2(0); + inline Parameter epsCurrentForRail3V3(0); + inline Parameter epsCurrentForRail3V4(0); + inline Parameter epsCurrentForRail5V1(0); + inline Parameter epsCurrentForRail5V2(0); + inline Parameter epsCurrentForRail5V3(0); + inline Parameter epsCurrentForRail5V4(0); + inline Parameter epsCurrentForRail1(0); + inline Parameter epsCurrentForRail2(0); + inline Parameter epsCurrentForRail3(0); + inline Parameter epsCurrentForRail4(0); + inline Parameter epsCurrentForRail5(0); + + inline Parameter epsVoltageForEachRail3V1(0); + inline Parameter epsVoltageForEachRail3V2(0); + inline Parameter epsVoltageForEachRail3V3(0); + inline Parameter epsVoltageForEachRail3V4(0); + inline Parameter epsVoltageForEachRail5V1(0); + inline Parameter epsVoltageForEachRail5V2(0); + inline Parameter epsVoltageForEachRail5V3(0); + inline Parameter epsVoltageForEachRail5V4(0); + inline Parameter epsVoltageForEachRail12V1(0); + inline Parameter epsVoltageForEachRail12V2(0); + inline Parameter epsVoltageForEachRail12V3(0); + inline Parameter epsVoltageForEachRail12V4(0); + + inline Parameter epsPanelVoltageXPlus(0); + inline Parameter epsPanelVoltageXMinus(0); + inline Parameter epsPanelVoltageYPlus(0); + inline Parameter epsPanelVoltageYMinus(0); + inline Parameter epsPanelVoltageZ(0); + + inline Parameter epsPanelCurrentXPlus(0); + inline Parameter epsPanelCurrentXMinus(0); + inline Parameter epsPanelCurrentYPlus(0); + inline Parameter epsPanelCurrentYMinus(0); + inline Parameter epsPanelCurrentZ(0); + + inline Parameter epsBatteryPackVoltage(0); + + inline Parameter epsPanelTemperatureXPlus(0); + inline Parameter epsPanelTemperatureXMinus(0); + inline Parameter epsPanelTemperatureYPlus(0); + inline Parameter epsPanelTemperatureYMinus(0); + inline Parameter epsPanelTemperatureZ(0); + + inline Parameter epsPCBTemperatureSensor1(0); + inline Parameter epsPCBTemperatureSensor2(0); + + inline Parameter epsBatteryTemperatureSensor1(0); + inline Parameter epsBatteryTemperatureSensor2(0); + + /****************** COMMS PARAMETERS *******************/ + inline Parameter commsUHFBandPATemperature(0); + inline Parameter commsSBandPATemperature(0); + inline Parameter commsPCBTemperature(0); + + inline Parameter commsAntennaDeploymentStatus(Closed); // enum + + inline Parameter commsDataRateUHFTX(Rate); // enum + inline Parameter commsDataRateUHFRX(0); + inline Parameter commsSymbolRateSBand(0); + inline Parameter commsCWInterval(0); + inline Parameter commsGMSKBeaconInterval(0); + inline Parameter commsUHFBandTXPower(0); + inline Parameter commsSBandTXPower(0); + inline Parameter commsChannelNumberUHFBand(0); + inline Parameter commsChannelNumberSBand(0); + + inline Parameter commsLNAGain(Gain); // enum + inline Parameter commsPAGainUHFBand(Gain); // enum + inline Parameter commsPAGainSBand(Gain); // enum + + inline Parameter commsVGAGain(0); + inline Parameter commsRSSI(0); + + inline Parameter commsUHFBandTXOnOff(0); + inline Parameter commsUHFBandRXOnOff(0); + inline Parameter commsSBandTXOnOff(0); + + inline Parameter commsPacketsRejectedCOMMS(0); + inline Parameter commsInvalidHMAC(0); + inline Parameter commsInvalidPacketStructure(0); + inline Parameter commsInvalidSpacecraftID(0); + inline Parameter commsFrameSequenceCounter(0); + + inline Parameter commsPCBTemperature1(0); + inline Parameter commsPCBTemperature2(0); + inline Parameter commsMCUTemperature(0); + inline Parameter commsMCUInputVoltage(0); + + inline Parameter commsMCUBootCounter(0); + inline Parameter commsOnBoardTime(Time::DefaultCUC(0)); + + inline Parameter commsNANDCurrentlyUsedMemoryPartition(First); // enum + + inline Parameter commsLastFailedEvent(0); + inline Parameter commsMCUSystick(0); + inline Parameter commsFlashInt(0); + inline Parameter commsSRAMInt(0); +} diff --git a/inc/Platform/Parameters/BootCounter.hpp b/inc/Platform/Parameters/BootCounter.hpp new file mode 100644 index 0000000..5d31877 --- /dev/null +++ b/inc/Platform/Parameters/BootCounter.hpp @@ -0,0 +1,48 @@ +#pragma once + +#include "device.h" +#include "Definitions.hpp" +/** + * The BootCounter namespace contains the functionality for the Boot Counter parameter. In this + * implementation ATSAMV71Q21's General Purpose Backup Registers (GPBR) were used. GPBR were chosen + * because the contents are saved after a software MCU reset which is needed for testing purposes. + * However, these registers reset at first power-up and on each power loss. As a result, a different + * non-volatile memory will be used in the satellite's final software. + */ +namespace BootCounter { + /** + * This function is used to read from a GPBR. + * @param registerIndex which one of the \ref BackupRegisters to read from. + * @return the 32-bit data inside the register. + */ + inline uint32_t GPBRRead(BackupRegisters registerIndex) { + return GPBR_REGS->SYS_GPBR[registerIndex]; + } + + /** + * This function is used to write inside a GPBR. + * @param registerIndex which one of the \ref BackupRegisters to write to. + * @param data the 32-bit data to store inside the register. + */ + inline void GPBRWrite(BackupRegisters registerIndex, uint32_t data) { + GPBR_REGS->SYS_GPBR[registerIndex] = data; + } + + /** + * Function that clears the \ref BackupRegisters. + */ + void clearRegisters(); + + /** + * Checks the value of the \ref UnexpectedResetRegister. If the \ref softwareResetValue value is stored, a + * software reset is detected and the function returns. Otherwise, a hardware reset is detected + * so both the \ref UnexpectedResetRegister and \ref BootCounterRegister are set to their initial values. + */ + void setRegisters(); + + /** + * Increments the boot counter. + * If the counter limit is reached, the registers are cleared. + */ + void incrementBootCounter(); +} diff --git a/inc/Platform/Parameters/Definitions.hpp b/inc/Platform/Parameters/Definitions.hpp new file mode 100644 index 0000000..fbb3a24 --- /dev/null +++ b/inc/Platform/Parameters/Definitions.hpp @@ -0,0 +1,80 @@ +#pragma once + +#include "etl/String.hpp" +#include "time.h" + +namespace BootCounter { + /** + * Enumeration of the General Purpose Backup Registers (GPBR) used in the boot counter parameter + * implementation. + */ + enum BackupRegisters : uint8_t { + /** + * Defines which one of the eight backup registers will be used to distinguish software from + * hardware resets. + */ + UnexpectedResetRegister = 0, + /** + * Defines which one of the eight backup registers will be used to save the boot counter variable. + */ + BootCounterRegister = 1 + }; + + /** + * When this value is detected inside the \ref UnexpectedResetRegister a software reset is acknowledged, + * otherwise an unexpected reset has occurred. + */ + inline const uint8_t SoftwareResetValue = 1; + + /** + * Defines the backup register's value after it is cleared. + */ + inline const uint8_t ClearRegisterValue = 0; + + /** + * A counter limit for hardware reset simulation. + * @see incrementBootCounter + */ + inline const uint16_t BootCounterLimit = 1000; +} + +/** + * Number of bytes used for the basic time units of the CUC header for the RTC transform + */ +inline constexpr uint8_t CUCSecondsBytes = 4; + +/** + * Number of bytes used for the fractional time units of the CUC header for the RTC transform + */ +inline constexpr uint8_t CUCFractionalBytes = 0; + +/** + * Contains initial epoch values for spacecraft time + */ +inline const tm EpochTime = {.tm_sec = 0, .tm_min = 0, .tm_hour = 0, .tm_mday = 1, .tm_mon = 0, .tm_year = 2022}; + +namespace LogSource { + /** + * The maximum number of letters in a string representation of a subsystem's name. + */ + inline constexpr uint8_t MaximumLettersInSubsystemName = 8; + + /** + * The maximum number of Logging Sources + */ + inline constexpr uint8_t NumberOfLogSources = 5; + + /** + * The subsystem to be used, if no other source is defined using the stream operator. + */ + extern String currentSubsystem; +} + +namespace CAN { + /** + * CAN Nodes, as specified in DDJF_OBDH. + */ + enum NodeIDs : uint8_t { + OBC = 0x0, COMMS = 0x1, ADCS = 0x2, SU = 0x3, ExternalMCU = 0x4 + }; +} diff --git a/inc/Platform/TaskInitialization.hpp b/inc/Platform/TaskInitialization.hpp new file mode 100644 index 0000000..25a1316 --- /dev/null +++ b/inc/Platform/TaskInitialization.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include "FreeRTOS.h" +#include "SEGGER_RTT.h" +#include "TimeKeepingTask.hpp" +#include "MCUTemperatureTask.hpp" +#include "AmbientTemperatureTask.hpp" +#include "UARTGatekeeperTask.hpp" +#include "WatchdogTask.hpp" +#include "CANGatekeeperTask.hpp" +#include "CANTestTask.hpp" + +void initializeTasks(); diff --git a/lib/atsam-component-drivers b/lib/atsam-component-drivers index d71108e..8e44235 160000 --- a/lib/atsam-component-drivers +++ b/lib/atsam-component-drivers @@ -1 +1 @@ -Subproject commit d71108e88a78e421a9a9d1b9198a86fed23dca09 +Subproject commit 8e44235f6f41503798b4510606500609fbd04f9a diff --git a/lib/cross-platform-software b/lib/cross-platform-software deleted file mode 160000 index 997c391..0000000 --- a/lib/cross-platform-software +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 997c391a02096a8721a437c8017ab6cc80cabd02 diff --git a/src/FreeRTOSTasks/AmbientTemperatureTask.cpp b/src/FreeRTOSTasks/AmbientTemperatureTask.cpp new file mode 100644 index 0000000..b95079b --- /dev/null +++ b/src/FreeRTOSTasks/AmbientTemperatureTask.cpp @@ -0,0 +1,35 @@ +#include "AmbientTemperatureTask.hpp" + +void AmbientTemperatureTask::execute() { + uint8_t numberOfDisconnectedSensors = 0; + + for (auto &sensor: sensors) { + if (not sensor.isDeviceConnected()) { + LOG_ERROR << "Temperature sensor with address " << sensor.getI2CUserAddress() + << " was disconnected"; + numberOfDisconnectedSensors++; + } + } + + if (numberOfDisconnectedSensors == NumberOfTemperatureSensors) { + LOG_ERROR << "Suspending ambient temperature task"; + vTaskSuspend(taskHandle); + } + + while (true) { + for (uint8_t sensorCounter = 0; sensorCounter < NumberOfTemperatureSensors; sensorCounter++) { + if (not sensors[sensorCounter].isDeviceConnected()) { + LOG_ERROR << "Temperature sensor with address " << sensors[sensorCounter].getI2CUserAddress() + << " was disconnected"; + continue; + } + ambientTemperature[sensorCounter] = sensors[sensorCounter].getTemperature(); + LOG_INFO << "Sensor with address" << sensors[sensorCounter].getI2CUserAddress() << + " responded with ambient temperature = " << ambientTemperature[sensorCounter]; + } + + CommonParameters::boardTemperature1.setValue(ambientTemperature[0]); + CommonParameters::boardTemperature2.setValue(ambientTemperature[1]); + vTaskDelay(pdMS_TO_TICKS(DelayMs)); + } +} diff --git a/src/FreeRTOSTasks/CANGatekeeperTask.cpp b/src/FreeRTOSTasks/CANGatekeeperTask.cpp new file mode 100644 index 0000000..af62374 --- /dev/null +++ b/src/FreeRTOSTasks/CANGatekeeperTask.cpp @@ -0,0 +1,40 @@ +#include "CAN/Driver.hpp" +#include "CAN/Frame.hpp" +#include "CANGatekeeperTask.hpp" + +CANGatekeeperTask::CANGatekeeperTask() : Task("CANGatekeeperTask") { + CAN::Driver::initialize(); + + outgoingQueue = xQueueCreateStatic(CAN::FrameQueueSize, sizeof(CAN::Frame), outgoingQueueStorageArea, + &outgoingQueueBuffer); + vQueueAddToRegistry(outgoingQueue, "CAN Outgoing"); + + incomingQueue = xQueueCreateStatic(CAN::FrameQueueSize, sizeof(CAN::Frame), incomingQueueStorageArea, + &incomingQueueBuffer); + vQueueAddToRegistry(incomingQueue, "CAN Incoming"); +} + +void CANGatekeeperTask::execute() { +#ifdef OBC_EQM_LCL + LCLDefinitions::lclArray[LCLDefinitions::CAN1].enableLCL(); + LCLDefinitions::lclArray[LCLDefinitions::CAN2].enableLCL(); +#endif + + PIO_PinWrite(CAN::CAN_SILENT_1, false); + PIO_PinWrite(CAN::CAN_SILENT_2, false); + + CAN::Frame message = {}; + + while (true) { + if(xTaskGetTickCount() - lastTransmissionTime > 8000) { + LOG_ERROR << "Resetting CAN LCLs"; + LCLDefinitions::lclArray[LCLDefinitions::CAN1].enableLCL(); + LCLDefinitions::lclArray[LCLDefinitions::CAN2].enableLCL(); + MCAN0_Initialize(); + MCAN1_Initialize(); + } + xQueueReceive(outgoingQueue, &message, portMAX_DELAY); + + CAN::Driver::send(message); + } +} diff --git a/src/FreeRTOSTasks/CANTestTask.cpp b/src/FreeRTOSTasks/CANTestTask.cpp new file mode 100644 index 0000000..abfd436 --- /dev/null +++ b/src/FreeRTOSTasks/CANTestTask.cpp @@ -0,0 +1,15 @@ +#include "CANTestTask.hpp" +#include "CANGatekeeperTask.hpp" + +void CANTestTask::execute() { + CAN::Frame frame = {CAN::NodeID}; + for (auto i = 0; i < CAN::Frame::MaxDataLength; i++) { + frame.data.at(i) = i; + } + + while (true) { + CAN::Application::sendPingMessage(CAN::ADCS, false); + canGatekeeperTask->send(frame); + vTaskDelay(pdMS_TO_TICKS(2000)); + } +} \ No newline at end of file diff --git a/src/FreeRTOSTasks/MCUTemperatureTask.cpp b/src/FreeRTOSTasks/MCUTemperatureTask.cpp new file mode 100644 index 0000000..7e560d2 --- /dev/null +++ b/src/FreeRTOSTasks/MCUTemperatureTask.cpp @@ -0,0 +1,16 @@ +#include "MCUTemperatureTask.hpp" + +void MCUTemperatureTask::execute() { + AFEC0_ConversionStart(); + while (true) { + AFEC0_ConversionStart(); + vTaskDelay(pdMS_TO_TICKS(1)); + uint16_t ADCconversion = AFEC0_ChannelResultGet(AFEC_CH11); + float voltageConversion = static_cast(ADCconversion) * PositiveVoltageReference / MaxADCValue; + const float MCUtemperature = + (voltageConversion - TypicalVoltageAt25) / TemperatureSensitivity + ReferenceTemperature; + LOG_DEBUG << "The temperature of the MCU is: " << MCUtemperature << " degrees Celsius"; + CommonParameters::mcuTemperature.setValue(MCUtemperature); + vTaskDelay(pdMS_TO_TICKS(delayMs)); + } +} diff --git a/src/FreeRTOSTasks/TimeKeepingTask.cpp b/src/FreeRTOSTasks/TimeKeepingTask.cpp new file mode 100644 index 0000000..06eb4b9 --- /dev/null +++ b/src/FreeRTOSTasks/TimeKeepingTask.cpp @@ -0,0 +1,46 @@ +#include "TimeKeepingTask.hpp" + +void TimeKeepingTask::execute() { + static tm dateTime; + setEpoch(dateTime); + RTC_TimeSet(&dateTime); + + while (true) { + RTC_TimeGet(&dateTime); + setTimePlatformParameters(dateTime); + printOnBoardTime(); + vTaskDelay(pdMS_TO_TICKS(DelayMs)); + } +} + +void TimeKeepingTask::printOnBoardTime() { + UTCTimestamp timestamp = CommonParameters::time.getValue().toUTCtimestamp(); + etl::string<29> printTime = "Time:"; + etl::to_string(timestamp.hour, printTime, true); + printTime += "-"; + etl::to_string(timestamp.minute, printTime, true); + printTime += "-"; + etl::to_string(timestamp.second, printTime, true); + printTime += " -- "; + etl::to_string(timestamp.day, printTime, true); + printTime += "/"; + etl::to_string(timestamp.month, printTime, true); + printTime += "/"; + etl::to_string(timestamp.year, printTime, true); + LOG_DEBUG << printTime.data(); +} + +void TimeKeepingTask::setTimePlatformParameters(tm &dateTime) { + UTCTimestamp timeUTC(dateTime.tm_year + yearBase, dateTime.tm_mon + 1, dateTime.tm_mday, dateTime.tm_hour, dateTime.tm_min, dateTime.tm_sec); + Time::DefaultCUC timeCUC(timeUTC); + CommonParameters::time.setValue(timeCUC); +} + +void TimeKeepingTask::setEpoch(tm &dateTime) { + dateTime.tm_sec = EpochTime.tm_sec; + dateTime.tm_min = EpochTime.tm_min; + dateTime.tm_hour = EpochTime.tm_hour; + dateTime.tm_mday = EpochTime.tm_mday; + dateTime.tm_mon = EpochTime.tm_mon; + dateTime.tm_year = EpochTime.tm_year - yearBase; +} diff --git a/src/FreeRTOSTasks/UARTGatekeeperTask.cpp b/src/FreeRTOSTasks/UARTGatekeeperTask.cpp new file mode 100644 index 0000000..4cb01c9 --- /dev/null +++ b/src/FreeRTOSTasks/UARTGatekeeperTask.cpp @@ -0,0 +1,23 @@ +#include "UARTGatekeeperTask.hpp" + +UARTGatekeeperTask::UARTGatekeeperTask() : Task("UARTGatekeeperTask") { + xUartQueue = xQueueCreateStatic(UARTQueueSize, sizeof(etl::string), ucQueueStorageArea, + &xStaticQueue); +} + +void UARTGatekeeperTask::execute() { + etl::string output; + const void *txRegisterAddress = const_cast(reinterpret_cast(&UART_PERIPHERAL_REGISTER)); + while (true) { + xQueueReceive(xUartQueue, &output, portMAX_DELAY); + output.repair(); + + if constexpr (LogsAreCOBSEncoded) { + auto cobsEncoded = COBSencode(output); + XDMAC_ChannelTransfer(XDMAC_CHANNEL_0, cobsEncoded.data(), txRegisterAddress, cobsEncoded.size()); + } else { + XDMAC_ChannelTransfer(XDMAC_CHANNEL_0, output.data(), txRegisterAddress, output.size()); + } + vTaskDelay(60); + } +} diff --git a/src/FreeRTOSTasks/WatchdogTask.cpp b/src/FreeRTOSTasks/WatchdogTask.cpp new file mode 100644 index 0000000..7e0f9f0 --- /dev/null +++ b/src/FreeRTOSTasks/WatchdogTask.cpp @@ -0,0 +1,9 @@ +#include "WatchdogTask.hpp" + +void WatchdogTask::execute() { + while (true) { + WDT_Clear(); + LOG_DEBUG << "Watchdog reset"; + vTaskDelay(pdMS_TO_TICKS(WatchdogWindow)); + } +} diff --git a/src/Platform/CAN/ApplicationLayer.cpp b/src/Platform/CAN/ApplicationLayer.cpp new file mode 100644 index 0000000..058f396 --- /dev/null +++ b/src/Platform/CAN/ApplicationLayer.cpp @@ -0,0 +1,262 @@ +#include "CAN/ApplicationLayer.hpp" +#include "CAN/Driver.hpp" +#include "CAN/TPMessage.hpp" +#include "CAN/TPProtocol.hpp" +#include "CANGatekeeperTask.hpp" + +namespace CAN::Application { + Driver::ActiveBus switchBus(Driver::ActiveBus newBus) { + AcubeSATParameters::obcCANBUSActive.setValue(newBus); + return AcubeSATParameters::obcCANBUSActive.getValue(); + } + + void sendPingMessage(NodeIDs destinationAddress, bool isMulticast) { + TPMessage message = {{NodeID, destinationAddress, isMulticast}}; + + message.appendUint8(Ping); + + CAN::TPProtocol::createCANTPMessage(message, false); + } + + void sendPongMessage() { + TPMessage message = {{NodeID, OBC, false}}; + + message.appendUint8(Pong); + + CAN::TPProtocol::createCANTPMessage(message, true); + } + + void sendHeartbeatMessage() { + canGatekeeperTask->send({MessageIDs::Heartbeat + CAN::NodeID}, false); + } + + void sendBusSwitchoverMessage() { + Driver::ActiveBus newBus = Driver::Redundant; + if (AcubeSATParameters::obcCANBUSActive.getValue() == Driver::Redundant) { + newBus = Driver::Main; + } + + etl::array data = {switchBus(newBus)}; + + canGatekeeperTask->send({MessageIDs::BusSwitchover + CAN::NodeID, data}, false); + } + + void sendBusSwitchoverMessage(Driver::ActiveBus newBus) { + etl::array data = {switchBus(newBus)}; + + canGatekeeperTask->send({MessageIDs::BusSwitchover + CAN::NodeID, data}, false); + } + + void sendUTCTimeMessageWithElapsedTicks() { + auto now = TimeGetter::getCurrentTimeDefaultCUC(); + + const std::chrono::duration msOfDay = now.asDuration() % millisecondsPerDay; + + uint32_t ticksOfDay = static_cast(msOfDay.count() / 100); + + UTCTimestamp utc = now.toUTCtimestamp(); + etl::array data = {0, 0, static_cast(ticksOfDay), + static_cast(ticksOfDay >> 8), + static_cast(ticksOfDay >> 16), + static_cast(ticksOfDay >> 24), + static_cast(utc.day), + static_cast(utc.day >> 8)}; + + canGatekeeperTask->send({MessageIDs::UTCTime + CAN::NodeID, data}, false); + } + + void createSendParametersMessage(NodeIDs destinationAddress, bool isMulticast, + const etl::array ¶meterIDs, bool isISR) { + TPMessage message = {{CAN::NodeID, destinationAddress, isMulticast}}; + + message.appendUint8(MessageIDs::SendParameters); + message.appendUint16(parameterIDs.size()); + for (auto parameterID: parameterIDs) { + if (Services.parameterManagement.getParameter(parameterID)) { + message.append(parameterID); + Services.parameterManagement.getParameter(parameterID)->get().appendValueToMessage(message); + } + else if (parameterID == 0 ) { + continue; + } + else { + LOG_ERROR << "Requested parameter that doesn't exist! ID: " << parameterID; + } + } + + CAN::TPProtocol::createCANTPMessage(message, isISR); + } + + void createRequestParametersMessage(NodeIDs destinationAddress, bool isMulticast, + const etl::array ¶meterIDs, + bool isISR) { + TPMessage message = {{CAN::NodeID, destinationAddress, isMulticast}}; + + message.appendUint8(MessageIDs::RequestParameters); + message.appendUint16(parameterIDs.size()); + + if constexpr (Logger::isLogged(Logger::debug)) { + String<128> logString = "Requesting parameters with ID: "; + for (auto parameterID: parameterIDs) { + if (parameterID == 0) { + continue; + } + etl::to_string(parameterID, logString, true); + message.append(parameterID); + } + LOG_DEBUG << logString.c_str(); + } else { + for (auto parameterID: parameterIDs) { + message.append(parameterID); + } + } + + CAN::TPProtocol::createCANTPMessage(message, isISR); + } + + void createPerformFunctionMessage(NodeIDs destinationAddress, bool isMulticast, + const etl::string &functionId, + const etl::map &arguments, + bool isISR) { + TPMessage message = {{CAN::NodeID, destinationAddress, isMulticast}}; + + message.appendUint8(MessageIDs::PerformFunction); + + message.appendString(functionId); + + message.appendUint16(arguments.size()); + + for (auto argument: arguments) { + message.appendUint8(argument.first); + message.appendUint64(argument.second); + } + + CAN::TPProtocol::createCANTPMessage(message, isISR); + } + + void createEventReportMessage(NodeIDs destinationAddress, bool isMulticast, EventReportType type, uint16_t eventID, + const Message &eventData, bool isISR) { + TPMessage message = {{CAN::NodeID, destinationAddress, isMulticast}}; + + message.appendUint8(MessageIDs::EventReport); + message.appendEnum8(type); + message.appendUint16(eventID); + message.appendMessage(eventData, eventData.dataSize); + + CAN::TPProtocol::createCANTPMessage(message, isISR); + } + + void createPacketMessage(NodeIDs destinationAddress, bool isMulticast, const etl::string<128> &incomingMessage, Message::PacketType packetType, bool isISR) { + TPMessage message = {{CAN::NodeID, destinationAddress, isMulticast}}; + + if (packetType == Message::TM) { + message.appendUint8(MessageIDs::TMPacket); + } else { + message.appendUint8(MessageIDs::TCPacket); + } + + message.appendString(incomingMessage); + + CAN::TPProtocol::createCANTPMessage(message, isISR); + } + + void + createCCSDSPacketMessage(NodeIDs destinationAddress, bool isMulticast, const Message &incomingMessage, bool isISR) { + TPMessage message = {{CAN::NodeID, destinationAddress, isMulticast}}; + + auto ccsdsMessage = MessageParser::compose(incomingMessage); + + message.appendUint8(MessageIDs::CCSDSPacket); + message.appendString(ccsdsMessage); + + CAN::TPProtocol::createCANTPMessage(message, isISR); + } + + void createLogMessage(NodeIDs destinationAddress, bool isMulticast, const String &log, + bool isISR) { + TPMessage message = {{CAN::NodeID, destinationAddress, isMulticast}}; + + message.appendUint8(MessageIDs::LogMessage); + message.appendString(log); + + CAN::TPProtocol::createCANTPMessage(message, isISR); + } + + void parseMessage(const CAN::Frame &message) { + uint32_t id = filterMessageID(message.id); + if (id == Heartbeat) { +// registerHeartbeat(); + } else if (id == BusSwitchover) { + switchBus(static_cast(message.data[0])); + } else if (id == UTCTime) { +// registerUTCTime(); + } + } + + void parseSendParametersMessage(TPMessage &message) { + uint8_t messageType = message.readUint8(); + if (not ErrorHandler::assertInternal(messageType == SendParameters, ErrorHandler::UnknownMessageType)) { + return; + } + uint16_t parameterCount = message.readUint16(); + + for (uint16_t idx = 0; idx < parameterCount; idx++) { + uint16_t parameterID = message.readUint16(); + if (Services.parameterManagement.parameterExists(parameterID)) { + if constexpr (Logger::isLogged(Logger::debug)) { + String<64> logString = "The value for parameter with ID "; + etl::to_string(parameterID, logString, true); + logString.append(" was "); + + auto parameter = Services.parameterManagement.getParameter(parameterID); + etl::to_string(parameter->get().getValueAsDouble(), logString, true); + + parameter->get().setValueFromMessage(message); + logString.append(" and is now "); + etl::to_string(parameter->get().getValueAsDouble(), logString, true); + + LOG_DEBUG << logString.c_str(); + } else { + Services.parameterManagement.getParameter(parameterID)->get().setValueFromMessage(message); + } + } + } + } + + void parseRequestParametersMessage(TPMessage &message) { + uint8_t messageType = message.readUint8(); + if (not ErrorHandler::assertInternal(messageType == RequestParameters, ErrorHandler::UnknownMessageType)) { + return; + } + uint16_t parameterCount = message.readUint16(); + etl::array parameterIDs = {}; + + for (uint16_t idx = 0; idx < parameterCount; idx++) { + parameterIDs[idx] = message.readUint16(); + } + + createSendParametersMessage(message.idInfo.sourceAddress, message.idInfo.isMulticast, parameterIDs, true); + } + + void parseTMMessage(TPMessage &message) { + uint8_t messageType = message.readUint8(); + if (not ErrorHandler::assertInternal(messageType == TMPacket, ErrorHandler::UnknownMessageType)) { + return; + } + + String logString = message.data + 1; + + LOG_DEBUG << logString.c_str(); + } + + void parseTCMessage(TPMessage &message) { + uint8_t messageType = message.readUint8(); + if (not ErrorHandler::assertInternal(messageType == TCPacket, ErrorHandler::UnknownMessageType)) { + return; + } + + Message teleCommand = MessageParser::parseECSSTC(message.data + 1); + + MessageParser::execute(teleCommand); + } +} diff --git a/src/Platform/CAN/Driver.cpp b/src/Platform/CAN/Driver.cpp new file mode 100644 index 0000000..c0fa1fd --- /dev/null +++ b/src/Platform/CAN/Driver.cpp @@ -0,0 +1,212 @@ +#include "CAN/Driver.hpp" +#include "CAN/TPProtocol.hpp" +#include "CANGatekeeperTask.hpp" +#include "Logger.hpp" + +uint8_t CAN::Driver::convertDlcToLength(uint8_t dlc) { + static constexpr uint8_t msgLength[] = {0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 12U, 16U, 20U, 24U, 32U, 48U, 64U}; + return msgLength[dlc]; +} + +uint8_t CAN::Driver::convertLengthToDLC(uint8_t length) { + uint8_t dlc; + + if (length <= 8U) { + dlc = length; + } else if (length <= 12U) { + dlc = 0x9U; + } else if (length <= 16U) { + dlc = 0xAU; + } else if (length <= 20U) { + dlc = 0xBU; + } else if (length <= 24U) { + dlc = 0xCU; + } else if (length <= 32U) { + dlc = 0xDU; + } else if (length <= 48U) { + dlc = 0xEU; + } else { + dlc = 0xFU; + } + return dlc; +} + +void CAN::Driver::mcan0TxFifoCallback(uintptr_t context) { + uint32_t status = MCAN0_ErrorGet() & MCAN_PSR_LEC_Msk; + bool isStatusOk = (status == MCAN_ERROR_NONE) || (status == MCAN_ERROR_LEC_NO_CHANGE); + auto appState = static_cast(context); + + if (appState == Transmit && not isStatusOk) { + LOG_ERROR << "Could not transmit CAN message. The status is " << status; + return; + } + + canGatekeeperTask->lastTransmissionTime = xTaskGetTickCount(); +} + +void CAN::Driver::mcan0RxFifo0Callback(uint8_t numberOfMessages, uintptr_t context) { + uint32_t status = MCAN0_ErrorGet() & MCAN_PSR_LEC_Msk; + bool isStatusOk = (status == MCAN_ERROR_NONE) || (status == MCAN_ERROR_LEC_NO_CHANGE); + auto appState = static_cast(context); + + if (not(isStatusOk && appState == Receive)) { + return; + } + + for (size_t messageNumber = 0; messageNumber < numberOfMessages; messageNumber++) { + memset(&rxFifo0, 0x0, (numberOfMessages * MCAN0_RX_FIFO0_ELEMENT_SIZE)); + if (MCAN0_MessageReceiveFifo(MCAN_RX_FIFO_0, 1, &rxFifo0)) { + if (rxFifo0.data[0] >> 6 == CAN::TPProtocol::Frame::Single) { + TPProtocol::processSingleFrame(getFrame(rxFifo0)); + continue; + } + + canGatekeeperTask->addToIncoming(getFrame(rxFifo0)); + + if (rxFifo0.data[0] >> 6 == CAN::TPProtocol::Frame::Final) { + CAN::TPProtocol::processMultipleFrames(); + } + } + } +} + +void CAN::Driver::mcan0RxFifo1Callback(uint8_t numberOfMessages, uintptr_t context) { + uint32_t status = MCAN0_ErrorGet() & MCAN_PSR_LEC_Msk; + bool isStatusOk = (status == MCAN_ERROR_NONE) || (status == MCAN_ERROR_LEC_NO_CHANGE); + auto appState = static_cast(context); + + if (not(isStatusOk && appState == Receive)) { + return; + } + + for (size_t messageNumber = 0; messageNumber < numberOfMessages; messageNumber++) { + memset(&rxFifo1, 0x0, MCAN0_RX_FIFO0_ELEMENT_SIZE); + if (MCAN0_MessageReceiveFifo(MCAN_RX_FIFO_1, 1, &rxFifo1)) { + logMessage(rxFifo1, Main); + CAN::Application::parseMessage(getFrame(rxFifo1)); + } + } +} + +void CAN::Driver::mcan1TxFifoCallback(uintptr_t context) { + uint32_t status = MCAN1_ErrorGet() & MCAN_PSR_LEC_Msk; + bool isStatusOk = (status == MCAN_ERROR_NONE) || (status == MCAN_ERROR_LEC_NO_CHANGE); + auto appState = static_cast(context); + + if (appState == Transmit && not isStatusOk) { + LOG_ERROR << "Could not transmit CAN message. The status is " << status; + return; + } + + canGatekeeperTask->lastTransmissionTime = xTaskGetTickCount(); +} + +void CAN::Driver::mcan1RxFifo0Callback(uint8_t numberOfMessages, uintptr_t context) { + uint32_t status = MCAN1_ErrorGet() & MCAN_PSR_LEC_Msk; + bool isStatusOk = (status == MCAN_ERROR_NONE) || (status == MCAN_ERROR_LEC_NO_CHANGE); + auto appState = static_cast(context); + + if (not(isStatusOk && appState == Receive)) { + return; + } + + for (size_t messageNumber = 0; messageNumber < numberOfMessages; messageNumber++) { + memset(&rxFifo0, 0x0, (numberOfMessages * MCAN1_RX_FIFO0_ELEMENT_SIZE)); + if (MCAN1_MessageReceiveFifo(MCAN_RX_FIFO_0, 1, &rxFifo0)) { + if (rxFifo0.data[0] >> 6 == CAN::TPProtocol::Frame::Single) { + TPProtocol::processSingleFrame(getFrame(rxFifo0)); + continue; + } + + canGatekeeperTask->addToIncoming(getFrame(rxFifo0)); + + if (rxFifo0.data[0] >> 6 == CAN::TPProtocol::Frame::Final) { + CAN::TPProtocol::processMultipleFrames(); + } + } + } +} + +void CAN::Driver::mcan1RxFifo1Callback(uint8_t numberOfMessages, uintptr_t context) { + uint32_t status = MCAN1_ErrorGet() & MCAN_PSR_LEC_Msk; + bool isStatusOk = (status == MCAN_ERROR_NONE) || (status == MCAN_ERROR_LEC_NO_CHANGE); + auto appState = static_cast(context); + + if (not(isStatusOk && appState == Receive)) { + return; + } + + for (size_t messageNumber = 0; messageNumber < numberOfMessages; messageNumber++) { + memset(&rxFifo1, 0x0, MCAN1_RX_FIFO0_ELEMENT_SIZE); + if (MCAN1_MessageReceiveFifo(MCAN_RX_FIFO_1, 1, &rxFifo1)) { + logMessage(rxFifo1, Redundant); + CAN::Application::parseMessage(getFrame(rxFifo1)); + } + } +} + +void CAN::Driver::send(const CAN::Frame &message) { + using namespace CAN; + + memset(&Driver::txFifo, 0, MCAN1_TX_FIFO_BUFFER_ELEMENT_SIZE); + + Driver::txFifo.brs = 1; + Driver::txFifo.fdf = 1; + Driver::txFifo.xtd = 0; + Driver::txFifo.id = Driver::writeId(message.id); + Driver::txFifo.dlc = Driver::convertLengthToDLC(message.data.size()); + + std::copy(message.data.begin(), message.data.end(), Driver::txFifo.data); + + if (AcubeSATParameters::obcCANBUSActive.getValue() == Main) { + MCAN0_MessageTransmitFifo(1, &Driver::txFifo); + } else { + MCAN1_MessageTransmitFifo(1, &Driver::txFifo); + } +} + +void CAN::Driver::logMessage(const MCAN_RX_BUFFER &rxBuf, ActiveBus incomingBus) { + auto message = String("CAN Message: "); + if (incomingBus == Main) { + message.append("MCAN0 "); + } else { + message.append("MCAN1 "); + } + uint32_t id = readId(rxBuf.id); + const uint8_t msgLength = convertDlcToLength(rxBuf.dlc); + message.append("ID : "); + etl::to_string(id, message, etl::format_spec().hex(), true); + message.append(" Length : "); + etl::to_string(msgLength, message, true); + message.append(" Data : "); + for (uint8_t idx = 0; idx < msgLength; idx++) { + etl::to_string(rxBuf.data[idx], message, true); + message.append(" "); + } + LOG_INFO << message.c_str(); +} + +CAN::Frame CAN::Driver::getFrame(const MCAN_RX_BUFFER &rxBuffer) { + CAN::Frame frame; + const uint8_t messageLength = convertDlcToLength(rxBuffer.dlc); + + frame.id = readId(rxBuffer.id); + for (uint8_t idx = 0; idx < messageLength; idx++) { + frame.data.at(idx) = rxBuffer.data[idx]; + } + + return frame; +} + +void CAN::Driver::initialize() { + MCAN0_MessageRAMConfigSet(CAN::Driver::mcan0MessageRAM); + MCAN1_MessageRAMConfigSet(CAN::Driver::mcan1MessageRAM); + + MCAN0_TxFifoCallbackRegister(CAN::Driver::mcan0TxFifoCallback, CAN::Driver::Transmit); + MCAN0_RxFifoCallbackRegister(MCAN_RX_FIFO_0, CAN::Driver::mcan0RxFifo0Callback, CAN::Driver::Receive); + MCAN0_RxFifoCallbackRegister(MCAN_RX_FIFO_1, CAN::Driver::mcan0RxFifo1Callback, CAN::Driver::Receive); + + MCAN1_TxFifoCallbackRegister(CAN::Driver::mcan1TxFifoCallback, CAN::Driver::Transmit); + MCAN1_RxFifoCallbackRegister(MCAN_RX_FIFO_0, CAN::Driver::mcan1RxFifo0Callback, CAN::Driver::Receive); + MCAN1_RxFifoCallbackRegister(MCAN_RX_FIFO_1, CAN::Driver::mcan1RxFifo1Callback, CAN::Driver::Receive); +} diff --git a/src/Platform/CAN/TPProtocol.cpp b/src/Platform/CAN/TPProtocol.cpp new file mode 100644 index 0000000..a73d039 --- /dev/null +++ b/src/Platform/CAN/TPProtocol.cpp @@ -0,0 +1,156 @@ +#include "CAN/TPProtocol.hpp" +#include "CANGatekeeperTask.hpp" + +using namespace CAN; + +void TPProtocol::processSingleFrame(const CAN::Frame &message) { + TPMessage tpMessage; + tpMessage.decodeId(message.id); + + if (not (tpMessage.idInfo.isMulticast or tpMessage.idInfo.destinationAddress == NodeID)) { + return; + } + + size_t messageSize = message.data[0] & 0b111111; + for (size_t idx = 1; idx <= messageSize; idx++) { + tpMessage.appendUint8(message.data[idx]); + } + + parseMessage(tpMessage); +} + +void TPProtocol::processMultipleFrames() { + TPMessage message; + uint8_t incomingMessagesCount = canGatekeeperTask->getIncomingMessagesCount(); + uint16_t dataLength = 0; + bool receivedFirstFrame = false; + + for (uint8_t messageCounter = 0; messageCounter < incomingMessagesCount; messageCounter++) { + CAN::Frame frame = canGatekeeperTask->getFromQueue(); + auto frameType = static_cast(frame.data[0] >> 6); + + if (not receivedFirstFrame) { + if (frameType == First) { + message.decodeId(frame.id); + dataLength = ((frame.data[0] & 0b111111) << 8) | frame.data[1]; + receivedFirstFrame = true; + } + } else { + uint8_t consecutiveFrameCount = frame.data[0] & 0b111111; + if (not ErrorHandler::assertInternal(messageCounter == consecutiveFrameCount, + ErrorHandler::InternalErrorType::UnacceptablePacket)) { //TODO: Add a more appropriate enum value + canGatekeeperTask->emptyIncomingQueue(); + return; + } + + for (size_t idx = 1; idx < CAN::Frame::MaxDataLength; idx++) { + message.appendUint8(frame.data[idx]); + if (message.dataSize >= dataLength) { + break; + } + } + } + } + + if (not (message.idInfo.isMulticast or message.idInfo.destinationAddress == NodeID)) { + return; + } + + parseMessage(message); +} + +void TPProtocol::parseMessage(TPMessage &message) { + uint8_t messageType = static_cast(message.data[0]); + switch (messageType) { + case CAN::Application::SendParameters: + CAN::Application::parseSendParametersMessage(message); + break; + case CAN::Application::RequestParameters: + CAN::Application::parseRequestParametersMessage(message); + break; + case CAN::Application::PerformFunction: + break; //todo: use ST[08] to execute the perform function command + case CAN::Application::EventReport: + break; //todo: use the Event Report service + case CAN::Application::TMPacket: + CAN::Application::parseTMMessage(message); + break; + case CAN::Application::TCPacket: + CAN::Application::parseTCMessage(message); + break; + case CAN::Application::CCSDSPacket: + break; //todo send this to comms? idk + case CAN::Application::Ping: { + auto senderID = static_cast(message.idInfo.sourceAddress); + auto senderName = CAN::Application::nodeIdToString.at(senderID); + LOG_DEBUG << "Received ping from " << senderName.c_str(); + CAN::Application::sendPongMessage(); + } + break; + case CAN::Application::Pong: { + auto senderID = static_cast(message.idInfo.sourceAddress); + auto senderName = CAN::Application::nodeIdToString.at(senderID); + LOG_DEBUG << "Received pong from " << senderName.c_str(); + } + break; + case CAN::Application::LogMessage: { + auto senderID = static_cast(message.idInfo.sourceAddress); + auto senderName = CAN::Application::nodeIdToString.at(senderID); + String logSource = "Incoming Log from "; + logSource.append(senderName); + logSource.append(": "); + auto logData = String(message.data + 1, message.dataSize - 1); + LOG_DEBUG << logSource.c_str() << logData.c_str(); + } + break; + default: + ErrorHandler::reportInternalError(ErrorHandler::UnknownMessageType); + break; + } +} + +void TPProtocol::createCANTPMessage(const TPMessage &message, bool isISR) { + size_t messageSize = message.dataSize; + uint32_t id = message.encodeId(); + // Data fits in a Single Frame + if (messageSize <= UsableDataLength) { + etl::array data = { + static_cast(((Single << 6) & 0xFF) | (messageSize & 0b111111))}; + for (size_t idx = 0; idx < messageSize; idx++) { + data.at(idx + 1) = message.data[idx]; + } + canGatekeeperTask->send({id, data}, isISR); + + return; + } + + // First Frame + { + // 4 MSB bits is the Frame Type identifier and the 4 LSB are the leftmost 4 bits of the data length. + uint8_t firstByte = (First << 6) | ((messageSize >> 8) & 0b111111); + // Rest of the data length. + uint8_t secondByte = messageSize & 0xFF; + + etl::array firstFrame = {firstByte, secondByte}; + + canGatekeeperTask->send({id, firstFrame}, isISR); + } + + // Consecutive Frames + uint8_t totalConsecutiveFramesNeeded = ceil(static_cast(messageSize) / UsableDataLength); + for (uint8_t currentConsecutiveFrameCount = 1; + currentConsecutiveFrameCount <= totalConsecutiveFramesNeeded; currentConsecutiveFrameCount++) { + + uint8_t firstByte = (Consecutive << 6) | (currentConsecutiveFrameCount & 0b111111); + if (currentConsecutiveFrameCount == totalConsecutiveFramesNeeded) { + firstByte = ((Final << 6) & 0xFF) | (currentConsecutiveFrameCount & 0b111111); + } + etl::array consecutiveFrame = {firstByte}; + + for (uint8_t idx = 0; idx < UsableDataLength; idx++) { + consecutiveFrame.at(idx + 1) = message.data[idx + UsableDataLength * (currentConsecutiveFrameCount - 1)]; + } + + canGatekeeperTask->send({id, consecutiveFrame}, isISR); + } +} diff --git a/src/Platform/Logger.cpp b/src/Platform/Logger.cpp new file mode 100644 index 0000000..beae0e5 --- /dev/null +++ b/src/Platform/Logger.cpp @@ -0,0 +1,78 @@ +#include +#include +#include +#include +#include +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" +#include "SEGGER_RTT.h" +#include "ServicePool.hpp" +#include "UARTGatekeeperTask.hpp" + +void Logger::log(Logger::LogLevel level, etl::istring &message) { + etl::string levelString; + etl::string time; + + if (level <= Logger::trace) { + levelString.append("trace"); + } else if (level <= Logger::debug) { + levelString.append("debug"); + } else if (level <= Logger::info) { + levelString.append("info"); + } else if (level <= Logger::notice) { + levelString.append("notice"); + } else if (level <= Logger::warning) { + levelString.append("warning"); + } else if (level <= Logger::error) { + levelString.append("error"); + } else { + levelString = "emergency"; + } + + while (levelString.available()) { + levelString.append(" "); + } + + etl::to_string(xTaskGetTickCount(), time, format.width(MaxTickCountStringSize), 0); + + etl::string output; + output.append(time.c_str()); + output.append(" ["); + output.append(levelString.c_str()); + output.append("] "); + + etl::string subsystemString = LogSource::currentSubsystem; + if (LogSource::currentSubsystem.empty()) { + subsystemString = "None "; + } + while (subsystemString.available()) { + subsystemString.append(" "); + } + output.append(subsystemString.c_str()); + + output.append(message.c_str()); + output.append("\n"); + + if (CommonParameters::useRTT.getValue()) { + SEGGER_RTT_printf(0, output.c_str()); + } + if (CommonParameters::useUART.getValue()) { + if (uartGatekeeperTask) { + uartGatekeeperTask->addToQueue(output); + } + } + if (CommonParameters::useCAN.getValue()) { + Services.dummyService.logAsECSSMessage(output); + } +} + +template<> +void convertValueToString(String& message, char* value) { + message.append(value); +} + +template<> +void convertValueToString(String& message, const char* value) { + message.append(value); +} diff --git a/src/Platform/Parameters/BootCounter.cpp b/src/Platform/Parameters/BootCounter.cpp new file mode 100644 index 0000000..270e85a --- /dev/null +++ b/src/Platform/Parameters/BootCounter.cpp @@ -0,0 +1,25 @@ +#include "BootCounter.hpp" + +namespace BootCounter { + void clearRegisters() { + GPBRWrite(UnexpectedResetRegister, ClearRegisterValue); + GPBRWrite(BootCounterRegister, ClearRegisterValue); + } + + void setRegisters() { + if (GPBRRead(UnexpectedResetRegister) == SoftwareResetValue) { + return; + } + + GPBRWrite(UnexpectedResetRegister, SoftwareResetValue); + GPBRWrite(BootCounterRegister, ClearRegisterValue); + } + + void incrementBootCounter() { + if (GPBRRead(BootCounterRegister) > BootCounterLimit) { + clearRegisters(); + } + setRegisters(); + GPBRWrite(BootCounterRegister, GPBRRead(BootCounterRegister) + 1); + } +} diff --git a/src/Platform/TaskInitialization.cpp b/src/Platform/TaskInitialization.cpp new file mode 100644 index 0000000..37354f4 --- /dev/null +++ b/src/Platform/TaskInitialization.cpp @@ -0,0 +1,15 @@ +#include "TaskInitialization.hpp" + +void initializeTasks() { + uartGatekeeperTask.emplace(); + timeKeepingTask.emplace(); + ambientTemperatureTask.emplace(); + watchdogTask.emplace(); + mcuTemperatureTask.emplace(); + + ambientTemperatureTask->createTask(); + mcuTemperatureTask->createTask(); + timeKeepingTask->createTask(); + uartGatekeeperTask->createTask(); + watchdogTask->createTask(); +} diff --git a/src/Platform/TimeGetter.cpp b/src/Platform/TimeGetter.cpp new file mode 100644 index 0000000..be2dced --- /dev/null +++ b/src/Platform/TimeGetter.cpp @@ -0,0 +1,10 @@ +#include "Helpers/TimeGetter.hpp" +#include "CommonParameters.hpp" + +UTCTimestamp TimeGetter::getCurrentTimeUTC() { + return getCurrentTimeDefaultCUC().toUTCtimestamp(); +} + +Time::DefaultCUC TimeGetter::getCurrentTimeDefaultCUC() { + return CommonParameters::time.getValue(); +} \ No newline at end of file From b13049c0597d7c849849d9f94e4a99372b9b3a75 Mon Sep 17 00:00:00 2001 From: sourland Date: Thu, 18 Jan 2024 10:54:28 +0200 Subject: [PATCH 3/4] fix conan branch switch --- conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index c93e9cf..6aea802 100644 --- a/conanfile.py +++ b/conanfile.py @@ -37,8 +37,7 @@ def source(self): git.clone(url="git@github.com:cmcqueen/cobs-c.git", target=join(str(self.source_folder), "lib/cobs-c")) git = Git(self) git.clone(url="git@gitlab.com:acubesat/obc/atsam-component-drivers.git", target=join(str(self.source_folder), "lib/atsam-component-drivers")) - self.run("cd lib/atsam-component-drivers") - self.run("git checkout NAND-partial-implementation") + self.run("cd lib/atsam-component-drivers && git checkout NAND-partial-implementation") def layout(self): cmake_layout(self) From 388ae8bb21a722f5e845a5ff3da707d70b40e1b3 Mon Sep 17 00:00:00 2001 From: sourland Date: Thu, 25 Jan 2024 13:54:51 +0200 Subject: [PATCH 4/4] fix can --- src/FreeRTOSTasks/CANTestTask.cpp | 7 ++++--- src/Platform/CAN/Driver.cpp | 9 +++++---- src/Platform/TaskInitialization.cpp | 4 ++-- src/main.cpp | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/FreeRTOSTasks/CANTestTask.cpp b/src/FreeRTOSTasks/CANTestTask.cpp index abfd436..0247bf5 100644 --- a/src/FreeRTOSTasks/CANTestTask.cpp +++ b/src/FreeRTOSTasks/CANTestTask.cpp @@ -7,9 +7,10 @@ void CANTestTask::execute() { frame.data.at(i) = i; } + String testPayload("WHO LIVES IN A PINEAPPLE UNDER THE SEA?"); while (true) { - CAN::Application::sendPingMessage(CAN::ADCS, false); - canGatekeeperTask->send(frame); - vTaskDelay(pdMS_TO_TICKS(2000)); + CAN::Application::createLogMessage(CAN::NodeIDs::OBC, false, testPayload.data(), false); + xTaskNotify(canGatekeeperTask->taskHandle, 0, eNoAction); + vTaskDelay(pdMS_TO_TICKS(1000)); } } \ No newline at end of file diff --git a/src/Platform/CAN/Driver.cpp b/src/Platform/CAN/Driver.cpp index c0fa1fd..f46736e 100644 --- a/src/Platform/CAN/Driver.cpp +++ b/src/Platform/CAN/Driver.cpp @@ -150,18 +150,19 @@ void CAN::Driver::send(const CAN::Frame &message) { memset(&Driver::txFifo, 0, MCAN1_TX_FIFO_BUFFER_ELEMENT_SIZE); - Driver::txFifo.brs = 1; + Driver::txFifo.brs = 0; Driver::txFifo.fdf = 1; Driver::txFifo.xtd = 0; Driver::txFifo.id = Driver::writeId(message.id); Driver::txFifo.dlc = Driver::convertLengthToDLC(message.data.size()); std::copy(message.data.begin(), message.data.end(), Driver::txFifo.data); - + MCAN1_MessageTransmitFifo(1, &Driver::txFifo); + MCAN0_MessageTransmitFifo(1, &Driver::txFifo); if (AcubeSATParameters::obcCANBUSActive.getValue() == Main) { - MCAN0_MessageTransmitFifo(1, &Driver::txFifo); + } else { - MCAN1_MessageTransmitFifo(1, &Driver::txFifo); + } } diff --git a/src/Platform/TaskInitialization.cpp b/src/Platform/TaskInitialization.cpp index 37354f4..33031d7 100644 --- a/src/Platform/TaskInitialization.cpp +++ b/src/Platform/TaskInitialization.cpp @@ -3,11 +3,11 @@ void initializeTasks() { uartGatekeeperTask.emplace(); timeKeepingTask.emplace(); - ambientTemperatureTask.emplace(); +// ambientTemperatureTask.emplace(); watchdogTask.emplace(); mcuTemperatureTask.emplace(); - ambientTemperatureTask->createTask(); +// ambientTemperatureTask->createTask(); mcuTemperatureTask->createTask(); timeKeepingTask->createTask(); uartGatekeeperTask->createTask(); diff --git a/src/main.cpp b/src/main.cpp index 678b1aa..ad0a2d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,14 +39,14 @@ extern "C" void main_cpp() { housekeepingTask.emplace(); canGatekeeperTask.emplace(); canTestTask.emplace(); - nandTask.emplace(); +// nandTask.emplace(); mramTask.emplace(); tcHandlingTask->createTask(); housekeepingTask->createTask(); canGatekeeperTask->createTask(); canTestTask->createTask(); - nandTask->createTask(); +// nandTask->createTask(); mramTask->createTask(); vTaskStartScheduler();