2024-08-11 10:11 PM - edited 2024-08-18 04:32 AM
I am transfering data array from an array to PWM register of TIM1.
int16_t sin_table[20]= { 0, 39, 77, 113, 147, 177, 202, 223, 238,247, 250, 247, 238, 223, 202, 177, 147, 113, 77, 39};
HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_1, (uint32_t *)sin_table, 20);
And i am trying to blink in complete transfer callback fuction as follows .
I am getting PWM signal as expected . but trigger the TransferCompleteCallback).
by using break poiint the DMA Inerupt Handler triggers but not trigger the callback i said .
whats the wrong am with please help me .
i am attaching the full code here
aNY BODY HELP ME
2024-08-18 04:33 AM
Any help ?
2024-08-18 04:54 AM
Seems you missunderstan HAL callbacks ... read examples in folder repository firmware for your MCU...
You mark all MCUs, this isnt very helpfull. For example F4 from stm32f4xx_hal_tim.c func HAL_TIM_PWM_Start_DMA
switch (Channel)
{
case TIM_CHANNEL_1:
{
/* Set the DMA compare callbacks */
htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseCplt;
htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt;
2024-08-19 02:02 AM - edited 2024-08-19 02:03 AM
Hi Thanks , I didnt find any examples related DMA transfer complete function trigger based projects .
Hi may i need to register the following function to trigger the calla back function
HAL_DMA_RegisterCallback(&hdma, HAL_DMA_XFER_CPLT_CB_ID, My_DMA_TransferCompleteCallback);
Or any other way to do this , is there tutorials or mannual for it ?