Skip to content

CRC peripheral corrections #710

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

Merged
merged 7 commits into from
Jul 3, 2022
Merged

Conversation

Pagten
Copy link
Contributor

@Pagten Pagten commented Mar 31, 2022

This PR proposes the following corrections related to the CRC peripheral.

1. Remove the CRC:Polysize field from the STM32F0x0

According to RM0360, these devices do not have a programmable polygonal size.

2. Ensure the polynomial field within CRC:POL has the same name in all devices

In the following devices, this field was named Polynomialcoefficients instead of POL like in other devices.

  • STM32L4x2
  • STM32L4R9
  • STM32L4x1
  • STM32L4x3
  • STM32L4x5
  • STM32L4x6

3. Add missing CRC:POL register to STM32F0x1, STM32F0x2, STM32F0x8

According to RM0091, these devices have a CRC:POL register but it is missing from the SVD.

Note: for the STM32F03x, STM32F04x and STM32F05x the CRC:POL register is read-only. However, since no separate SVD file is in place for these device sub-ranges, the register will be incorrectly marked as read-write for them. The same applies to the CRC:CR:POLYSIZE field, which was already present in these devices before this PR.

4. Merge crc_with_polysize.yaml into crc_pol.yaml and update devices accordingly

As far as I can tell, the CRC:CR:POLYSIZE field (for setting the size of the CRC polynomial) and the CRC:POL register (for reading/writing the CRC polynomial itself) always coincide.

Quite a number of devices only had crc_with_polysize.yaml without crc_pol.yaml, which does not make sense to me, because why would a device support setting the size of the polynomial if it doesn't support setting the polynomial itself? For all devices that now have access to the CRC:POL register because of this change, I verified that this is in line with the applicable reference manual.

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

github-actions bot commented Apr 2, 2022

Memory map comparison

@Pagten
Copy link
Contributor Author

Pagten commented Apr 2, 2022

I noticed the STM32L0x0, STM32L0x1, STM32L0x2 and STM32L0x3 device files were renaming the Polynomialcoefficients field to POL manually, so I added a commit to replace that manual renaming with including the crc_rename_pol.yaml file, to avoid the code duplication.

adamgreig
adamgreig previously approved these changes Jul 3, 2022
Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 3, 2022

Merge conflict.

@adamgreig adamgreig force-pushed the crc-peripheral-corrections branch from 7158e71 to 428dcdb Compare July 3, 2022 21:01
adamgreig
adamgreig previously approved these changes Jul 3, 2022
Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to fix merge conflicts.

bors r+

bors bot added a commit that referenced this pull request Jul 3, 2022
710: CRC peripheral corrections r=adamgreig a=Pagten

This PR proposes the following corrections related to the CRC peripheral.

### 1. Remove the CRC:Polysize field from the STM32F0x0
According to [RM0360](https://www.st.com/resource/en/reference_manual/rm0360-stm32f030x4x6x8xc-and-stm32f070x6xb-advanced-armbased-32bit-mcus-stmicroelectronics.pdf), these devices do not have a programmable polygonal size.

### 2. Ensure the polynomial field within CRC:POL has the same name in all devices
In the following devices, this field was named `Polynomialcoefficients` instead of `POL` like in other devices.
 * STM32L4x2
 * STM32L4R9
 * STM32L4x1
 * STM32L4x3
 * STM32L4x5
 * STM32L4x6

### 3. Add missing CRC:POL register to STM32F0x1, STM32F0x2, STM32F0x8
According to [RM0091](https://www.st.com/resource/en/reference_manual/rm0091-stm32f0x1stm32f0x2stm32f0x8-advanced-armbased-32bit-mcus-stmicroelectronics.pdf), these devices have a CRC:POL register but it is missing from the SVD.

Note: for the STM32F03x, STM32F04x and STM32F05x the CRC:POL register is read-only. However, since no separate SVD file is in place for these device sub-ranges, the register will be incorrectly marked as read-write for them. The same applies to the CRC:CR:POLYSIZE field, which was already present in these devices before this PR.

### 4. Merge `crc_with_polysize.yaml` into `crc_pol.yaml` and update devices accordingly
As far as I can tell, the CRC:CR:POLYSIZE field (for setting the size of the CRC polynomial) and the CRC:POL register (for reading/writing the CRC polynomial itself) always coincide.

Quite a number of devices only had `crc_with_polysize.yaml` without `crc_pol.yaml`, which does not make sense to me, because why would a device support setting the size of the polynomial if it doesn't support setting the polynomial itself? For all devices that now have access to the CRC:POL register because of this change, I verified that this is in line with the applicable reference manual.


Co-authored-by: Pieter Agten <pieter.agten@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 3, 2022

Build failed:

adamgreig
adamgreig previously approved these changes Jul 3, 2022
Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 3, 2022

Merge conflict.

@adamgreig adamgreig force-pushed the crc-peripheral-corrections branch from fc9cda9 to 0514eca Compare July 3, 2022 21:25
@github-actions
Copy link

github-actions bot commented Jul 3, 2022

Memory map comparison

@github-actions
Copy link

github-actions bot commented Jul 3, 2022

Memory map comparison

Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 3, 2022

Build succeeded:

@bors bors bot merged commit 4cbe55e into stm32-rs:master Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants