-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[STM32G031G8]: BOOT_LOCK is not possible to change on option bytes address 0x1FFF7870 #1194
Comments
The situation for the STM32G03 similar to the F446 #1156. |
@spflieger Appropriate |
This works for reading, but not for writing. The option bytes are not contiguous in option byte area. There is a gap at 0x1FFF7868 and there is no option byte at 0x1FFF7878 either. So we have actual only 0x70 bytes. This can be seen in Table 16. Organization of option bytes in RM0444. I reviewed the option write support. To write other registers than FLASH_OPTR requires a mayor rework of the code. |
@Ant-ON What is your opinion on that? How shall we proceed here? |
@Nightwalker-87 Need increase |
@Ant-ON: I'll push the change soon, maybe update the docs if necessary, needs testing then for verification. |
@Ant-ON: I had another look at this. @spflieger seems to have pointed out a relevant aspect with his last mention. |
Thank you for giving feedback to the stlink project.
NOTE: In order to offer sufficient and the best possible support, please read /CONTRIBUTING.md and follow the given instructions before submitting a ticket.
Bug reports and/or feature requests will be deleted, if they violate our contribution guidelines and if no issue-template is used! Thank you for your support.
In order to allow developers to isolate and target your respective issue, please take some time to select the check boxes below and fill out each of the following items appropriate to your specific problem.
st-info
,st-flash
,st-trace
,st-util
)Further we kindly ask you to describe the detected problem as detailed as possible and to add debug output if available, by using the following template:
Commandline output:
./st-flash --debug write output.bin 0x1FFF7870
st-flash 1.7.0-120-gbeffed4-dirty
2021-10-18T09:03:32 DEBUG common.c: *** looking up stlink version
2021-10-18T09:03:32 DEBUG common.c: st vid = 0x0483 (expect 0x0483)
2021-10-18T09:03:32 DEBUG common.c: stlink pid = 0x374e
2021-10-18T09:03:32 DEBUG common.c: stlink version = 0x3
2021-10-18T09:03:32 DEBUG common.c: jtag version = 0x3
2021-10-18T09:03:32 DEBUG common.c: swim version = 0x0
2021-10-18T09:03:32 DEBUG common.c: stlink current mode: mass
2021-10-18T09:03:32 DEBUG usb.c: JTAG/SWD freq set to 0
2021-10-18T09:03:32 DEBUG common.c: stlink current mode: mass
2021-10-18T09:03:32 DEBUG common.c: *** stlink_enter_swd_mode ***
2021-10-18T09:03:32 DEBUG common.c: Loading device parameters....
2021-10-18T09:03:32 DEBUG common.c: *** stlink_core_id ***
2021-10-18T09:03:32 DEBUG common.c: core_id = 0x0bc11477
2021-10-18T09:03:32 DEBUG common.c: *** stlink_read_debug32 0x410cc601 at 0xe000ed00
2021-10-18T09:03:32 DEBUG common.c: *** stlink_read_debug32 0x10016466 at 0x40015800
---------- old ------------
Chip-ID file for G03x/G04x
chip_id 0x466
description G03x/G04x
flash_type 7
flash_size_reg 0x1fff75e0
flash_pagesize 0x800
sram_size 0x2000
bootrom_base 0x1fff0000
bootrom_size 0x2000
option_base 0x1fff7800
option_size 0x4
flags 0
---------- new ------------
Chip-ID file for G03x/G04x
chip_id 0x466
description G03x/G04x
flash_type 7
flash_size_reg 0x0
flash_pagesize 0x800
sram_size 0x2000
bootrom_base 0x1fff0000
bootrom_size 0x2000
option_base 0x1fff7800
option_size 0x4
flags 0
2021-10-18T09:03:32 DEBUG common.c: *** stlink_read_debug32 0xffffffff at 0000000000
2021-10-18T09:03:32 INFO common.c: G03x/G04x: 8 KiB SRAM, 65535 KiB flash in at least 2 KiB pages.
2021-10-18T09:03:32 DEBUG common.c: *** stlink_force_debug_mode ***
2021-10-18T09:03:32 DEBUG common.c: *** stlink_read_debug32 0000000000 at 0x40015808
2021-10-18T09:03:32 DEBUG common.c: *** stlink_write_debug32 0x00001800 to 0x40015808
2021-10-18T09:03:32 DEBUG common.c: *** stlink_status ***
2021-10-18T09:03:33 DEBUG usb.c: core status: 01030003
2021-10-18T09:03:33 DEBUG common.c: core status: halted
Unknown memory region
2021-10-18T09:03:33 DEBUG common.c: *** stlink_exit_debug_mode ***
2021-10-18T09:03:33 DEBUG common.c: *** stlink_write_debug32 0xa05f0000 to 0xe000edf0
2021-10-18T09:03:33 DEBUG common.c: *** stlink_close ***
Expected/description:
BOOT_LOCK is a flag/bit on address 0x1FFF7870. Due to hard coded option_size of 0x4, it is not possible to change this flag. I get an error "Unknown memory region".
I tried with increased option_size to 0x71, then I get an error "stlink_fwrite_option_bytes() == -1"
The text was updated successfully, but these errors were encountered: