cancel
Showing results for 
Search instead for 
Did you mean: 

Code and vector in SRAM

eric2
Associate
Posted on February 17, 2015 at 17:36

Hello,

I want to have a fast interrupt with the STM32F429 at 168MHz. I use EXTI interrupt who toggle an gpio for test. I measure the time with a scope between the exti pin front and the gpio output front.

I made 3 test:

1- vector and IRQHandler in flash -> 184ns

2- vector in flash and IRQ handler in sram -> 204ns

3- vector and IRQHandler in sram -> 212ns

I

thought that

IRQ

would be

faster

in

sram

. Is it correct?

Here my code:

//&sharpdefine RAMFUNC __attribute__ ((section (''.ramfunctions'')))

RAMFUNC void EXTI9_5_IRQHandler(void)

    {

    GPIOH->BSRRL = GPIO_PIN_5;    //set led V

    __HAL_GPIO_EXTI_CLEAR_IT(GPIO_PIN_8);        // pin DE

    GPIOH->BSRRH = GPIO_PIN_5;    //reset led V

    }

I tried to

put

vectors in

CCMram

but I have a

hardfault

.

Is it possible

to put the

vectors

in

CCMram

?

Thanks

#stm32f4-vectors-in-sram
3 REPLIES 3
Posted on February 17, 2015 at 18:13

The ART ''cache'' can deliver cache-line hits to the prefetch port more quickly than SRAM can. SRAM will be more predictable.

The F4 doesn't support execution from CCM, it's on the data port not the instruction port.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 17, 2015 at 18:17

You can put your stack in CCM, there it won't be contended for access via DMA, etc.

In most cases I doubt the speed difference would be measurable.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
eric2
Associate
Posted on February 17, 2015 at 18:38

So, I'll leave all in flash.

Thanks for your fast reply.