cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H747 Stopped working after flashing

Linas L
Senior II

Hello.

I made big board with STM32H743XI, and it works without glitch. Since STM32H747 is pin to pin compatible (TFBA240+40) I modified PCB that it will fit both processors. ( just a single ground was needed for SMPS, but i don't use it,)

For some reason i was able to generate code from CubeMx just to toggle led from one MCU, and same for the other on different pin. IT worked first debugging session, but after trying to change code, debugger was not able to flash device.

Tried using STlink V2, same, can't connect to MCU, and led is not toggling now.

So I am lost here, how this could be. I know that incorrect clock settings can leave MCU hanging and in this case it is hard to connect to MCU. I disconnected clock from MCU, but still, can't access it.

Never had this much trouble recovering from similar situation on Single Core device. Maybe it has something to do with multi-core program ? IF yes, how can i recover from problem like this ?

4 REPLIES 4

Likely incorrect LDO/SMPS or VOS settings. See other threads.

You'll need to strap BOOT0 high and enter the ROM loader a couple of times so you can erase your app.​

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

I can't put BOOT0 High, it i hardwired to ground ( next revision will place resistor so i could put some voltage to it)

On thing i found is that i did ot connect SMPSVDD to VDD, since it looks like it should be done by datasheet...

But have no problem to connect with empty fresh PCB, just with one i programmed.

Also, does VCAP need to be externaly connected togerther ? It does not that in datasheet clearly

  int32_t timeout = 0xFFFF; 
 SCB_EnableICache();
 SCB_EnableDCache();
 
/* USER CODE BEGIN Boot_Mode_Sequence_1 */
 /* Wait until CPU2 boots and enters in stop mode or timeout*/
 
 while((__HAL_RCC_GET_FLAG(RCC_FLAG_D2CKRDY) != RESET) && (timeout-- > 0));
 
 if ( timeout < 0 )
 {
      Error_Handler();
 }

So fresh PCB with fresh new project just with clock enabled to correct speed and it hangs in 8 line.

Reference programming manual says: 0: D2 domain clocks are not available (default after reset)

But my System_Clock init that is generated by CubeMx is below that while cycle. So, what should i do ?

update:

For some reason this new code runs without a hanging,but if i just press run, CSTACK get out of range, but if I step my debugging session, it does not do that. very very strange....

The stack pointer for stack 'CSTACK' (currently 0xA05F0001) is outside the stack range (0x10000018 to 0x10000418) 

Complete M4 code:

#include "main.h"
 
#define HSEM_ID_0 (0U) /* HW semaphore 0*/
 
static void MX_GPIO_Init(void);
 
void Delsa(uint32_t a)
{
  while(a)
  {
    a--;
    asm("nop");
  }
}
 
int main(void)
{
  /* USER CODE BEGIN 1 */
 
  /* USER CODE END 1 */
  
 
/* USER CODE BEGIN Boot_Mode_Sequence_1 */
  /*HW semaphore Clock enable*/
  __HAL_RCC_HSEM_CLK_ENABLE();
  /* Activate HSEM notification for Cortex-M4*/
  HAL_HSEM_ActivateNotification(__HAL_HSEM_SEMID_TO_MASK(HSEM_ID_0));
  /*
  Domain D2 goes to STOP mode (Cortex-M4 in deep-sleep) waiting for Cortex-M7 to
  perform system initialization (system clock config, external memory configuration.. )
  */
  HAL_PWREx_ClearPendingEvent();
  HAL_PWREx_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFE, PWR_D2_DOMAIN);
  /* Clear HSEM flag */
  __HAL_HSEM_CLEAR_FLAG(__HAL_HSEM_SEMID_TO_MASK(HSEM_ID_0));
 
/* USER CODE END Boot_Mode_Sequence_1 */
  /* MCU Configuration--------------------------------------------------------*/
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();
 
  MX_GPIO_Init();
 
  while (1)
  {
    HAL_GPIO_TogglePin(GPIOG,GPIO_PIN_6);
    Delsa(0xFFFFFF); 
  }
}

While M7 does not go out of stack if i step or just press run my code...

Usually the VCAPs go to their own 2u2 capacitor, in single VCAP pin devices to a 4u7. I assume they bond out the pads together, but I've always placed as two independent caps, usually makes routing/escape easier.

I'd always recommend escaping BOOT0 to a point where you can get it high or low, even if you default build has a zero-ohm resistor placed. Also one of the serial ports supported by the system loader (AN2606)

https://community.st.com/s/question/0D50X0000BL7SnASQV/stlink-problems-with-stm32h745idisco

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