The rp2040 watchdog does not actually reset anything by default. The
psm_hw->wdsel field must be programmed to actually get a reset on a
watchdog failure. Program that field so the watchdog is usable.
Also, disable the watchdog before attempting a reboot into the
bootloader. Otherwise the machine may just reboot a second time due
to a missed watchdog event in the bootloader.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Specify the arm architecture flash bootup address for each chip type
in Kconfig using a new FLASH_BOOT_ADDRESS setting.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The stm32h7 uses similar usart hardware as the stm32f0 and stm32g0
chips. Use the same code implementation for all these chips.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If an USART RX overrun happened on a stm32g0/f0/h7, the ORE flag
would get set by hardware. This flag would also trigger an interrupt.
The problem was that this flag was never cleared on these 3 mcu families
since the ORE flag clear sequence is different to all of the older
chips.
Since the ORE flag is not used in any meaningful way anyway, it was
disabled during the init sequence.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
Send the fault information explicitly in the query_thermocouple fault
field for max6675, max31855, and max31865.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Uses existing common code for STM32. Adds a table for device-
specific PWM mappings. Adds support for enabling all TIM timer
devices. Makes it a runtime error to enable devices the code
doesn't know how to enable.
I have verified performance of the fan pins (PC6, PC7, PB15)
on the SKR Mini E3 V3.
Signed-off-by: Ben Jackson <ben@ben.com>
Introduce a CONFIG_USB build symbol that is set whenever
CONFIG_USBSERIAL or CONFIG_USBCANBUS is set. Use that symbol during
setup so that the USB controller is properly initialized for both usb
serial and usb canbus bridge configurations.
This fixes the clock configuration for usb canbus bridge mode on
stm32f446.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
An mcu device acting as an "mcu bridge" should only be reset after
other normal devices are reset - otherwise the bridge wont be able to
pass along the reset message to the downstream mcus.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use bootloader_request() instead of try_request_canboot(). This
allows the bootloader machanism to work for more bootloaders.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename this board API function to a more generic name. This is in
preparation for calling the function from the canbus code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The stm32g0 specification states that it is required to wait for the
CCRDY flag to be raised after changing the channel configuration.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support a USB interface that shows up as a canbus adapter to linux.
Route both local and real canbus packets over that interface.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>