-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32H7: split RAM usage #11507
STM32H7: split RAM usage #11507
Conversation
Bit wary about that Also, formally, you can't guarantee that Does the dummy write have to be "near" the crash dump to make sure you're affecting the correct cache? Or would a write to a normal RAM variable (up in 24000000) do? (Why does the crash data have to be in the 20000000 area? - I missed that discussion) To make it solid (ignoring caches), I think you architecturally need:
Ideally the last 4 lines of that would be packaged into a |
Thanks @kjbracey-arm for feedback. I agree that dummy is far from perfect solution... In fact, we need to ensure that a data is written in the crash data ram partition before the reset occurs. The solution to add an interface in order to customize the system reset for each platform sounds really good. Do you think it is something we can have ? For the crash data ram location to 0x20000000, it was my assumption because of tests-mbed_platform-crash_reporting and tests-mbedmicro-rtos-mbed-heap_and_stack test failling as soon as I use 0x24000000 instead of 0x20000000. This is the case in main branch today... |
@VVESTM, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the crash data ram location to 0x20000000, it was my assumption because of tests-mbed_platform-crash_reporting and tests-mbedmicro-rtos-mbed-heap_and_stack test failling as soon as I use 0x24000000 instead of 0x20000000. This is the case in main branch today...
Although I don't have an objection to the actual location of the crash data, it would be useful to understand why the tests are failing if the crash data ram location is at 0x24000000 instead of 0x20000000; I don't see anything obvious that would explain it.
The other part of the change related to a specific issue on STM32H7 should not be handled by introducing a dummy
variable at the end of mbed_error_ctx ; this will affect all other targets.
I agree that the ideal solution would be to introduce a hal_reset
API.
Can we find a workaround in the meantime; for example by writing a byte write elsewhere but only on that target?
I suspect an hard coded value somewhere but get no time to do a deep investigation on this point. There is one in cmsis but update this value to 0x24000000 was not sufficient. Then, even if we fix this point, we cannot guarantee that the last write will be done.
the system reset is called from mbed_error.c and between this call and the reset, there is no target specific code. So, the only workarround I see is to add some code under target switch (STM32H7 for example). |
@evedon you changes still stand ? |
Due to ECC cache mechanism, the last data is not guarantee to be written in RAM before a system reset. With this modification, we ensure that the crc is well written. Fiw ARMmbed#11422 Signed-off-by: Vincent Veron <vincent.veron@st.com>
To ease discussion and merging, I split this PR in 2 parts:
So, we can concentrate on the solution to customize system reset on this PR and merge #11562 one. |
Than you for splitting the PR in two parts as there is no issue about the ram relocation. As for adding a generic
We would need a test for We don't have the capacity to work on this at the moment so it would be great if you can do it. |
@VVESTM please take a look at the review comments |
@VVESTM Any update? Is this still relevant? |
@VVESTM Please reopen with an update. I'll close it for now. |
Description
Following latest patches done on STM32H743 for ethernet (PR #11274), the test "tests-mbed_platform-crash_reporting" was failing. This was due to RAM relocation from 0x20000000 to 0x24000000.
In order to make this test a success, we need to have crash data ram partition in 0x20000000 area.
So, I decided to use this memory layout :
0x20000000 => int vect (as before ethernet patches)
0x20000298 => crash data ram (as before ethernet patches)
0x24000000 => ram (mandatory for ethernet)
latest commit of this PR concern an issue seen on STM32H7. Due to ECC cache mechanism, there is no guarantee that last data is written before a system reset. Adding a dummy will avoid this situation. See #11422 for more details.
Pull request type