cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, Please. STM32F405RG - REV 2 The same code of HAL_FLASH_Program works well in main function and not in interrupt subroutine ? Best regards. Henri

HBRUS.1
Associate II
 
1 ACCEPTED SOLUTION

Accepted Solutions
HBRUS.1
Associate II

Hello,

Finally, in the form NVIC, I checked "Flash global interrupt" with priority "0" and I called the function "HAL_FLASH_Program_IT" instead of "HAL_FLASH_Program". Nothing else.

Best regards.

Henri

View solution in original post

5 REPLIES 5
Mike_ST
ST Employee

Hello,

maybe because the Systick cannot increase while your interrupt is executing, because of its priority ?

HBRUS.1
Associate II

Hello Mike,

Thank you for your attention.

From time to time, I work arround this problem since many days.

Due to your answer, I moved the code from the interrupt sub-routine to the infinite loop "while();" of the file containing the main function. The behavior is the same.

Please, would you have another suggestion ?

For information, the processor runs at 168Mhz.

Precisely, the errors are HAL_FLASH_ERROR_PGP and HAL_FLASH_ERROR_PGS.

Best regards.

Henri

HBRUS.1
Associate II

Hello Mike,

You put me on the right track.

With the code in the infinite loop of the main function, without interruption, the writes in the flash are effective.0693W00000GXDoJQAX.jpgLike the image above, increasing the level of preemption of "Time base: System tick timer" has no effect.

So, how to allow Systick to be incremented when other interruptions are active ?

Please, would you have suggestion ?

Best regards.

Henri

Hello,

Help !

In my reply above, there is a mistake.

The NVIC table, preemption priority, is actualy:

0693W00000GXXx6QAH.jpg"Time base : System tick timer" is now at the highest premption priority.

As I could read somewhere, I put the code (mine) of all ISR in RAM (why not), specialy "Time base : System tick timer".

The problem persists.

I can read that I am not the only one facing this difficulty.

It would seem that no one has a solution

Should I give up ?

Best regards.

Henri

HBRUS.1
Associate II

Hello,

Finally, in the form NVIC, I checked "Flash global interrupt" with priority "0" and I called the function "HAL_FLASH_Program_IT" instead of "HAL_FLASH_Program". Nothing else.

Best regards.

Henri