cancel
Showing results for 
Search instead for 
Did you mean: 

stm32cubeIDE does not generate required startup file for STM32H743VITX_RAM.ld

SeyyedMohammad
Senior III

Changing linker script to STM32H743VITX_RAM.ld caused program to not work.

It has also optimization for speed. But why? I'm using cubeIDE 1.12.

What is the point of existence of this file? I mean ram.ld. could you please provide manual to use it?

My goal was to move at least stack memory to DTCM to make program faster. It seems it also moves instructions to TCM too. But don't know why this doesn't work, maybe it requires it's own startup code. but why the startup code does not generated with cubeMX?

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

The same startup as for flash works also for RAM.

But SCB.VTOR should be set differently.

The simplest way is to add the following in your main() before everything else:

int main(void)
{
  /* USER CODE BEGIN 1 */
  extern int g_pfnVectors[];
  SCB->VTOR = (uint32_t)(void*)g_pfnVectors;
  /* USER CODE END 1 */
..............

View solution in original post

1 REPLY 1
Pavel A.
Evangelist III

The same startup as for flash works also for RAM.

But SCB.VTOR should be set differently.

The simplest way is to add the following in your main() before everything else:

int main(void)
{
  /* USER CODE BEGIN 1 */
  extern int g_pfnVectors[];
  SCB->VTOR = (uint32_t)(void*)g_pfnVectors;
  /* USER CODE END 1 */
..............