Flash Interrupt
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2008-04-21 4:53 AM
Posted on April 21, 2008 at 13:53
Flash Interrupt
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:30 AM
Posted on May 17, 2011 at 12:30
I have included the following code in the Flash Example 1 of the STM32 Library, to enable an interrupt after a flash operation:
Code:
NVIC_InitStructure.NVIC_IRQChannel = FLASH_IRQChannel;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); FLASH_ITConfig(FLASH_IT_EOP, ENABLE);I have also tried ensureing the HSI is on with: RCC_HSICmd(ENABLE); This causes an interrupt when debugging (via JTAG), but not when run from flash normally (i.e. after a reset). Does anybody know what else I have to do to ensure there is always an interrupt.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:30 AM
Posted on May 17, 2011 at 12:30
It seems that one must Unlock the flash before setting the interrupt flag. Thus:
Code:
FLASH_Unlock();
FLASH_ITConfig(FLASH_IT_EOP, ENABLE); will interrupt (following a flash operation), but:Code:
FLASH_ITConfig(FLASH_IT_EOP, ENABLE);
FLASH_Unlock();Will not. I'm not sure why this is though. I couldn't find any mention in the manuals.