Skip to main content
missiontous
Associate II
December 7, 2009
Question

FLASH_ErasePage function time delay

  • December 7, 2009
  • 11 replies
  • 2561 views
Posted on December 07, 2009 at 04:33

FLASH_ErasePage function time delay

    This topic has been closed for replies.

    11 replies

    trevor1
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Are you saying that FLASH_ErasePage is causing interrupts to be delayed by 250mS or are you saying that FLASH_ErasePage is taking 250mS to return?

    missiontous
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    i have used following step To write new data inside the flash of stm32f103rbt6

    step 1: FLASHStatus=FLASH_ErasePage(Flash address);

    Step2: FLASH_ProgramWord(Flash address,data);

    i am able to write and retreive data in the flash . But ''FLASH_ErasePage'' function creating some time delay(aprox 250ms).

    this time delay creates flicker in seven segment display(ie Interrupt Driven multiplux)

    any solution to solve the delay in page erase function

    [ This message was edited by: missiontous on 01-12-2009 12:28 ]

    missiontous
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi

    FLASH_ErasePage is taking 250mS to return

    i configured SRAM using-> NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);

    but the timer2 interrupt stoped working

    is there any other solution to solve this problem?

    [ This message was edited by: missiontous on 03-12-2009 10:13 ]

    armmcu
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi,

    In STM32 product during a write operation to the Flash memory, any attempt to read the Flash memory will stall the bus.I think you should remap your interrupt ISR into internal SRAM to overcome the interrupt latency due to page erase.

    may this help.

    A+

    missiontous
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi trevor,

    i am using Timer2 interrupt to drive sevensegment display.

    i want to store data inside the flash every 1 minute once. this creating

    display flicker every 1 minute once.

    pls guide how to map and configure interrupt vector to SRAM?

    trevor1
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi missiontous,

    If your display is being driven from interrupt it should not matter how long FLASH_ErasePage takes. If your seeing flicker then the interrupt must be being delayed - for the reason stated by armmcu.engineer.

    Can you confirm that the display code is in an interrupt?

    If the display code is not in an interrupt routine then we can then look at a solution to your problem.

    Regards

    Trevor

    missiontous
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi trevor

    please guide how to move/configure/map IVT to SRAM

    thanks

    trevor1
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    The flash has an endurance of 10000 write cycles. 10000 minutes is less than 7 days!

    You realise you don't need an erase for every write -- you erase a page (1 or 2k bytes) and then write a word (2 bytes) at a time.

    Maybe post some code.

    Trevor

    trevor1
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Never had to do it so can't help. I think you may have to move the ISR into RAM not just the IVT. Maybe someone else can comment.

    tomas23
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Check SCB->VTOR, resp. NVIC_SetVectorTable.

    The offset must be aligned to size of IVT increased to nearest power of 2.