Skip to main content
Graduate
June 19, 2024
Solved

Flash programming issue using custom tool

  • June 19, 2024
  • 2 replies
  • 1370 views

Hi everyone, 
I facing some issues with the custom flash loader tool and MCU, I developed the tool and bootloader code of the STM32H503RBt6 controller, and I flashed the hex file using the custom tool, its works but the data is not flashed in the controller,

I configured the HSI Clock frequency 64Mhz(default freq),  set the voltage scaling is 2, FLASH_ACR_WRHIGHFREQ is 01,
I was debugging step by step, it flashed properly but normally(without debugging) it's not working. I can't understand it.

Anyone, please help to resolve this error, and suggest some ideas to develop the tool
I have lot of questions, like 
what freq range is used to MCU in the custom bootloader, voltage scaling level and FLASH_ACR_WRHIGHFREQ ( to better convenient)

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    Don't use the debugger to understand what's going on with real-time code operation.

    Instrument the code so you can output status, progress and understand the flow, and why/how it fails.

    With FLASH you're going to need to pay attention to the alignment of the addresses being written, the minimum write width, and that you're not attempting to write a flash-line more than once.

    Look at the related FLASH examples in CubeH5

    2 replies

    Graduate II
    June 19, 2024

    Don't use the debugger to understand what's going on with real-time code operation.

    Instrument the code so you can output status, progress and understand the flow, and why/how it fails.

    With FLASH you're going to need to pay attention to the alignment of the addresses being written, the minimum write width, and that you're not attempting to write a flash-line more than once.

    Look at the related FLASH examples in CubeH5

    Mohan30Author
    Graduate
    June 20, 2024

    Hi @Tesla DeLorean  
    can you tell me, what is the better frequency in the custom bootloader?

    in the code, I developed the working code, it works in the debugging method only(step-by-step analysis), but in real-time(flow) it does not work(it doesn't write the data in flash memory).
    Please help to resolve this problem

    Graduate II
    June 20, 2024

    Frequency is irelevant. Your code isnt working. And debug can run code and then pause ... 

    Mohan30Author
    Graduate
    August 8, 2024

    sorry for the late reply, thanks @Tesla DeLorean