-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query: Tweaking __main or updating / modifying SystemInit() to call System Clock Configure, Peripheral Configure and FMC Initialization before calling Zero Initialization of memory #134
Comments
Hello, Please also help provide a user code section just before Thanks, |
Hello, When comparing the STM32CubeH7 / STM32CubeMX implementation with the Keil Provided CMSIS implementation, I found some inputs which I want to share with you. As per ARM / Keil, it is expected, all the memory used by the application is enabled before calling __main. In the CMSIS standard, the
I also came across below comments under system_stm32f7xx.c/.h files
May ST please help me understand the reason for above, and how do I implement my requirement without having any adverse impact from regeneration of Code (using STM32CubeMX) and ensuring that my team does not have to bother about adding any tweaks again to the project. Please help. Thanks, |
Hello @rxa1031, The use-case you are describing is typical of the STM32H750B-DK Value Line board. In order to enable the external memory access during start-up, you have to adapt the As you can notice in the STM32CubeH7/Projects/STM32H750B-DK/Templates/ExtMem_Boot/Src/system_stm32h7xx.c Lines 227 to 229 in 5975bff
The
You simply have to port these into the Regarding aspects, related to Cube MX, please submit your questions and requests to the ST Community, in the dedicated section. With regards, |
Hi @ALABSTM , I believe the STM32CubeH7 project can provide mechanism using conditional compile code to help implement what I wanted (i.e. initialize Clocks, configure FMC related GPIOs, and configure FMC SRAM) before a call to __main() is made. I coded RCC / Clock related functions, FMC GPIO configuration and FMC configuration functions_ which only use the Microcontroller registers and constant values. I also coded my own I am now able to declare global variables in external SRAM / MRAM which can be initialized while declaring. I am now able to declare both UNINIT and Initialize with Zero (or) known value in External SRAM Attached code for reference: FMC-SRAM_C_Code_as_TXT_File.TXT SCT_FILE_EXTENSION_CHANGED_TO_TXT.TXT Sample Global Variables declaration for testing:
Regards, |
Duplicate of #145 |
Hello,
I am currently unable to declare initialized Global Variables in External SRAM because of the limitations with __main function (available with Keil compiler version V6.16 ) code availability and use of STM32CubeMX (version 6.2.1). The generated code is using the HAL drivers for System Clock, Peripherals and FMC.
I had earlier informed in one of my queries that when FMC is configured with STM32CubeMX, the tool does not embed details of the external SRAM to the SCT file that is used by Keil Compiler.
I read the document Application Startup and understand that if I want to declare an Initialized Global Variable in external FMC SRAM, then this can only be done by tweaking the __main or preceding __main execution with a function call / execution that:
On reviewing the function
SystemInit
, which is called before __main, I observe that the function only uses Microcontroller registers, and assigns constant values to the used registers, and I understand the reason for why variables are not used.Current understanding:
Considerations:
Requests:
A. before the call that initializes global variables and zeroes the ZI section
B. Exist after the stack is created.
Please help me with your inputs.
Thanks,
@rxa1031
The text was updated successfully, but these errors were encountered: