cancel
Showing results for 
Search instead for 
Did you mean: 

How to know if there are any memory directions reserved?

rubenles
Senior

Hello!

I am trying to use DTCMRAM on my stm32h743zi micro.

When i use an array located from 0x20001760 to 0x200017d4 there are some positions that do not update, it stays in 0 or "inf" value, but when i use other array located in different location, it works perfectly.

My question is..., Is there any reserved directions in this memory that are not allowed to use?  If yes, how can i know which positions i can not use?

 

Thank you so much to everybody!

7 REPLIES 7
TDK
Guru

There aren't any reserved locations. You should be able to read and write wherever you want in DTCM.

Typically, memory values are 0x00 or 0xFF when not initialized. Where is it showing "inf"? Probably there is some other explanation for what you are seeing.

If you feel a post has answered your question, please click "Accept as Solution".
SofLit
ST Employee

Hello,

Nothing prevents you to use the overall DTCM memory (128 Kbytes).

Maybe you need to provide more information of your context: Which IDE? how are you accessing the DTCM RAM? Show some screenshots, etc .. Maybe also to share your project?

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.
rubenles
Senior

Hi @TDK2 . I show you in the next image, there are a few values in 0 and then in "inf" using these directions. 

rubenles_1-1710337078973.png

But if i use other array with other directions, everything works perfectly. I am lost in this problem.

rubenles_2-1710337292589.png

 

Thank you so much

 

 

If they're not 0, something probably wrote to them and you're seeing the result. Perhaps initialize the array to known values before it is used.

Reduce your code to a minimal example to convince yourself that memory is working as expected.

If you feel a post has answered your question, please click "Accept as Solution".
Pavel A.
Evangelist III

The problem is that you want to use uninitialized memory where you have not written any data. The C library zero-initializes only the "bss" memory defined in your program. If other memory areas should be zero-initialized, do it yourself.

The ST GNU startup.s code is a bit naive, would suggest code that explicitly clears other sections of memory that the linker/script dole out. You have to add code to copy initial content from FLASH, or clear.

Keil, IAR, and Arduino GNU do this better, with table driven methods.

Nothing is reserved in DTCMRAM, just be aware it's not cached, and optimization and volatile setting may impact how data is pushed back into memory, and seen by the debugger at certain points.

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rubenles
Senior

Thanks @TDK @Tesla DeLorean @Pavel A. @SofLit for all your answers.

I was looking for the issue and... I was using a variable that was overwriting some position of the array that I sent here..., indeed, the addresses can be fully used.

At least I have that information for the future... 

Thank you all for your time. Appreciate it.