stm32duino / Arduino_Tools

Contains upload tools for STM32 based boards
Other
87 stars 63 forks source link

[STM32CubeProg] Add offset option for upload #60

Closed ricaun closed 1 year ago

ricaun commented 4 years ago

By issue #57 and using the @GIPdA idea.

Add an option command to offset the upload address. Ex: -o 0x5000

The already implemented parameter build.flash_offset can be used to upload on the 0x08005000 using the stm32CubeProg tool like this board configuration.

GenF1.menu.upload_method.serialMethod2=STM32CubeProgrammer (Serial) - Bootloader
GenF1.menu.upload_method.serialMethod2.upload.protocol=1
GenF1.menu.upload_method.serialMethod2.upload.options={serial.port.file} -s
GenF1.menu.upload_method.serialMethod2.upload.tool=stm32CubeProg
GenF1.menu.upload_method.serialMethod2.build.flash_offset=0x5000
GenF1.menu.upload_method.serialMethod2.build.bootloader_flags=-DVECT_TAB_OFFSET={build.flash_offset}

It needs to change the platform.txt on the Arduino_Core_STM32 and add -o {build.flash_offset} on the upload pattern.

tools.stm32CubeProg.upload.pattern="{path}/{cmd}" {upload.protocol} "{build.path}/{build.project_name}.bin" {upload.options} -o {build.flash_offset}

This should make all the boards with build.flash_offset offset the upload when using the stm32CubeProg.

See yaa.

fpistm commented 4 years ago

@ricaun I will review this for the next release as it required more work (core update, other OS support)

fpistm commented 1 year ago

Replaced by #90