How to use STM32CubeIDE or STM32CubeMX to automatically add settings for RAM_D2 and RAM_D3 in LD fil
- 18 replies
- 5852 views
Hi All,
Requesting help with below.
I am using latest version of STM32CubeIDE. The microcontroller in use is STM32H743BITx.
I have concerns with regards to:
1. Whether to add ALIGN(4) even inside the FLASH sections present in STM32H753BITX_FLASH.ld (attached)
2. The file generated by STM32CubeMX (ran from within STM32CubeIDE) generated a STM32H753BITX_FLASH.ld file in the project folder. It does not contain sections that reside in RAM_D2 and RAM_D3. Attached the STM32H753BITX_FLASH.ld.txt file for reference. Is there a way available with STM32CubeMX (preferably) or with STM32CubeIDE to add the necessary RAM sections in the LD file for STM32H743BITx?
3. I observe that macro DATA_IN_D2_SRAM is disabled and hence concerned about how clocks to RAM_D1, RAM_D2 and RAM_D3 are being enabled. I am also unable to figure out any valid assignment to register AHB2ENR which would enable the clock to the three RAM sections.
In file system_stm32h7xx.c please refer to below section starting at line number 79.
The macro DATA_IN_D2_SRAM is disabled
/************************* Miscellaneous Configuration ************************/
/*!< Uncomment the following line if you need to use initialized data in D2 domain SRAM (AHB SRAM) */
/* #define DATA_IN_D2_SRAM */
Then from line number 267
#if defined(DATA_IN_D2_SRAM)
/* in case of initialized data in D2 SRAM (AHB SRAM), enable the D2 SRAM clock (AHB SRAM clock) */
#if defined(RCC_AHB2ENR_D2SRAM3EN)
RCC->AHB2ENR |= (RCC_AHB2ENR_D2SRAM1EN | RCC_AHB2ENR_D2SRAM2EN | RCC_AHB2ENR_D2SRAM3EN);
#elif defined(RCC_AHB2ENR_D2SRAM2EN)
RCC->AHB2ENR |= (RCC_AHB2ENR_D2SRAM1EN | RCC_AHB2ENR_D2SRAM2EN);
#else
RCC->AHB2ENR |= (RCC_AHB2ENR_AHBSRAM1EN | RCC_AHB2ENR_AHBSRAM2EN);
#endif /* RCC_AHB2ENR_D2SRAM3EN */
tmpreg = RCC->AHB2ENR;
(void) tmpreg;
#endif /* DATA_IN_D2_SRAM */
Please help resolve my above concerns.
Thanks!
Rajeev



