AnsweredAssumed Answered

Clone master chip firmware onto slave chip.

Question asked by kostka.tim on Apr 14, 2015
Latest reply on Apr 27, 2015 by Moore.Patrick
In my application, I have a master chip and a slave chip, both identical STM32F407.  From the master chip, I would like to flash the slave chip so that it has the exact same firmware as the master chip.  From my understanding, this means cloning the contents of the flash onto the slave chip.  (Right?)  I do this with the following:
       
  • Put slave chip into system bootloader mode.  (I do this programmatically, but shorting BOOT0 on startup produces the same results.)
  •    
  • Use USART1 to write relevant flash to slave chip...   
             
    • I directly copy from the master chip memory 0x08000000 to the slave using the WRITE MEMORY command.  Everything checks out and I get the ACKs saying it worked.
    •        
    • I then send the slave the GO command to start executing at 0x08000000, which is where my code lies.  I get an ACK and the slave restarts.
    •    
       
  •    
  • When the slave restarts, it doesn't respond.  (The correct behavior would be that it responds to various commands over the USART1 bus and some LEDs should flash.)
I can't figure out why this isn't working.  Do I need to erase or modify the RAM or something else on the chip as well?  Or is there something special I need to do at the beginning of the flash for this to work?

To debug, I've done a few separate things to verify the steps I'm doing.
       
  • When in the bootloader, sending the GO command alone without modifying the flash gives the expected result (slave is responsive), so the GO command seems fine.
  •    
  • Instead of copying the entire FLASH, I've also just written a single byte, and can verify on the slave chip that it was indeed changed.  so the WRITE MEMORY command seems fine.
  •    
  • If I flash the slave chip directly using ST-Link, it all works.  So something is different between what I'm doing and what ST-Link is doing.  I'm guessing it's a lack of understanding on my part.
Any ideas?  Many thanks.

Outcomes