Skip to main content
Visitor II
March 16, 2007
Question

Reprograming Bank 0 from Bank 1

  • March 16, 2007
  • 2 replies
  • 730 views
Posted on March 16, 2007 at 14:02

Reprograming Bank 0 from Bank 1

    This topic has been closed for replies.

    2 replies

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:39

    Hi,

    I try to reprogramm bank 0 (256kB) from bank 1. Stepping the code the programm works well, running after reset the breakpoint an the end of the BOOT_vLoader never reached.

    What could be wrong with my code:

    void BOOT_vLoader( void ){

    dword dwSource, dwDestination;

    FMI_WriteProtectionCmd(FMI_B0S3, DISABLE);

    FMI_EraseSector(FMI_B0S3);

    FMI_WaitForLastOperation(FMI_BANK_0);

    dwDestination = 0x30000; /* destination adress */

    /* writing data into sector 3 (0x30000...0x3ffff) */

    for(dwSource = 0; dwSource < 0x8000; dwSource++){

    FMI_vWriteHalfWord(dwDestination, (word)dwSource);

    FMI_bWaitForLastOperation(FMI_BANK_0);

    dwDestination += 2;

    }

    while(1){

    dwSource++; /* breakpoint here was never reached */

    }

    The BOOT_vLoader() function is placed in bank 1.

    Best regards,

    Jens

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:39

    Hi folks,

    Befor you doing anything with the STR9 read the errata, read the errata, read the errata,....

    During reprogramming, the RCLK must be lower than 50MHz or the copying routine has to be placed into RAM.

    Why in the hell is no hint in the original STM library (they copied the copying software into RAM)?

    Regards,

    Jens