- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a recommended procedure from Infineon for Debugging a PSOC6 DFU application in Modus Toolbox?
In the case of Psoc Creator and PSOC4, the usual routine ()although not entirely graceful) was to manually disable the 'Bootloadable Component'.
I see another user posted this question, noting the issues around the CRC Validation steps failing when in debug mode, and a kludgey workaround to manually edit the binaries, but there wasn't much of a response:
This seems to be a common enough scenario to warrant some tool, procedure, or configuration hooks from Infineon to allow for DFU debug in applications that have a bootloader (aka App0).
Solved! Go to Solution.
- Labels:
-
ModusToolbox General
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@John_K assuming you meant debugging app1, not app0 the loader, my workaround is to link the only the Release config for DFU. Then your IDE debug links work they way they used to, and you don't even have the loader onboard. Put this condition in the makefile for app1:
ifeq ($(shell tr '[:lower:]' '[:upper:]' <<< $(CONFIG)), RELEASE)
# Path to the linker script to use (if empty, use the default linker script).
LINKER_SCRIPT=dfu_cm4_app1.ld
# Custom pre-build commands to run.
PREBUILD=
# Custom post-build commands to run.
POSTBUILD="$(CY_MCUELFTOOL_DIR)/bin/cymcuelftool.exe" --sign $(CY_CONFIG_DIR)/$(APPNAME).elf CRC --output $(APPNAME)_crc.elf && \
"$(CY_MCUELFTOOL_DIR)/bin/cymcuelftool.exe" -P $(APPNAME)_crc.elf --output $(APPNAME)_crc.cyacd2
else
LINKER_SCRIPT=
PREBUILD=
POSTBUILD=
endif
$(info Linker Script: $(LINKER_SCRIPT))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
One recommendation would be to comment Cy_DFU_OnResetApp0(); API in main.c file and then debug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@John_K assuming you meant debugging app1, not app0 the loader, my workaround is to link the only the Release config for DFU. Then your IDE debug links work they way they used to, and you don't even have the loader onboard. Put this condition in the makefile for app1:
ifeq ($(shell tr '[:lower:]' '[:upper:]' <<< $(CONFIG)), RELEASE)
# Path to the linker script to use (if empty, use the default linker script).
LINKER_SCRIPT=dfu_cm4_app1.ld
# Custom pre-build commands to run.
PREBUILD=
# Custom post-build commands to run.
POSTBUILD="$(CY_MCUELFTOOL_DIR)/bin/cymcuelftool.exe" --sign $(CY_CONFIG_DIR)/$(APPNAME).elf CRC --output $(APPNAME)_crc.elf && \
"$(CY_MCUELFTOOL_DIR)/bin/cymcuelftool.exe" -P $(APPNAME)_crc.elf --output $(APPNAME)_crc.cyacd2
else
LINKER_SCRIPT=
PREBUILD=
POSTBUILD=
endif
$(info Linker Script: $(LINKER_SCRIPT))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I did mean debugging App1.
I like your approach very much and that looks pretty clean.
Infineon,
I think you should review and add something like this to the basic dfu upgrade sample projects (along with the sdk documentation). This should be a very common thing that customers will want (ability to debug a DFU application in this environment).