2024-10-23 06:35 AM - last edited on 2024-10-23 06:41 AM by SofLit
hello everyone,
I am having a problem with my stm32H745I board testing code for the RTC,RCC and power supply it seems that it stopped working. At first it wouldn't let me upload code until with stmprogrammer I connected by holding reset.
Now I can upload code but it doesn't do anything, not even a simple led which is a test code of mine that was working.
When debugging I find that it stays in this part of the code in loop:
/* invalidate D-Cache */
sets = (uint32_t)(CCSIDR_SETS(ccsidr));
do {
ways = (uint32_t)(CCSIDR_WAYS(ccsidr));
do {
SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) |
((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk) );
#if defined ( __CC_ARM )
__schedule_barrier();
#endif
} while (ways-- != 0U);
} while(sets-- != 0U);
__DSB();
SCB->CCR |= (uint32_t)SCB_CCR_DC_Msk; /* enable D-Cache */
__DSB();
__ISB();
#endif
}"
I tried to update firmware, load .hex, erase memory with stmprogrammer and nothing.
Solved! Go to Solution.
2024-10-24 03:22 AM
Hello,
This is why users need to read the documentation before starting a development especially for complex products such as H7 dual core line:
In red is what you configured and in green is what you need to configure for this board. You can notice that the external HW is not the same. So the software needs to follow the hardware configuration:
And also to refer to the Hardware getting started and board's schematics and User manual of it.
This is what is provided in the user manual of the board:
And also at least to refer to the Cube examples and how they were implemented especially for ST boards.
2024-10-23 06:44 AM - edited 2024-10-23 06:45 AM
Hello @Maximiliano ,
First please use </> button to share your code. I've already edited your post.
Second, as you are using a stm32h745i-disco board what, is the power supply you set? SMPS or LDO? What Frequency and what VOS level you set?
On this board you need to set SMPS for power configuration and you can't exceed 400MHz of system clock at VOS1.
2024-10-23 06:50 AM
Use invalidate with caution, it can trash the execution state, writes to stack, etc.
2024-10-23 06:55 AM
Thank you for your response SofLit.
I was testing the RCC with PWR_LDO_SUPPLY and with PWR_EXTERNAL_SOURCE_SUP (I don't remember after which one it stopped working) but I feed the board by USB STLK. The only thing I am sure is that I did not exceed any MHZ limit because it is very clear in that stm32cubeIDE so as soon as I saw something in red or warning when I wanted to generate the code I modified it. I share with you my code in .zip.
I remember that when I used the LSI it generated a delay in the RTC clock so when I changed the LSE it worked without delays but when I restarted the board it did not keep the time but between tests and tests it did not let me upload any more code until I did all the above mentioned.
2024-10-23 06:57 AM
sorry I did not understand
2024-10-23 07:01 AM - edited 2024-10-23 07:02 AM
@Maximiliano wrote:
Thank you for your response SofLit.
I was testing the RCC with PWR_LDO_SUPPLY and with PWR_EXTERNAL_SOURCE_SUP (I don't remember after which one it stopped working)
This board is configured in SMPS by hardware, so you can't configure another power supply unless you do a modification on the board.
/*!< Supply configuration update enable */
HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY);
/* The voltage scaling allows optimizing the power consumption when the device is
clocked below the maximum system frequency, to update the voltage scaling value
regarding system frequency refer to product datasheet. */
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
See the example from github:
If you feel the MCU is broken you can recover the MCU. Please refer to this article: https://community.st.com/t5/stm32-mcus/how-can-i-recover-my-stm32h7-board-after-facing-a-power/ta-p/49579
2024-10-23 07:23 AM - edited 2024-10-23 07:25 AM
I double checked your system clock config and found this power contig:
HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
And this is what I have a doubt about!
Need to set it to SMPS:
HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY);
But this needs to be set after to recover the MCU: https://community.st.com/t5/stm32-mcus/how-can-i-recover-my-stm32h7-board-after-facing-a-power/ta-p/49579
2024-10-23 07:28 AM
Thank you very much SofLit, I am looking for the boot0 pin to perform the procedure and as soon as I can make my LED blink code work I will know that I was able to recover the board and I will see the power supply better.
2024-10-23 08:00 AM
Sorry SofLit on my board it says reference: MB1381B and the schematic I am using says MB1381 is it the same? according to the schematic I have to jumper R144 is it correct? attached photo
https://www.st.com/resource/en/schematic_pack/mb1381-h750xb-b01-schematic.pdf
2024-10-23 08:39 AM - edited 2024-10-23 08:39 AM
Try to solder a wire for Boot0 here and connect it to VDD to enter system memory: