aboutsummaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* nrf/timer: remove awaitable.Dario Nieuwenhuis2023-03-061-26/+0
|
* nrf/uart: switch to new interrupt binding.Dario Nieuwenhuis2023-03-065-16/+33
|
* Merge pull request #1232 from embassy-rs/nrf-qspi-fixesDario Nieuwenhuis2023-03-052-7/+13
|\ | | | | nrf/qspi: nrf53 support, u32 addrs, remove const generic, add raw read/write.
| * nrf/qspi: add _raw variants of methods that don't do bounds checks.Dario Nieuwenhuis2023-03-052-0/+6
| | | | | | | | | | Useful for the nRF7002, which presents as a "fake" QSPI flash, and the "capacity" concept doesn't really apply to it.
| * nrf/qspi: remove FLASH_SIZE const generic param.Dario Nieuwenhuis2023-03-052-2/+2
| |
| * nrf/qspi: always use u32 for addresses.Dario Nieuwenhuis2023-03-051-5/+5
| |
* | nrf/buffered_uarte: make available on stable.Dario Nieuwenhuis2023-03-041-1/+1
| |
* | nrf/buffered_uarte: remove PeripheralMutex, make it work without rts/cts.Dario Nieuwenhuis2023-03-041-9/+3
|/ | | | | | | | | | | | | | | | | | | > dirbaio: so I was checking how zephyr does UARTE RX on nRF > dirbaio: because currently we have the ugly "restart DMA on line idle to flush it" hack > dirbaio: because according to the docs "For each byte received over the RXD line, an RXDRDY event will be generated. This event is likely to occur before the corresponding data has been transferred to Data RAM." > dirbaio: so as I understood it, the only way to guarantee the data is actually transferred to RAM is to stop+restart DMA > dirbaio: well, guess what? > dirbaio: they just count RXDRDY's, and process that amount of data without restarting DMA > dirbaio: with a timer configured as counter https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/serial/uart_nrfx_uarte.c#L650-L692 > dirbaio: 🤔🤷⁉️ > dirbaio: someone saying you can do the "hook up rxdrdy to a counter" trick, someone else saying it's wrong 🤪 https://devzone.nordicsemi.com/f/nordic-q-a/28420/uarte-in-circular-mode So we're going to do just that! - BufferedUarte is lock-free now. No PeripheralMutex. - The "restart DMA on line idle to flush it" hack is GONE. This means - It'll work correctly without RTS/CTS now. - It'll have better throughput when using RTS/CTS.
* Merge pull request #1244 from embassy-rs/interruptexecutorDario Nieuwenhuis2023-03-015-49/+89
|\ | | | | cortex-m/executor: don't use the owned interrupts system.
| * cortex-m/executor: don't use the owned interrupts system.Dario Nieuwenhuis2023-02-285-49/+89
| | | | | | | | Preparation for #1224.
* | Example fixes.Dario Nieuwenhuis2023-03-016-56/+11
|/
* examples/std: fix net running out of sockets.Dario Nieuwenhuis2023-02-263-3/+3
|
* stm32/sdmmc: Implement proper clock configurationchemicstry2023-02-232-1/+3
|
* nrf: rename UARTETWISPIn -> SERIALnDario Nieuwenhuis2023-02-211-1/+1
| | | | | The UARTETWISPIn naming is quite horrible. With the nRF53, Nordic realized this and renamed the interrupts to SERIALn. Let's copy that for our peripheral names, in nrf53 and nrf91.
* examples/stm32wb: do not reserve words at start of RAM.Dario Nieuwenhuis2023-02-201-1/+1
| | | | | | | They're used to communicate from the app to ST's OTA bootloader. See AN5247. This bootloader is optional, must be flashed by the user, and requires changing the FLASH start address as well, so the current memory regions still require modifications to use it. Therefore there's no point in reserving these words. Thanks @adamgreig for investigating the purpose.
*-. Merge #1218 #1219bors[bot]2023-02-191-2/+37
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1218: Lora: sx126x: Change timing window to match values found experimentally. r=Dirbaio a=CBJamo As mentioned in #1188. 1219: stm32/sdmmc: Fix SDIOv1 writes r=Dirbaio a=chemicstry This fixes writes on sdmmc v1 (SDIO). I'm pretty sure I tested writes in #669, but maybe I was just lucky or I just forgot. There were two problems: - Writes require DMA FIFO mode, otherwise SDIO FIFO is under/overrun depending on sdio/pclk2 clock ratio. - Hardware flow control is broken for sdmmc v1 (I checked F1 and F4 erratas). This causes clock glitches above 12 MHz and results in write CRC errors. Co-authored-by: Caleb Jamison <[email protected]> Co-authored-by: chemicstry <[email protected]>
| | * stm32/sdmmc: Fix SDIOv1 writeschemicstry2023-02-181-2/+37
| |/
* | Merge #1217bors[bot]2023-02-192-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | 1217: Fix a typo in "PioPeripheral" r=Dirbaio a=SekoiaTree Renames "PioPeripherial" to "PioPeripheral" (without the second i). Co-authored-by: sekoia <[email protected]>
| * | Fix a typo in "PioPeripheral"sekoia2023-02-152-2/+2
| |/
* / examples/stm32wb: fix linker script.Dario Nieuwenhuis2023-02-191-1/+1
|/ | | | | | | | | | cortex-m-rt 0.7.2 now enforces the stack is 8-byte aligned. Stack is placed at `ORIGIN(RAM) + LENGTH(RAM)` by default, which wasn't 8-byte-aligned. See https://github.com/rust-embedded/cortex-m/discussions/469 ST trims 8 bytes from start of RAM, and uses the whole 192kb, so let's just copy that: https://github.com/STMicroelectronics/STM32CubeWB/blob/bceb1dae09f912eae47fba059251d499ba32f4ca/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb55xx_flash_cm4.ld#L48
* fix h7 examplesDario Nieuwenhuis2023-02-102-1/+24
|
* exmaples/dns: don't use the socket.Dario Nieuwenhuis2023-02-101-6/+3
|
* Rewrite to use a single socketUlf Lilleengen2023-02-101-2/+1
|
* Add DNS socket to embassy-netUlf Lilleengen2023-02-102-1/+103
|
* usb: use InterfaceNumber in msos.Dario Nieuwenhuis2023-02-081-1/+2
|
* usb: unify ControlHandler+DeviceStateHandler, route all control requests to ↵Dario Nieuwenhuis2023-02-0819-30/+13
| | | | | | | | all handlers. - Allows classes to handle vendor requests. - Allows classes to use a single handler for multiple interfaces. - Allows classes to access the other events (previously only `reset` was available).
* Lazily encode UTF16 values and add docsalexmoon2023-02-071-17/+8
|
* Convert MS OS descriptor builder to a writer APIalexmoon2023-02-072-1/+145
| | | | | | This brings it inline with the other embassy-usb descriptor APIs and allows it to integrate well with the Builder to allow class constructors to add MS OS descriptors. Also adds a `usb_serial_winusb` example to demonstrate how to use the API.
* nrf: docs.Dario Nieuwenhuis2023-02-0110-25/+25
|
*-. Merge #1173 #1174bors[bot]2023-01-243-3/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1173: nRF examples crates names r=lulf a=davidedellagiustina Fixed nRF examples crates' names: they had the same names and they were conflicting during compilation (Cargo warning). 1174: add missing copy of icmpv6 checksum r=lulf a=lulf add proto-ipv6 feature to stm32h7 example to catch issues in CI Co-authored-by: Davide Della Giustina <[email protected]> Co-authored-by: Ulf Lilleengen <[email protected]>
| | * add missing copy of icmpv6 checksumUlf Lilleengen2023-01-241-1/+1
| |/ |/| | | | | add proto-ipv6 feature to stm32h7 example to catch issues in CI
| * Changed crates' names for nrf examples since they were conflictingDavide Della Giustina2023-01-242-2/+2
|/
* net: allocate space for 2 sockets, needed for dhcp.Dario Nieuwenhuis2023-01-198-8/+8
|
* Add smoltcp dhcp socket configurationPaweł Jan Czochański2023-01-199-67/+29
|
* stm32/usb_otg: Add F4 usb_ethernet examplechemicstry2023-01-182-1/+174
|
* stm32: add stm32c0 examples.Dario Nieuwenhuis2023-01-176-0/+114
|
* Merge #1142bors[bot]2023-01-141-1/+1
|\ | | | | | | | | | | | | | | | | | | 1142: More rp2040 BufferedUart fixes r=Dirbaio a=timokroeger * Refactor init code * Make it possible to drop RX without breaking TX (or vice versa) * Correctly handle RX buffer full scenario Co-authored-by: Timo Kröger <[email protected]>
| * rp: Fix BufferedUart drop codeTimo Kröger2023-01-041-1/+1
| | | | | | | | Only unregister the interrupt handler when both parts are inactive
* | Merge #1147bors[bot]2023-01-122-1/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1147: Support codesigning in the firmware updater r=lulf a=huntc This PR provides a method to verify that firmware has been SHA-512 hashed and signed with a private key given its public key. The implementation provides both [`ed25519-dalek`](https://github.com/dalek-cryptography/ed25519-dalek/blob/main/Cargo.toml) and [`salty`](https://github.com/ycrypto/salty) as the signature verifiers. Either of the `ed25519-dalek` and `ed25519-salty` features is required to enable the functionality from `embassy-boot`. The `verify_and_mark_updated` method is used in place of `mark_updated` when signing is used via its feature. This avoids the accidental omission of validation where it has been declared as required at compile time. It also keeps the parity of calls at the same number to the previous situation. The PR permits other types of signature verifiers in the future on the proviso that the [Signature trait](https://github.com/RustCrypto/traits/tree/master/signature) is supported. Finally, I've updated the CI to include testing `embassy-boot`, which it was doing before. In addition, I've included a unit test for verification based on a `ed25519-dalek` documentation example. This tests both the `dalek` and `salty` implementations. In terms of code size comparisons, `dalek` adds about 68KiB and `salty` adds about 20KiB. I'm using `salty` myself. I've also tested this out by signing my code with the OpenBSD `signify` utility and then verify it during firmware upload using `salty`. Co-authored-by: huntc <[email protected]>
| * | Support codesigning in the firmware updaterhuntc2023-01-122-1/+6
| | | | | | | | | | | | This commit provides a method to verify that firmware has been signed with a private key given its public key. The implementation uses ed25519-dalek as the signature verifier. An "ed25519" feature is required to enable the functionality. When disabled (the default), calling the firmware updater's verify method will return a failure.
* | | stm32 otg: add examples.chemicstry2023-01-1110-5/+542
|/ /
* | Reduce amount of samples for nrf5340Dominik Boehi2023-01-097-305/+0
| |
* | Rename examples/nrf to examples/nrf52840Dominik Boehi2023-01-0955-0/+0
| |
* | Change UART pins for nRF5340 DKDominik Boehi2023-01-082-2/+2
| |
* | Add samples for nrf5340Dominik Boehi2023-01-0814-0/+542
| |
* | Merge #1141bors[bot]2023-01-056-7/+51
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1141: feat: compile bootloader examples for nRF91 r=lulf a=lulf * Add nRF91 as target in CI builds * Add example linker scripts for nrf91 * Make less nRF52 assumptions example config * Add llvm-tools-preview required for cargo objcopy example Co-authored-by: Ulf Lilleengen <[email protected]>
| * | feat: compile bootloader examples for nRF91Ulf Lilleengen2023-01-046-7/+51
| | | | | | | | | | | | | | | | | | | | | * Add nRF91 as target in CI builds * Add example linker scripts for nrf91 * Make less nRF52 assumptions example config * Add llvm-tools-preview required for cargo objcopy example
* | | rp2040: add {tx,rx}-only constructors to UARTPedro Ferreira2023-01-041-0/+42
|/ /
* | Merge #1139bors[bot]2023-01-047-5/+34
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1139: Wdt config changes r=lulf a=huntc Per commits: * By passing WDT config around we can control it more easily and promote sharing it between files. * The memory layout of the s140 crept into a number of memory files, which can cause confusion (well, it did for me!). * Obtaining the current WDT config is useful so that we do not have to duplicate configurations around the place. A constructor method has been introduced that attempts to return the current running WDT config from the WDT peripheral. The bootloader example has also been updated to show how the watchdog can be obtained and used. Co-authored-by: huntc <[email protected]>
| * | Provides a means of obtaining the current WDT confighuntc2023-01-041-0/+18
| | | | | | | | | | | | Obtaining the current WDT config is important so that we do not have to duplication configuration around the place. A constructor method has been introduced that returns WDT config in accordance with how the register is presently configured. The bootloader example has also been updated to show the watchdog can be obtained and used.