Skip to content
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

Fix: Improved support for writing option bytes #1102

Merged
merged 2 commits into from
Mar 14, 2021

Conversation

2a17
Copy link
Contributor

@2a17 2a17 commented Mar 11, 2021

(Closes #1128)

@2a17
Copy link
Contributor Author

2a17 commented Mar 11, 2021

option byte wirte does not work, parameter is not forwarded

@2a17
Copy link
Contributor Author

2a17 commented Mar 11, 2021

tested on chip id 0x0413

@Ant-ON
Copy link
Collaborator

Ant-ON commented Mar 12, 2021

@2a17 Yes, сorrections in the right direction. Writing option byte have bug now (not work). But it is worth paying attention to write code:

stlink/src/st-flash/flash.c

Lines 182 to 193 in cc9bedd

} else if (o.area == FLASH_OPTION_BYTES) {
if (o.val == 0) {
printf("attempting to set option byte to 0, abort.\n");
goto on_error;
}
err = stlink_write_option_bytes32(sl, o.val);
if (err == -1) {
printf("stlink_write_option_bytes32() == -1\n");
goto on_error;
}

Parsing needs to be simplify by remove unused parameters (filename and addr)

@Nightwalker-87 Nightwalker-87 merged commit cc9084c into stlink-org:develop Mar 14, 2021
@Nightwalker-87 Nightwalker-87 changed the title option byte support improved Improved support for writing option bytes Mar 14, 2021
@Nightwalker-87 Nightwalker-87 changed the title Improved support for writing option bytes Fix: Improved support for writing option bytes Mar 14, 2021
@2a17 2a17 deleted the write_option_bytes branch March 14, 2021 23:47
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Mar 24, 2021
@Nightwalker-87 Nightwalker-87 linked an issue Apr 15, 2021 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[STM32L471]: Cannot set option byte
3 participants