Skip to content

Commit

Permalink
MPLabX test-app project: include libwolfboot
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinux committed Jan 18, 2024
1 parent 42d496d commit 422f6c9
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 39 deletions.
3 changes: 2 additions & 1 deletion .gdbinit
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tar rem:3333
file wolfboot.elf
add-symbol-file test-app/image.elf
#add-symbol-file test-app/image.elf
add-symbol-file /home/dan/src/wolfboot/IDE/MPLabX/wolfBoot_usbUpdateApp.X/dist/default/production/wolfBoot_usbUpdateApp.X.production.elf
foc c


15 changes: 1 addition & 14 deletions IDE/MPLabX/wolfBoot-SAME51.X/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,11 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/home/dan/src/wolfboot/hal/same51.c</file>
<file>file:/home/dan/src/wolfboot/include/target.h</file>
<file>file:/home/dan/src/wolfboot/include/image.h</file>
<file>file:/home/dan/src/wolfboot/include/loader.h</file>
<file>file:/home/dan/src/wolfboot/src/update_flash.c</file>
<file>file:/home/dan/src/wolfboot/IDE/MPLabX/wolfBoot_usbUpdateApp.X/startup_same51j20a.c</file>
<file>file:/home/dan/src/wolfboot/src/loader.c</file>
<file>file:/home/dan/src/wolfboot/IDE/MPLabX/wolfBoot-SAME51.X/Makefile</file>
<file>file:/home/dan/src/wolfboot/hal/same51.ld</file>
<file>file:/home/dan/src/wolfboot/src/image.c</file>
<file>file:/home/dan/src/wolfboot/IDE/MPLabX/wolfBoot_usbUpdateApp.X/same51j20a_flash.ld</file>
<file>file:/home/dan/src/wolfboot/src/string.c</file>
<file>file:/home/dan/src/wolfboot/IDE/MPLabX/wolfBoot_usbUpdateApp.X/system_same51j20a.c</file>
<file>file:/home/dan/src/wolfboot/include/wolfboot/wolfboot.h</file>
<file>file:/home/dan/src/wolfboot/src/libwolfboot.c</file>
<file>file:/home/dan/src/wolfboot/IDE/MPLabX/wolfBoot_usbUpdateApp.X/main.c</file>
<file>file:/home/dan/src/wolfboot/src/keystore.c</file>
<file>file:/home/dan/src/wolfboot/src/update_flash_hwswap.c</file>
<file>file:/home/dan/src/wolfboot/IDE/MPLabX/wolfBoot-SAME51.X/Makefile</file>
</group>
</open-files>
</project-private>
3 changes: 3 additions & 0 deletions IDE/MPLabX/wolfBoot_usbUpdateApp.X/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@

#include <stdio.h>
#include <stdlib.h>
#include "wolfboot/wolfboot.h"


/*
*
*/
int main(int argc, char** argv) {
wolfBoot_success();

while (1)
asm volatile ("wfi");
Expand Down
58 changes: 41 additions & 17 deletions IDE/MPLabX/wolfBoot_usbUpdateApp.X/nbproject/Makefile-default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}

# Source Files Quoted if spaced
SOURCEFILES_QUOTED_IF_SPACED=startup_same51j20a.c system_same51j20a.c main.c
SOURCEFILES_QUOTED_IF_SPACED=startup_same51j20a.c system_same51j20a.c main.c ../../../src/libwolfboot.c ../../../hal/same51.c

# Object Files Quoted if spaced
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/startup_same51j20a.o ${OBJECTDIR}/system_same51j20a.o ${OBJECTDIR}/main.o
POSSIBLE_DEPFILES=${OBJECTDIR}/startup_same51j20a.o.d ${OBJECTDIR}/system_same51j20a.o.d ${OBJECTDIR}/main.o.d
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/startup_same51j20a.o ${OBJECTDIR}/system_same51j20a.o ${OBJECTDIR}/main.o ${OBJECTDIR}/_ext/1386528437/libwolfboot.o ${OBJECTDIR}/_ext/1386517348/same51.o
POSSIBLE_DEPFILES=${OBJECTDIR}/startup_same51j20a.o.d ${OBJECTDIR}/system_same51j20a.o.d ${OBJECTDIR}/main.o.d ${OBJECTDIR}/_ext/1386528437/libwolfboot.o.d ${OBJECTDIR}/_ext/1386517348/same51.o.d

# Object Files
OBJECTFILES=${OBJECTDIR}/startup_same51j20a.o ${OBJECTDIR}/system_same51j20a.o ${OBJECTDIR}/main.o
OBJECTFILES=${OBJECTDIR}/startup_same51j20a.o ${OBJECTDIR}/system_same51j20a.o ${OBJECTDIR}/main.o ${OBJECTDIR}/_ext/1386528437/libwolfboot.o ${OBJECTDIR}/_ext/1386517348/same51.o

# Source Files
SOURCEFILES=startup_same51j20a.c system_same51j20a.c main.c
SOURCEFILES=startup_same51j20a.c system_same51j20a.c main.c ../../../src/libwolfboot.c ../../../hal/same51.c

# Pack Options
PACK_COMMON_OPTIONS=-I "${DFP_DIR}/include" -I "${CMSIS_DIR}/CMSIS/Core/Include"
Expand Down Expand Up @@ -103,42 +103,66 @@ endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: compile
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${OBJECTDIR}/startup_same51j20a.o: startup_same51j20a.c .generated_files/flags/default/266835027f1c66a22b2cebc9ad2a636c2acd2834 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
${OBJECTDIR}/startup_same51j20a.o: startup_same51j20a.c .generated_files/flags/default/227bf08d8249cfdb3a1dd412eeadf59e1f401bdb .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/startup_same51j20a.o.d
@${RM} ${OBJECTDIR}/startup_same51j20a.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/startup_same51j20a.o.d" -o ${OBJECTDIR}/startup_same51j20a.o startup_same51j20a.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../../../include" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/startup_same51j20a.o.d" -o ${OBJECTDIR}/startup_same51j20a.o startup_same51j20a.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)

${OBJECTDIR}/system_same51j20a.o: system_same51j20a.c .generated_files/flags/default/ba387db6506ddb8f987a69df1a74ec0d3eef8db3 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
${OBJECTDIR}/system_same51j20a.o: system_same51j20a.c .generated_files/flags/default/37cc62d7e3d8803d2f03966ac2486806abba6ed8 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/system_same51j20a.o.d
@${RM} ${OBJECTDIR}/system_same51j20a.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/system_same51j20a.o.d" -o ${OBJECTDIR}/system_same51j20a.o system_same51j20a.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../../../include" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/system_same51j20a.o.d" -o ${OBJECTDIR}/system_same51j20a.o system_same51j20a.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)

${OBJECTDIR}/main.o: main.c .generated_files/flags/default/49e09785ee8b5e59c6bdfea009ff02a2c195819 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
${OBJECTDIR}/main.o: main.c .generated_files/flags/default/4b883f0a456f349c7fe2f514cc539a0f0c919e54 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/main.o.d
@${RM} ${OBJECTDIR}/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/main.o.d" -o ${OBJECTDIR}/main.o main.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../../../include" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/main.o.d" -o ${OBJECTDIR}/main.o main.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)

${OBJECTDIR}/_ext/1386528437/libwolfboot.o: ../../../src/libwolfboot.c .generated_files/flags/default/8b2bb306f3cc0d6937fe247a82c65e4cfe2266a0 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/_ext/1386528437"
@${RM} ${OBJECTDIR}/_ext/1386528437/libwolfboot.o.d
@${RM} ${OBJECTDIR}/_ext/1386528437/libwolfboot.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../../../include" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1386528437/libwolfboot.o.d" -o ${OBJECTDIR}/_ext/1386528437/libwolfboot.o ../../../src/libwolfboot.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)

${OBJECTDIR}/_ext/1386517348/same51.o: ../../../hal/same51.c .generated_files/flags/default/d16e0c50d565fb975f3e7325c0883f0d30ab13d0 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/_ext/1386517348"
@${RM} ${OBJECTDIR}/_ext/1386517348/same51.o.d
@${RM} ${OBJECTDIR}/_ext/1386517348/same51.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -g -D__DEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../../../include" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1386517348/same51.o.d" -o ${OBJECTDIR}/_ext/1386517348/same51.o ../../../hal/same51.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)

else
${OBJECTDIR}/startup_same51j20a.o: startup_same51j20a.c .generated_files/flags/default/9f4b4bd2f996ada19fbde8c04519e12d0d1596b8 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
${OBJECTDIR}/startup_same51j20a.o: startup_same51j20a.c .generated_files/flags/default/8359dfa65ced3fc08a65768a20be9b8f4f59f0bc .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/startup_same51j20a.o.d
@${RM} ${OBJECTDIR}/startup_same51j20a.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/startup_same51j20a.o.d" -o ${OBJECTDIR}/startup_same51j20a.o startup_same51j20a.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../../../include" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/startup_same51j20a.o.d" -o ${OBJECTDIR}/startup_same51j20a.o startup_same51j20a.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)

${OBJECTDIR}/system_same51j20a.o: system_same51j20a.c .generated_files/flags/default/39fd1a6cdcc4067182b19e40e5b25cd58230930f .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
${OBJECTDIR}/system_same51j20a.o: system_same51j20a.c .generated_files/flags/default/25414ef865ff4887ff2ba1c951132cf553dce327 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/system_same51j20a.o.d
@${RM} ${OBJECTDIR}/system_same51j20a.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/system_same51j20a.o.d" -o ${OBJECTDIR}/system_same51j20a.o system_same51j20a.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../../../include" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/system_same51j20a.o.d" -o ${OBJECTDIR}/system_same51j20a.o system_same51j20a.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)

${OBJECTDIR}/main.o: main.c .generated_files/flags/default/eebcae32a2b5f7279a7c29803829db2b62fbbd1b .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
${OBJECTDIR}/main.o: main.c .generated_files/flags/default/6660876d8b57ca1dba5af5cabdc4f438004043a4 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/main.o.d
@${RM} ${OBJECTDIR}/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/main.o.d" -o ${OBJECTDIR}/main.o main.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../../../include" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/main.o.d" -o ${OBJECTDIR}/main.o main.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)

${OBJECTDIR}/_ext/1386528437/libwolfboot.o: ../../../src/libwolfboot.c .generated_files/flags/default/1365789152c7cd40f3031ed411ba9e3b0891e067 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/_ext/1386528437"
@${RM} ${OBJECTDIR}/_ext/1386528437/libwolfboot.o.d
@${RM} ${OBJECTDIR}/_ext/1386528437/libwolfboot.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../../../include" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1386528437/libwolfboot.o.d" -o ${OBJECTDIR}/_ext/1386528437/libwolfboot.o ../../../src/libwolfboot.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)

${OBJECTDIR}/_ext/1386517348/same51.o: ../../../hal/same51.c .generated_files/flags/default/38a43373eea8173c482685a440dc93188d64817b .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/_ext/1386517348"
@${RM} ${OBJECTDIR}/_ext/1386517348/same51.o.d
@${RM} ${OBJECTDIR}/_ext/1386517348/same51.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=cortex-m4 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -mthumb -I "../../../include" ${PACK_COMMON_OPTIONS} -Os -ffunction-sections -mlong-calls -Wall -MP -MMD -MF "${OBJECTDIR}/_ext/1386517348/same51.o.d" -o ${OBJECTDIR}/_ext/1386517348/same51.o ../../../hal/same51.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)

endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#
#Thu Jan 18 11:39:43 CET 2024
#Thu Jan 18 15:10:16 CET 2024
default.languagetoolchain.version=12.2.1
default.com-microchip-mplab-nbide-toolchain-arm-ARMLanguageToolchain.md5=c33efee51d7853b82066e227bca20492
default.Pack.dfplocation=/opt/microchip/mplabx/v6.15/packs/Microchip/SAME51_DFP/3.7.242
conf.ids=default
default.languagetoolchain.dir=/usr/bin
host.id=130a-gnot-23
configurations-xml=f236b96cf6f4f80083dfa8c84d6eb609
configurations-xml=7eafda18e0c159c9ccbe22544f660f14
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=e62346c0c0ecee2637e613b49cb7b7fa
default.com-microchip-mplab-mdbcore-JLink-JLinkImpl.md5=09370ac9c9e001d99845a6c8b21609d2
proj.dir=/home/dan/src/wolfboot/IDE/MPLabX/wolfBoot_usbUpdateApp.X
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ MP_CPPC_DIR="/usr/bin"
MP_AS_DIR="/usr/bin"
MP_LD_DIR="/usr/bin"
MP_AR_DIR="/usr/bin"
DFP_DIR=/opt/microchip/mplabx/v6.15/packs/Microchip/SAME51_DFP/3.7.242
CMSIS_DIR=/opt/microchip/mplabx/v6.15/packs/arm/CMSIS/5.4.0
DFP_DIR=/opt/microchip/mplabx/v6.15/packs/Microchip/SAME51_DFP/3.7.242
Loading

0 comments on commit 422f6c9

Please sign in to comment.