modify startup_stm32f769xx.s so that newly added memory range is initialized ?
I'm working with the STM32F769 microcontroller and I've defined a new section in the linker script using instructions from https://www.openstm32.org/Using%2BCCM%2BMemory :
/* Emulated RAM in the JPEG peripheral */
HACK_RAM_JPEG_HUFFENC_AC0 (rwx): ORIGIN = 0x40024000, LENGTH = 352 /* JPEG->HUFFENC_AC0 */
.hackRamJpegHuffencAc0 :
{
. = ALIGN(4);
KEEP(*(.hackRamJpegHuffencAc0))
*(.hackRamJpegHuffencAc0 .hackRamJpegHuffencAc0.*)
} >HACK_RAM_JPEG_HUFFENC_AC0
/* Used by the startup to initialize data */
_sidata_HACK_RAM_JPEG_HUFFENC_AC0 = LOADADDR(.data_HACK_RAM_JPEG_HUFFENC_AC0);
/* Initialized HACK_RAM_JPEG_HUFFENC section
*
* IMPORTANT NOTE!
* If initialized variables will be placed in this section,
* the startup code needs to be modified to copy the init-values.
*/
.data_HACK_RAM_JPEG_HUFFENC_AC0 :
{
. = ALIGN(4);
_sdata_HACK_RAM_JPEG_HUFFENC_AC0 = .; /* create a global symbol at data start */
*(.data_HACK_RAM_JPEG_HUFFENC_AC0) /* .data sections */
*(.data_HACK_RAM_JPEG_HUFFENC_AC0*) /* .data* sections */
. = ALIGN(4);
_edata_HACK_RAM_JPEG_HUFFENC_AC0 = .; /* define a global symbol at data end */
} >HACK_RAM_JPEG_HUFFENC_AC0 AT> FLASH
/* Uninitialized (bss-like) section in HACK_RAM_JPEG_HUFFENC_AC0 */
.bss_HACK_RAM_JPEG_HUFFENC_AC0 :
{
. = ALIGN(4);
_sbss_HACK_RAM_JPEG_HUFFENC_AC0 = .; /* Define the start of bss */
*(.bss.HACK_RAM_JPEG_HUFFENC_AC0) /* Uninitialized section */
*(.bss.HACK_RAM_JPEG_HUFFENC_AC0.*)
. = ALIGN(4);
_ebss_HACK_RAM_JPEG_HUFFENC_AC0 = .; /* Define the end of bss */
} >HACK_RAM_JPEG_HUFFENC_AC0
I have absolutely no knowledge of assembler programming and ChatGPT was just hallucinating when I asked him, so I don't know how to change the assembler code in startup_stm32f769xx.s. Unlike in the example (https://www.openstm32.org/Using%2BCCM%2BMemory ), I'm adding a section, not replacing a section. So, can somebody please help me to modify startup_stm32f769xx.s so that __HAL_RCC_JPEG_CLK_ENABLE() is called and then the HACK_RAM_JPEG_HUFFENC_AC0 area is initialized?
