cancel
Showing results for 
Search instead for 
Did you mean: 

Changing boot address of CM4 and CM7 in STM32H745 - Dual core

uREG
Associate II

Hello Tesla

I need to run M4 from 0x08000000  and then M7 from 0x08100000.

Is there any example ?

 

Exactly I v'done my BOOT that runs on M4 (0x08000000) loads the Flash , then jumps into M4 (0x08040000).

Now i have to run M7 from 0x08100000, but i don't know how...

Please help :)

4 REPLIES 4
SofLit
ST Employee

Hello @uREG and welcome to the community.

I moved your post from this one to a new thread as it's not the same question.

You can manage that in the linker file:

CM7:

 

MEMORY
{
FLASH (rx)      : ORIGIN = 0x08100000, LENGTH = 2048K
RAM (xrw)      : ORIGIN = 0x24000000, LENGTH = 512K
ITCMRAM (xrw)      : ORIGIN = 0x00000000, LENGTH = 64K
}

 

CM4:

 

MEMORY
{
FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 1024K
RAM (xrw)      : ORIGIN = 0x10000000, LENGTH = 288K
}

 

In system_stm32h7xx.c, you need to modify the vector table offset address in such way you swap the addresses between CM4 and CM7 VTOR addresses.

For CM4: (BANK1)

 

SCB->VTOR = FLASH_BANK1_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ 

 

For CM7: (BANK2)

 

SCB->VTOR = FLASH_BANK2_BASE | VECT_TAB_OFFSET;       /* Vector Table Relocation in Internal FLASH */

 

 And for performance purposes, in stm32h7xx_hal.c don't forget to change the ART base address according to the BANK1 address:

 

HAL_StatusTypeDef HAL_Init(void)
{

uint32_t common_system_clock;

#if defined(DUAL_CORE) && defined(CORE_CM4)
   /* Configure Cortex-M4 Instruction cache through ART accelerator */
   __HAL_RCC_ART_CLK_ENABLE();                   /* Enable the Cortex-M4 ART Clock */
   __HAL_ART_CONFIG_BASE_ADDRESS(0x08000000UL);  /* Configure the Cortex-M4 ART Base address to the Flash Bank 1 : */
   __HAL_ART_ENABLE();                           /* Enable the Cortex-M4 ART */
#endif /* DUAL_CORE &&  CORE_CM4 */

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello SofLit and thank You for the answer.

The changes in linker files i've just done, also the ART relocation.

The changes in 'system_stm32h7xx_dualcore_boot_cm4_cm7.c' file are debatable, because the file is common for CM4 and CM7 parts in STM32CubeIDE and i suppose the directives 'CORE_CM4' and 'CORE_CM7' made in Preprocessor menu [Properties-Tool Settings-MCU GCC Compiler-Preprocessor] are invisible !

So I've done #define CORE_CM4 directly in that file, but this excludes CORE_CM7.

All this #defines politics in Attolic/CubeIDE is unclear for me...

 

But - what should I do in main.c files of both parts ?

 

Thanks,

Bartek.

Hi Bartek,

did you manage to solve the problem? I am trying to do the same thing, the CM4 started correctly in debug mode and wait but when I launch CM7 it runs directly without halt and addres starts with 0x801... which is not correct.

If you got it running, can you please share your solution?

Thank you in advance.

Rocha

Hello Rocha.

No, I didn't. I'm still waiting in deadlock.

I have received such an info from STM Partner:

// Ensure CM7 is held in reset
RCC->AHB1RSTR |= RCC_AHB1RSTR_CM7RST;

// Set vector table for CM7
SCB->VTOR = 0x08100000; // Address for CM7 vector table

3. Release the CM7 Core from Reset

// Release CM7 from reset
RCC->AHB1RSTR &= ~RCC_AHB1RSTR_CM7RST;

 

but...there is no such bit in RCC->AHB1RSTR register...  :(

Can someone help us ?

Bartek.