2025-02-06 09:52 PM
hi,
I am trying to external loader connect with stm32h723zgt6 + w25q128 .
before loading the stldr file into debugger i need know why cube ide not compiling the data into qspi location ?
In the main.c file constant data has been declared as below .
const __attribute__((section(".extFlash"))) uint8_t buff[] = "Hello world from H723 QSPI";
In the flash id file has been modified as below.
QSPI_FLASH (r) : ORIGIN = 0x90000000, LENGTH = 16M
.extFlash :
{
*(.extFlash)
} >QSPI
after compiling why memory details not showing in the below menu
Solved! Go to Solution.
2025-02-07 03:06 AM - edited 2025-02-07 03:16 AM
@MMARI.1 wrote:hi @unsigned_char_array @SofLit
I have declared constant data only as above , not used Since this constant data to suppose to write in external flash. I do agree cube ide skip the unused variable during the compiling . I am not sure cube ide will skip the unused constant data for the external flash since stldr file going to handle this !.
If unused it won't be linked. CubeIDE doesn't skip anything as it doesn't compile, it just calls the compiler/linker. If not linked it won't end up in the elf file and it won't be flashed regardless of what flashing tool will be used.
Either use it (reference it) in your code or add __attribute__((used))
const uint8_t buff[] __attribute__((section(".extFlash"))) __attribute__((used))= "Hello world from H723 QSPI";
2025-02-07 12:10 AM
hello,
Try:
uint8_t buff[] __attribute__((section(".extFlash")));
2025-02-07 12:27 AM
hi,
i have modified as below :
uint8_t buff[] __attribute__((section(".extFlash")))= "hello world";
but still problem continues as same !. it not showing as earlier attached picture
2025-02-07 01:07 AM
Have you refreshed the build analyzer? Sometimes it doesn't refresh on its own. Rebuild and click the refresh icon:
Also, why did you remove const? You cannot put a variable in ROM, only constants. The linker won't like it. And if it somehow builds you will get a hardfault error if the MCU tries to modify the object.
Is the object used? If not, it might be optimized away by the linker.
2025-02-07 01:24 AM
hi,
i have modified constant as below
const uint8_t buff[] __attribute__((section(".extFlash"))) = "Hello world from H723 QSPI";
i have refreshed many times and build the project many times but problem is same as continues.
2025-02-07 01:30 AM
Did you use it in your application or you've only declared it? it could be optimized by the tool if you didn't use it.
If you put buff in the live expression are you able to see the content?
2025-02-07 01:37 AM - edited 2025-02-07 01:39 AM
Let me ask again. Is the object used? If not, it might be optimized away by the linker.
Please upload the .map file too.
Please upload the complete linker file too.
2025-02-07 02:46 AM
hi @unsigned_char_array @SofLit
const uint8_t buff[] __attribute__((section(".extFlash"))) = "Hello world from H723 QSPI";
I have declared constant data only as above , not used Since this constant data to suppose to write in external flash. I do agree cube ide skip the unused variable during the compiling . I am not sure cube ide will skip the unused constant data for the external flash since stldr file going to handle this !.
Live Expressions not accepting buff and it's shows error .
2025-02-07 03:06 AM - edited 2025-02-07 03:16 AM
@MMARI.1 wrote:hi @unsigned_char_array @SofLit
I have declared constant data only as above , not used Since this constant data to suppose to write in external flash. I do agree cube ide skip the unused variable during the compiling . I am not sure cube ide will skip the unused constant data for the external flash since stldr file going to handle this !.
If unused it won't be linked. CubeIDE doesn't skip anything as it doesn't compile, it just calls the compiler/linker. If not linked it won't end up in the elf file and it won't be flashed regardless of what flashing tool will be used.
Either use it (reference it) in your code or add __attribute__((used))
const uint8_t buff[] __attribute__((section(".extFlash"))) __attribute__((used))= "Hello world from H723 QSPI";
2025-02-07 06:28 AM - edited 2025-02-07 06:30 AM
hi, @unsigned_char_array , @SofLit
sincere many thanks :) for your deep finding .
finally problem solved by using external flash constant data declared and used inside the code ! .
Initially i was struggled to setup stldr file that's what i have went deep of QSPI data compiling and memory allocation .
Now moving to dual quad spi ( like to be Octal SPI) for high speed output as below.
https://community.st.com/t5/stm32-mcus/how-to-connect-two-quad-spi-memories-using-only-one-octospi/ta-p/675936
Octal SPI memory availability issue here and cost too .
i have only one option to buy one more the same quad spi which is currently used .
Kind request :
Please suggest me which BSP examples or Any other link i should follow for dual quad spi in octal mode for a init , read , write and memory map driver file.
Based on your suggestion i can build my own custom stldr file for dual quad in octal mode .