2020-10-26 03:37 PM
Hello,
I am trying to program the STM32H743ZI using the STM32CubeProgrammer tool in uart mode.
First in order to get the board into the boot loader I use the following runtime code to get into bootloader mode:
/**
* Function to perform jump to system memory boot from user application
*
* Call function when you want to jump to system memory
*/
void JumpToBootloader(void) {
uint32_t i=0;
void (*SysMemBootJump)(void);
/* Set the address of the entry point to bootloader */
volatile uint32_t BootAddr = 0x1FF09800;
/* Disable all interrupts */
__disable_irq();
/* Disable Systick timer */
SysTick->CTRL = 0;
/* Set the clock to the default state */
HAL_RCC_DeInit();
/* Clear Interrupt Enable Register & Interrupt Pending Register */
for (i=0;i<5;i++)
{
NVIC->ICER[i]=0xFFFFFFFF;
NVIC->ICPR[i]=0xFFFFFFFF;
}
/* Re-enable all interrupts */
__enable_irq();
/* Set up the jump to booloader address + 4 */
SysMemBootJump = (void (*)(void)) (*((uint32_t *) ((BootAddr + 4))));
/* Set the main stack pointer to the bootloader stack */
__set_MSP(*(uint32_t *)BootAddr);
/* Call the function to jump to bootloader location */
SysMemBootJump();
/* Jump is done successfully */
while (1)
{
/* Code should never reach this loop */
}
}
Then I connect via UART3 to the chip and try to program it. It seems to transfer the program ok - but fails on verifying. The same result happens at different lower baudrates as well. Below is the output of STM32_Programmer_CLI.exe:
" -------------------------------------------------------------------\r\n STM32CubeProgrammer v2.4.0 \r\n -------------------------------------------------------------------\r\n\r\nSerial Port COM20 is successfully opened.\r\nPort configuration: parity = even, baudrate = 115200, data-bit = 8,\r\n stop-bit = 1.0, flow-control = off\r\nActivating device: OK\r\nChip ID: 0x450 \r\nBootLoader protocol version: 3.1\r\n\r\n\r\nMemory Programming ...\r\nOpening and parsing file: DSPBoardH7.elf\r\n File : DSPBoardH7.elf\r\n Size : 92232 Bytes\r\n Address : 0x08000000 \r\n\r\n\r\nErasing memory corresponding to segment 0:\r\nDownload in Progress:\r\n\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1 0%\r\xDB 2%\xDB 4%\xDB 6%\xDB 8%\xDB 10%\xDB 12%\xDB 14%\xDB 16%\xDB 18%\xDB 20%\xDB 22%\xDB 24%\xDB 26%\xDB 28%\xDB 30%\xDB 32%\xDB 34%\xDB 36%\xDB 38%\xDB 40%\xDB 42%\xDB 44%\xDB 46%\xDB 48%\xDB 50%\xDB 52%\xDB 54%\xDB 56%\xDB 58%\xDB 60%\xDB 62%\xDB 64%\xDB 66%\xDB 68%\xDB 70%\xDB 72%\xDB 74%\xDB 76%\xDB 78%\xDB 80%\xDB 82%\xDB 84%\xDB 86%\xDB 88%\xDB 90%\xDB 92%\xDB 94%\xDB 96%\xDB 98%\xDB 100%\r\n\r\nFile download complete\r\nTime elapsed during download operation: 00:00:23.082\r\n\r\n\r\n\r\nVerifying ...\r\n\r\n\r\nRead progress:\r\n\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1\xB1 50%\r\r\n\r\nError: Read Serial Response timed out.\r\n\r\n\r\nError: Error occured during memory read at address 0x08000200\r\n\r\n\r\nError: Failed to read memory at address 0x08000000 during verification\r\n\r\n\r\nError: Download verification failed\r\n\r\n\r\n\r\nRUNNING Program ... \r\n Address: : 0x8000000\r\n\r\nTimeout error occured while waiting for acknowledgement.\r\nError: START command not acknowledged!\r\nError: Start operation failed\r\n"
Any Ideas on how to fix this or what I'm missing would be appreciated!
2020-10-31 02:06 PM
can you try to enter boortlaoder mode by hardware option instead of run-time ? and check again.
as it seems not able to read at start of the flash at address 0x0800_0000 which is the run-time bootstrap code.
2020-11-02 11:33 AM
HI STOne-32,
I was able to enter bootloader mode by hardware (holding boot0 high and pulling down the reset pin to reset the board). And indeed I was able to program and verify with UART once in that state.
I'm guessing not, but Is there a way that the chip can be programmed in software boot mode? Basically I need a way for the H7 to get itself into boot mode. Is using the chip to drive its own boot0 via external pins a better method for this?
Thanks for your help
2020-11-02 12:17 PM
Update: I was able to have the H7 drive its own BOOT0 pin high via another pin and a capacitor for holding it high long enough for self reset (again via an external pin). This seems to work well for me