- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For safety critical reasons, I need app1 to periodically check the integrity of its own image at run time. I knew the App0/bootloader was doing this, so I checked out the function it used to do this, Cy_DFU_ValidateApp. I simplified this down to:
bool ValidateApp1( void )
{
uint32_t appVerifyStartAddress;
uint32_t appVerifySize;
cy_en_dfu_status_t status = Cy_DFU_GetAppMetadata(1, &appVerifyStartAddress, &appVerifySize);
if (status == CY_DFU_SUCCESS)
{
uint32_t appCrc = Cy_DFU_DataChecksum((uint8_t *)appVerifyStartAddress, appVerifySize, NULL);
uint32_t appFooterAddress = (appVerifyStartAddress + appVerifySize);
status = (*(uint32_t*)appFooterAddress == appCrc) ? CY_DFU_SUCCESS : CY_DFU_ERROR_VERIFY;
}
return (status == CY_DFU_SUCCESS);
}
My first attempt to compile this threw the following error:
Build error_ undefined reference to '__cy_boot_metadata_addr' in file cy_dfu.c.
After a little more tracing through how the App0/bootloader did business, I figured I could resolve this error by adding the line
#include "dfu_mdk_common.h"
to App1's version of dfu_user.h .
Now when I try to build App1, I get the error:
Build error: expected '(' before 'void' in file dfu_mdk_common.h at line 109, column 7.
And that line is:
__asm void cy_DFU_mdkAsmDummy(void);
And that error has me totally bewildered. I believe dfu_mdk_common.h is provided as part of the DFU ecosystem, it seems it should build as-is without an error. And I have absolutely no idea what the compiler is complaining about.
Can anybody give me a suggestion on how to resolve this error?
Thanks, Ed H.
Solved! Go to Solution.
- Labels:
-
PSoC 6 MCU
- Tags:
- cyble-416045-02
- dfu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, but that didn't help at all.
Let me come at it from a different direction. I DON'T want to use a boot loader. I DO want to use just a single main app. I DON'T want to do DFUs. And I DO want my image for the single main app to include the checksum that can be generated by the ELF file and I DO want my single main to self-check this checksum.
How do I modify cy8c6xx7_cm4_dual.ld so that the elf tool will find and fill in the checksum, and how do I check that the code image for the single main app is correct from within the single main app itself?
Thanks,
Ed H.