Bootloader checksum test verification

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
D_Sd_3235936
Level 4
Level 4
25 sign-ins 50 questions asked 25 replies posted

As a part of a validation process of a PSOC4 device i am working on, i will be needing to check corrupted code on flash.

I am using a bootloader app to update code via CySmart.

I would like to check the bootlader app checksum test, by writing to some arbitrary flash location (by that corrupting the checksum). and restarting app.

How can i do that kind of writing to code location?

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Please use CySysFlashWriteRow(uint32 rowNum, const uint8 rowData[]) to corrupt bootloader flash row. Select an appropriate flash row nmber that comes in bootloadere flash area. Please refer to PSoC 4 System Reference Guide​ for more details on API.

View solution in original post

0 Likes
3 Replies
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Please use CySysFlashWriteRow(uint32 rowNum, const uint8 rowData[]) to corrupt bootloader flash row. Select an appropriate flash row nmber that comes in bootloadere flash area. Please refer to PSoC 4 System Reference Guide​ for more details on API.

0 Likes

how do i know the first address of application?

And first address of bootloader?

This is the case i am handling :

Case # 1. Bootloadable application

     *

     *  _______________________________

     * | Metadata (BTLDBL)             |

     * |-------------------------------|

     * | Checksum Exclude (BTLDBL)     |

     * |-------------------------------|

     * |                               |

     * |                               |

     * |                               |

     * |-------------------------------|

     * |                               |

     * |                               |

     * |                               |

     * | BTLDBL                        |

     * |                               |

     * |                               |

     * |                               |

     * |-------------------------------|

     * |                               |

     * | BTLDR                         |

     * |_______________________________|

     *

Breakpoint and debug doesn't work for me through psoc creator.

0 Likes
  • Bootloader run first after device reset and start from flash address zero ie, zeroth flash row. Please note that CySysFlashWriteRow API require flash row number as the parameter.
  • Bootloadable resides after bootloader in flash. Bootloadable start address depends on the bootloader flash consumption and bootloadable configuration.
    • Unless specified, bootloadable occupies flash starting from the next empty flash row to the bootloader application. When the bootloader is built, PSoC Creator Output window shows the amount of flash consumption in bytes. For flash row usage, divide the flash used with the device specific flash row size in bytes. Bootloadable occupies from the next empty flash row. For flash row size in bytes, refer to Table 1-1. Programming Values of Programming Specifications.
    • If the Manual application image placement option in the Bootloadable Component Configure dialog is enabled, the bootloadable application is placed at an address specified by the Placement address option. Divide the placement address with the flash row size for bootloadable start flash row number.
  • Bootloadable project do not support Debug option. It supports Attach to Running Target only. Both project support breakpoints. Are you getting any error while placing the break point? For more details, please refer to section: Debugging Bootloadable Projects of AN73854.
0 Likes