Skip to content

Fix bit shift in AHB1 register for CRC enable/reset/sleep-mode bits, STM32L4x3.svd patch #517

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 4 commits into from
Mar 28, 2021

Conversation

cyrusmetcalf
Copy link
Contributor

@cyrusmetcalf cyrusmetcalf commented Mar 18, 2021

Discovered when attempting to enable CRC hardware module.

    let crc_guy = dp.CRC.constrain(&mut rcc.ahb1);

CRC output would be 0. Found with debugger that the enable bit was not
being set in rcc.ahb1 power enable register. Other peripherals in the
register (DMA1/2) could be enabled and the remaining bits in the
register are not writable.

Tested against the following code provided by STM32CubeMX, in which the
CRC module is functional.

Sources

  • CMSIS/Device/ST/STM32L4xx/Include/stm32l433xx.h

  • STM32L43xxx... Reference Manual RM0394 Rev 4. Sections 6.4.9, 6.4.15, 6.4.21

  • Bug Verified/Fixed/Tested on STM32L433 (Nucleo-L433RC-P)

Discovered when attempting to enable CRC hardware module.
```rust
    let crc_guy = dp.CRC.constrain(&mut rcc.ahb1);
```
CRC output would be 0. Found with debugger that the enable bit was not
being set in rcc.ahb1 power enable register. Other peripherals in the
register (DMA1/2) could be enabled and the remaining bits in the
register are not writable.

Tested against the following code provided by STM32CubeMX, in which the
CRC module is functional.

Source: CMSIS/Device/ST/STM32L4xx/Include/stm32l433xx.h
```

```
 - STM32L43xxx... Reference Manual RM0394 Rev 4. Sections 6.4.9, 6.4.15, 6.4.21

 - Bug Verified/Fixed/Tested on STM32L433 (Nucleo-L433RC-P)
@github-actions
Copy link

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.

Thanks for this PR! The changes look good, just need to fix a syntax problem in the YAML (below).

Co-authored-by: Adam Greig <adam@adamgreig.com>
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.

Sorry, looks like my indentation wasn't quite right in that suggested change - the new content had been indented with 4 spaces per tab, so when we combined the sections they were indented underneath the existing APB1ENR1 register and that's why the CI failed.

Co-authored-by: Adam Greig <adam@adamgreig.com>
@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

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.

Thank you, looks good!

bors merge

@bors bors bot merged commit ae10055 into stm32-rs:master Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy