2024-03-13 06:27 AM
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!
2024-03-13 06:32 AM
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.
2024-03-13 06:41 AM - edited 2024-03-13 06:42 AM
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?
2024-03-13 06:42 AM
Hi @TDK2 . I show you in the next image, there are a few values in 0 and then in "inf" using these directions.
But if i use other array with other directions, everything works perfectly. I am lost in this problem.
Thank you so much
2024-03-13 07:02 AM
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.
2024-03-13 07:11 AM
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.
2024-03-13 09:00 AM
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.
2024-03-14 03:09 AM
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.