Commit Graph

4167 Commits

Author SHA1 Message Date
Rasmus Melchior Jacobsen
d8c92c53d6 Merge remote-tracking branch 'upstream/master' into u32-partition 2023-04-11 07:36:23 +02:00
Dario Nieuwenhuis
1f25d2ba83
Merge pull request #1347 from embassy-rs/h5-spi
stm32h5: add spi support, fix DMA hang, add HIL tests.
2023-04-10 21:27:44 +02:00
Dario Nieuwenhuis
cae683cd41 stm32: update pac. 2023-04-10 21:12:48 +02:00
bors[bot]
53c60df997
Merge #1346
1346: fix I2C controller problems after NACK r=Dirbaio a=Juravenator

While tinkering with I2C on a NUCLEO-H723ZG, I noticed that when trying to communicate with a non-existent device you do receive a proper NACK error, but afterwards any future communications with any device no longer works as expected.

The use case is auto-detection of devices, in this case a series of Adafruit 24LC32 I2C EEPROM boards.

On closer inspection with a logic analyzer, I observed that after the NACK, any data bytes sent out by the board to the devices are just zeros. Even though the embassy code specifies the correct data in `set_txdata` in `write_internal`. Something seems to be going wrong with the controller or buffers on the board itself.

Then I noticed what seems to be a logic error in `flush_txdr`, which is called when issuing a NACK.

After flipping the if statement, I2C communications keep working as expected after issuing a NACK.

Co-authored-by: Glenn Dirkx <glenn.dirkx@gmail.com>
2023-04-10 14:49:12 +00:00
Glenn Dirkx
6760258ec3 fix I2C controller problems after NACK 2023-04-10 16:20:47 +02:00
Dario Nieuwenhuis
dbfd28130f stm32/test: add h5 hil tests. 2023-04-10 15:25:11 +02:00
Dario Nieuwenhuis
4ef8e008e8 stm32/spi: add v4/v5 support (for H5). 2023-04-10 15:25:11 +02:00
Dario Nieuwenhuis
44b7fe45e2 stm32/gpdma: fix race condition when resetting channel when done. 2023-04-10 15:11:07 +02:00
bors[bot]
df17a88448
Merge #1342
1342: feat(rp): add `Wait` impl to `OutputOpenDrain` r=Dirbaio a=TheLostLambda

A while ago `OutputOpenDrain` was made to implement `InputPin`, something that allowed drivers for various one-wire protocols to be written, but it's been lacking a `Wait` implementation — something that's needed to write async versions of these drivers.

This commit also adds `get_level()` to `OutputOpenDrain`, since `is_high()` and `is_low()` were already implemented, but `get_level()` itself was missing.

Co-authored-by: Brooks J Rady <b.j.rady@gmail.com>
2023-04-09 20:50:08 +00:00
Dario Nieuwenhuis
dee8c71a2d lora: fix embassy docs build. 2023-04-09 22:40:09 +02:00
Brooks J Rady
1fbb8f0b32 feat(rp): add Wait impl to OutputOpenDrain
A while ago `OutputOpenDrain` was made to implement `InputPin`,
something that allowed drivers for various one-wire protocols to be
written, but it's been lacking a `Wait` implementation — something
that's needed to write async versions of these drivers.

This commit also adds `get_level()` to `OutputOpenDrain`, since
`is_high()` and `is_low()` were already implemented, but `get_level()`
itself was missing.
2023-04-09 09:15:57 +01:00
bors[bot]
047ea9066f
Merge #1335
1335: Misc stm32 fixes r=Dirbaio a=Dirbaio

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-04-07 00:29:18 +00:00
Dario Nieuwenhuis
f38899728c stm32: add h5 flavor. 2023-04-07 02:28:36 +02:00
Dario Nieuwenhuis
8469a2409c stm32/otg: add U5 support. 2023-04-07 02:28:36 +02:00
Dario Nieuwenhuis
dee1d51ad3 stm32: remove subghz feature.
It's available only on WL. if you're using a WL, you want subghz for sure.
2023-04-07 02:28:36 +02:00
bors[bot]
da8258b767
Merge #1330
1330: stm32/pwm: add complementary pwm r=Dirbaio a=xoviat

This implements complementary PWM with dead time on many supported targets. The specific dead-time programming functions are passed through directly to the user, which is a bit ugly but the best compromise I could reach for now.

Co-authored-by: xoviat <xoviat@users.noreply.github.com>
2023-04-06 21:33:17 +00:00
bors[bot]
60809edf2c
Merge #1306
1306: Update embedded-hal r=Dirbaio a=Dirbaio

- [x] Wait for merge https://github.com/rust-embedded/embedded-hal/pull/443
- [x] Wait for release
- [x] embassy-embedded-hal
- [x] embassy-nrf
- [x] embassy-stm32
- [x] embassy-rp

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-04-06 21:06:54 +00:00
Dario Nieuwenhuis
be37eee13d Update embedded-hal crates. 2023-04-06 22:41:50 +02:00
bors[bot]
c9b7dbc541
Merge #1334
1334: executor: fix doc features. r=Dirbaio a=Dirbaio

Forgot to update them in #1321 

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-04-06 20:40:17 +00:00
Dario Nieuwenhuis
e2516bba09 executor: fix doc features. 2023-04-06 22:39:36 +02:00
bors[bot]
f3ec6080bf
Merge #1332
1332: executor: Replace unsound critical sections with atomics r=Dirbaio a=GrantM11235

I couldn't figure out the correct orderings, so I just left them as SeqCst for now.

Co-authored-by: Grant Miller <GrantM11235@gmail.com>
2023-04-06 18:01:21 +00:00
bors[bot]
89279dcdc9
Merge #1333
1333: STM32: Adc V1 r=Dirbaio a=GrantM11235

Based on #947

Co-authored-by: Matthew W. Samsonoff <matt.samsonoff@gmail.com>
Co-authored-by: Grant Miller <GrantM11235@gmail.com>
2023-04-06 17:16:50 +00:00
Dario Nieuwenhuis
d9696bd212
Merge pull request #1300 from embassy-rs/h5
Add support for STM32H5.
2023-04-06 19:14:02 +02:00
Dario Nieuwenhuis
611d023829 stm32: add H5 support. 2023-04-06 18:59:37 +02:00
Dario Nieuwenhuis
9f28d80977 stm32/usb: add support for 32bit usbram. 2023-04-06 18:59:37 +02:00
bors[bot]
52cab3a9f4
Merge #1323
1323: Add hash functions to FirmwareUpdater r=Dirbaio a=rmja

This adds support for computing any hash over the update in the dtu area by providing a closure to the hash update function.

Co-authored-by: Rasmus Melchior Jacobsen <rmja@laesoe.org>
2023-04-05 23:43:24 +00:00
xoviat
31ef783ac1 stm32/pwm: fix unused import 2023-04-05 18:18:05 -05:00
xoviat
9f1dac3f5d stm32/pwm: add complementary pwm example 2023-04-05 18:07:07 -05:00
xoviat
7677268319 stm32/pwm: cleanup and fix complementary pwm 2023-04-05 17:50:23 -05:00
Grant Miller
0ef419bee4 Change ADC1 to ADC 2023-04-05 16:52:32 -05:00
Grant Miller
92e96bd601 Fix typo 2023-04-05 16:38:06 -05:00
Grant Miller
7c53ebd576 Fix example reference voltage 2023-04-05 16:28:28 -05:00
Grant Miller
20e7b5e296 InternalChannel 2023-04-05 16:11:21 -05:00
Grant Miller
37d8f2e512 Properly enable and reset adc 2023-04-05 15:28:42 -05:00
Grant Miller
efd9e18321 Fix example 2023-04-05 15:12:27 -05:00
Grant Miller
f588105429 wip 2023-04-05 15:01:31 -05:00
Matthew W. Samsonoff
28b8ac4b62 Update STM32F0 ADC example to use read_internal 2023-04-05 14:34:24 -05:00
Matthew W. Samsonoff
511a951246 Differentiate between read and read_internal for STM32F0 ADC
The internal channels (vbat, vref, and temperature) are not real pins and do
not have the `set_as_analog` method. They must be read using the
`read_internal` method.
2023-04-05 14:34:24 -05:00
Matthew W. Samsonoff
a0b6096610 Put ADC input pin into analog mode 2023-04-05 14:34:24 -05:00
Matthew W. Samsonoff
7e9e628eb9 Add ADC example for STM32F0 2023-04-05 14:34:24 -05:00
Matthew W. Samsonoff
5d9ae3dbdb Add implementation of STM32 v1 ADC 2023-04-05 14:34:24 -05:00
Grant Miller
8290236ed6 executor: Replace unsound critical sections with atomics 2023-04-05 13:23:12 -05:00
bors[bot]
eed2b12325
Merge #1297
1297: feat(stm32): Support multiple flash regions r=Dirbaio a=rmja

This depends on https://github.com/embassy-rs/stm32-data/pull/176

This is a general overhaul of the flash module to support multiple erase sizes.
Overall this PR contains:
* Move complex sector computation to embassy-hal-common to allow for tests
* Implement `FlashRegion` trait for each available flash region
* Add Flash::into_regions() to get each region.
* Implement embedded-storage traits for each region to support different erase sizes
* Split family write operations into begin/do/end
* Protection against simultaneous writes/erases for each split region is done through a global mutex

Co-authored-by: Rasmus Melchior Jacobsen <rmja@laesoe.org>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-04-05 11:12:40 +00:00
Rasmus Melchior Jacobsen
2a49e11cb0 Align flash examples 2023-04-05 10:55:31 +02:00
Rasmus Melchior Jacobsen
57d3d4d581 Align stm32 bootloader example 2023-04-05 10:29:45 +02:00
Rasmus Melchior Jacobsen
95b31cf2db Remove Drop on Flash and FlashLayout and propage lifetime to region types
This allows the user to "split" the FlashRegions struct into each region
2023-04-05 10:27:13 +02:00
Rasmus Melchior Jacobsen
05b2b2fb5f Align platform specific bootloaders 2023-04-05 09:56:40 +02:00
Rasmus Melchior Jacobsen
7e5ead78fe Remove firmware_len 2023-04-05 08:28:46 +02:00
Rasmus Melchior Jacobsen
2deb2c624c Let Partition range be u32 instead of usize 2023-04-05 08:28:31 +02:00
Rasmus Melchior Jacobsen
d8e2f82569 Let update_len be usize for now 2023-04-05 07:11:52 +02:00