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

Fix mass-erase trigger on "small" devices. #210

Merged
merged 4 commits into from
Feb 8, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Added Interruptable trait to Alternate mode pins
- Added a "low pin count" variant of the f730 chip to the crate features: packages <144 pins don't include a high speed USB PHY
- Added SPI2_SCK pin for stm32f769i-discovery
- Fix mass-erase triggering in `flash` on smaller chips

## [v0.7.0] - 2022-06-05

Expand Down
2 changes: 1 addition & 1 deletion examples/serial_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn main() -> ! {
// function won't return as long as the program runs, so there's no chance
// of anyone else using the same static.
static mut BUFFER: [u8; 4] = [0; 4];
let mut buffer = unsafe { Pin::new(&mut BUFFER) };
let mut buffer = unsafe { Pin::new(&mut *core::ptr::addr_of_mut!(BUFFER)) };
loop {
// Read using DMA
let mut transfer = rx.read_all(buffer, &dma, rx_stream);
Expand Down
2 changes: 1 addition & 1 deletion examples/spi_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn main() -> ! {
// function won't return as long as the program runs, so there's no chance
// of anyone else using the same static.
static mut BUFFER: [u8; 2] = [0; 2];
let mut buffer = unsafe { Pin::new(&mut BUFFER) };
let mut buffer = unsafe { Pin::new(&mut *core::ptr::addr_of_mut!(BUFFER)) };

loop {
// Read WHO_AM_I register of an MPU9250 sensor.
Expand Down
2 changes: 1 addition & 1 deletion examples/spi_dma_16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn main() -> ! {
// function won't return as long as the program runs, so there's no chance
// of anyone else using the same static.
static mut BUFFER: [u16; 1] = [0; 1];
let mut buffer = unsafe { Pin::new(&mut BUFFER) };
let mut buffer = unsafe { Pin::new(&mut *core::ptr::addr_of_mut!(BUFFER)) };

// Use a button to control output via the Maxim Integrated MAX5214 DAC.
loop {
Expand Down
4 changes: 2 additions & 2 deletions examples/stm32f7disco-qspi-flash/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ fn memory_example_dma(

// Create pinned versions for DMA transfers
let mut stream = stream;
let mut read_buffer = unsafe { Pin::new(&mut READ_BUFFER) };
let mut page_buffer = unsafe { Pin::new(&mut PAGE_BUFFER) };
let mut read_buffer = unsafe { Pin::new(&mut *core::ptr::addr_of_mut!(READ_BUFFER)) };
let mut page_buffer = unsafe { Pin::new(&mut *core::ptr::addr_of_mut!(PAGE_BUFFER)) };

///////////////////////
// Test erase + read //
Expand Down
2 changes: 1 addition & 1 deletion examples/stm32f7disco-screen/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn main() -> ! {
let mut display = screen::Stm32F7DiscoDisplay::new(perif.LTDC, perif.DMA2D);
display
.controller
.config_layer(Layer::L1, unsafe { &mut FB_LAYER1 }, PixelFormat::RGB565);
.config_layer(Layer::L1, unsafe { &mut *core::ptr::addr_of_mut!(FB_LAYER1) }, PixelFormat::RGB565);

display.controller.enable_layer(Layer::L1);
display.controller.reload();
Expand Down
2 changes: 1 addition & 1 deletion src/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl<'a> EraseSequence<'a> {
feature = "stm32f778",
feature = "stm32f779",
)))]
w.mer().clear_bit();
w.mer().set_bit();
w.ser().clear_bit()
});

Expand Down
Loading