3 Replies Latest reply on Dec 26, 2018 10:27 PM by GeonaP_26

    Bootloader checksum test verification

    D.Sd_3235936

      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?

        • 1. Re: Bootloader checksum test verification
          GeonaP_26

          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.

          • 2. Re: Bootloader checksum test verification
            D.Sd_3235936

            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.

            • 3. Re: Bootloader checksum test verification
              GeonaP_26
              • 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.