+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Newbie level 6
    Points: 247, Level: 2

    Join Date
    Oct 2018
    Posts
    11
    Helped
    0 / 0
    Points
    247
    Level
    2

    stm32f103 update frimware from spiflash

    hellow guys
    i have a stm32f103 microcontroller and i run a bootloader code on it. i wanna know how can i update stm32 frimware with a bin file in to spiflash?
    i this possible?
    how i can wtite bin file of my project to spi flash ?
    how i can update frimware from spi flash?
    can some one please help me or intriduc a refrence that explane how to do it
    thanks

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 78,583, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,950
    Helped
    3616 / 3616
    Points
    78,583
    Level
    68

    Re: stm32f103 update frimware from spiflash

    Hi,

    when I do an internet search for: "stm32 spi flash bootloader" I get about 250,000 hits.
    (Didnīt you do this already on your own?)

    There are some application notes and documents directly from STMicroelectronics. I think they describe in detail how to handle it.
    There are even "how to " youtube videos...

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  3. #3
    Newbie level 6
    Points: 247, Level: 2

    Join Date
    Oct 2018
    Posts
    11
    Helped
    0 / 0
    Points
    247
    Level
    2

    Re: stm32f103 update frimware from spiflash

    Quote Originally Posted by KlausST View Post
    Hi,

    when I do an internet search for: "stm32 spi flash bootloader" I get about 250,000 hits.
    (Didnīt you do this already on your own?)

    There are some application notes and documents directly from STMicroelectronics. I think they describe in detail how to handle it.
    There are even "how to " youtube videos...

    Klaus

    i know i can searh. but when i search every one explane how to do that with uart. i didnt find a step by step explnation about how to do that with spi flash. if you now a refrence please introduce to me



    •   AltAdvertisement

        
       

  4. #4
    Super Moderator
    Points: 78,583, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,950
    Helped
    3616 / 3616
    Points
    78,583
    Level
    68

    Re: stm32f103 update frimware from spiflash

    Hi,

    Since we donīt know your circuit and your requirements ... we can only tell you the "usual" way.
    (And so do the internet documents)
    If your circuit or requirement differs from the usual way, then you need to tell us in which regard. Otherwise helping will be impossible.

    *****

    The usual way to get/generate the hex file is:
    PC --> your source code --> compiler --> HEX file

    The usual way of SPI flash connection is:
    STM32 --> via SPI --> Flash

    Now usually the Flash is an SMD part and directely soldered to the PCB.
    If this is not the case with your application then you need to tell us how it is.

    Then often the SPI Flash is updated via the STM32.
    PC --> UART --> STM32 --> via SPI --> Flash.

    If you donīt want it this way, you should tell us why .. and how else you want it.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  5. #5
    Newbie level 6
    Points: 247, Level: 2

    Join Date
    Oct 2018
    Posts
    11
    Helped
    0 / 0
    Points
    247
    Level
    2

    Re: stm32f103 update frimware from spiflash

    Quote Originally Posted by KlausST View Post
    Hi,

    Since we donīt know your circuit and your requirements ... we can only tell you the "usual" way.
    (And so do the internet documents)
    If your circuit or requirement differs from the usual way, then you need to tell us in which regard. Otherwise helping will be impossible.

    *****

    The usual way to get/generate the hex file is:
    PC --> your source code --> compiler --> HEX file

    The usual way of SPI flash connection is:
    STM32 --> via SPI --> Flash

    Now usually the Flash is an SMD part and directely soldered to the PCB.
    If this is not the case with your application then you need to tell us how it is.

    Then often the SPI Flash is updated via the STM32.
    PC --> UART --> STM32 --> via SPI --> Flash.

    If you donīt want it this way, you should tell us why .. and how else you want it.

    Klaus

    hi KlausST
    thanks for repling

    i have a smd spiflash on my stm32f103 borad. right now i can read and write into spi flash.first i wanna write a bin file (output of a blinky project) into spi flash as a frimware. and second i wanna update micro prgoram whit that bin file.

    with attention to we cant run a file system on spiflash i wanna know how shoud i write a bin file in to spiflash and how i can update frimware from spiflash. i can update frimware through uart with ymodem protocol but i dont know how shoud i update from spiflash



    •   AltAdvertisement

        
       

  6. #6
    Newbie level 6
    Points: 247, Level: 2

    Join Date
    Oct 2018
    Posts
    11
    Helped
    0 / 0
    Points
    247
    Level
    2

    Re: stm32f103 update frimware from spiflash

    Quote Originally Posted by KlausST View Post
    Hi,

    Again: We donīt see your system. Please give usueful informations.

    Does your system support any other way (to read/write the Flash) than: STM32 --> via SPI --> Flash?


    ****

    If you already can read/write the flash...Where exactly is the problem then?

    Klaus
    yes my system is support spi and spi flash

    the problem is as i say i dont know how to write a file (bin file) to spi flash without file system and i dont know how to update firmware from spi flash. i can write an array to spi flash but i dont know how to write a file in to that.



  7. #7
    Super Moderator
    Points: 78,583, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,950
    Helped
    3616 / 3616
    Points
    78,583
    Level
    68

    Re: stm32f103 update frimware from spiflash

    ...sorry for the wrong order of posts
    ***************************

    Hi,

    Again: We donīt see your system. Please give usueful informations.

    Does your system support any other way (to read/write the Flash) than: STM32 --> via SPI --> Flash?


    ****
    i can read and write into spi flash. First i wanna write a bin file (output of a blinky project) into spi flash as a frimware.
    If you already can read/write the flash...Where exactly is the problem then?

    Klaus

    - - - Updated - - - ************************************************** ***************

    Hi,

    Difficult to communicate....

    I asked about:
    Does your system support any other way (to read/write the Flash) than: STM32 --> via SPI --> Flash?
    We donīt know whether your FLASH is removable an can be programmed with an external programmer, or whether your SPI bus has a connetor for another SPI MASTER to read/write the Flash ... or maybe there is any other way to read/write the FLASH.

    *****
    i can write an array to spi flash but i dont know how to write a file in to that.
    Any "file" is an array of bytes.
    So if you can write an array of bytes ... where is the problem to write the binary file?

    *****
    But I have to assume you did not read deeply through the bootloader application notes.
    Thus please tell us what exact bootloader you use.
    And give links to the application notes regarding this bootloader.

    To explain your problem, please draw a draft. A picture says more than a lot of words.

    ***

    Without clear informations I see no way to go on.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



--[[ ]]--