cancel
Showing results for 
Search instead for 
Did you mean: 

invalidate D-Cache in stm32h745i-disco

Maximiliano
Associate III

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.

 

30 REPLIES 30

in the schematic, which is VDD? just in case to corroborate that because 3.3V I think it is the vdd

Yes VDD = 3.3V in your case.

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.

 

after completing the deletion without problem but being still connected, the 3.3v was disconnected by mistake and now even if I remove boot0 from the 3.3v and reboot the board when loading the code, it indicates the following error

Maximiliano_0-1729704602384.png

 

from the stm32cubeide I could load the code but when debugging the same thing happens it stays in invalidate D-cache I do not know what I can be doing wrong are a few steps with the stmprogrammer

Forget about your application for now and after recovering the MCU with the steps discribed previously, try to load an existing application with any example provided in STM32CubeH7 (Example: https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H745I-DISCO). If it doens't work, I'm afraid it could be something related to the chip itself and something gone wrong (corrupted flash, or broken chip ...) and I cannot have more to add.

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.

I am supposed to put these lines in the code to be uploaded after deleting the memory? if so, where in the code?

 

/*!< Supply configuration update enable */ HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY);

/*!< Supply configuration update enable */ HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);

 


@Maximiliano wrote:

I am supposed to put these lines in the code to be uploaded after deleting the memory? if so, where in the code?

 

/*!< Supply configuration update enable */ HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY);

/*!< Supply configuration update enable */ HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);

 


Please refer to the examples provided for that board! PWR configuration is in the system clock config. And in CubeMx you find it in RCC:

https://github.com/STMicroelectronics/STM32CubeH7/blob/master/Projects/STM32H745I-DISCO/Examples/GPIO/GPIO_EXTI/CM7/Src/main.c



static void SystemClock_Config(void)
{
  RCC_ClkInitTypeDef RCC_ClkInitStruct;
  RCC_OscInitTypeDef RCC_OscInitStruct;
  HAL_StatusTypeDef ret = HAL_OK;
  
  /*!< 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);
.
.

 

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.

Did it work for you? Do you use my same board?

It was a spam.. hope you didn't click on the click he shared!

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.

Thanks SofLit for the help, unfortunately I think I will not be able to make the board work again, since I have done the steps several times. I hope it can help someone else.

For the moment I just have to be more careful with the power supply I choose for the RCC and just to be sure I ask you: any power supply that says SMPS is valid?
I mean, won't it give me problems at least like this one?
because by default this “PWR_DIRECT_SMPS_SUPPLY” but I happened that sometimes I do not have that option and also this SMPS options from 1V8 to 2V5 and I want to be sure that it will not damage anything to test with any. I know now that neither PWR_external nor PWR_LDO to use.