cancel
Showing results for 
Search instead for 
Did you mean: 

qspi data not compiling

MMARI.1
Senior

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 

MMARI1_0-1738907478474.png

 

8 REPLIES 8
SofLit
ST Employee

hello,

Try:

uint8_t buff[] __attribute__((section(".extFlash")));
To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

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 

Have you refreshed the build analyzer? Sometimes it doesn't refresh on its own. Rebuild and click the refresh icon:

unsigned_char_array_0-1738919012084.png

 

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.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

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. 

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?

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
PS:
1 - This is NOT an online support (https://ols.st.com) but a collaborative space.
2 - Please be polite in your reply. Otherwise, it will be reported as inappropriate and you will be permanently blacklisted from my help.

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.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

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 .

 

 

 

 


@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";

 

 

https://developer.arm.com/documentation/dui0472/m/Compiler-specific-Features/--attribute----used---variable-attribute

 

 

 

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.