arm-trusted-firmware/plat/st/common/include/stm32cubeprogrammer.h
Patrick Delaunay fb3e7985c9 feat(plat/st): add STM32CubeProgrammer support on UART
Add a file to support the STMicroelectronics tool STM32CubeProgrammer
over UART in BL2 for STM32MP15x platform.

This tools is based on protocol defined in AN5275,
"USB DFU/USART protocols used in STM32MP1 Series bootloaders"
based on STM32 MCU protocols (AN3155, "USART protocol used
in the STM32 bootloader").

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I956c95d8de0a94d1eb8e61f043651dae7b838170
2021-12-03 09:26:11 +01:00

29 lines
650 B
C

/*
* Copyright (c) 2021, STMicroelectronics - All Rights Reserved
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef STM32CUBEPROGRAMMER_H
#define STM32CUBEPROGRAMMER_H
#include <stdint.h>
#include <usb_dfu.h>
/* Phase definition */
#define PHASE_FLASHLAYOUT 0U
#define PHASE_SSBL 3U
#define PHASE_CMD 0xF1U
#define PHASE_RESET 0xFFU
/* Functions provided by plat */
uint8_t usb_dfu_get_phase(uint8_t alt);
int stm32cubeprog_usb_load(struct usb_handle *usb_core_handle,
uintptr_t ssbl_base,
size_t ssbl_len);
int stm32cubeprog_uart_load(uintptr_t instance, uintptr_t base, size_t len);
#endif /* STM32CUBEPROGRAMMER_H */