Skip to content

[STM32CubeProg] Add an offset for upload? #57

@GIPdA

Description

@GIPdA

Hello

I'm using the STM32CubeProgrammer to upload, and I just had the use of an address offset, to upload code via Arduino without overwriting my custom bootloader.

I modified the upload script for my purposes, but it may be useful to add it properly as a feature/option? (and I wouldn't need to modify everything again after updates :P )

I added this to the upload script:

case $1 in
    -o|--offset)
    OFFSET=$2
    ADDRESS=$((ADDRESS+OFFSET))
    shift # past argument
    shift # past value
    ;;
esac

And to the boards.txt file:

GenF3.menu.pnum.MY_BOARD.upload.extra_options=-o 0x2800
...
GenF3.menu.upload_method.swdMethod.upload.options={upload.extra_options} -g

I'm no expert in scripts or Arduino's board definitions syntax, maybe there's a better way?
I can add a pull request if desired and if the way I did it seems suited. What do you think?

Cheers,
Benjamin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions