Jan,
Thanks once again for your efforts to help me!
I took thought about your point about not having anything connected. I decided this would make debugging simpler to use the Nucleo-L476RG board (which has only been exposed to a multimeter) and work on that in isolation. (The Nucleo H7A3ZI-Q which I am using to develop the full application has other peripherals set up.) So, I changed back to the Nucleo-L476RG board and used TIM1. All the other settings are default in the .ioc file.
The pins used by TIM1 are PA8 for TIM1_CH1 output (OC1) and PA9 for TIM1_CH2 input (TI2FP2). I managed to pin down a bit mire where the problems is.
In debugging, after execution of HAL_Init(); the impedance of PA9 to ground was high. I modified the code slightly so I could have debugger breakpoints immediately before and after HAL_TIM_OnePulse_Start(&htim1, TIM_CHANNEL_1); is executed.
Before this command is executed the impedance to ground was high and the registers were:
GPIOA
MODER
Mode8 = Mode0 = 0x2
OSPEED
OSPEED8 = OSPEED= 0
PUPDR
PUPDR8 = PUPDR9 = 0
IDR
IDR9 = IDR8 = 1
AFRH
AFR8 = AFR9 = 1
TIM1
CR1: 0x8
OPM = CEN = 1
CR2 :0x100
OIS1 = 1
SMCR: 0x66
TS=0x6 SMS = 0x6
SR: 0x30505f
TIF = CC4IF = CC3IF = CC2IF = CC1IF =UIF = 1
CCMR output: 0x100100
OC1M = 1
CCMR input: 0x100100
ICIF = 1
CCER: 0x2
CC1P = 1
PSC: 0x4f
ARR: c34f
CCR1: 0x270f
BDTR: 0x2002000
MOE = 0 BMP = 1
DMAR: 0x9
DMAB = 0x9
OR2: 0x1
BKINE = 1
OR3: 0x1
B2KINE = 1
After execution of HAL_TIM_OnePulse_Start(&htim1, TIM_CHANNEL_1); the resistance drops for pin PA9 to ground to about 140 Ohms. The GPIOA registers for pins PA8 and PA9 are unchanged. The following TIM1 registers are however, changed.
CR1: 0x8
CEN -> 0
CCER: 0x13
CC2E -> 1, CC1E -> 1
BDTR: 0x200a000
MOE ->1
DMAR: 0x8
DMAB –> 0x8
The reproducible change in impedance when this the above line is executed suggests that the low impedance is not likely to be due to a damaged chip. I checked the power supply voltages and these are OK. Also, since MODER is unchanged – the problem is likely to be elsewhere.
Looking at what the registers do in the manual and looking how the registers change I believe setting CEN -> 0 is OK, MOE -> turns on the OCR output(s) so this is also OK. Why DMAB which has to do with DMA changed, I don’t understand, but it should not have any effect because DMA is not used. What now looks suspicious to me is CCER, where according to the manual CC2E would set the output on channel 2 which is TI2FP2 to a capture compare output. This, I think, would put PA9 to 0 and this could account for the low impedance. I can try a register write to CCER to set CC2E to zero. However, I will leave that till later to avoid making mistakes.
Many thanks again!