Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates for working with next svd2rust release #540

Merged
merged 3 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ jobs:
id: cache-cargo
with:
path: ~/cargo-bin
key: ${{ runner.os }}-svd2rust-0.17.0
key: ${{ runner.os }}-svd2rust-0.19.0
- name: Install svd2rust
if: steps.cache-cargo.outputs.cache-hit != 'true'
uses: actions-rs/[email protected]
with:
crate: svd2rust
version: 0.17.0
version: 0.19.0
- name: Copy svd2rust to cache directory
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightlies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
id: cache-cargo
with:
path: ~/cargo-bin
key: ${{ runner.os }}-cargo-binaries-0.17.0
key: ${{ runner.os }}-cargo-binaries-0.18.0
- name: Install svd2rust
if: steps.cache-cargo.outputs.cache-hit != 'true'
uses: actions-rs/cargo@v1
with:
command: install
args: svd2rust --version 0.17.0
args: svd2rust --version 0.19.0
- name: Install form
if: steps.cache-cargo.outputs.cache-hit != 'true'
uses: actions-rs/cargo@v1
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ crates:
define crate_template
$(1)/src/%/mod.rs: svd/%.svd.patched $(1)/Cargo.toml
mkdir -p $$(@D)
cd $$(@D); svd2rust -g -i ../../../$$<
rustfmt --config-path="rustfmt.toml" $$(@D)/lib.rs
sed "1,20d;23,28d" $$(@D)/lib.rs > $$@
rm $$(@D)/build.rs $$(@D)/lib.rs
cd $$(@D); svd2rust -m -g -i ../../../$$<
rustfmt --config-path="rustfmt.toml" $$@
rm $$(@D)/build.rs
mv -f $$(@D)/generic.rs $$(@D)/../

$(1)/src/%/.form: $(1)/src/%/mod.rs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ contain the latest patches and updates.

## Generating Device Crates / Building Locally

* Install `svd2rust`: `cargo install --version 0.17.0 svd2rust`
* Install `svd2rust`: `cargo install --version 0.19.0 svd2rust`
* Install `form`: `cargo install form`
* Install rustfmt: `rustup component add rustfmt`
* Install svdtools: `pip install --user svdtools`
Expand Down
34 changes: 34 additions & 0 deletions devices/common_patches/tim/v2/g0_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"TIM1,TIM15":
CCMR1_Output:
_clear:
- OC1M?
_modify:
OC2M1:
name: OC2M
OC2M2:
name: OC2M_3
TIM1:
CCMR2_Output:
_modify:
OC3M1:
name: OC3M
OC3M2:
name: OC3M_3
OC4M1:
name: OC4M
OC4M2:
name: OC4M_3
CCMR3_Output:
_modify:
OC5M_bit3:
name: OC5M_3
OC6M_bit3:
name: OC6M_3

"TIM1[46]":
CCMR1_Output:
_clear:
- OC1M?
_modify:
OC1M2:
name: OC1M_3
9 changes: 8 additions & 1 deletion devices/stm32f401.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ CRC:
CR:
name: RESET

FLASH:
ACR:
_modify:
LATENCY:
bitWidth: 4

USART1:
# Add the missing USART interrupts
_add:
Expand Down Expand Up @@ -132,14 +138,15 @@ _include:
- ../peripherals/tim/tim_advanced.yaml
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency16.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_fixes_v1.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- common_patches/fpu_interrupt.yaml
- ../peripherals/tim/tim_ccm_v1.yaml
- ../peripherals/flash/flash_v1.yaml
- common_patches/rtc/rtc_cr.yaml
- ../peripherals/rtc/rtc_common.yaml
- ../peripherals/sdio/sdio_f4.yaml
Expand Down
2 changes: 2 additions & 0 deletions devices/stm32f405.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ _include:
- ../peripherals/tim/tim_advanced.yaml
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency8.yaml
- common_patches/hash/hash.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
Expand Down
1 change: 1 addition & 0 deletions devices/stm32f407.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ _include:
- ../peripherals/eth/eth_mmc_common.yaml
- ../peripherals/eth/eth_mmc_mcfhp_mcp.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency8.yaml
- ../peripherals/usart/uart_usart.yaml
- ../peripherals/usart/uart_sample.yaml
- ../peripherals/usart/uart_uart.yaml
Expand Down
8 changes: 8 additions & 0 deletions devices/stm32f410.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ CRC:
CR:
name: RESET

FLASH:
ACR:
_modify:
LATENCY:
bitWidth: 4

# Add missing reset/enable bits for SPI 5 (SPI5EN is present)
RCC:
PLLCFGR:
Expand Down Expand Up @@ -184,6 +190,8 @@ _include:
- ../peripherals/tim/tim6.yaml
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency16.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
Expand Down
8 changes: 8 additions & 0 deletions devices/stm32f411.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ CRC:
CR:
name: RESET

FLASH:
ACR:
_modify:
LATENCY:
bitWidth: 4

# Add missing interrupts
DMA1:
_add:
Expand Down Expand Up @@ -155,6 +161,8 @@ _include:
- common_patches/tim/tim2345_mixed_l.yaml
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency16.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_fixes_v1.yaml
Expand Down
8 changes: 8 additions & 0 deletions devices/stm32f412.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ _modify:
# ST got the base address of the FSMC peripheral wrong
baseAddress: "0xA0000000"

FLASH:
ACR:
_modify:
LATENCY:
bitWidth: 4

# FSMC register fixes
FSMC:
# Fix reset values
Expand Down Expand Up @@ -427,6 +433,8 @@ _include:
- common_patches/tim/tim2345_mixed_l.yaml
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency16.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/tim/tim_ccr.yaml
Expand Down
8 changes: 8 additions & 0 deletions devices/stm32f413.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ _modify:
TIFRFE:
name: "FRE"

FLASH:
ACR:
_modify:
LATENCY:
bitWidth: 4

CRC:
# The SVD calls the RESET field "CR", fix per RM0430
CR:
Expand Down Expand Up @@ -191,6 +197,8 @@ _include:
- ../peripherals/tim/tim_advanced.yaml
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency16.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/tim/tim_ccr.yaml
Expand Down
8 changes: 7 additions & 1 deletion devices/stm32f427.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ CRYP:
bitOffset: 12
bitWidth: 1


FLASH:
ACR:
_modify:
LATENCY:
bitWidth: 4

# Fix RCC enable bits naming
RCC:
Expand Down Expand Up @@ -234,6 +238,8 @@ _include:
- ../peripherals/sai/sai.yaml
- ../peripherals/rng/rng_v1.yaml
- common_patches/f4_rtc_cr.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency16.yaml
- common_patches/rtc/rtc_cr.yaml
- ../peripherals/rtc/rtc_common.yaml
- ../peripherals/sdio/sdio_f4.yaml
Expand Down
8 changes: 8 additions & 0 deletions devices/stm32f429.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ FMC:
addressOffset: "0x11C"
alternateRegister: ""

FLASH:
ACR:
_modify:
LATENCY:
bitWidth: 4

# Add missing RCC reset/enable bits
RCC:
AHB1LPENR:
Expand Down Expand Up @@ -196,5 +202,7 @@ _include:
- common_patches/f4_rtc_cr.yaml
- common_patches/rtc/rtc_cr.yaml
- ../peripherals/rtc/rtc_common.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency16.yaml
- ../peripherals/sdio/sdio_f4.yaml
- ../peripherals/i2c/i2c_v1_fltr.yaml
7 changes: 7 additions & 0 deletions devices/stm32f446.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ CRC:
_merge:
- "FB*"

FLASH:
ACR:
_modify:
LATENCY:
bitWidth: 4

# Fix misnamed RCC enable bits, add PLLSAI clock
RCC:
CR:
Expand Down Expand Up @@ -581,5 +587,6 @@ _include:
- ../peripherals/sdio/sdio.yaml
- ../peripherals/sdio/sdio_f4_common.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency16.yaml
- ../peripherals/rcc/rcc_v2_pllcfgr_pllr.yaml
- ../peripherals/i2c/i2c_v1_fltr.yaml
16 changes: 16 additions & 0 deletions devices/stm32f469.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ CRYP:
_merge:
- "IV*"

FLASH:
ACR:
_modify:
LATENCY:
bitWidth: 4

# Fix misnamed RCC enable bits
RCC:
APB1ENR:
Expand Down Expand Up @@ -78,6 +84,14 @@ DSIHOST:
DSIHOST:
description: DSI host global interrupt
value: 92
_strip:
- "DSI_"
VMCR:
_modify:
LVAE:
name: LPVAE
LPHFE:
name: LPHFPE

_include:
- common_patches/4_nvic_prio_bits.yaml
Expand Down Expand Up @@ -147,6 +161,8 @@ _include:
- ../peripherals/fsmc/fsmc_wfdis.yaml
- ../peripherals/fsmc/fsmc_nand.yaml
- ../peripherals/fsmc/fsmc_sd.yaml
- ../peripherals/flash/flash_v1.yaml
- ../peripherals/flash/flash_latency16.yaml
- common_patches/hash/hash.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/usb_otg/otg_hs_remove_prefix.yaml
Expand Down
2 changes: 1 addition & 1 deletion devices/stm32f730.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ _include:
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- ../peripherals/tim/tim_ccm_v2.yaml
# - ../peripherals/tim/tim_ccm_v2.yaml
- ../peripherals/sai/sai.yaml
- common_patches/rtc/rtc_cr.yaml
- ../peripherals/rtc/rtc_common.yaml
2 changes: 1 addition & 1 deletion devices/stm32f745.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ _include:
- ../peripherals/fsmc/fsmc_wfdis.yaml
- ../peripherals/fsmc/fsmc_nand.yaml
- ../peripherals/fsmc/fsmc_sd.yaml
- ../peripherals/tim/tim_ccm_v2.yaml
# - ../peripherals/tim/tim_ccm_v2.yaml
- ../peripherals/sai/sai.yaml
- ../peripherals/dma/dma2d_v1.yaml
- common_patches/rtc/rtc_cr.yaml
Expand Down
4 changes: 2 additions & 2 deletions devices/stm32f750.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ _include:
- ../peripherals/tim/tim2345_mixed.yaml
- ../peripherals/tim/tim_advanced.yaml
- common_patches/tim/tim_ccr.yaml
- ../peripherals/tim/tim_ccm_v2.yaml
- ../peripherals/tim/tim1234_1567_ccm_v2.yaml
# - ../peripherals/tim/tim_ccm_v2.yaml
# - ../peripherals/tim/tim1234_1567_ccm_v2.yaml
- ../peripherals/iwdg/iwdg_with_WINR.yaml
- ../peripherals/exti/exti.yaml
- ../peripherals/i2c/i2c_v2.yaml
Expand Down
2 changes: 1 addition & 1 deletion devices/stm32f765.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ _include:
- ../peripherals/fsmc/fsmc_wfdis.yaml
- ../peripherals/fsmc/fsmc_nand.yaml
- ../peripherals/fsmc/fsmc_sd.yaml
- ../peripherals/tim/tim_ccm_v2.yaml
# - ../peripherals/tim/tim_ccm_v2.yaml
- ../peripherals/sai/sai.yaml
- ../peripherals/dma/dma2d_v1.yaml
- common_patches/rtc/rtc_cr.yaml
Expand Down
11 changes: 10 additions & 1 deletion devices/stm32f7x2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ _svd: ../svd/stm32f7x2.svd

_derive:
USART3: USART1
TIM5: TIM2

_rebase:
SPI1: SPI5
Expand All @@ -12,6 +13,14 @@ _modify:
C_ADC:
name: ADC_Common

TIM1:
CCMR3_Output:
_modify:
OC5M3:
name: OC5M_3
OC6M3:
name: OC6M_3

_include:
- common_patches/f7x23_pllsai.yaml
- common_patches/dma_fcr_wo.yaml
Expand Down Expand Up @@ -69,7 +78,7 @@ _include:
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- ../peripherals/tim/tim_ccm_v2.yaml
# - ../peripherals/tim/tim_ccm_v2.yaml
- ../peripherals/sai/sai.yaml
- common_patches/rtc/rtc_cr.yaml
- ../peripherals/rtc/rtc_common.yaml
Loading