Skip to content

stm32: some timers (PWM) cannot output to pin #1985

Open
@kenbell

Description

@kenbell

The stm32l032 for example does not enable pin output. The root cause is that I assumed no BDTR register meant no need to enable pin output.

However, the BDTR register was just missing from the Go code generated by the gen-device tool.

Root Cause

The BDTR field is missing because:

  1. not all TIM peripherals have all registers present (however they do have 'compatible' layout) - so if a particular register is present in a peripheral it WILL be at the same address on all peripherals
  2. gen-device assumes all peripherals in a 'group' are identical, so it takes the first and uses it's register layout as definitive
  3. in some cases, gen-device first see's a TIM peripheral with the BDTR register not present

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingstm32

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions