Append checksum to the program

Sysprogs forums Forums VisualGDB Append checksum to the program

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24934
    wtywtykk
    Participant

    Hi,

    I would like to put a checksum to the end of flash area. I wrote a program to calculate checksum and write it to the bin file. Then I added the program to after building actions. The bin file works fine. But when I debug the program, the checksum is missing. It seems that gdb ignores the bin file and somehow the unmodified program is used. Could you tell me how to make it work in debugging environment?

    Thanks in advance.

    #24943
    support
    Keymaster

    Hi,

    If you are using OpenOCD, please try adding the mon flash write_image command to the gdb startup commands.

    #26494
    SR
    Participant

    Hi,

     

    reading your post, I managed to work this out by adding the command: “mon flash write_image erase F:/Path/To/Project/Firmware.bin 0x08000000 bin"

    I still have additional questions:

    1. When adding “mon flash write_image erase $(TargetDir)\$(TargetNameWithoutExtension).bin 0x08000000 bin” to the commands I get the following error in the GDB Session:

    mon flash write_image erase F:\Path\To\Project\Firmware.bin 0x08000000 bin
    &"mon flash write_image erase F:\\Path\\To\\Project\\Firmware.bin 0x08000000 bin\n"
    couldn't open F:PathToProjectFirmware.bin

    It seem as the windows backslashes are not escaped correctly. Is there any workaround, other than fully qualifying the file with forward slashes?

     

    2. When adding the flash command like above, VisualGDB now writes the Firmware twice to the device.

    Is it possible to override/suppress the first “default” flash, as I will override the Firmware anyway?

     

    Thanks in advance.

    Attachments:
    You must be logged in to view attached files.
    #26512
    support
    Keymaster

    Hi,

    Yes, please try using the $(TargetDir.forwardslashes)/$(TargetNameWithoutExtension) syntax.

    You can disable the regular FLASH programming via the “Program FLASH memory” setting on the Debug Settings page of VisualGDB Project Properties.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.