Следите за руками. Вот так не работает:
LPTIM1->DIER = 0
| 0 * LPTIM_DIER_UEIE // Update event DMA request enable
| 0 * LPTIM_DIER_CMP2OKIE // CCR2 update complete interrupt enable
| 1 * LPTIM_DIER_CC2IE // Capture/Compare 2 interrupt enable
| 0 * LPTIM_DIER_REPOKIE // RCR update interrupt enable
| 0 * LPTIM_DIER_UEIE // Update event interrupt enable
| 0 * LPTIM_DIER_DOWNIE // Direction change to down interrupt enable
| 0 * LPTIM_DIER_UPIE // Direction change to up interrupt enable
| 0 * LPTIM_DIER_ARROKIE // ARR update complete interrupt enable
| 0 * LPTIM_DIER_CMP1OKIE // CCR1 update complete interrupt enable
| 0 * LPTIM_DIER_EXTTRIGIE // External trigger valid edge interrupt enable
| 0 * LPTIM_DIER_ARRMIE // Autoreload match interrupt enable
| 0 * LPTIM_DIER_CC1IE // Capture/Compare 1 interrupt enable
;
// enable timer
LPTIM1->CR = 0
| 0 * LPTIM_CR_RSTARE // Reset after read enable, can be set when LPTIM is enabled
| 0 * LPTIM_CR_COUNTRST // Reset counter, can be set when LPTIM is enabled
| 0 * LPTIM_CR_CNTSTRT // Start in continuous mode, can be set when LPTIM is enabled
| 0 * LPTIM_CR_SNGSTRT // Start in single pulse mode, can be set when LPTIM is enabled
| 1 * LPTIM_CR_ENABLE // Enable
;
А вот так работает:
// enable timer
LPTIM1->CR = 0
| 0 * LPTIM_CR_RSTARE // Reset after read enable, can be set when LPTIM is enabled
| 0 * LPTIM_CR_COUNTRST // Reset counter, can be set when LPTIM is enabled
| 0 * LPTIM_CR_CNTSTRT // Start in continuous mode, can be set when LPTIM is enabled
| 0 * LPTIM_CR_SNGSTRT // Start in single pulse mode, can be set when LPTIM is enabled
| 1 * LPTIM_CR_ENABLE // Enable
;
LPTIM1->DIER = 0
| 0 * LPTIM_DIER_UEIE // Update event DMA request enable
| 0 * LPTIM_DIER_CMP2OKIE // CCR2 update complete interrupt enable
| 1 * LPTIM_DIER_CC2IE // Capture/Compare 2 interrupt enable
| 0 * LPTIM_DIER_REPOKIE // RCR update interrupt enable
| 0 * LPTIM_DIER_UEIE // Update event interrupt enable
| 0 * LPTIM_DIER_DOWNIE // Direction change to down interrupt enable
| 0 * LPTIM_DIER_UPIE // Direction change to up interrupt enable
| 0 * LPTIM_DIER_ARROKIE // ARR update complete interrupt enable
| 0 * LPTIM_DIER_CMP1OKIE // CCR1 update complete interrupt enable
| 0 * LPTIM_DIER_EXTTRIGIE // External trigger valid edge interrupt enable
| 0 * LPTIM_DIER_ARRMIE // Autoreload match interrupt enable
| 0 * LPTIM_DIER_CC1IE // Capture/Compare 1 interrupt enable
;
Хотя в в обоих случаях отладчик показывает, что нужные биты в DIER устанавливаются.
Для регистров CCRx, ARR, RCR в документации явно указано, что писать их можно только при активированном (enabled) таймере, для CFGR - наоборот, при неактивном. На запись в DIER никаких ограничений в документации нет.
Куб оказался ни при чем, но помог. В его проекте DIER вообще не трогался и влияющих на него галочек я не обнаружил. Куб просто запускал таймер и когда я, остановив программу, отладчиком включал нужные биты в DIER на уже включенном активированном и запущенном таймере - прерывания запускались.
Вычитывать DIER после записи пробовал - не помогало.