filmov
tv
Configuring LPBAM applications on the STM32U5 with STM32CubeMX
Показать описание
The Low Power Background Autonomous Mode (LPBAM) is a powerful new feature of the STM32U5 microcontroller that allows peripherals to run autonomously with optimized power consumption down to STOP 2 mode. In this video, you will learn about how the LPBAM works and go through the creation of an example project that utilizes the LPBAM.
Here are some useful links if you would like to learn more about the LPBAM:
AN5645: STM32U5 Series power optimization using LPBAM
RM0456: STM32U575 Reference Manual
STM32U575 Datasheet:
Below is the necessary code for the example project in the video:
/* Modify STM32U575ITXQ_FLASH.ld */
MEMORY
{
RAM(xrw): ORIGIN = 0x28000000,LENGTH = 16K
FLASH(rx): ORIGIN = 0x08000000,LENGTH = 2048K
}
/* main.c USER CODE BEGIN Includes */
#include "lpbam_txapp.h"
/* main.c USER CODE BEGIN PV */
uint8_t SPIBuff[] = {0x12};
uint8_t UARTBuff[] = {'!'};
DMA_HandleTypeDef *LPDMA_Handlers[2] =
{
&handle_LPDMA1_Channel0,
&handle_LPDMA1_Channel1
};
/* lpbam_txapp_txdata_build.c USER CODE BEGIN EV */
extern uint8_t SPIBuff[];
extern uint8_t UARTBuff[];
/* main.c USER CODE BEGIN 2 */
MX_TXApp_Init();
MX_TXApp_TxData_Init();
MX_TXApp_TxData_Build();
MX_TXApp_TxData_Link(LPDMA_Handlers[0]);
MX_TXApp_TxData_Start(LPDMA_Handlers[0]);
__HAL_RCC_PWR_CLK_ENABLE();
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
/* lpbam_txapp_txdata_config.c USER CODE BEGIN TXApp_TxData_Start
* in MX_TXApp_TxData_Start()
*/
if (HAL_LPTIM_PWM_Start(&hlptim1, LPTIM_CHANNEL_1) != HAL_OK)
{
Error_Handler();
}
if (HAL_LPTIM_PWM_Start(&hlptim3, LPTIM_CHANNEL_1) != HAL_OK)
{
Error_Handler();
}
Комментарии