2021-04-21 11:38 PM
Hello @Khouloud ZEMMELI .
I raised two concerns on STM32CubeH7 github page
https://github.com/STMicroelectronics/STM32CubeH7/issues/133
https://github.com/STMicroelectronics/STM32CubeH7/issues/134
I am informed to share my concerns here, as parts of the code in use are generated by STM32CubeMX
I it possible to update the tool so that my concerns are resolved.
I am unwell and hence might take some time to respond back to any raised queries.
Please bear with me.
Thanks,
Rajeev
2021-04-22 12:44 AM
Hello @Rajeev Arora
Thanks for your post,
Could you please share more details about your problem?
I'll take care of it, do not worry :)
Khouloud
2021-04-22 05:48 AM
Hello @Khouloud ZEMMELI ,
It is easy to access the STM32H753BIT6 internal SRAM and peripherals.
In the internal SRAM, one can easily create a global variable and simultaneously assign a value to it. Similarly one can easily declare a section of internal SRAM as UNINIT / NOINIT. However, this is not easy for an EXTERNAL SRAM that is configured using the FMC.
Also when an external SRAM is configured using the STM32CubeMX tool, the tool does not add section / address range associated with the External SRAM to the SCT file (which is used by Keil compiler).
Further, in order to allow the __main (library code part) to store zero to every byte of external SRAM (like it does to internal RAM and SRAM), the System Clock configuration, FMC / External SRAM associated pins configuration and FMC settings must be executed before executing __main.
As the __main is responsible for setting up stack and heap, hence when configuring clock, FMC pins, FMC settings etc. one cannot use code pieces that use variables.
Hence tweak to the startup related file, SCT file, Project settings etc are needed. These tweaks need to be made available through STM32CubeMX.
I hope my concern is clear to you.
Thanks,
Rajeev
2021-04-22 07:08 AM
Hello Rajeev
Since inside "startup_stm32h753xx.s" Reset_Handler is defined as WEAK, you can define a new startup sequence with HAL like the picture below that initializes external SDRAM .
2021-04-26 10:53 AM
Hello @Khouloud ZEMMELI , @Vangelis Fortounas ,
Is it possible for STM32CubeMX development team to provide:
1. A FMC Init code / driver (preferably LL DRIVER) which does not use variables.
2. If above is not possible then mark the FMC Init function as WEAK
3. Always update the SCT file with start address and size of EXTERNAL SRAM (connected over FMC)
Thanks,
Rajeev
2021-04-26 11:13 AM
Hello @Vangelis Fortounas
I observe function is not declared as weak.
Regards,
Rajeev
2021-04-26 02:07 PM
Hello @Rajeev Arora
in startup_stm32h753xx.s line 239 Reset_Handler is weak so the programmer has the freedom to define his own Reset_Handler. (like the picture above)
2021-05-04 10:34 PM
Hello @Khouloud ZEMMELI , @Vangelis Fortounas
I've coded few functions which do not use any local or global variable (except for various Microcontroller registers)
I believe these function calls and the Reset_Handler will help declare a global variable in External SRAM which can be assigned a value during declaration itself.
Regards,
Rajeev
2021-05-07 01:36 AM
2021-05-07 02:38 AM
#define dExternamUninitializedMRAM_Segment __attribute__( ( section( ".bss.EXT_NO_INIT_RW_SRAM_SECTION" ) ) )
#define dExternamZeroInitializedMRAM_Segment __attribute__( ( section( ".EXT_ZERO_INIT_RW_SRAM_SECTION" ) ) )
uint8_t au8ExternalMRAM_ZeroInitializedReadAndWriteBuffer[dExternalMRAM_TestBufferSize] dExternamZeroInitializedMRAM_Segment = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
uint8_t au8ExternalMRAM_UninitializedReadAndWriteBuffer[dExternalMRAM_TestBufferSize] dExternamUninitializedMRAM_Segment;
SCT file attached with extension changed to TXT