cancel
Showing results for 
Search instead for 
Did you mean: 

Executing the program in SDRAM

Vitaliy Kostyrev
Associate II
Posted on May 26, 2018 at 11:57

Hello! I'm using stm32f746igt. You can run the program in sdram on this controller and use Chrome Art to display the image on the display.

6 REPLIES 6
Posted on May 27, 2018 at 13:18

Is there a question?

Yes, you should be able to use the SDRAM for code, not sure how fast/efficient that will be, the cache will likely mask some of that.

The bigger problem is getting the code loaded into SDRAM, you can direct the linker build code there, but you need startup code that will initialize the clocks, pins, peripheral and memory before you can copy code/data there and transfer control to it.

You could for example build a simple loader that pulls the code out of QSPI and places it in SDRAM

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 27, 2018 at 15:22

Yes! execution of the program in sdram together with ltdc and chrome art! run blink in sdram no problem! I want execute emwin!

Posted on May 28, 2018 at 15:49

Hello

vitalik180887

,

Please provide more details about your use case.

Why do you want to execute from SDRAM ? Is it because of size of his application ?

To know thatthe QSPI can hold big applications in size and execution from QSPI is fast, thanks to CPU cache in STM32F7.

With Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on May 29, 2018 at 05:48

Hello! Running the program requires that the program be deleted after the power is turned off. My program is on the SD card in a binary file.

My Steps:

I work in Keil.

step one - copy the binary file into the SDRAM, address 0x70000000;

step two - copy the table of vectors;

&sharpdefine APLICATION_BEGIN                                                       0x70000100

&sharpdefine NEXT_ADDRESS_APLICATION(A)                                 (APLICATION_BEGIN+(A))

extern void SysTick_Handler(void);

extern void LTDC_IRQHandler(void);

extern void DMA2D_IRQHandler(void);

for (uint32_t i = 0; i < VECTORTABLE_SIZE; i++) {

*(uint32_t*)NEXT_ADDRESS_APLICATION(i) = __Vectors[i];

}

*(uint32_t*)NEXT_ADDRESS_APLICATION((SysTick_IRQn + 16)*4) = (uint32_t)SysTick_Handler;

*(uint32_t*)NEXT_ADDRESS_APLICATION((LTDC_IRQn+ 16)*4) = (uint32_t)LTDC_IRQHandler;

*(uint32_t*)NEXT_ADDRESS_APLICATION((DMA2D_IRQn+ 16)*4) = (uint32_t)DMA2D_IRQHandler;

step three - turn to the program:

__disable_irq();

SCB->VTOR = APLICATION_BEGIN;

__DSB();

__enable_irq();

my program comes to GUI_Init (EMWIN function inital initialization) and stops.

Posted on May 29, 2018 at 06:17

step three - 

void jumpToApplication(uint32_t addr)

{

typedef void (*pFunction)(void);

pFunction Jump_To_Application;

uint32_t jumpAddress;

jumpAddress = *(__IO uint32_t*) (addr+4);

Jump_To_Application = (pFunction) jumpAddress;

__set_MSP(*(__IO uint32_t*) addr);

Jump_To_Application();

}
Posted on May 30, 2018 at 04:06

Thank you! I solved the problem myself)