possible error in stm32_ll_lpbam.c
@MKISTM ci sta già lavorando.
Dal 8/5/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
LPBAM_Status_t LPBAM_LPTIM_FillNodeConfig(LPBAM_LPTIM_ConfNode_t const *const pConfNode,
DMA_NodeConfTypeDef *const pDMANodeConfig)
{
LPBAM_Status_t status;
LPBAM_InfoDesc_t desc_info;
...
in stm32_lpbam_lptim.c leaves desc_info uninitialized and calls
LPBAM_Status_t LPBAM_LPTIM_FillStructInfo(LPBAM_LPTIM_ConfNode_t const *const pConfNode,
LPBAM_InfoDesc_t *const pDescInfo)
in stm32_ll_lpbam.c with reference to desc_info.
While LPBAM_LPTIM_FillStructInfo does not set pDescInfo->Request in case of LPBAM_LPTIM_CONFIG_ID with pConfNode->Config.State != ENABLE and pConfNode->Config.Mode != LPBAM_LPTIM_UE_MODE as it can be seen in the following code snippet.
...
/* Check node ID */
switch (pConfNode->NodeDesc.NodeInfo.NodeID)
{
/* LPBAM LPTIM Update Period node ID */
case LPBAM_LPTIM_CONFIG_ID:
{
/* Get control register value */
dummy = pConfNode->pInstance->CR;
/* Check LPTIM state */
if (pConfNode->Config.State == ENABLE)
{
/* Set LPTIM update event request */
pDescInfo->Request = DMA_REQUEST_SW;
/* Set LPTIM state */
dummy |= LPTIM_CR_ENABLE;
/* Check LPTIM start mode update */
if (pConfNode->Config.UpdateStartMode == ENABLE)
{
if (pConfNode->Config.StartMode == LPBAM_LPTIM_START_SINGLE)
{
/* Configure LPTIM to start in single mode */
dummy |= LPTIM_CR_SNGSTRT;
}
else
{
/* Configure LPTIM to start in continuous mode */
dummy |= LPTIM_CR_CNTSTRT;
}
}
}
else
{
/* Set LPTIM state */
dummy &= ~(LPTIM_CR_ENABLE);
/* Check LPTIM mode */
if (pConfNode->Config.Mode == LPBAM_LPTIM_UE_MODE)
{
/* Check LPTIM instance */
if (pConfNode->pInstance == LPTIM1)
{
/* Set LPTIM1 update event request */
pDescInfo->Request = LPDMA1_REQUEST_LPTIM1_UE;
}
else
{
/* Set LPTIM3 update event request */
pDescInfo->Request = LPDMA1_REQUEST_LPTIM3_UE;
}
}
}
/* Set value to be written */
*pConfNode->NodeDesc.pSrcVarReg = dummy;
/* Set DMA source address */
pDescInfo->SrcAddr = (uint32_t)pConfNode->NodeDesc.pSrcVarReg;
/* Set DMA destination address */
pDescInfo->DstAddr = lptim_descitem_tbl[pConfNode->NodeDesc.NodeInfo.NodeID].RegOffset +
(uint32_t)pConfNode->pInstance;
/* Set DMA data size */
pDescInfo->DataSize = lptim_descitem_tbl[pConfNode->NodeDesc.NodeInfo.NodeID].RegDataSize;
break;
}
....
Later code uses Request leading to undefined behavior. The fix that worked for me was adding
...
else
{
pDescInfo->Request = DMA_REQUEST_SW;
/* Set LPTIM state */
dummy &= ~(LPTIM_CR_ENABLE);
...
essentially this problem occurred when adding a lptim stop node with "not from update event detection" in cubemx lpbam scenario.
- Lingua principale
- C
- Stelle
- 184
- Fork
- 94
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di STMicroelectronics/STM32CubeU5
-
LPBAM I2C MasterTx silently writes wrong SADD on bus (STM32CubeU5)Forse di nuovo libera @MKISTM l’ha presa 170 giorni fa e non c’è nessuna pull request aperta. Apertabug cube mx internal bug tracker lpbam
STMicroelectronics/STM32CubeU5#68 · 3 commenti · 1 assegnatario ·
Tutte le issue di STMicroelectronics/STM32CubeU5
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
[cmocka] update to 2.0.2Apertaupdate-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
msys2/MINGW-packages#33004 ·
I maintainer di solito rispondono entro 1 giorno
-
area:buffer good first issue type:documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sudo-project/sudo#586 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
OpenPrinting/cups#1795 ·
I maintainer di solito rispondono entro 1 giorno