2020-06-26 06:12 AM
Hi,
I'm trying to program code into custom PCB with STM32H7B3.
I was first able to connect to STM32H7B3 (read Device ID etc.), but after flashing, the target cannot be found!
ERROR: STM32: Connecting to CPU via connect under reset failed.
I created code for STM32H7B3IIK6 using CubeMX. I used all default settings for project, then compiled using GCC, and flashed using SEGGER J-Link.
Debugger showed:
Break at address "0x0" with no debug information available, or outside of program code.
What could be going on? How to recover from this?
Is the external flash causing problems? Some reset pin configuration? How about security features?
It was just an example project, how can it brick the device!
There is no excessive current consumption (5mA now after bricked, before programming it was 10mA)
2020-06-26 06:46 AM
Easy enough to do, we've covered this in H747I-DISCO, and related H7 topics
Usually relates to incorrect/missing LDO/SMPS or VOS settings in your clock initialization code.
One recovery trick is to pull BOOT0 high, cycling the power a couple of times, and then erasing/programing the part in STM32 Cube Programmer.
2020-06-26 06:48 AM
https://community.st.com/s/question/0D50X0000Bh5aWoSQI/stm32h747-discovery-kit-not-debugprogrammer
#BRICKED #H7BRICKED
2020-06-26 07:09 AM
Ok thank you very much, will try that!
Why the CubeMX default project creates "incorrect/missing LDO/SMPS or VOS settings in your clock initialization code"?
Or is it because our PCB does not match default settings? I think it should use internal oscillators etc.
This is our current setup code (default):
How should we fix it to prevent bricking?
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
/** Supply configuration update enable
*/
HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
/** Configure the main internal regulator output voltage
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
/** Initializes the CPU, AHB and APB busses clocks
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_DIV1;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
/** Initializes the CPU, AHB and APB busses clocks
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
|RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV1;
RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV1;
RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV1;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
{
Error_Handler();
}
}
We have 8MHz external oscillator, but in development internal is fine.
2020-06-26 07:44 AM
EDIT: method worked ! Thank you!
2020-06-26 08:44 AM
Ok, glad to hear, as your earlier response left me thinking that this might be a different/newer issue.
The code below looks Ok as I figure you're running from the internal 64 MHz
Do you have a LDO or SMPS based supply configuration on your board?
The NUCLEO's have an SMPS, run VOS3, and clock at 280 MHz, so would perhaps need to understand the board/wiring in your situation.