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

fixes infinite busy loop #1087

Closed
wants to merge 1 commit into from
Closed

Conversation

bmbove
Copy link

@bmbove bmbove commented Jan 18, 2021

I'm not super well-versed in this codebase, but I've been struggling to upload and debug on an STM32L412K8

I've got it working with an instruction modification in the flash loader. Original code:

wait:
    ldrh r3, [r10]  ; load flash status register (upper) value into r3
    tst r3, #0x1    ; logical AND flash status register value and literal 0x01 (check FLASH_BSY flag for a 1)
    beq wait        ; if zero flag is set, jump to wait

when FLASH_BSY == 0, the tst instruction should set the zero flag. beq takes the branch if the 0 flag is set, so if flash is not busy, it continues to wait (incorrect behavior). changing beq to bne fixes this.

I'm hung up on this though because it seems like a really naive fix on my part. I'm willing to dig a little deeper if need be. This might help some folks with #607.

@bmbove bmbove marked this pull request as ready for review January 18, 2021 00:45
@bmbove
Copy link
Author

bmbove commented Jan 18, 2021

actually, I'm going to investigate a little more.

@bmbove bmbove closed this Jan 18, 2021
@Nightwalker-87 Nightwalker-87 added this to the v1.6.2 milestone Jan 18, 2021
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Mar 20, 2021
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.

None yet

2 participants