Skip to main content
Visitor II
September 24, 2007
Question

Erase Sector Problem -Please Help-

  • September 24, 2007
  • 5 replies
  • 1132 views
Posted on September 24, 2007 at 13:27

Erase Sector Problem -Please Help-

    This topic has been closed for replies.

    5 replies

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

    Hi.

    I wrote a few problem messages but no answer come.

    System boots from bank1.And I tried writing to bank0's sec0 a few bytes.

    If i call FMI_EraseSector(FMI_B0S0) func program crashes else program runs perfectly.I can't call FMI_EraseSector func.

    I look for help.

    Regards...

    Mehmet

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

    I checked the flash status register in FMI_EraseSector func.There is no problem in register but program doesn't run.Also when i called the FMI_EraseSector func if i debug(program runs step by step) there is no problem,program runs well.So i wait 500 ms in FMI_EraseSector func.It is not solution.

    I wait help

    Regards...

    Mehmet

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

    Hi sword.

    My str9 revision is D.

    If i call erase sector command program go in infinite loop on PAbtHandler.I tried to take flash code to ram but it was not solution.

    And when debug -run step by step- there is no problem.I wait 2s after erase sector command.

    Wait help

    Regards...

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

    Hello sword,

    So thanks for your answer.

    I can boot from bank1 but can't erase sector.

    I have remapped physically the banks.But i have not used caps.I used

    Keil v3.05.Bank1 is at 0x00 address.

    In the startup file i have changed the initialization of the banks mapping as it place bank1 at 0x0, and bank0 at 0x8000.

    In the file flash.h(i don't use st library) i decommented the line #define Remap_Bank_1.

    In program all the functions from the flash.c run from SRAM.

    I can boot bank1 and write ban0.I checked, it is right.But when i call eraseSector(B0S0) func(erase sector 0 of bank 0) program go in PAbt_Handler for infinite loop.

    But when i debug (step by step run) i can erase.

    So thanks again, i wait your help.

    Best regards..

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

    Hello sword,

    I did everythings that you said but problem keeps on.

    But a good thing have happened; when i closed timer int. i could erase sector.

    How does timer int. create flash problem?

    Mabe my library has a bug.

    I sent you required files.If you check i will be so glad you.

    If you send me your e-mail address i sent you project-sory the library does not belong to me-

    regards

    mehmet