cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE ISR at CCM SRAM

Asantos
Senior

Hi,

I followed application note AN 4996 and my application stopped working after the modifications:

Is there an example project using the STM32CubeIDE configured for an interrupt routine to run in CCM RAM?

//AT linker cmd file

MEMORY

{

 RAM  (xrw)  : ORIGIN = 0x20000000,  LENGTH = 96K

 FLASH  (rx)  : ORIGIN = 0x8000000,  LENGTH = 512K

 CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 32K

}

  /*--- New CCMRAM linker section definition ---*/

 _siccmram = LOADADDR(.ccmram);

  /* CCMRAM section */

  .ccmram :

 {

  . = ALIGN(4);

  _sccmram = .; /* define a global symbols at ccmram start */

  *(.ccmram)

  *(.ccmram*)

  . = ALIGN(4);

  _eccmram = .; /* define a global symbols at ccmram end */

  } >CCMRAM AT> FLASH

 /*--- End of CCMRAM linker section definition ---*/

//At startup code:

Reset_Handler:

 ldr  r0, =_estack

 mov  sp, r0     /* set stack pointer */

/* Copy the data segment initializers from flash to SRAM */

 ldr r0, =_sdata

 ldr r1, =_edata

 ldr r2, =_sidata

 movs r3, #0

 b LoopCopyDataInit

CopyDataInit:

 ldr r4, [r2, r3]

 str r4, [r0, r3]

 adds r3, r3, #4

LoopCopyDataInit:

 adds r4, r0, r3

 cmp r4, r1

 bcc CopyDataInit

/* Copy from flash to CCMRAM */

 ldr r0, =_sccmram

 ldr r1, =_eccmram

 ldr r2, =_siccmram

 movs r3, #0

 b LoopCopyCcmInit

CopyCcmInit:

 ldr r4, [r2, r3]

 str r4, [r0, r3]

 adds r3, r3, #4

LoopCopyCcmInit:

 adds r4, r0, r3

 cmp r4, r1

 bcc CopyCcmInit

/* End of copy to CCMRAM */

  

/* Zero fill the bss segment. */

 ldr r2, =_sbss

 ldr r4, =_ebss

 movs r3, #0

 b LoopFillZerobss

FillZerobss:

 str r3, [r2]

 adds r2, r2, #4

LoopFillZerobss:

 cmp r2, r4

 bcc FillZerobss

/* Call the clock system intitialization function.*/

  bl SystemInit

/* Call static constructors */

  bl __libc_init_array

/* Call the application's entry point.*/

bl main

LoopForever:

  b LoopForever

.size Reset_Handler, .-Reset_Handler

1 REPLY 1
Asantos
Senior

Hi,

My problem wasn't the CCM-RAM configuration, it is working. It was the debuger that sometimes "get lost' to an address without code. But when I reset the NUCLEO-G474 the firmware works. Someone already experienced this issue?