2021-07-06 06:51 AM
Greetings.
I have a microcontroller and QSPI flash. Everything works fine with TouchGFX. The pictures are stored in ExtFlashSection on the flash.
I need to store 3 large arrays for DAC. Tried adding to "STM32F746BGTX_FLASH.ld" except
ExtFlashSection :
{
*(ExtFlashSection ExtFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >QUADSPI
section like this
MusicFlashSection :
{
*(MusicFlashSection MusicFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >QUADSPI
also added in "Middlewares\ST\touchgfx\framework\include\touchgfx\hal\Config.hpp"
#define LOCATION_MUSICFLASH_PRAGMA LOCATION_PRAGMA("MusicFlashSection")
#define LOCATION_MUSICFLASH_ATTRIBUTE LOCATION_ATTRIBUTE("MusicFlashSection")
Build Analyzer did not show a new section.
Then I found an example C:\Users\User\STM32Cube\Repository\STM32Cube_FW_F7_V1.8.0\Projects\STM32746G-Discovery\Applications\QSPI\QSPI_perfs
and copied in my "STM32F746BGTX_FLASH.ld"
.textqspi :
{
. = ALIGN(4);
_qspi_start = .; /* create a global symbol at qspi start */
*(.textqspi) /* .textqspi sections */
*(.textqspi*) /* .textqspi* sections */
. = ALIGN(4);
_qspi_end = .; /* define a global symbols at end of textqspi */
} >QSPI AT> FLASH
and
.textqspi : { *(.textqspi) } >QSPI
Added my arrays similar to the example, but Build Analyzer still didn't show a new section.
Can someone please tell me what I've missed? The analogy just didn't work and I don't know where or how to look for a solution.
I programmed in CubeIDE.
2021-07-06 07:08 AM
__attribute__((section(".textqspi")))
2021-07-07 11:28 PM
Yes of course I did it in a similar way to the example.
#ifndef _WAVE1_H
#define _WAVE1_H
#define NUM_ELEMENTS_1 13223
#ifndef IMG_NO_DATA
#if defined ( __ICCARM__ )
#pragma location = ".voiceqspi"
#else
__attribute__((section(".voiceqspi")))
#endif
const unsigned short Wave_1[13223] = {
2035, 2034, 2033, 2032, 2030, 2030, 2029, 2028, 2028, 2026,
2053, 2035, 2060};
#else
extern const unsigned char Wave_1[];
#endif
#endif
2021-07-08 05:07 AM
I found out what was wrong. Opened the UM2609(https://www.st.com/resource/en/user_manual/dm00629856-stm32cubeide-user-guide-stmicroelectronics.pdf) and read about the linker. I was just declaring my arrays, but I didn't refer to them anywhere in the code. I wanted to figure out how to store them first and then do the rest. Anyway, I unchecked the box and the linker did what I needed to do.