-
-
Notifications
You must be signed in to change notification settings - Fork 793
chips: add stm32l4xx support #4672
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
base: master
Are you sure you want to change the base?
Conversation
Add complete support for STM32L4xx family (specifically L476): - Implement clock management (MSI, HSI, PLL, peripheral clocks) - Add RCC, PWR, Flash, GPIO, EXTI, and SYSCFG drivers - Implement interrupt-based USART driver (no DMA) - Add chip-specific traits for clock constants and flash latency - Create stm32l476rg board crate with default peripherals - Add nucleo_l476rg board support with LED, button, GPIO, and console - Implement MSI as default 4MHz system clock source All drivers follow Tock's HIL interfaces and coding standards. Tested on STM32L476RG Nucleo board.
lschuermann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! I only skimmed much of the files in chips/stm32l4xx. I'm not an STM expert and someone more familiar with that family of chips should take a look at whether this crate organization is proper, or should be further deduplicated with other STM chip implementations. But apart from that, this looks pretty good!
Tagging @alexandruradovici as one of the resident STM chip maintainers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but we probably want to create an stm/ subdirectory in boards to keep our directory structure manageable, similar to what we do for nordic/.
|
|
||
| #![no_std] | ||
| #![no_main] | ||
| //#![deny(missing_docs)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reenable?
| // Optional kernel tests | ||
| // | ||
| // See comment in `boards/imix/src/main.rs` | ||
| // virtual_uart_rx_test::run_virtual_uart_receive(mux_uart); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
| [features] | ||
| # Currently, Tock supports only these chips. | ||
| # When a new chip is added, add its identifier here and inside | ||
| # the chip's crate as a feature for the dependency. | ||
| stm32l476 = [] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't prematurely define features that aren't actually used in the codebase (as far as I can tell). We can add them as soon as we have another chip crate using this common infrastructure.
| // Return BUSY if setting the frequency took too long. The caller can either: | ||
| // | ||
| // + recall this method | ||
| // + or busy wait get_latency() until the flash latency has the desired value | ||
| Err(ErrorCode::BUSY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd guess AGAIN could be a better error code here? What are the cases where this is expected to happen?
Pull Request Overview
Add initial support for STM32L4xx family (specifically L476):
Testing Strategy
Tested on STM32L476RG Nucleo board.
TODO or Help Wanted
This pull request still needs...
Documentation Updated
/docs, or no updates are required.Formatting
make prepush.