aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/boot/application/nrf/Cargo.toml2
-rw-r--r--examples/boot/application/nrf/src/bin/a.rs1
-rw-r--r--examples/boot/application/nrf/src/bin/b.rs1
-rw-r--r--examples/boot/application/rp/Cargo.toml2
-rw-r--r--examples/boot/application/rp/src/bin/a.rs1
-rw-r--r--examples/boot/application/rp/src/bin/b.rs1
-rw-r--r--examples/boot/application/stm32f3/Cargo.toml2
-rw-r--r--examples/boot/application/stm32f3/src/bin/a.rs1
-rw-r--r--examples/boot/application/stm32f3/src/bin/b.rs1
-rw-r--r--examples/boot/application/stm32f7/Cargo.toml2
-rw-r--r--examples/boot/application/stm32f7/src/bin/a.rs1
-rw-r--r--examples/boot/application/stm32f7/src/bin/b.rs1
-rw-r--r--examples/boot/application/stm32h7/Cargo.toml2
-rw-r--r--examples/boot/application/stm32h7/src/bin/a.rs1
-rw-r--r--examples/boot/application/stm32h7/src/bin/b.rs1
-rw-r--r--examples/boot/application/stm32l0/Cargo.toml2
-rw-r--r--examples/boot/application/stm32l0/src/bin/a.rs1
-rw-r--r--examples/boot/application/stm32l0/src/bin/b.rs1
-rw-r--r--examples/boot/application/stm32l1/Cargo.toml2
-rw-r--r--examples/boot/application/stm32l1/src/bin/a.rs1
-rw-r--r--examples/boot/application/stm32l1/src/bin/b.rs1
-rw-r--r--examples/boot/application/stm32l4/Cargo.toml2
-rw-r--r--examples/boot/application/stm32l4/src/bin/a.rs1
-rw-r--r--examples/boot/application/stm32l4/src/bin/b.rs1
-rw-r--r--examples/boot/application/stm32wb-dfu/.cargo/config.toml9
-rw-r--r--examples/boot/application/stm32wb-dfu/Cargo.toml32
-rw-r--r--examples/boot/application/stm32wb-dfu/README.md29
-rw-r--r--examples/boot/application/stm32wb-dfu/build.rs37
-rw-r--r--examples/boot/application/stm32wb-dfu/memory.x15
-rw-r--r--examples/boot/application/stm32wb-dfu/src/main.rs63
-rw-r--r--examples/boot/application/stm32wl/Cargo.toml2
-rw-r--r--examples/boot/application/stm32wl/src/bin/a.rs1
-rw-r--r--examples/boot/application/stm32wl/src/bin/b.rs1
-rw-r--r--examples/boot/bootloader/stm32wb-dfu/Cargo.toml63
-rw-r--r--examples/boot/bootloader/stm32wb-dfu/README.md11
-rw-r--r--examples/boot/bootloader/stm32wb-dfu/build.rs27
-rw-r--r--examples/boot/bootloader/stm32wb-dfu/memory.x18
-rw-r--r--examples/boot/bootloader/stm32wb-dfu/src/main.rs93
-rw-r--r--examples/nrf-rtos-trace/src/bin/rtos_trace.rs1
-rw-r--r--examples/nrf52840/Cargo.toml12
-rw-r--r--examples/nrf52840/src/bin/blinky.rs1
-rw-r--r--examples/nrf52840/src/bin/buffered_uart.rs1
-rw-r--r--examples/nrf52840/src/bin/channel.rs1
-rw-r--r--examples/nrf52840/src/bin/channel_sender_receiver.rs1
-rw-r--r--examples/nrf52840/src/bin/ethernet_enc28j60.rs18
-rw-r--r--examples/nrf52840/src/bin/executor_fairness_test.rs1
-rw-r--r--examples/nrf52840/src/bin/gpiote_channel.rs1
-rw-r--r--examples/nrf52840/src/bin/gpiote_port.rs1
-rw-r--r--examples/nrf52840/src/bin/i2s_effect.rs1
-rw-r--r--examples/nrf52840/src/bin/i2s_monitor.rs1
-rw-r--r--examples/nrf52840/src/bin/i2s_waveform.rs1
-rw-r--r--examples/nrf52840/src/bin/manually_create_executor.rs1
-rw-r--r--examples/nrf52840/src/bin/multiprio.rs1
-rw-r--r--examples/nrf52840/src/bin/mutex.rs1
-rw-r--r--examples/nrf52840/src/bin/nvmc.rs1
-rw-r--r--examples/nrf52840/src/bin/pdm.rs1
-rw-r--r--examples/nrf52840/src/bin/pdm_continuous.rs1
-rw-r--r--examples/nrf52840/src/bin/ppi.rs1
-rw-r--r--examples/nrf52840/src/bin/pubsub.rs1
-rw-r--r--examples/nrf52840/src/bin/pwm.rs1
-rw-r--r--examples/nrf52840/src/bin/pwm_double_sequence.rs1
-rw-r--r--examples/nrf52840/src/bin/pwm_sequence.rs1
-rw-r--r--examples/nrf52840/src/bin/pwm_sequence_ppi.rs1
-rw-r--r--examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs1
-rw-r--r--examples/nrf52840/src/bin/pwm_servo.rs1
-rw-r--r--examples/nrf52840/src/bin/qdec.rs1
-rw-r--r--examples/nrf52840/src/bin/qspi.rs1
-rw-r--r--examples/nrf52840/src/bin/qspi_lowpower.rs1
-rw-r--r--examples/nrf52840/src/bin/rng.rs1
-rw-r--r--examples/nrf52840/src/bin/saadc.rs1
-rw-r--r--examples/nrf52840/src/bin/saadc_continuous.rs1
-rw-r--r--examples/nrf52840/src/bin/self_spawn.rs1
-rw-r--r--examples/nrf52840/src/bin/self_spawn_current_executor.rs1
-rw-r--r--examples/nrf52840/src/bin/spim.rs1
-rw-r--r--examples/nrf52840/src/bin/spis.rs1
-rw-r--r--examples/nrf52840/src/bin/temp.rs1
-rw-r--r--examples/nrf52840/src/bin/timer.rs1
-rw-r--r--examples/nrf52840/src/bin/twim.rs1
-rw-r--r--examples/nrf52840/src/bin/twim_lowpower.rs1
-rw-r--r--examples/nrf52840/src/bin/twis.rs1
-rw-r--r--examples/nrf52840/src/bin/uart.rs1
-rw-r--r--examples/nrf52840/src/bin/uart_idle.rs1
-rw-r--r--examples/nrf52840/src/bin/uart_split.rs1
-rw-r--r--examples/nrf52840/src/bin/usb_ethernet.rs33
-rw-r--r--examples/nrf52840/src/bin/usb_hid_keyboard.rs1
-rw-r--r--examples/nrf52840/src/bin/usb_hid_mouse.rs1
-rw-r--r--examples/nrf52840/src/bin/usb_serial.rs1
-rw-r--r--examples/nrf52840/src/bin/usb_serial_multitask.rs21
-rw-r--r--examples/nrf52840/src/bin/usb_serial_winusb.rs1
-rw-r--r--examples/nrf52840/src/bin/wdt.rs1
-rw-r--r--examples/nrf52840/src/bin/wifi_esp_hosted.rs14
-rw-r--r--examples/nrf5340/Cargo.toml4
-rw-r--r--examples/nrf5340/src/bin/blinky.rs1
-rw-r--r--examples/nrf5340/src/bin/gpiote_channel.rs1
-rw-r--r--examples/nrf5340/src/bin/uart.rs1
-rw-r--r--examples/rp/Cargo.toml10
-rw-r--r--examples/rp/src/bin/adc.rs1
-rw-r--r--examples/rp/src/bin/blinky.rs1
-rw-r--r--examples/rp/src/bin/button.rs3
-rw-r--r--examples/rp/src/bin/ethernet_w5500_multisocket.rs14
-rw-r--r--examples/rp/src/bin/ethernet_w5500_tcp_client.rs14
-rw-r--r--examples/rp/src/bin/ethernet_w5500_tcp_server.rs14
-rw-r--r--examples/rp/src/bin/ethernet_w5500_udp.rs14
-rw-r--r--examples/rp/src/bin/flash.rs1
-rw-r--r--examples/rp/src/bin/gpio_async.rs1
-rw-r--r--examples/rp/src/bin/gpout.rs1
-rw-r--r--examples/rp/src/bin/i2c_async.rs1
-rw-r--r--examples/rp/src/bin/i2c_blocking.rs1
-rw-r--r--examples/rp/src/bin/i2c_slave.rs1
-rw-r--r--examples/rp/src/bin/multicore.rs1
-rw-r--r--examples/rp/src/bin/multiprio.rs1
-rw-r--r--examples/rp/src/bin/pio_async.rs1
-rw-r--r--examples/rp/src/bin/pio_dma.rs1
-rw-r--r--examples/rp/src/bin/pio_hd44780.rs1
-rw-r--r--examples/rp/src/bin/pio_rotary_encoder.rs1
-rw-r--r--examples/rp/src/bin/pio_stepper.rs1
-rw-r--r--examples/rp/src/bin/pio_uart.rs1
-rw-r--r--examples/rp/src/bin/pio_ws2812.rs1
-rw-r--r--examples/rp/src/bin/pwm.rs1
-rw-r--r--examples/rp/src/bin/pwm_input.rs1
-rw-r--r--examples/rp/src/bin/rosc.rs1
-rw-r--r--examples/rp/src/bin/rtc.rs1
-rw-r--r--examples/rp/src/bin/spi.rs1
-rw-r--r--examples/rp/src/bin/spi_async.rs1
-rw-r--r--examples/rp/src/bin/spi_display.rs1
-rw-r--r--examples/rp/src/bin/uart.rs1
-rw-r--r--examples/rp/src/bin/uart_buffered_split.rs9
-rw-r--r--examples/rp/src/bin/uart_unidir.rs1
-rw-r--r--examples/rp/src/bin/usb_ethernet.rs29
-rw-r--r--examples/rp/src/bin/usb_hid_keyboard.rs1
-rw-r--r--examples/rp/src/bin/usb_logger.rs1
-rw-r--r--examples/rp/src/bin/usb_midi.rs1
-rw-r--r--examples/rp/src/bin/usb_raw.rs1
-rw-r--r--examples/rp/src/bin/usb_raw_bulk.rs1
-rw-r--r--examples/rp/src/bin/usb_serial.rs1
-rw-r--r--examples/rp/src/bin/watchdog.rs1
-rw-r--r--examples/rp/src/bin/wifi_ap_tcp_server.rs14
-rw-r--r--examples/rp/src/bin/wifi_blinky.rs6
-rw-r--r--examples/rp/src/bin/wifi_scan.rs6
-rw-r--r--examples/rp/src/bin/wifi_tcp_server.rs14
-rw-r--r--examples/std/Cargo.toml4
-rw-r--r--examples/std/src/bin/net.rs12
-rw-r--r--examples/std/src/bin/net_dns.rs12
-rw-r--r--examples/std/src/bin/net_ppp.rs14
-rw-r--r--examples/std/src/bin/net_udp.rs12
-rw-r--r--examples/std/src/bin/serial.rs2
-rw-r--r--examples/std/src/bin/tcp_accept.rs12
-rw-r--r--examples/std/src/bin/tick.rs2
-rw-r--r--examples/stm32c0/Cargo.toml2
-rw-r--r--examples/stm32c0/src/bin/blinky.rs1
-rw-r--r--examples/stm32c0/src/bin/button.rs3
-rw-r--r--examples/stm32c0/src/bin/button_exti.rs1
-rw-r--r--examples/stm32f0/Cargo.toml4
-rw-r--r--examples/stm32f0/src/bin/adc.rs1
-rw-r--r--examples/stm32f0/src/bin/blinky.rs1
-rw-r--r--examples/stm32f0/src/bin/button_controlled_blink.rs1
-rw-r--r--examples/stm32f0/src/bin/button_exti.rs1
-rw-r--r--examples/stm32f0/src/bin/hello.rs1
-rw-r--r--examples/stm32f0/src/bin/multiprio.rs1
-rw-r--r--examples/stm32f0/src/bin/wdg.rs1
-rw-r--r--examples/stm32f1/Cargo.toml2
-rw-r--r--examples/stm32f1/src/bin/adc.rs1
-rw-r--r--examples/stm32f1/src/bin/blinky.rs1
-rw-r--r--examples/stm32f1/src/bin/can.rs66
-rw-r--r--examples/stm32f1/src/bin/hello.rs1
-rw-r--r--examples/stm32f1/src/bin/usb_serial.rs1
-rw-r--r--examples/stm32f2/Cargo.toml2
-rw-r--r--examples/stm32f2/src/bin/blinky.rs1
-rw-r--r--examples/stm32f2/src/bin/pll.rs1
-rw-r--r--examples/stm32f3/Cargo.toml4
-rw-r--r--examples/stm32f3/src/bin/blinky.rs1
-rw-r--r--examples/stm32f3/src/bin/button.rs3
-rw-r--r--examples/stm32f3/src/bin/button_events.rs1
-rw-r--r--examples/stm32f3/src/bin/button_exti.rs1
-rw-r--r--examples/stm32f3/src/bin/flash.rs1
-rw-r--r--examples/stm32f3/src/bin/hello.rs1
-rw-r--r--examples/stm32f3/src/bin/multiprio.rs1
-rw-r--r--examples/stm32f3/src/bin/spi_dma.rs1
-rw-r--r--examples/stm32f3/src/bin/usart_dma.rs1
-rw-r--r--examples/stm32f3/src/bin/usb_serial.rs1
-rw-r--r--examples/stm32f334/Cargo.toml4
-rw-r--r--examples/stm32f334/src/bin/adc.rs1
-rw-r--r--examples/stm32f334/src/bin/button.rs1
-rw-r--r--examples/stm32f334/src/bin/hello.rs1
-rw-r--r--examples/stm32f334/src/bin/opamp.rs1
-rw-r--r--examples/stm32f334/src/bin/pwm.rs1
-rw-r--r--examples/stm32f4/Cargo.toml6
-rw-r--r--examples/stm32f4/src/bin/adc.rs1
-rw-r--r--examples/stm32f4/src/bin/blinky.rs1
-rw-r--r--examples/stm32f4/src/bin/button.rs3
-rw-r--r--examples/stm32f4/src/bin/button_exti.rs1
-rw-r--r--examples/stm32f4/src/bin/can.rs1
-rw-r--r--examples/stm32f4/src/bin/dac.rs1
-rw-r--r--examples/stm32f4/src/bin/eth.rs14
-rw-r--r--examples/stm32f4/src/bin/flash.rs7
-rw-r--r--examples/stm32f4/src/bin/flash_async.rs7
-rw-r--r--examples/stm32f4/src/bin/hello.rs1
-rw-r--r--examples/stm32f4/src/bin/i2c.rs1
-rw-r--r--examples/stm32f4/src/bin/i2c_async.rs1
-rw-r--r--examples/stm32f4/src/bin/i2c_comparison.rs1
-rw-r--r--examples/stm32f4/src/bin/i2s_dma.rs1
-rw-r--r--examples/stm32f4/src/bin/mco.rs1
-rw-r--r--examples/stm32f4/src/bin/multiprio.rs1
-rw-r--r--examples/stm32f4/src/bin/pwm.rs1
-rw-r--r--examples/stm32f4/src/bin/pwm_complementary.rs1
-rw-r--r--examples/stm32f4/src/bin/rtc.rs1
-rw-r--r--examples/stm32f4/src/bin/sdmmc.rs1
-rw-r--r--examples/stm32f4/src/bin/spi.rs1
-rw-r--r--examples/stm32f4/src/bin/spi_dma.rs1
-rw-r--r--examples/stm32f4/src/bin/usart.rs1
-rw-r--r--examples/stm32f4/src/bin/usart_buffered.rs1
-rw-r--r--examples/stm32f4/src/bin/usart_dma.rs1
-rw-r--r--examples/stm32f4/src/bin/usb_ethernet.rs32
-rw-r--r--examples/stm32f4/src/bin/usb_raw.rs1
-rw-r--r--examples/stm32f4/src/bin/usb_serial.rs1
-rw-r--r--examples/stm32f4/src/bin/wdt.rs1
-rw-r--r--examples/stm32f4/src/bin/ws2812_pwm_dma.rs150
-rw-r--r--examples/stm32f4/src/bin/ws2812_spi.rs95
-rw-r--r--examples/stm32f7/Cargo.toml4
-rw-r--r--examples/stm32f7/src/bin/adc.rs1
-rw-r--r--examples/stm32f7/src/bin/blinky.rs1
-rw-r--r--examples/stm32f7/src/bin/button.rs3
-rw-r--r--examples/stm32f7/src/bin/button_exti.rs1
-rw-r--r--examples/stm32f7/src/bin/can.rs8
-rw-r--r--examples/stm32f7/src/bin/eth.rs14
-rw-r--r--examples/stm32f7/src/bin/flash.rs1
-rw-r--r--examples/stm32f7/src/bin/hello.rs1
-rw-r--r--examples/stm32f7/src/bin/sdmmc.rs1
-rw-r--r--examples/stm32f7/src/bin/usart_dma.rs1
-rw-r--r--examples/stm32f7/src/bin/usb_serial.rs1
-rw-r--r--examples/stm32g0/Cargo.toml2
-rw-r--r--examples/stm32g0/src/bin/blinky.rs1
-rw-r--r--examples/stm32g0/src/bin/button.rs3
-rw-r--r--examples/stm32g0/src/bin/button_exti.rs1
-rw-r--r--examples/stm32g0/src/bin/flash.rs1
-rw-r--r--examples/stm32g0/src/bin/spi_neopixel.rs1
-rw-r--r--examples/stm32g4/Cargo.toml2
-rw-r--r--examples/stm32g4/src/bin/adc.rs1
-rw-r--r--examples/stm32g4/src/bin/blinky.rs1
-rw-r--r--examples/stm32g4/src/bin/button.rs3
-rw-r--r--examples/stm32g4/src/bin/button_exti.rs1
-rw-r--r--examples/stm32g4/src/bin/pll.rs1
-rw-r--r--examples/stm32g4/src/bin/pwm.rs1
-rw-r--r--examples/stm32g4/src/bin/usb_serial.rs1
-rw-r--r--examples/stm32h5/Cargo.toml8
-rw-r--r--examples/stm32h5/src/bin/blinky.rs1
-rw-r--r--examples/stm32h5/src/bin/button_exti.rs1
-rw-r--r--examples/stm32h5/src/bin/eth.rs14
-rw-r--r--examples/stm32h5/src/bin/i2c.rs1
-rw-r--r--examples/stm32h5/src/bin/rng.rs1
-rw-r--r--examples/stm32h5/src/bin/usart.rs1
-rw-r--r--examples/stm32h5/src/bin/usart_dma.rs1
-rw-r--r--examples/stm32h5/src/bin/usart_split.rs1
-rw-r--r--examples/stm32h5/src/bin/usb_serial.rs1
-rw-r--r--examples/stm32h7/Cargo.toml8
-rw-r--r--examples/stm32h7/src/bin/adc.rs1
-rw-r--r--examples/stm32h7/src/bin/blinky.rs1
-rw-r--r--examples/stm32h7/src/bin/button_exti.rs1
-rw-r--r--examples/stm32h7/src/bin/camera.rs1
-rw-r--r--examples/stm32h7/src/bin/dac.rs1
-rw-r--r--examples/stm32h7/src/bin/dac_dma.rs7
-rw-r--r--examples/stm32h7/src/bin/eth.rs14
-rw-r--r--examples/stm32h7/src/bin/eth_client.rs14
-rw-r--r--examples/stm32h7/src/bin/flash.rs1
-rw-r--r--examples/stm32h7/src/bin/fmc.rs1
-rw-r--r--examples/stm32h7/src/bin/i2c.rs1
-rw-r--r--examples/stm32h7/src/bin/low_level_timer_api.rs11
-rw-r--r--examples/stm32h7/src/bin/mco.rs1
-rw-r--r--examples/stm32h7/src/bin/pwm.rs1
-rw-r--r--examples/stm32h7/src/bin/rng.rs1
-rw-r--r--examples/stm32h7/src/bin/rtc.rs1
-rw-r--r--examples/stm32h7/src/bin/sdmmc.rs1
-rw-r--r--examples/stm32h7/src/bin/signal.rs1
-rw-r--r--examples/stm32h7/src/bin/spi.rs1
-rw-r--r--examples/stm32h7/src/bin/spi_dma.rs1
-rw-r--r--examples/stm32h7/src/bin/usart.rs1
-rw-r--r--examples/stm32h7/src/bin/usart_dma.rs1
-rw-r--r--examples/stm32h7/src/bin/usart_split.rs1
-rw-r--r--examples/stm32h7/src/bin/usb_serial.rs1
-rw-r--r--examples/stm32h7/src/bin/wdg.rs1
-rw-r--r--examples/stm32l0/Cargo.toml4
-rw-r--r--examples/stm32l0/src/bin/blinky.rs1
-rw-r--r--examples/stm32l0/src/bin/button.rs3
-rw-r--r--examples/stm32l0/src/bin/button_exti.rs1
-rw-r--r--examples/stm32l0/src/bin/flash.rs1
-rw-r--r--examples/stm32l0/src/bin/spi.rs1
-rw-r--r--examples/stm32l0/src/bin/usart_dma.rs1
-rw-r--r--examples/stm32l0/src/bin/usart_irq.rs1
-rw-r--r--examples/stm32l1/Cargo.toml2
-rw-r--r--examples/stm32l1/src/bin/blinky.rs1
-rw-r--r--examples/stm32l1/src/bin/flash.rs1
-rw-r--r--examples/stm32l1/src/bin/spi.rs1
-rw-r--r--examples/stm32l4/Cargo.toml10
-rw-r--r--examples/stm32l4/src/bin/adc.rs1
-rw-r--r--examples/stm32l4/src/bin/blinky.rs1
-rw-r--r--examples/stm32l4/src/bin/button.rs3
-rw-r--r--examples/stm32l4/src/bin/button_exti.rs1
-rw-r--r--examples/stm32l4/src/bin/dac.rs1
-rw-r--r--examples/stm32l4/src/bin/dac_dma.rs7
-rw-r--r--examples/stm32l4/src/bin/i2c.rs1
-rw-r--r--examples/stm32l4/src/bin/i2c_blocking_async.rs1
-rw-r--r--examples/stm32l4/src/bin/i2c_dma.rs1
-rw-r--r--examples/stm32l4/src/bin/mco.rs1
-rw-r--r--examples/stm32l4/src/bin/rng.rs1
-rw-r--r--examples/stm32l4/src/bin/rtc.rs1
-rw-r--r--examples/stm32l4/src/bin/spe_adin1110_http_server.rs28
-rw-r--r--examples/stm32l4/src/bin/spi.rs1
-rw-r--r--examples/stm32l4/src/bin/spi_blocking_async.rs3
-rw-r--r--examples/stm32l4/src/bin/spi_dma.rs3
-rw-r--r--examples/stm32l4/src/bin/usart.rs1
-rw-r--r--examples/stm32l4/src/bin/usart_dma.rs1
-rw-r--r--examples/stm32l4/src/bin/usb_serial.rs1
-rw-r--r--examples/stm32l5/Cargo.toml4
-rw-r--r--examples/stm32l5/src/bin/button_exti.rs1
-rw-r--r--examples/stm32l5/src/bin/rng.rs1
-rw-r--r--examples/stm32l5/src/bin/usb_ethernet.rs29
-rw-r--r--examples/stm32l5/src/bin/usb_hid_mouse.rs1
-rw-r--r--examples/stm32l5/src/bin/usb_serial.rs1
-rw-r--r--examples/stm32u5/Cargo.toml2
-rw-r--r--examples/stm32u5/src/bin/blinky.rs1
-rw-r--r--examples/stm32u5/src/bin/boot.rs1
-rw-r--r--examples/stm32u5/src/bin/usb_serial.rs1
-rw-r--r--examples/stm32wb/Cargo.toml4
-rw-r--r--examples/stm32wb/src/bin/blinky.rs1
-rw-r--r--examples/stm32wb/src/bin/button_exti.rs1
-rw-r--r--examples/stm32wb/src/bin/eddystone_beacon.rs1
-rw-r--r--examples/stm32wb/src/bin/gatt_server.rs1
-rw-r--r--examples/stm32wb/src/bin/mac_ffd.rs1
-rw-r--r--examples/stm32wb/src/bin/mac_ffd_net.rs21
-rw-r--r--examples/stm32wb/src/bin/mac_rfd.rs1
-rw-r--r--examples/stm32wb/src/bin/tl_mbox.rs1
-rw-r--r--examples/stm32wb/src/bin/tl_mbox_ble.rs1
-rw-r--r--examples/stm32wb/src/bin/tl_mbox_mac.rs1
-rw-r--r--examples/stm32wba/Cargo.toml4
-rw-r--r--examples/stm32wba/src/bin/blinky.rs1
-rw-r--r--examples/stm32wba/src/bin/button_exti.rs1
-rw-r--r--examples/stm32wl/Cargo.toml2
-rw-r--r--examples/stm32wl/src/bin/blinky.rs1
-rw-r--r--examples/stm32wl/src/bin/button.rs3
-rw-r--r--examples/stm32wl/src/bin/button_exti.rs1
-rw-r--r--examples/stm32wl/src/bin/flash.rs1
-rw-r--r--examples/stm32wl/src/bin/random.rs1
-rw-r--r--examples/stm32wl/src/bin/rtc.rs1
-rw-r--r--examples/stm32wl/src/bin/uart_async.rs1
-rw-r--r--examples/wasm/Cargo.toml2
-rw-r--r--examples/wasm/src/lib.rs2
346 files changed, 1068 insertions, 570 deletions
diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml
index 5f11750b2..b52bac650 100644
--- a/examples/boot/application/nrf/Cargo.toml
+++ b/examples/boot/application/nrf/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } 8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } 9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers", "arch-cortex-m", "executor-thread"] }
10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [] } 10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [] }
11embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", ] } 11embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", ] }
12embassy-boot = { version = "0.1.0", path = "../../../../embassy-boot/boot", features = [] } 12embassy-boot = { version = "0.1.0", path = "../../../../embassy-boot/boot", features = [] }
diff --git a/examples/boot/application/nrf/src/bin/a.rs b/examples/boot/application/nrf/src/bin/a.rs
index 8b510ed35..f3abfddbc 100644
--- a/examples/boot/application/nrf/src/bin/a.rs
+++ b/examples/boot/application/nrf/src/bin/a.rs
@@ -1,7 +1,6 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![macro_use] 3#![macro_use]
4#![feature(type_alias_impl_trait)]
5 4
6use embassy_boot_nrf::{FirmwareUpdater, FirmwareUpdaterConfig}; 5use embassy_boot_nrf::{FirmwareUpdater, FirmwareUpdaterConfig};
7use embassy_embedded_hal::adapter::BlockingAsync; 6use embassy_embedded_hal::adapter::BlockingAsync;
diff --git a/examples/boot/application/nrf/src/bin/b.rs b/examples/boot/application/nrf/src/bin/b.rs
index a88c3c56c..de97b6a22 100644
--- a/examples/boot/application/nrf/src/bin/b.rs
+++ b/examples/boot/application/nrf/src/bin/b.rs
@@ -1,7 +1,6 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![macro_use] 3#![macro_use]
4#![feature(type_alias_impl_trait)]
5 4
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
7use embassy_nrf::gpio::{Level, Output, OutputDrive}; 6use embassy_nrf::gpio::{Level, Output, OutputDrive};
diff --git a/examples/boot/application/rp/Cargo.toml b/examples/boot/application/rp/Cargo.toml
index 89ac5a8f6..08ce16877 100644
--- a/examples/boot/application/rp/Cargo.toml
+++ b/examples/boot/application/rp/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } 8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } 9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers", "arch-cortex-m", "executor-thread"] }
10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [] } 10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [] }
11embassy-rp = { version = "0.1.0", path = "../../../../embassy-rp", features = ["time-driver", ] } 11embassy-rp = { version = "0.1.0", path = "../../../../embassy-rp", features = ["time-driver", ] }
12embassy-boot-rp = { version = "0.1.0", path = "../../../../embassy-boot/rp", features = [] } 12embassy-boot-rp = { version = "0.1.0", path = "../../../../embassy-boot/rp", features = [] }
diff --git a/examples/boot/application/rp/src/bin/a.rs b/examples/boot/application/rp/src/bin/a.rs
index 6fd5d7f60..3f0bf90e2 100644
--- a/examples/boot/application/rp/src/bin/a.rs
+++ b/examples/boot/application/rp/src/bin/a.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::cell::RefCell; 4use core::cell::RefCell;
6 5
diff --git a/examples/boot/application/rp/src/bin/b.rs b/examples/boot/application/rp/src/bin/b.rs
index 1eca5b4a2..a46d095bf 100644
--- a/examples/boot/application/rp/src/bin/b.rs
+++ b/examples/boot/application/rp/src/bin/b.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use embassy_executor::Spawner; 4use embassy_executor::Spawner;
6use embassy_rp::gpio; 5use embassy_rp::gpio;
diff --git a/examples/boot/application/stm32f3/Cargo.toml b/examples/boot/application/stm32f3/Cargo.toml
index 1a0f8cee5..248ec6dce 100644
--- a/examples/boot/application/stm32f3/Cargo.toml
+++ b/examples/boot/application/stm32f3/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } 8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } 9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] }
10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } 10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32f303re", "time-driver-any", "exti"] } 11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32f303re", "time-driver-any", "exti"] }
12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } 12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" }
diff --git a/examples/boot/application/stm32f3/src/bin/a.rs b/examples/boot/application/stm32f3/src/bin/a.rs
index 8be39bfb7..96ae5c47b 100644
--- a/examples/boot/application/stm32f3/src/bin/a.rs
+++ b/examples/boot/application/stm32f3/src/bin/a.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32f3/src/bin/b.rs b/examples/boot/application/stm32f3/src/bin/b.rs
index 8411f384c..22ba82d5e 100644
--- a/examples/boot/application/stm32f3/src/bin/b.rs
+++ b/examples/boot/application/stm32f3/src/bin/b.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32f7/Cargo.toml b/examples/boot/application/stm32f7/Cargo.toml
index e42d1d421..aa5f87615 100644
--- a/examples/boot/application/stm32f7/Cargo.toml
+++ b/examples/boot/application/stm32f7/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } 8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } 9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] }
10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } 10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32f767zi", "time-driver-any", "exti"] } 11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32f767zi", "time-driver-any", "exti"] }
12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } 12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] }
diff --git a/examples/boot/application/stm32f7/src/bin/a.rs b/examples/boot/application/stm32f7/src/bin/a.rs
index 0c3819bed..a6107386a 100644
--- a/examples/boot/application/stm32f7/src/bin/a.rs
+++ b/examples/boot/application/stm32f7/src/bin/a.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::cell::RefCell; 4use core::cell::RefCell;
6 5
diff --git a/examples/boot/application/stm32f7/src/bin/b.rs b/examples/boot/application/stm32f7/src/bin/b.rs
index 4c2ad06a2..190477204 100644
--- a/examples/boot/application/stm32f7/src/bin/b.rs
+++ b/examples/boot/application/stm32f7/src/bin/b.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32h7/Cargo.toml b/examples/boot/application/stm32h7/Cargo.toml
index 8450d8639..78e33de28 100644
--- a/examples/boot/application/stm32h7/Cargo.toml
+++ b/examples/boot/application/stm32h7/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } 8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } 9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] }
10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } 10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32h743zi", "time-driver-any", "exti"] } 11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32h743zi", "time-driver-any", "exti"] }
12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } 12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] }
diff --git a/examples/boot/application/stm32h7/src/bin/a.rs b/examples/boot/application/stm32h7/src/bin/a.rs
index f239e3732..b73506cf3 100644
--- a/examples/boot/application/stm32h7/src/bin/a.rs
+++ b/examples/boot/application/stm32h7/src/bin/a.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::cell::RefCell; 4use core::cell::RefCell;
6 5
diff --git a/examples/boot/application/stm32h7/src/bin/b.rs b/examples/boot/application/stm32h7/src/bin/b.rs
index 5c03e2d0c..5f3f35207 100644
--- a/examples/boot/application/stm32h7/src/bin/b.rs
+++ b/examples/boot/application/stm32h7/src/bin/b.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32l0/Cargo.toml b/examples/boot/application/stm32l0/Cargo.toml
index d6684bedb..240afe4c6 100644
--- a/examples/boot/application/stm32l0/Cargo.toml
+++ b/examples/boot/application/stm32l0/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } 8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } 9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] }
10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } 10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l072cz", "time-driver-any", "exti", "memory-x"] } 11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l072cz", "time-driver-any", "exti", "memory-x"] }
12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } 12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] }
diff --git a/examples/boot/application/stm32l0/src/bin/a.rs b/examples/boot/application/stm32l0/src/bin/a.rs
index 42e1a71eb..02f74bdef 100644
--- a/examples/boot/application/stm32l0/src/bin/a.rs
+++ b/examples/boot/application/stm32l0/src/bin/a.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32l0/src/bin/b.rs b/examples/boot/application/stm32l0/src/bin/b.rs
index 52d42395f..6bf00f41a 100644
--- a/examples/boot/application/stm32l0/src/bin/b.rs
+++ b/examples/boot/application/stm32l0/src/bin/b.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml
index cca8bf443..97f1e277b 100644
--- a/examples/boot/application/stm32l1/Cargo.toml
+++ b/examples/boot/application/stm32l1/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } 8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } 9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] }
10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } 10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l151cb-a", "time-driver-any", "exti"] } 11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l151cb-a", "time-driver-any", "exti"] }
12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } 12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] }
diff --git a/examples/boot/application/stm32l1/src/bin/a.rs b/examples/boot/application/stm32l1/src/bin/a.rs
index 42e1a71eb..02f74bdef 100644
--- a/examples/boot/application/stm32l1/src/bin/a.rs
+++ b/examples/boot/application/stm32l1/src/bin/a.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32l1/src/bin/b.rs b/examples/boot/application/stm32l1/src/bin/b.rs
index 52d42395f..6bf00f41a 100644
--- a/examples/boot/application/stm32l1/src/bin/b.rs
+++ b/examples/boot/application/stm32l1/src/bin/b.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32l4/Cargo.toml b/examples/boot/application/stm32l4/Cargo.toml
index 30d61056c..0c3830f97 100644
--- a/examples/boot/application/stm32l4/Cargo.toml
+++ b/examples/boot/application/stm32l4/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } 8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } 9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] }
10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } 10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "time-driver-any", "exti"] } 11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "time-driver-any", "exti"] }
12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } 12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] }
diff --git a/examples/boot/application/stm32l4/src/bin/a.rs b/examples/boot/application/stm32l4/src/bin/a.rs
index eefa25f75..892446968 100644
--- a/examples/boot/application/stm32l4/src/bin/a.rs
+++ b/examples/boot/application/stm32l4/src/bin/a.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32l4/src/bin/b.rs b/examples/boot/application/stm32l4/src/bin/b.rs
index 8411f384c..22ba82d5e 100644
--- a/examples/boot/application/stm32l4/src/bin/b.rs
+++ b/examples/boot/application/stm32l4/src/bin/b.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32wb-dfu/.cargo/config.toml b/examples/boot/application/stm32wb-dfu/.cargo/config.toml
new file mode 100644
index 000000000..4f8094ff2
--- /dev/null
+++ b/examples/boot/application/stm32wb-dfu/.cargo/config.toml
@@ -0,0 +1,9 @@
1[target.'cfg(all(target_arch = "arm", target_os = "none"))']
2# replace your chip as listed in `probe-rs chip list`
3runner = "probe-rs run --chip STM32WLE5JCIx"
4
5[build]
6target = "thumbv7em-none-eabihf"
7
8[env]
9DEFMT_LOG = "trace"
diff --git a/examples/boot/application/stm32wb-dfu/Cargo.toml b/examples/boot/application/stm32wb-dfu/Cargo.toml
new file mode 100644
index 000000000..cdaee802e
--- /dev/null
+++ b/examples/boot/application/stm32wb-dfu/Cargo.toml
@@ -0,0 +1,32 @@
1[package]
2edition = "2021"
3name = "embassy-boot-stm32wb-dfu-examples"
4version = "0.1.0"
5license = "MIT OR Apache-2.0"
6
7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] }
10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32wb55rg", "time-driver-any", "exti"] }
12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] }
13embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
14embassy-usb = { version = "0.1.0", path = "../../../../embassy-usb" }
15embassy-usb-dfu = { version = "0.1.0", path = "../../../../embassy-usb-dfu", features = ["application", "cortex-m"] }
16
17defmt = { version = "0.3", optional = true }
18defmt-rtt = { version = "0.4", optional = true }
19panic-reset = { version = "0.1.1" }
20embedded-hal = { version = "0.2.6" }
21
22cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
23cortex-m-rt = "0.7.0"
24
25[features]
26defmt = [
27 "dep:defmt",
28 "dep:defmt-rtt",
29 "embassy-stm32/defmt",
30 "embassy-boot-stm32/defmt",
31 "embassy-sync/defmt",
32]
diff --git a/examples/boot/application/stm32wb-dfu/README.md b/examples/boot/application/stm32wb-dfu/README.md
new file mode 100644
index 000000000..c8dce0387
--- /dev/null
+++ b/examples/boot/application/stm32wb-dfu/README.md
@@ -0,0 +1,29 @@
1# Examples using bootloader
2
3Example for STM32WL demonstrating the bootloader. The example consists of application binaries, 'a'
4which allows you to press a button to start the DFU process, and 'b' which is the updated
5application.
6
7
8## Prerequisites
9
10* `cargo-binutils`
11* `cargo-flash`
12* `embassy-boot-stm32`
13
14## Usage
15
16```
17# Flash bootloader
18cargo flash --manifest-path ../../bootloader/stm32/Cargo.toml --release --features embassy-stm32/stm32wl55jc-cm4 --chip STM32WLE5JCIx
19# Build 'b'
20cargo build --release --bin b
21# Generate binary for 'b'
22cargo objcopy --release --bin b -- -O binary b.bin
23```
24
25# Flash `a` (which includes b.bin)
26
27```
28cargo flash --release --bin a --chip STM32WLE5JCIx
29```
diff --git a/examples/boot/application/stm32wb-dfu/build.rs b/examples/boot/application/stm32wb-dfu/build.rs
new file mode 100644
index 000000000..e1da69328
--- /dev/null
+++ b/examples/boot/application/stm32wb-dfu/build.rs
@@ -0,0 +1,37 @@
1//! This build script copies the `memory.x` file from the crate root into
2//! a directory where the linker can always find it at build time.
3//! For many projects this is optional, as the linker always searches the
4//! project root directory -- wherever `Cargo.toml` is. However, if you
5//! are using a workspace or have a more complicated build setup, this
6//! build script becomes required. Additionally, by requesting that
7//! Cargo re-run the build script whenever `memory.x` is changed,
8//! updating `memory.x` ensures a rebuild of the application with the
9//! new memory settings.
10
11use std::env;
12use std::fs::File;
13use std::io::Write;
14use std::path::PathBuf;
15
16fn main() {
17 // Put `memory.x` in our output directory and ensure it's
18 // on the linker search path.
19 let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
20 File::create(out.join("memory.x"))
21 .unwrap()
22 .write_all(include_bytes!("memory.x"))
23 .unwrap();
24 println!("cargo:rustc-link-search={}", out.display());
25
26 // By default, Cargo will re-run a build script whenever
27 // any file in the project changes. By specifying `memory.x`
28 // here, we ensure the build script is only re-run when
29 // `memory.x` is changed.
30 println!("cargo:rerun-if-changed=memory.x");
31
32 println!("cargo:rustc-link-arg-bins=--nmagic");
33 println!("cargo:rustc-link-arg-bins=-Tlink.x");
34 if env::var("CARGO_FEATURE_DEFMT").is_ok() {
35 println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
36 }
37}
diff --git a/examples/boot/application/stm32wb-dfu/memory.x b/examples/boot/application/stm32wb-dfu/memory.x
new file mode 100644
index 000000000..ff1b800d2
--- /dev/null
+++ b/examples/boot/application/stm32wb-dfu/memory.x
@@ -0,0 +1,15 @@
1MEMORY
2{
3 /* NOTE 1 K = 1 KiBi = 1024 bytes */
4 BOOTLOADER : ORIGIN = 0x08000000, LENGTH = 24K
5 BOOTLOADER_STATE : ORIGIN = 0x08006000, LENGTH = 4K
6 FLASH : ORIGIN = 0x08008000, LENGTH = 128K
7 DFU : ORIGIN = 0x08028000, LENGTH = 132K
8 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 32K
9}
10
11__bootloader_state_start = ORIGIN(BOOTLOADER_STATE) - ORIGIN(BOOTLOADER);
12__bootloader_state_end = ORIGIN(BOOTLOADER_STATE) + LENGTH(BOOTLOADER_STATE) - ORIGIN(BOOTLOADER);
13
14__bootloader_dfu_start = ORIGIN(DFU) - ORIGIN(BOOTLOADER);
15__bootloader_dfu_end = ORIGIN(DFU) + LENGTH(DFU) - ORIGIN(BOOTLOADER);
diff --git a/examples/boot/application/stm32wb-dfu/src/main.rs b/examples/boot/application/stm32wb-dfu/src/main.rs
new file mode 100644
index 000000000..b2ccb9e1a
--- /dev/null
+++ b/examples/boot/application/stm32wb-dfu/src/main.rs
@@ -0,0 +1,63 @@
1#![no_std]
2#![no_main]
3
4use core::cell::RefCell;
5
6#[cfg(feature = "defmt-rtt")]
7use defmt_rtt::*;
8use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareState, FirmwareUpdaterConfig};
9use embassy_executor::Spawner;
10use embassy_stm32::flash::{Flash, WRITE_SIZE};
11use embassy_stm32::rcc::WPAN_DEFAULT;
12use embassy_stm32::usb::{self, Driver};
13use embassy_stm32::{bind_interrupts, peripherals};
14use embassy_sync::blocking_mutex::Mutex;
15use embassy_time::Duration;
16use embassy_usb::Builder;
17use embassy_usb_dfu::consts::DfuAttributes;
18use embassy_usb_dfu::{usb_dfu, Control, ResetImmediate};
19use panic_reset as _;
20
21bind_interrupts!(struct Irqs {
22 USB_LP => usb::InterruptHandler<peripherals::USB>;
23});
24
25#[embassy_executor::main]
26async fn main(_spawner: Spawner) {
27 let mut config = embassy_stm32::Config::default();
28 config.rcc = WPAN_DEFAULT;
29 let p = embassy_stm32::init(config);
30 let flash = Flash::new_blocking(p.FLASH);
31 let flash = Mutex::new(RefCell::new(flash));
32
33 let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash);
34 let mut magic = AlignedBuffer([0; WRITE_SIZE]);
35 let mut firmware_state = BlockingFirmwareState::from_config(config, &mut magic.0);
36 firmware_state.mark_booted().expect("Failed to mark booted");
37
38 let driver = Driver::new(p.USB, Irqs, p.PA12, p.PA11);
39 let mut config = embassy_usb::Config::new(0xc0de, 0xcafe);
40 config.manufacturer = Some("Embassy");
41 config.product = Some("USB-DFU Runtime example");
42 config.serial_number = Some("1235678");
43
44 let mut device_descriptor = [0; 256];
45 let mut config_descriptor = [0; 256];
46 let mut bos_descriptor = [0; 256];
47 let mut control_buf = [0; 64];
48 let mut state = Control::new(firmware_state, DfuAttributes::CAN_DOWNLOAD);
49 let mut builder = Builder::new(
50 driver,
51 config,
52 &mut device_descriptor,
53 &mut config_descriptor,
54 &mut bos_descriptor,
55 &mut [],
56 &mut control_buf,
57 );
58
59 usb_dfu::<_, _, ResetImmediate>(&mut builder, &mut state, Duration::from_millis(2500));
60
61 let mut dev = builder.build();
62 dev.run().await
63}
diff --git a/examples/boot/application/stm32wl/Cargo.toml b/examples/boot/application/stm32wl/Cargo.toml
index 7489a2fe9..b5677e148 100644
--- a/examples/boot/application/stm32wl/Cargo.toml
+++ b/examples/boot/application/stm32wl/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } 8embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } 9embassy-executor = { version = "0.4.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] }
10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] } 10embassy-time = { version = "0.2", path = "../../../../embassy-time", features = [ "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32wl55jc-cm4", "time-driver-any", "exti"] } 11embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["stm32wl55jc-cm4", "time-driver-any", "exti"] }
12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] } 12embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = [] }
diff --git a/examples/boot/application/stm32wl/src/bin/a.rs b/examples/boot/application/stm32wl/src/bin/a.rs
index c837e47b5..d9665e6ee 100644
--- a/examples/boot/application/stm32wl/src/bin/a.rs
+++ b/examples/boot/application/stm32wl/src/bin/a.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/application/stm32wl/src/bin/b.rs b/examples/boot/application/stm32wl/src/bin/b.rs
index 1ca3c6ea8..8dd15d8cd 100644
--- a/examples/boot/application/stm32wl/src/bin/b.rs
+++ b/examples/boot/application/stm32wl/src/bin/b.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5#[cfg(feature = "defmt-rtt")] 4#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 5use defmt_rtt::*;
diff --git a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml
new file mode 100644
index 000000000..ada073970
--- /dev/null
+++ b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml
@@ -0,0 +1,63 @@
1[package]
2edition = "2021"
3name = "stm32wb-dfu-bootloader-example"
4version = "0.1.0"
5description = "Example USB DFUbootloader for the STM32WB series of chips"
6license = "MIT OR Apache-2.0"
7
8[dependencies]
9defmt = { version = "0.3", optional = true }
10defmt-rtt = { version = "0.4", optional = true }
11
12embassy-stm32 = { path = "../../../../embassy-stm32", features = ["stm32wb55rg"] }
13embassy-boot-stm32 = { path = "../../../../embassy-boot/stm32" }
14cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
15embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" }
16cortex-m-rt = { version = "0.7" }
17embedded-storage = "0.3.1"
18embedded-storage-async = "0.4.0"
19cfg-if = "1.0.0"
20embassy-usb-dfu = { version = "0.1.0", path = "../../../../embassy-usb-dfu", features = ["dfu", "cortex-m"] }
21embassy-usb = { version = "0.1.0", path = "../../../../embassy-usb", default-features = false }
22embassy-futures = { version = "0.1.1", path = "../../../../embassy-futures" }
23
24[features]
25defmt = [
26 "dep:defmt",
27 "embassy-boot-stm32/defmt",
28 "embassy-stm32/defmt",
29 "embassy-usb/defmt",
30 "embassy-usb-dfu/defmt"
31]
32debug = ["defmt-rtt", "defmt"]
33
34[profile.dev]
35debug = 2
36debug-assertions = true
37incremental = false
38opt-level = 'z'
39overflow-checks = true
40
41[profile.release]
42codegen-units = 1
43debug = 2
44debug-assertions = false
45incremental = false
46lto = 'fat'
47opt-level = 'z'
48overflow-checks = false
49
50# do not optimize proc-macro crates = faster builds from scratch
51[profile.dev.build-override]
52codegen-units = 8
53debug = false
54debug-assertions = false
55opt-level = 0
56overflow-checks = false
57
58[profile.release.build-override]
59codegen-units = 8
60debug = false
61debug-assertions = false
62opt-level = 0
63overflow-checks = false
diff --git a/examples/boot/bootloader/stm32wb-dfu/README.md b/examples/boot/bootloader/stm32wb-dfu/README.md
new file mode 100644
index 000000000..a82b730b9
--- /dev/null
+++ b/examples/boot/bootloader/stm32wb-dfu/README.md
@@ -0,0 +1,11 @@
1# Bootloader for STM32
2
3The bootloader uses `embassy-boot` to interact with the flash.
4
5# Usage
6
7Flash the bootloader
8
9```
10cargo flash --features embassy-stm32/stm32wl55jc-cm4 --release --chip STM32WLE5JCIx
11```
diff --git a/examples/boot/bootloader/stm32wb-dfu/build.rs b/examples/boot/bootloader/stm32wb-dfu/build.rs
new file mode 100644
index 000000000..fd605991f
--- /dev/null
+++ b/examples/boot/bootloader/stm32wb-dfu/build.rs
@@ -0,0 +1,27 @@
1use std::env;
2use std::fs::File;
3use std::io::Write;
4use std::path::PathBuf;
5
6fn main() {
7 // Put `memory.x` in our output directory and ensure it's
8 // on the linker search path.
9 let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
10 File::create(out.join("memory.x"))
11 .unwrap()
12 .write_all(include_bytes!("memory.x"))
13 .unwrap();
14 println!("cargo:rustc-link-search={}", out.display());
15
16 // By default, Cargo will re-run a build script whenever
17 // any file in the project changes. By specifying `memory.x`
18 // here, we ensure the build script is only re-run when
19 // `memory.x` is changed.
20 println!("cargo:rerun-if-changed=memory.x");
21
22 println!("cargo:rustc-link-arg-bins=--nmagic");
23 println!("cargo:rustc-link-arg-bins=-Tlink.x");
24 if env::var("CARGO_FEATURE_DEFMT").is_ok() {
25 println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
26 }
27}
diff --git a/examples/boot/bootloader/stm32wb-dfu/memory.x b/examples/boot/bootloader/stm32wb-dfu/memory.x
new file mode 100644
index 000000000..858062631
--- /dev/null
+++ b/examples/boot/bootloader/stm32wb-dfu/memory.x
@@ -0,0 +1,18 @@
1MEMORY
2{
3 /* NOTE 1 K = 1 KiBi = 1024 bytes */
4 FLASH : ORIGIN = 0x08000000, LENGTH = 24K
5 BOOTLOADER_STATE : ORIGIN = 0x08006000, LENGTH = 4K
6 ACTIVE : ORIGIN = 0x08008000, LENGTH = 128K
7 DFU : ORIGIN = 0x08028000, LENGTH = 132K
8 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 16K
9}
10
11__bootloader_state_start = ORIGIN(BOOTLOADER_STATE) - ORIGIN(FLASH);
12__bootloader_state_end = ORIGIN(BOOTLOADER_STATE) + LENGTH(BOOTLOADER_STATE) - ORIGIN(FLASH);
13
14__bootloader_active_start = ORIGIN(ACTIVE) - ORIGIN(FLASH);
15__bootloader_active_end = ORIGIN(ACTIVE) + LENGTH(ACTIVE) - ORIGIN(FLASH);
16
17__bootloader_dfu_start = ORIGIN(DFU) - ORIGIN(FLASH);
18__bootloader_dfu_end = ORIGIN(DFU) + LENGTH(DFU) - ORIGIN(FLASH);
diff --git a/examples/boot/bootloader/stm32wb-dfu/src/main.rs b/examples/boot/bootloader/stm32wb-dfu/src/main.rs
new file mode 100644
index 000000000..a7ab813b6
--- /dev/null
+++ b/examples/boot/bootloader/stm32wb-dfu/src/main.rs
@@ -0,0 +1,93 @@
1#![no_std]
2#![no_main]
3
4use core::cell::RefCell;
5
6use cortex_m_rt::{entry, exception};
7#[cfg(feature = "defmt")]
8use defmt_rtt as _;
9use embassy_boot_stm32::*;
10use embassy_stm32::flash::{Flash, BANK1_REGION, WRITE_SIZE};
11use embassy_stm32::rcc::WPAN_DEFAULT;
12use embassy_stm32::usb::Driver;
13use embassy_stm32::{bind_interrupts, peripherals, usb};
14use embassy_sync::blocking_mutex::Mutex;
15use embassy_usb::Builder;
16use embassy_usb_dfu::consts::DfuAttributes;
17use embassy_usb_dfu::{usb_dfu, Control, ResetImmediate};
18
19bind_interrupts!(struct Irqs {
20 USB_LP => usb::InterruptHandler<peripherals::USB>;
21});
22
23#[entry]
24fn main() -> ! {
25 let mut config = embassy_stm32::Config::default();
26 config.rcc = WPAN_DEFAULT;
27 let p = embassy_stm32::init(config);
28
29 // Prevent a hard fault when accessing flash 'too early' after boot.
30 #[cfg(feature = "defmt")]
31 for _ in 0..10000000 {
32 cortex_m::asm::nop();
33 }
34
35 let layout = Flash::new_blocking(p.FLASH).into_blocking_regions();
36 let flash = Mutex::new(RefCell::new(layout.bank1_region));
37
38 let config = BootLoaderConfig::from_linkerfile_blocking(&flash);
39 let active_offset = config.active.offset();
40 let bl = BootLoader::prepare::<_, _, _, 2048>(config);
41 if bl.state == State::DfuDetach {
42 let driver = Driver::new(p.USB, Irqs, p.PA12, p.PA11);
43 let mut config = embassy_usb::Config::new(0xc0de, 0xcafe);
44 config.manufacturer = Some("Embassy");
45 config.product = Some("USB-DFU Bootloader example");
46 config.serial_number = Some("1235678");
47
48 let fw_config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash);
49 let mut buffer = AlignedBuffer([0; WRITE_SIZE]);
50 let updater = BlockingFirmwareUpdater::new(fw_config, &mut buffer.0[..]);
51
52 let mut device_descriptor = [0; 256];
53 let mut config_descriptor = [0; 256];
54 let mut bos_descriptor = [0; 256];
55 let mut control_buf = [0; 4096];
56 let mut state = Control::new(updater, DfuAttributes::CAN_DOWNLOAD);
57 let mut builder = Builder::new(
58 driver,
59 config,
60 &mut device_descriptor,
61 &mut config_descriptor,
62 &mut bos_descriptor,
63 &mut [],
64 &mut control_buf,
65 );
66
67 usb_dfu::<_, _, _, ResetImmediate, 4096>(&mut builder, &mut state);
68
69 let mut dev = builder.build();
70 embassy_futures::block_on(dev.run());
71 }
72
73 unsafe { bl.load(BANK1_REGION.base + active_offset) }
74}
75
76#[no_mangle]
77#[cfg_attr(target_os = "none", link_section = ".HardFault.user")]
78unsafe extern "C" fn HardFault() {
79 cortex_m::peripheral::SCB::sys_reset();
80}
81
82#[exception]
83unsafe fn DefaultHandler(_: i16) -> ! {
84 const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32;
85 let irqn = core::ptr::read_volatile(SCB_ICSR) as u8 as i16 - 16;
86
87 panic!("DefaultHandler #{:?}", irqn);
88}
89
90#[panic_handler]
91fn panic(_info: &core::panic::PanicInfo) -> ! {
92 cortex_m::asm::udf();
93}
diff --git a/examples/nrf-rtos-trace/src/bin/rtos_trace.rs b/examples/nrf-rtos-trace/src/bin/rtos_trace.rs
index 888375693..41cc06417 100644
--- a/examples/nrf-rtos-trace/src/bin/rtos_trace.rs
+++ b/examples/nrf-rtos-trace/src/bin/rtos_trace.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::future::poll_fn; 4use core::future::poll_fn;
6use core::task::Poll; 5use core::task::Poll;
diff --git a/examples/nrf52840/Cargo.toml b/examples/nrf52840/Cargo.toml
index 65cd631f8..bc8a7f2d6 100644
--- a/examples/nrf52840/Cargo.toml
+++ b/examples/nrf52840/Cargo.toml
@@ -4,12 +4,6 @@ name = "embassy-nrf52840-examples"
4version = "0.1.0" 4version = "0.1.0"
5license = "MIT OR Apache-2.0" 5license = "MIT OR Apache-2.0"
6 6
7[features]
8default = ["nightly"]
9nightly = [
10 "static_cell/nightly",
11]
12
13[dependencies] 7[dependencies]
14embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } 8embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
15embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 9embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
@@ -36,9 +30,9 @@ rand = { version = "0.8.4", default-features = false }
36embedded-storage = "0.3.1" 30embedded-storage = "0.3.1"
37usbd-hid = "0.6.0" 31usbd-hid = "0.6.0"
38serde = { version = "1.0.136", default-features = false } 32serde = { version = "1.0.136", default-features = false }
39embedded-hal = { version = "1.0.0-rc.2" } 33embedded-hal = { version = "1.0.0-rc.3" }
40embedded-hal-async = { version = "1.0.0-rc.2" } 34embedded-hal-async = { version = "1.0.0-rc.3" }
41embedded-hal-bus = { version = "0.1.0-rc.2", features = ["async"] } 35embedded-hal-bus = { version = "0.1.0-rc.3", features = ["async"] }
42num-integer = { version = "0.1.45", default-features = false } 36num-integer = { version = "0.1.45", default-features = false }
43microfft = "0.5.0" 37microfft = "0.5.0"
44 38
diff --git a/examples/nrf52840/src/bin/blinky.rs b/examples/nrf52840/src/bin/blinky.rs
index d3d1a7122..58a3d2cd9 100644
--- a/examples/nrf52840/src/bin/blinky.rs
+++ b/examples/nrf52840/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use embassy_executor::Spawner; 4use embassy_executor::Spawner;
6use embassy_nrf::gpio::{Level, Output, OutputDrive}; 5use embassy_nrf::gpio::{Level, Output, OutputDrive};
diff --git a/examples/nrf52840/src/bin/buffered_uart.rs b/examples/nrf52840/src/bin/buffered_uart.rs
index d9c505786..6ac72bcaf 100644
--- a/examples/nrf52840/src/bin/buffered_uart.rs
+++ b/examples/nrf52840/src/bin/buffered_uart.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/channel.rs b/examples/nrf52840/src/bin/channel.rs
index d3c7b47d2..7fcea9dbd 100644
--- a/examples/nrf52840/src/bin/channel.rs
+++ b/examples/nrf52840/src/bin/channel.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::unwrap; 4use defmt::unwrap;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/channel_sender_receiver.rs b/examples/nrf52840/src/bin/channel_sender_receiver.rs
index 79d2c4048..3095a04ec 100644
--- a/examples/nrf52840/src/bin/channel_sender_receiver.rs
+++ b/examples/nrf52840/src/bin/channel_sender_receiver.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::unwrap; 4use defmt::unwrap;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/ethernet_enc28j60.rs b/examples/nrf52840/src/bin/ethernet_enc28j60.rs
index d1b796fab..a8e64b38a 100644
--- a/examples/nrf52840/src/bin/ethernet_enc28j60.rs
+++ b/examples/nrf52840/src/bin/ethernet_enc28j60.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -14,7 +13,7 @@ use embassy_nrf::{bind_interrupts, peripherals, spim};
14use embassy_time::Delay; 13use embassy_time::Delay;
15use embedded_hal_bus::spi::ExclusiveDevice; 14use embedded_hal_bus::spi::ExclusiveDevice;
16use embedded_io_async::Write; 15use embedded_io_async::Write;
17use static_cell::make_static; 16use static_cell::StaticCell;
18use {defmt_rtt as _, panic_probe as _}; 17use {defmt_rtt as _, panic_probe as _};
19 18
20bind_interrupts!(struct Irqs { 19bind_interrupts!(struct Irqs {
@@ -70,11 +69,20 @@ async fn main(spawner: Spawner) {
70 let seed = u64::from_le_bytes(seed); 69 let seed = u64::from_le_bytes(seed);
71 70
72 // Init network stack 71 // Init network stack
73 let stack = &*make_static!(Stack::new( 72 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
73 static STACK: StaticCell<
74 Stack<
75 Enc28j60<
76 ExclusiveDevice<Spim<'static, peripherals::SPI3>, Output<'static, peripherals::P0_15>, Delay>,
77 Output<'static, peripherals::P0_13>,
78 >,
79 >,
80 > = StaticCell::new();
81 let stack = STACK.init(Stack::new(
74 device, 82 device,
75 config, 83 config,
76 make_static!(StackResources::<2>::new()), 84 RESOURCES.init(StackResources::<2>::new()),
77 seed 85 seed,
78 )); 86 ));
79 87
80 unwrap!(spawner.spawn(net_task(stack))); 88 unwrap!(spawner.spawn(net_task(stack)));
diff --git a/examples/nrf52840/src/bin/executor_fairness_test.rs b/examples/nrf52840/src/bin/executor_fairness_test.rs
index f111b272e..df6e7af3f 100644
--- a/examples/nrf52840/src/bin/executor_fairness_test.rs
+++ b/examples/nrf52840/src/bin/executor_fairness_test.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::future::poll_fn; 4use core::future::poll_fn;
6use core::task::Poll; 5use core::task::Poll;
diff --git a/examples/nrf52840/src/bin/gpiote_channel.rs b/examples/nrf52840/src/bin/gpiote_channel.rs
index 5bfd02465..e254d613d 100644
--- a/examples/nrf52840/src/bin/gpiote_channel.rs
+++ b/examples/nrf52840/src/bin/gpiote_channel.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/gpiote_port.rs b/examples/nrf52840/src/bin/gpiote_port.rs
index 0155d539e..c1afe2f20 100644
--- a/examples/nrf52840/src/bin/gpiote_port.rs
+++ b/examples/nrf52840/src/bin/gpiote_port.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/i2s_effect.rs b/examples/nrf52840/src/bin/i2s_effect.rs
index 391514d93..9eadeb4e4 100644
--- a/examples/nrf52840/src/bin/i2s_effect.rs
+++ b/examples/nrf52840/src/bin/i2s_effect.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::f32::consts::PI; 4use core::f32::consts::PI;
6 5
diff --git a/examples/nrf52840/src/bin/i2s_monitor.rs b/examples/nrf52840/src/bin/i2s_monitor.rs
index 4ed597c0d..799be351f 100644
--- a/examples/nrf52840/src/bin/i2s_monitor.rs
+++ b/examples/nrf52840/src/bin/i2s_monitor.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{debug, error, info}; 4use defmt::{debug, error, info};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/i2s_waveform.rs b/examples/nrf52840/src/bin/i2s_waveform.rs
index f2c1166b1..137d82840 100644
--- a/examples/nrf52840/src/bin/i2s_waveform.rs
+++ b/examples/nrf52840/src/bin/i2s_waveform.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::f32::consts::PI; 4use core::f32::consts::PI;
6 5
diff --git a/examples/nrf52840/src/bin/manually_create_executor.rs b/examples/nrf52840/src/bin/manually_create_executor.rs
index 80364d34a..7ca39348e 100644
--- a/examples/nrf52840/src/bin/manually_create_executor.rs
+++ b/examples/nrf52840/src/bin/manually_create_executor.rs
@@ -3,7 +3,6 @@
3 3
4#![no_std] 4#![no_std]
5#![no_main] 5#![no_main]
6#![feature(type_alias_impl_trait)]
7 6
8use cortex_m_rt::entry; 7use cortex_m_rt::entry;
9use defmt::{info, unwrap}; 8use defmt::{info, unwrap};
diff --git a/examples/nrf52840/src/bin/multiprio.rs b/examples/nrf52840/src/bin/multiprio.rs
index 352f62bf2..b634d8569 100644
--- a/examples/nrf52840/src/bin/multiprio.rs
+++ b/examples/nrf52840/src/bin/multiprio.rs
@@ -55,7 +55,6 @@
55 55
56#![no_std] 56#![no_std]
57#![no_main] 57#![no_main]
58#![feature(type_alias_impl_trait)]
59 58
60use cortex_m_rt::entry; 59use cortex_m_rt::entry;
61use defmt::{info, unwrap}; 60use defmt::{info, unwrap};
diff --git a/examples/nrf52840/src/bin/mutex.rs b/examples/nrf52840/src/bin/mutex.rs
index 11b47d991..5c22279b5 100644
--- a/examples/nrf52840/src/bin/mutex.rs
+++ b/examples/nrf52840/src/bin/mutex.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/nvmc.rs b/examples/nrf52840/src/bin/nvmc.rs
index 624829863..a79385b98 100644
--- a/examples/nrf52840/src/bin/nvmc.rs
+++ b/examples/nrf52840/src/bin/nvmc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/pdm.rs b/examples/nrf52840/src/bin/pdm.rs
index bff323974..52dadc805 100644
--- a/examples/nrf52840/src/bin/pdm.rs
+++ b/examples/nrf52840/src/bin/pdm.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/pdm_continuous.rs b/examples/nrf52840/src/bin/pdm_continuous.rs
index 7d8531475..e948203a5 100644
--- a/examples/nrf52840/src/bin/pdm_continuous.rs
+++ b/examples/nrf52840/src/bin/pdm_continuous.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::cmp::Ordering; 4use core::cmp::Ordering;
6 5
diff --git a/examples/nrf52840/src/bin/ppi.rs b/examples/nrf52840/src/bin/ppi.rs
index d74ce4064..129ad06e7 100644
--- a/examples/nrf52840/src/bin/ppi.rs
+++ b/examples/nrf52840/src/bin/ppi.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::future::pending; 4use core::future::pending;
6 5
diff --git a/examples/nrf52840/src/bin/pubsub.rs b/examples/nrf52840/src/bin/pubsub.rs
index 17d902227..5ebea9220 100644
--- a/examples/nrf52840/src/bin/pubsub.rs
+++ b/examples/nrf52840/src/bin/pubsub.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::unwrap; 4use defmt::unwrap;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/pwm.rs b/examples/nrf52840/src/bin/pwm.rs
index 9750935c8..a5bb1347a 100644
--- a/examples/nrf52840/src/bin/pwm.rs
+++ b/examples/nrf52840/src/bin/pwm.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/pwm_double_sequence.rs b/examples/nrf52840/src/bin/pwm_double_sequence.rs
index 1bfe6e15a..386c483b8 100644
--- a/examples/nrf52840/src/bin/pwm_double_sequence.rs
+++ b/examples/nrf52840/src/bin/pwm_double_sequence.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/pwm_sequence.rs b/examples/nrf52840/src/bin/pwm_sequence.rs
index f282cf910..87eda265f 100644
--- a/examples/nrf52840/src/bin/pwm_sequence.rs
+++ b/examples/nrf52840/src/bin/pwm_sequence.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/pwm_sequence_ppi.rs b/examples/nrf52840/src/bin/pwm_sequence_ppi.rs
index 6594fa348..60ea712b5 100644
--- a/examples/nrf52840/src/bin/pwm_sequence_ppi.rs
+++ b/examples/nrf52840/src/bin/pwm_sequence_ppi.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::future::pending; 4use core::future::pending;
6 5
diff --git a/examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs b/examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs
index 8596e6545..751cf4425 100644
--- a/examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs
+++ b/examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/pwm_servo.rs b/examples/nrf52840/src/bin/pwm_servo.rs
index 92ded1f88..d772d2f5d 100644
--- a/examples/nrf52840/src/bin/pwm_servo.rs
+++ b/examples/nrf52840/src/bin/pwm_servo.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/qdec.rs b/examples/nrf52840/src/bin/qdec.rs
index 59783d312..ea849be63 100644
--- a/examples/nrf52840/src/bin/qdec.rs
+++ b/examples/nrf52840/src/bin/qdec.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/qspi.rs b/examples/nrf52840/src/bin/qspi.rs
index 9e8a01f4e..4539dd0e3 100644
--- a/examples/nrf52840/src/bin/qspi.rs
+++ b/examples/nrf52840/src/bin/qspi.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{assert_eq, info, unwrap}; 4use defmt::{assert_eq, info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/qspi_lowpower.rs b/examples/nrf52840/src/bin/qspi_lowpower.rs
index 42b5454e0..516c9b481 100644
--- a/examples/nrf52840/src/bin/qspi_lowpower.rs
+++ b/examples/nrf52840/src/bin/qspi_lowpower.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::mem; 4use core::mem;
6 5
diff --git a/examples/nrf52840/src/bin/rng.rs b/examples/nrf52840/src/bin/rng.rs
index 855743f50..326054c9a 100644
--- a/examples/nrf52840/src/bin/rng.rs
+++ b/examples/nrf52840/src/bin/rng.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use embassy_executor::Spawner; 4use embassy_executor::Spawner;
6use embassy_nrf::rng::Rng; 5use embassy_nrf::rng::Rng;
diff --git a/examples/nrf52840/src/bin/saadc.rs b/examples/nrf52840/src/bin/saadc.rs
index d651834f5..653b7d606 100644
--- a/examples/nrf52840/src/bin/saadc.rs
+++ b/examples/nrf52840/src/bin/saadc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/saadc_continuous.rs b/examples/nrf52840/src/bin/saadc_continuous.rs
index a5f8a4dd7..f76fa3570 100644
--- a/examples/nrf52840/src/bin/saadc_continuous.rs
+++ b/examples/nrf52840/src/bin/saadc_continuous.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/self_spawn.rs b/examples/nrf52840/src/bin/self_spawn.rs
index 8a58396a4..5bfefc2af 100644
--- a/examples/nrf52840/src/bin/self_spawn.rs
+++ b/examples/nrf52840/src/bin/self_spawn.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/self_spawn_current_executor.rs b/examples/nrf52840/src/bin/self_spawn_current_executor.rs
index 65d50f8c3..ec9569a64 100644
--- a/examples/nrf52840/src/bin/self_spawn_current_executor.rs
+++ b/examples/nrf52840/src/bin/self_spawn_current_executor.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/spim.rs b/examples/nrf52840/src/bin/spim.rs
index 9d1843a8f..131187660 100644
--- a/examples/nrf52840/src/bin/spim.rs
+++ b/examples/nrf52840/src/bin/spim.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/spis.rs b/examples/nrf52840/src/bin/spis.rs
index 77b6e8b64..613cd37ab 100644
--- a/examples/nrf52840/src/bin/spis.rs
+++ b/examples/nrf52840/src/bin/spis.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/temp.rs b/examples/nrf52840/src/bin/temp.rs
index d94dea38d..1d28f8ecf 100644
--- a/examples/nrf52840/src/bin/temp.rs
+++ b/examples/nrf52840/src/bin/temp.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/timer.rs b/examples/nrf52840/src/bin/timer.rs
index 9b9bb3eb4..365695a20 100644
--- a/examples/nrf52840/src/bin/timer.rs
+++ b/examples/nrf52840/src/bin/timer.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/twim.rs b/examples/nrf52840/src/bin/twim.rs
index 959e3a4be..a9a0765e8 100644
--- a/examples/nrf52840/src/bin/twim.rs
+++ b/examples/nrf52840/src/bin/twim.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/twim_lowpower.rs b/examples/nrf52840/src/bin/twim_lowpower.rs
index bf9f966ef..c743614b8 100644
--- a/examples/nrf52840/src/bin/twim_lowpower.rs
+++ b/examples/nrf52840/src/bin/twim_lowpower.rs
@@ -6,7 +6,6 @@
6 6
7#![no_std] 7#![no_std]
8#![no_main] 8#![no_main]
9#![feature(type_alias_impl_trait)]
10 9
11use core::mem; 10use core::mem;
12 11
diff --git a/examples/nrf52840/src/bin/twis.rs b/examples/nrf52840/src/bin/twis.rs
index aa42b679e..88bd4cceb 100644
--- a/examples/nrf52840/src/bin/twis.rs
+++ b/examples/nrf52840/src/bin/twis.rs
@@ -2,7 +2,6 @@
2 2
3#![no_std] 3#![no_std]
4#![no_main] 4#![no_main]
5#![feature(type_alias_impl_trait)]
6 5
7use defmt::*; 6use defmt::*;
8use embassy_executor::Spawner; 7use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/uart.rs b/examples/nrf52840/src/bin/uart.rs
index 50d5cab8c..accaccea1 100644
--- a/examples/nrf52840/src/bin/uart.rs
+++ b/examples/nrf52840/src/bin/uart.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/uart_idle.rs b/examples/nrf52840/src/bin/uart_idle.rs
index e1f42fa6c..fa93bcf21 100644
--- a/examples/nrf52840/src/bin/uart_idle.rs
+++ b/examples/nrf52840/src/bin/uart_idle.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/uart_split.rs b/examples/nrf52840/src/bin/uart_split.rs
index b748bfcd8..c7510a9a8 100644
--- a/examples/nrf52840/src/bin/uart_split.rs
+++ b/examples/nrf52840/src/bin/uart_split.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/usb_ethernet.rs b/examples/nrf52840/src/bin/usb_ethernet.rs
index b7806f418..3469c6e5f 100644
--- a/examples/nrf52840/src/bin/usb_ethernet.rs
+++ b/examples/nrf52840/src/bin/usb_ethernet.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::mem; 4use core::mem;
6 5
@@ -16,7 +15,7 @@ use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState
16use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; 15use embassy_usb::class::cdc_ncm::{CdcNcmClass, State};
17use embassy_usb::{Builder, Config, UsbDevice}; 16use embassy_usb::{Builder, Config, UsbDevice};
18use embedded_io_async::Write; 17use embedded_io_async::Write;
19use static_cell::make_static; 18use static_cell::StaticCell;
20use {defmt_rtt as _, panic_probe as _}; 19use {defmt_rtt as _, panic_probe as _};
21 20
22bind_interrupts!(struct Irqs { 21bind_interrupts!(struct Irqs {
@@ -71,14 +70,19 @@ async fn main(spawner: Spawner) {
71 config.device_protocol = 0x01; 70 config.device_protocol = 0x01;
72 71
73 // Create embassy-usb DeviceBuilder using the driver and config. 72 // Create embassy-usb DeviceBuilder using the driver and config.
73 static DEVICE_DESC: StaticCell<[u8; 256]> = StaticCell::new();
74 static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
75 static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
76 static MSOS_DESC: StaticCell<[u8; 128]> = StaticCell::new();
77 static CONTROL_BUF: StaticCell<[u8; 128]> = StaticCell::new();
74 let mut builder = Builder::new( 78 let mut builder = Builder::new(
75 driver, 79 driver,
76 config, 80 config,
77 &mut make_static!([0; 256])[..], 81 &mut DEVICE_DESC.init([0; 256])[..],
78 &mut make_static!([0; 256])[..], 82 &mut CONFIG_DESC.init([0; 256])[..],
79 &mut make_static!([0; 256])[..], 83 &mut BOS_DESC.init([0; 256])[..],
80 &mut make_static!([0; 128])[..], 84 &mut MSOS_DESC.init([0; 128])[..],
81 &mut make_static!([0; 128])[..], 85 &mut CONTROL_BUF.init([0; 128])[..],
82 ); 86 );
83 87
84 // Our MAC addr. 88 // Our MAC addr.
@@ -87,14 +91,16 @@ async fn main(spawner: Spawner) {
87 let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; 91 let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88];
88 92
89 // Create classes on the builder. 93 // Create classes on the builder.
90 let class = CdcNcmClass::new(&mut builder, make_static!(State::new()), host_mac_addr, 64); 94 static STATE: StaticCell<State> = StaticCell::new();
95 let class = CdcNcmClass::new(&mut builder, STATE.init(State::new()), host_mac_addr, 64);
91 96
92 // Build the builder. 97 // Build the builder.
93 let usb = builder.build(); 98 let usb = builder.build();
94 99
95 unwrap!(spawner.spawn(usb_task(usb))); 100 unwrap!(spawner.spawn(usb_task(usb)));
96 101
97 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); 102 static NET_STATE: StaticCell<NetState<MTU, 4, 4>> = StaticCell::new();
103 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(NET_STATE.init(NetState::new()), our_mac_addr);
98 unwrap!(spawner.spawn(usb_ncm_task(runner))); 104 unwrap!(spawner.spawn(usb_ncm_task(runner)));
99 105
100 let config = embassy_net::Config::dhcpv4(Default::default()); 106 let config = embassy_net::Config::dhcpv4(Default::default());
@@ -111,12 +117,9 @@ async fn main(spawner: Spawner) {
111 let seed = u64::from_le_bytes(seed); 117 let seed = u64::from_le_bytes(seed);
112 118
113 // Init network stack 119 // Init network stack
114 let stack = &*make_static!(Stack::new( 120 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
115 device, 121 static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new();
116 config, 122 let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed));
117 make_static!(StackResources::<2>::new()),
118 seed
119 ));
120 123
121 unwrap!(spawner.spawn(net_task(stack))); 124 unwrap!(spawner.spawn(net_task(stack)));
122 125
diff --git a/examples/nrf52840/src/bin/usb_hid_keyboard.rs b/examples/nrf52840/src/bin/usb_hid_keyboard.rs
index 7ccd2946a..45850b4a4 100644
--- a/examples/nrf52840/src/bin/usb_hid_keyboard.rs
+++ b/examples/nrf52840/src/bin/usb_hid_keyboard.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::mem; 4use core::mem;
6use core::sync::atomic::{AtomicBool, Ordering}; 5use core::sync::atomic::{AtomicBool, Ordering};
diff --git a/examples/nrf52840/src/bin/usb_hid_mouse.rs b/examples/nrf52840/src/bin/usb_hid_mouse.rs
index 96fcf8a66..04ad841b7 100644
--- a/examples/nrf52840/src/bin/usb_hid_mouse.rs
+++ b/examples/nrf52840/src/bin/usb_hid_mouse.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::mem; 4use core::mem;
6 5
diff --git a/examples/nrf52840/src/bin/usb_serial.rs b/examples/nrf52840/src/bin/usb_serial.rs
index dc95cde84..aff539b1b 100644
--- a/examples/nrf52840/src/bin/usb_serial.rs
+++ b/examples/nrf52840/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::mem; 4use core::mem;
6 5
diff --git a/examples/nrf52840/src/bin/usb_serial_multitask.rs b/examples/nrf52840/src/bin/usb_serial_multitask.rs
index cd4392903..4e8118fb8 100644
--- a/examples/nrf52840/src/bin/usb_serial_multitask.rs
+++ b/examples/nrf52840/src/bin/usb_serial_multitask.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::mem; 4use core::mem;
6 5
@@ -12,7 +11,7 @@ use embassy_nrf::{bind_interrupts, pac, peripherals, usb};
12use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; 11use embassy_usb::class::cdc_acm::{CdcAcmClass, State};
13use embassy_usb::driver::EndpointError; 12use embassy_usb::driver::EndpointError;
14use embassy_usb::{Builder, Config, UsbDevice}; 13use embassy_usb::{Builder, Config, UsbDevice};
15use static_cell::make_static; 14use static_cell::StaticCell;
16use {defmt_rtt as _, panic_probe as _}; 15use {defmt_rtt as _, panic_probe as _};
17 16
18bind_interrupts!(struct Irqs { 17bind_interrupts!(struct Irqs {
@@ -64,17 +63,23 @@ async fn main(spawner: Spawner) {
64 config.device_protocol = 0x01; 63 config.device_protocol = 0x01;
65 config.composite_with_iads = true; 64 config.composite_with_iads = true;
66 65
67 let state = make_static!(State::new()); 66 static STATE: StaticCell<State> = StaticCell::new();
67 let state = STATE.init(State::new());
68 68
69 // Create embassy-usb DeviceBuilder using the driver and config. 69 // Create embassy-usb DeviceBuilder using the driver and config.
70 static DEVICE_DESC: StaticCell<[u8; 256]> = StaticCell::new();
71 static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
72 static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
73 static MSOS_DESC: StaticCell<[u8; 128]> = StaticCell::new();
74 static CONTROL_BUF: StaticCell<[u8; 128]> = StaticCell::new();
70 let mut builder = Builder::new( 75 let mut builder = Builder::new(
71 driver, 76 driver,
72 config, 77 config,
73 &mut make_static!([0; 256])[..], 78 &mut DEVICE_DESC.init([0; 256])[..],
74 &mut make_static!([0; 256])[..], 79 &mut CONFIG_DESC.init([0; 256])[..],
75 &mut make_static!([0; 256])[..], 80 &mut BOS_DESC.init([0; 256])[..],
76 &mut make_static!([0; 128])[..], 81 &mut MSOS_DESC.init([0; 128])[..],
77 &mut make_static!([0; 128])[..], 82 &mut CONTROL_BUF.init([0; 128])[..],
78 ); 83 );
79 84
80 // Create classes on the builder. 85 // Create classes on the builder.
diff --git a/examples/nrf52840/src/bin/usb_serial_winusb.rs b/examples/nrf52840/src/bin/usb_serial_winusb.rs
index 1d39d3841..060f9ba94 100644
--- a/examples/nrf52840/src/bin/usb_serial_winusb.rs
+++ b/examples/nrf52840/src/bin/usb_serial_winusb.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::mem; 4use core::mem;
6 5
diff --git a/examples/nrf52840/src/bin/wdt.rs b/examples/nrf52840/src/bin/wdt.rs
index 058746518..ede88cc26 100644
--- a/examples/nrf52840/src/bin/wdt.rs
+++ b/examples/nrf52840/src/bin/wdt.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf52840/src/bin/wifi_esp_hosted.rs b/examples/nrf52840/src/bin/wifi_esp_hosted.rs
index a60822fd9..fc2086f75 100644
--- a/examples/nrf52840/src/bin/wifi_esp_hosted.rs
+++ b/examples/nrf52840/src/bin/wifi_esp_hosted.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap, warn}; 4use defmt::{info, unwrap, warn};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -13,7 +12,7 @@ use embassy_nrf::{bind_interrupts, peripherals};
13use embassy_time::Delay; 12use embassy_time::Delay;
14use embedded_hal_bus::spi::ExclusiveDevice; 13use embedded_hal_bus::spi::ExclusiveDevice;
15use embedded_io_async::Write; 14use embedded_io_async::Write;
16use static_cell::make_static; 15use static_cell::StaticCell;
17use {defmt_rtt as _, embassy_net_esp_hosted as hosted, panic_probe as _}; 16use {defmt_rtt as _, embassy_net_esp_hosted as hosted, panic_probe as _};
18 17
19const WIFI_NETWORK: &str = "EmbassyTest"; 18const WIFI_NETWORK: &str = "EmbassyTest";
@@ -61,8 +60,9 @@ async fn main(spawner: Spawner) {
61 let spi = spim::Spim::new(p.SPI3, Irqs, sck, miso, mosi, config); 60 let spi = spim::Spim::new(p.SPI3, Irqs, sck, miso, mosi, config);
62 let spi = ExclusiveDevice::new(spi, cs, Delay); 61 let spi = ExclusiveDevice::new(spi, cs, Delay);
63 62
63 static ESP_STATE: StaticCell<embassy_net_esp_hosted::State> = StaticCell::new();
64 let (device, mut control, runner) = embassy_net_esp_hosted::new( 64 let (device, mut control, runner) = embassy_net_esp_hosted::new(
65 make_static!(embassy_net_esp_hosted::State::new()), 65 ESP_STATE.init(embassy_net_esp_hosted::State::new()),
66 spi, 66 spi,
67 handshake, 67 handshake,
68 ready, 68 ready,
@@ -89,11 +89,13 @@ async fn main(spawner: Spawner) {
89 let seed = u64::from_le_bytes(seed); 89 let seed = u64::from_le_bytes(seed);
90 90
91 // Init network stack 91 // Init network stack
92 let stack = &*make_static!(Stack::new( 92 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
93 static STACK: StaticCell<Stack<hosted::NetDriver<'static>>> = StaticCell::new();
94 let stack = &*STACK.init(Stack::new(
93 device, 95 device,
94 config, 96 config,
95 make_static!(StackResources::<2>::new()), 97 RESOURCES.init(StackResources::<2>::new()),
96 seed 98 seed,
97 )); 99 ));
98 100
99 unwrap!(spawner.spawn(net_task(stack))); 101 unwrap!(spawner.spawn(net_task(stack)));
diff --git a/examples/nrf5340/Cargo.toml b/examples/nrf5340/Cargo.toml
index 17d3e30e4..fc0346f90 100644
--- a/examples/nrf5340/Cargo.toml
+++ b/examples/nrf5340/Cargo.toml
@@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
7[dependencies] 7[dependencies]
8embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } 8embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
9embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 9embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
10embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "defmt", "integrated-timers"] } 10embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
11embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } 11embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] }
12embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf5340-app-s", "time-driver-rtc1", "gpiote", "unstable-pac"] } 12embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf5340-app-s", "time-driver-rtc1", "gpiote", "unstable-pac"] }
13embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } 13embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] }
@@ -17,7 +17,7 @@ embedded-io-async = { version = "0.6.1" }
17defmt = "0.3" 17defmt = "0.3"
18defmt-rtt = "0.4" 18defmt-rtt = "0.4"
19 19
20static_cell = { version = "2", features = ["nightly"]} 20static_cell = "2"
21cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } 21cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
22cortex-m-rt = "0.7.0" 22cortex-m-rt = "0.7.0"
23panic-probe = { version = "0.3", features = ["print-defmt"] } 23panic-probe = { version = "0.3", features = ["print-defmt"] }
diff --git a/examples/nrf5340/src/bin/blinky.rs b/examples/nrf5340/src/bin/blinky.rs
index b784564a5..5c533c9b1 100644
--- a/examples/nrf5340/src/bin/blinky.rs
+++ b/examples/nrf5340/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use embassy_executor::Spawner; 4use embassy_executor::Spawner;
6use embassy_nrf::gpio::{Level, Output, OutputDrive}; 5use embassy_nrf::gpio::{Level, Output, OutputDrive};
diff --git a/examples/nrf5340/src/bin/gpiote_channel.rs b/examples/nrf5340/src/bin/gpiote_channel.rs
index ceab1194a..c0a55142f 100644
--- a/examples/nrf5340/src/bin/gpiote_channel.rs
+++ b/examples/nrf5340/src/bin/gpiote_channel.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/nrf5340/src/bin/uart.rs b/examples/nrf5340/src/bin/uart.rs
index d68539702..7b41d7463 100644
--- a/examples/nrf5340/src/bin/uart.rs
+++ b/examples/nrf5340/src/bin/uart.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml
index 7f637758d..07de83203 100644
--- a/examples/rp/Cargo.toml
+++ b/examples/rp/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8[dependencies] 8[dependencies]
9embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] } 9embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] }
13embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl"] } 13embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl"] }
14embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 14embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
@@ -38,12 +38,12 @@ smart-leds = "0.3.0"
38heapless = "0.8" 38heapless = "0.8"
39usbd-hid = "0.6.1" 39usbd-hid = "0.6.1"
40 40
41embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } 41embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.3" }
42embedded-hal-async = "1.0.0-rc.2" 42embedded-hal-async = "1.0.0-rc.3"
43embedded-hal-bus = { version = "0.1.0-rc.2", features = ["async"] } 43embedded-hal-bus = { version = "0.1.0-rc.3", features = ["async"] }
44embedded-io-async = { version = "0.6.1", features = ["defmt-03"] } 44embedded-io-async = { version = "0.6.1", features = ["defmt-03"] }
45embedded-storage = { version = "0.3" } 45embedded-storage = { version = "0.3" }
46static_cell = { version = "2", features = ["nightly"]} 46static_cell = "2"
47portable-atomic = { version = "1.5", features = ["critical-section"] } 47portable-atomic = { version = "1.5", features = ["critical-section"] }
48log = "0.4" 48log = "0.4"
49pio-proc = "0.2" 49pio-proc = "0.2"
diff --git a/examples/rp/src/bin/adc.rs b/examples/rp/src/bin/adc.rs
index a579be139..1bb7c2249 100644
--- a/examples/rp/src/bin/adc.rs
+++ b/examples/rp/src/bin/adc.rs
@@ -3,7 +3,6 @@
3 3
4#![no_std] 4#![no_std]
5#![no_main] 5#![no_main]
6#![feature(type_alias_impl_trait)]
7 6
8use defmt::*; 7use defmt::*;
9use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/blinky.rs b/examples/rp/src/bin/blinky.rs
index 66c8773fa..60fc45a70 100644
--- a/examples/rp/src/bin/blinky.rs
+++ b/examples/rp/src/bin/blinky.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/button.rs b/examples/rp/src/bin/button.rs
index d7aa89410..e9054fd48 100644
--- a/examples/rp/src/bin/button.rs
+++ b/examples/rp/src/bin/button.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use embassy_executor::Spawner; 8use embassy_executor::Spawner;
10use embassy_rp::gpio::{Input, Level, Output, Pull}; 9use embassy_rp::gpio::{Input, Level, Output, Pull};
@@ -17,7 +16,7 @@ async fn main(_spawner: Spawner) {
17 16
18 // Use PIN_28, Pin34 on J0 for RP Pico, as a input. 17 // Use PIN_28, Pin34 on J0 for RP Pico, as a input.
19 // You need to add your own button. 18 // You need to add your own button.
20 let button = Input::new(p.PIN_28, Pull::Up); 19 let mut button = Input::new(p.PIN_28, Pull::Up);
21 20
22 loop { 21 loop {
23 if button.is_high() { 22 if button.is_high() {
diff --git a/examples/rp/src/bin/ethernet_w5500_multisocket.rs b/examples/rp/src/bin/ethernet_w5500_multisocket.rs
index c0fde62ab..a16ea0007 100644
--- a/examples/rp/src/bin/ethernet_w5500_multisocket.rs
+++ b/examples/rp/src/bin/ethernet_w5500_multisocket.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
@@ -20,7 +19,7 @@ use embassy_time::{Delay, Duration};
20use embedded_hal_bus::spi::ExclusiveDevice; 19use embedded_hal_bus::spi::ExclusiveDevice;
21use embedded_io_async::Write; 20use embedded_io_async::Write;
22use rand::RngCore; 21use rand::RngCore;
23use static_cell::make_static; 22use static_cell::StaticCell;
24use {defmt_rtt as _, panic_probe as _}; 23use {defmt_rtt as _, panic_probe as _};
25 24
26#[embassy_executor::task] 25#[embassy_executor::task]
@@ -55,7 +54,8 @@ async fn main(spawner: Spawner) {
55 let w5500_reset = Output::new(p.PIN_20, Level::High); 54 let w5500_reset = Output::new(p.PIN_20, Level::High);
56 55
57 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; 56 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00];
58 let state = make_static!(State::<8, 8>::new()); 57 static STATE: StaticCell<State<8, 8>> = StaticCell::new();
58 let state = STATE.init(State::<8, 8>::new());
59 let (device, runner) = embassy_net_wiznet::new( 59 let (device, runner) = embassy_net_wiznet::new(
60 mac_addr, 60 mac_addr,
61 state, 61 state,
@@ -70,11 +70,13 @@ async fn main(spawner: Spawner) {
70 let seed = rng.next_u64(); 70 let seed = rng.next_u64();
71 71
72 // Init network stack 72 // Init network stack
73 let stack = &*make_static!(Stack::new( 73 static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new();
74 static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
75 let stack = &*STACK.init(Stack::new(
74 device, 76 device,
75 embassy_net::Config::dhcpv4(Default::default()), 77 embassy_net::Config::dhcpv4(Default::default()),
76 make_static!(StackResources::<3>::new()), 78 RESOURCES.init(StackResources::<3>::new()),
77 seed 79 seed,
78 )); 80 ));
79 81
80 // Launch network task 82 // Launch network task
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs
index b19362fc1..975b3d385 100644
--- a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs
+++ b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use core::str::FromStr; 8use core::str::FromStr;
10 9
@@ -22,7 +21,7 @@ use embassy_time::{Delay, Duration, Timer};
22use embedded_hal_bus::spi::ExclusiveDevice; 21use embedded_hal_bus::spi::ExclusiveDevice;
23use embedded_io_async::Write; 22use embedded_io_async::Write;
24use rand::RngCore; 23use rand::RngCore;
25use static_cell::make_static; 24use static_cell::StaticCell;
26use {defmt_rtt as _, panic_probe as _}; 25use {defmt_rtt as _, panic_probe as _};
27 26
28#[embassy_executor::task] 27#[embassy_executor::task]
@@ -58,7 +57,8 @@ async fn main(spawner: Spawner) {
58 let w5500_reset = Output::new(p.PIN_20, Level::High); 57 let w5500_reset = Output::new(p.PIN_20, Level::High);
59 58
60 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; 59 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00];
61 let state = make_static!(State::<8, 8>::new()); 60 static STATE: StaticCell<State<8, 8>> = StaticCell::new();
61 let state = STATE.init(State::<8, 8>::new());
62 let (device, runner) = embassy_net_wiznet::new( 62 let (device, runner) = embassy_net_wiznet::new(
63 mac_addr, 63 mac_addr,
64 state, 64 state,
@@ -73,11 +73,13 @@ async fn main(spawner: Spawner) {
73 let seed = rng.next_u64(); 73 let seed = rng.next_u64();
74 74
75 // Init network stack 75 // Init network stack
76 let stack = &*make_static!(Stack::new( 76 static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new();
77 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
78 let stack = &*STACK.init(Stack::new(
77 device, 79 device,
78 embassy_net::Config::dhcpv4(Default::default()), 80 embassy_net::Config::dhcpv4(Default::default()),
79 make_static!(StackResources::<2>::new()), 81 RESOURCES.init(StackResources::<2>::new()),
80 seed 82 seed,
81 )); 83 ));
82 84
83 // Launch network task 85 // Launch network task
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs
index c62caed7a..489af2c76 100644
--- a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs
+++ b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs
@@ -5,7 +5,6 @@
5 5
6#![no_std] 6#![no_std]
7#![no_main] 7#![no_main]
8#![feature(type_alias_impl_trait)]
9 8
10use defmt::*; 9use defmt::*;
11use embassy_executor::Spawner; 10use embassy_executor::Spawner;
@@ -21,7 +20,7 @@ use embassy_time::{Delay, Duration};
21use embedded_hal_bus::spi::ExclusiveDevice; 20use embedded_hal_bus::spi::ExclusiveDevice;
22use embedded_io_async::Write; 21use embedded_io_async::Write;
23use rand::RngCore; 22use rand::RngCore;
24use static_cell::make_static; 23use static_cell::StaticCell;
25use {defmt_rtt as _, panic_probe as _}; 24use {defmt_rtt as _, panic_probe as _};
26 25
27#[embassy_executor::task] 26#[embassy_executor::task]
@@ -57,7 +56,8 @@ async fn main(spawner: Spawner) {
57 let w5500_reset = Output::new(p.PIN_20, Level::High); 56 let w5500_reset = Output::new(p.PIN_20, Level::High);
58 57
59 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; 58 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00];
60 let state = make_static!(State::<8, 8>::new()); 59 static STATE: StaticCell<State<8, 8>> = StaticCell::new();
60 let state = STATE.init(State::<8, 8>::new());
61 let (device, runner) = embassy_net_wiznet::new( 61 let (device, runner) = embassy_net_wiznet::new(
62 mac_addr, 62 mac_addr,
63 state, 63 state,
@@ -72,11 +72,13 @@ async fn main(spawner: Spawner) {
72 let seed = rng.next_u64(); 72 let seed = rng.next_u64();
73 73
74 // Init network stack 74 // Init network stack
75 let stack = &*make_static!(Stack::new( 75 static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new();
76 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
77 let stack = &*STACK.init(Stack::new(
76 device, 78 device,
77 embassy_net::Config::dhcpv4(Default::default()), 79 embassy_net::Config::dhcpv4(Default::default()),
78 make_static!(StackResources::<2>::new()), 80 RESOURCES.init(StackResources::<2>::new()),
79 seed 81 seed,
80 )); 82 ));
81 83
82 // Launch network task 84 // Launch network task
diff --git a/examples/rp/src/bin/ethernet_w5500_udp.rs b/examples/rp/src/bin/ethernet_w5500_udp.rs
index 76dabce1c..41bd7d077 100644
--- a/examples/rp/src/bin/ethernet_w5500_udp.rs
+++ b/examples/rp/src/bin/ethernet_w5500_udp.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
@@ -20,7 +19,7 @@ use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
20use embassy_time::Delay; 19use embassy_time::Delay;
21use embedded_hal_bus::spi::ExclusiveDevice; 20use embedded_hal_bus::spi::ExclusiveDevice;
22use rand::RngCore; 21use rand::RngCore;
23use static_cell::make_static; 22use static_cell::StaticCell;
24use {defmt_rtt as _, panic_probe as _}; 23use {defmt_rtt as _, panic_probe as _};
25 24
26#[embassy_executor::task] 25#[embassy_executor::task]
@@ -55,7 +54,8 @@ async fn main(spawner: Spawner) {
55 let w5500_reset = Output::new(p.PIN_20, Level::High); 54 let w5500_reset = Output::new(p.PIN_20, Level::High);
56 55
57 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; 56 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00];
58 let state = make_static!(State::<8, 8>::new()); 57 static STATE: StaticCell<State<8, 8>> = StaticCell::new();
58 let state = STATE.init(State::<8, 8>::new());
59 let (device, runner) = embassy_net_wiznet::new( 59 let (device, runner) = embassy_net_wiznet::new(
60 mac_addr, 60 mac_addr,
61 state, 61 state,
@@ -70,11 +70,13 @@ async fn main(spawner: Spawner) {
70 let seed = rng.next_u64(); 70 let seed = rng.next_u64();
71 71
72 // Init network stack 72 // Init network stack
73 let stack = &*make_static!(Stack::new( 73 static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new();
74 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
75 let stack = &*STACK.init(Stack::new(
74 device, 76 device,
75 embassy_net::Config::dhcpv4(Default::default()), 77 embassy_net::Config::dhcpv4(Default::default()),
76 make_static!(StackResources::<2>::new()), 78 RESOURCES.init(StackResources::<2>::new()),
77 seed 79 seed,
78 )); 80 ));
79 81
80 // Launch network task 82 // Launch network task
diff --git a/examples/rp/src/bin/flash.rs b/examples/rp/src/bin/flash.rs
index 129a8497f..eb3e6a2b9 100644
--- a/examples/rp/src/bin/flash.rs
+++ b/examples/rp/src/bin/flash.rs
@@ -2,7 +2,6 @@
2 2
3#![no_std] 3#![no_std]
4#![no_main] 4#![no_main]
5#![feature(type_alias_impl_trait)]
6 5
7use defmt::*; 6use defmt::*;
8use embassy_executor::Spawner; 7use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/gpio_async.rs b/examples/rp/src/bin/gpio_async.rs
index 98209fe41..b79fb2a15 100644
--- a/examples/rp/src/bin/gpio_async.rs
+++ b/examples/rp/src/bin/gpio_async.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/gpout.rs b/examples/rp/src/bin/gpout.rs
index 896cc15ee..011359253 100644
--- a/examples/rp/src/bin/gpout.rs
+++ b/examples/rp/src/bin/gpout.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/i2c_async.rs b/examples/rp/src/bin/i2c_async.rs
index 7b53aae72..e31cc894c 100644
--- a/examples/rp/src/bin/i2c_async.rs
+++ b/examples/rp/src/bin/i2c_async.rs
@@ -5,7 +5,6 @@
5 5
6#![no_std] 6#![no_std]
7#![no_main] 7#![no_main]
8#![feature(type_alias_impl_trait)]
9 8
10use defmt::*; 9use defmt::*;
11use embassy_executor::Spawner; 10use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/i2c_blocking.rs b/examples/rp/src/bin/i2c_blocking.rs
index 9ddb48d69..c9c8a2760 100644
--- a/examples/rp/src/bin/i2c_blocking.rs
+++ b/examples/rp/src/bin/i2c_blocking.rs
@@ -5,7 +5,6 @@
5 5
6#![no_std] 6#![no_std]
7#![no_main] 7#![no_main]
8#![feature(type_alias_impl_trait)]
9 8
10use defmt::*; 9use defmt::*;
11use embassy_executor::Spawner; 10use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/i2c_slave.rs b/examples/rp/src/bin/i2c_slave.rs
index 151b083a4..479f9a16a 100644
--- a/examples/rp/src/bin/i2c_slave.rs
+++ b/examples/rp/src/bin/i2c_slave.rs
@@ -1,7 +1,6 @@
1//! This example shows how to use the 2040 as an i2c slave. 1//! This example shows how to use the 2040 as an i2c slave.
2#![no_std] 2#![no_std]
3#![no_main] 3#![no_main]
4#![feature(type_alias_impl_trait)]
5 4
6use defmt::*; 5use defmt::*;
7use embassy_executor::Spawner; 6use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/multicore.rs b/examples/rp/src/bin/multicore.rs
index 43eaf8b0a..a1678d99a 100644
--- a/examples/rp/src/bin/multicore.rs
+++ b/examples/rp/src/bin/multicore.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Executor; 9use embassy_executor::Executor;
diff --git a/examples/rp/src/bin/multiprio.rs b/examples/rp/src/bin/multiprio.rs
index 28f621437..26b80c11d 100644
--- a/examples/rp/src/bin/multiprio.rs
+++ b/examples/rp/src/bin/multiprio.rs
@@ -55,7 +55,6 @@
55 55
56#![no_std] 56#![no_std]
57#![no_main] 57#![no_main]
58#![feature(type_alias_impl_trait)]
59 58
60use cortex_m_rt::entry; 59use cortex_m_rt::entry;
61use defmt::{info, unwrap}; 60use defmt::{info, unwrap};
diff --git a/examples/rp/src/bin/pio_async.rs b/examples/rp/src/bin/pio_async.rs
index a6d6144be..ee248591b 100644
--- a/examples/rp/src/bin/pio_async.rs
+++ b/examples/rp/src/bin/pio_async.rs
@@ -2,7 +2,6 @@
2 2
3#![no_std] 3#![no_std]
4#![no_main] 4#![no_main]
5#![feature(type_alias_impl_trait)]
6use defmt::info; 5use defmt::info;
7use embassy_executor::Spawner; 6use embassy_executor::Spawner;
8use embassy_rp::bind_interrupts; 7use embassy_rp::bind_interrupts;
diff --git a/examples/rp/src/bin/pio_dma.rs b/examples/rp/src/bin/pio_dma.rs
index 86e5017ac..02700269c 100644
--- a/examples/rp/src/bin/pio_dma.rs
+++ b/examples/rp/src/bin/pio_dma.rs
@@ -2,7 +2,6 @@
2 2
3#![no_std] 3#![no_std]
4#![no_main] 4#![no_main]
5#![feature(type_alias_impl_trait)]
6use defmt::info; 5use defmt::info;
7use embassy_executor::Spawner; 6use embassy_executor::Spawner;
8use embassy_futures::join::join; 7use embassy_futures::join::join;
diff --git a/examples/rp/src/bin/pio_hd44780.rs b/examples/rp/src/bin/pio_hd44780.rs
index 5e5a6f9a3..3fab7b5f2 100644
--- a/examples/rp/src/bin/pio_hd44780.rs
+++ b/examples/rp/src/bin/pio_hd44780.rs
@@ -3,7 +3,6 @@
3 3
4#![no_std] 4#![no_std]
5#![no_main] 5#![no_main]
6#![feature(type_alias_impl_trait)]
7 6
8use core::fmt::Write; 7use core::fmt::Write;
9 8
diff --git a/examples/rp/src/bin/pio_rotary_encoder.rs b/examples/rp/src/bin/pio_rotary_encoder.rs
index 6d9d59df6..58bdadbc0 100644
--- a/examples/rp/src/bin/pio_rotary_encoder.rs
+++ b/examples/rp/src/bin/pio_rotary_encoder.rs
@@ -2,7 +2,6 @@
2 2
3#![no_std] 3#![no_std]
4#![no_main] 4#![no_main]
5#![feature(type_alias_impl_trait)]
6 5
7use defmt::info; 6use defmt::info;
8use embassy_executor::Spawner; 7use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/pio_stepper.rs b/examples/rp/src/bin/pio_stepper.rs
index 02fb20699..ab9ecf623 100644
--- a/examples/rp/src/bin/pio_stepper.rs
+++ b/examples/rp/src/bin/pio_stepper.rs
@@ -3,7 +3,6 @@
3 3
4#![no_std] 4#![no_std]
5#![no_main] 5#![no_main]
6#![feature(type_alias_impl_trait)]
7use core::mem::{self, MaybeUninit}; 6use core::mem::{self, MaybeUninit};
8 7
9use defmt::info; 8use defmt::info;
diff --git a/examples/rp/src/bin/pio_uart.rs b/examples/rp/src/bin/pio_uart.rs
index c0ea23607..a07f1c180 100644
--- a/examples/rp/src/bin/pio_uart.rs
+++ b/examples/rp/src/bin/pio_uart.rs
@@ -8,7 +8,6 @@
8 8
9#![no_std] 9#![no_std]
10#![no_main] 10#![no_main]
11#![feature(type_alias_impl_trait)]
12#![allow(async_fn_in_trait)] 11#![allow(async_fn_in_trait)]
13 12
14use defmt::{info, panic, trace}; 13use defmt::{info, panic, trace};
diff --git a/examples/rp/src/bin/pio_ws2812.rs b/examples/rp/src/bin/pio_ws2812.rs
index 7b3259538..9a97cb8a7 100644
--- a/examples/rp/src/bin/pio_ws2812.rs
+++ b/examples/rp/src/bin/pio_ws2812.rs
@@ -3,7 +3,6 @@
3 3
4#![no_std] 4#![no_std]
5#![no_main] 5#![no_main]
6#![feature(type_alias_impl_trait)]
7 6
8use defmt::*; 7use defmt::*;
9use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/pwm.rs b/examples/rp/src/bin/pwm.rs
index a99e88003..4fb62546d 100644
--- a/examples/rp/src/bin/pwm.rs
+++ b/examples/rp/src/bin/pwm.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/pwm_input.rs b/examples/rp/src/bin/pwm_input.rs
index 0fc2e40c3..e7bcbfbd4 100644
--- a/examples/rp/src/bin/pwm_input.rs
+++ b/examples/rp/src/bin/pwm_input.rs
@@ -2,7 +2,6 @@
2 2
3#![no_std] 3#![no_std]
4#![no_main] 4#![no_main]
5#![feature(type_alias_impl_trait)]
6 5
7use defmt::*; 6use defmt::*;
8use embassy_executor::Spawner; 7use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/rosc.rs b/examples/rp/src/bin/rosc.rs
index f841043b6..942b72319 100644
--- a/examples/rp/src/bin/rosc.rs
+++ b/examples/rp/src/bin/rosc.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/rtc.rs b/examples/rp/src/bin/rtc.rs
index 667876db5..e9a5e43a8 100644
--- a/examples/rp/src/bin/rtc.rs
+++ b/examples/rp/src/bin/rtc.rs
@@ -2,7 +2,6 @@
2 2
3#![no_std] 3#![no_std]
4#![no_main] 4#![no_main]
5#![feature(type_alias_impl_trait)]
6 5
7use defmt::*; 6use defmt::*;
8use embassy_executor::Spawner; 7use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/spi.rs b/examples/rp/src/bin/spi.rs
index 602348f7a..4cc4f5210 100644
--- a/examples/rp/src/bin/spi.rs
+++ b/examples/rp/src/bin/spi.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/spi_async.rs b/examples/rp/src/bin/spi_async.rs
index f5a2d334e..266584efc 100644
--- a/examples/rp/src/bin/spi_async.rs
+++ b/examples/rp/src/bin/spi_async.rs
@@ -3,7 +3,6 @@
3 3
4#![no_std] 4#![no_std]
5#![no_main] 5#![no_main]
6#![feature(type_alias_impl_trait)]
7 6
8use defmt::*; 7use defmt::*;
9use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/spi_display.rs b/examples/rp/src/bin/spi_display.rs
index 26c258e1c..e937b9d0a 100644
--- a/examples/rp/src/bin/spi_display.rs
+++ b/examples/rp/src/bin/spi_display.rs
@@ -5,7 +5,6 @@
5 5
6#![no_std] 6#![no_std]
7#![no_main] 7#![no_main]
8#![feature(type_alias_impl_trait)]
9 8
10use core::cell::RefCell; 9use core::cell::RefCell;
11 10
diff --git a/examples/rp/src/bin/uart.rs b/examples/rp/src/bin/uart.rs
index 451c3c396..6a2816cd0 100644
--- a/examples/rp/src/bin/uart.rs
+++ b/examples/rp/src/bin/uart.rs
@@ -6,7 +6,6 @@
6 6
7#![no_std] 7#![no_std]
8#![no_main] 8#![no_main]
9#![feature(type_alias_impl_trait)]
10 9
11use embassy_executor::Spawner; 10use embassy_executor::Spawner;
12use embassy_rp::uart; 11use embassy_rp::uart;
diff --git a/examples/rp/src/bin/uart_buffered_split.rs b/examples/rp/src/bin/uart_buffered_split.rs
index 14e8810a4..fac61aa04 100644
--- a/examples/rp/src/bin/uart_buffered_split.rs
+++ b/examples/rp/src/bin/uart_buffered_split.rs
@@ -6,7 +6,6 @@
6 6
7#![no_std] 7#![no_std]
8#![no_main] 8#![no_main]
9#![feature(type_alias_impl_trait)]
10 9
11use defmt::*; 10use defmt::*;
12use embassy_executor::Spawner; 11use embassy_executor::Spawner;
@@ -15,7 +14,7 @@ use embassy_rp::peripherals::UART0;
15use embassy_rp::uart::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, Config}; 14use embassy_rp::uart::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, Config};
16use embassy_time::Timer; 15use embassy_time::Timer;
17use embedded_io_async::{Read, Write}; 16use embedded_io_async::{Read, Write};
18use static_cell::make_static; 17use static_cell::StaticCell;
19use {defmt_rtt as _, panic_probe as _}; 18use {defmt_rtt as _, panic_probe as _};
20 19
21bind_interrupts!(struct Irqs { 20bind_interrupts!(struct Irqs {
@@ -27,8 +26,10 @@ async fn main(spawner: Spawner) {
27 let p = embassy_rp::init(Default::default()); 26 let p = embassy_rp::init(Default::default());
28 let (tx_pin, rx_pin, uart) = (p.PIN_0, p.PIN_1, p.UART0); 27 let (tx_pin, rx_pin, uart) = (p.PIN_0, p.PIN_1, p.UART0);
29 28
30 let tx_buf = &mut make_static!([0u8; 16])[..]; 29 static TX_BUF: StaticCell<[u8; 16]> = StaticCell::new();
31 let rx_buf = &mut make_static!([0u8; 16])[..]; 30 let tx_buf = &mut TX_BUF.init([0; 16])[..];
31 static RX_BUF: StaticCell<[u8; 16]> = StaticCell::new();
32 let rx_buf = &mut RX_BUF.init([0; 16])[..];
32 let uart = BufferedUart::new(uart, Irqs, tx_pin, rx_pin, tx_buf, rx_buf, Config::default()); 33 let uart = BufferedUart::new(uart, Irqs, tx_pin, rx_pin, tx_buf, rx_buf, Config::default());
33 let (rx, mut tx) = uart.split(); 34 let (rx, mut tx) = uart.split();
34 35
diff --git a/examples/rp/src/bin/uart_unidir.rs b/examples/rp/src/bin/uart_unidir.rs
index 42c8b432e..a45f40756 100644
--- a/examples/rp/src/bin/uart_unidir.rs
+++ b/examples/rp/src/bin/uart_unidir.rs
@@ -7,7 +7,6 @@
7 7
8#![no_std] 8#![no_std]
9#![no_main] 9#![no_main]
10#![feature(type_alias_impl_trait)]
11 10
12use defmt::*; 11use defmt::*;
13use embassy_executor::Spawner; 12use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/usb_ethernet.rs b/examples/rp/src/bin/usb_ethernet.rs
index cc63029fb..01f0d5967 100644
--- a/examples/rp/src/bin/usb_ethernet.rs
+++ b/examples/rp/src/bin/usb_ethernet.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::*; 8use defmt::*;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
@@ -17,7 +16,7 @@ use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState
17use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; 16use embassy_usb::class::cdc_ncm::{CdcNcmClass, State};
18use embassy_usb::{Builder, Config, UsbDevice}; 17use embassy_usb::{Builder, Config, UsbDevice};
19use embedded_io_async::Write; 18use embedded_io_async::Write;
20use static_cell::make_static; 19use static_cell::StaticCell;
21use {defmt_rtt as _, panic_probe as _}; 20use {defmt_rtt as _, panic_probe as _};
22 21
23bind_interrupts!(struct Irqs { 22bind_interrupts!(struct Irqs {
@@ -65,14 +64,18 @@ async fn main(spawner: Spawner) {
65 config.device_protocol = 0x01; 64 config.device_protocol = 0x01;
66 65
67 // Create embassy-usb DeviceBuilder using the driver and config. 66 // Create embassy-usb DeviceBuilder using the driver and config.
67 static DEVICE_DESC: StaticCell<[u8; 256]> = StaticCell::new();
68 static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
69 static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
70 static CONTROL_BUF: StaticCell<[u8; 128]> = StaticCell::new();
68 let mut builder = Builder::new( 71 let mut builder = Builder::new(
69 driver, 72 driver,
70 config, 73 config,
71 &mut make_static!([0; 256])[..], 74 &mut DEVICE_DESC.init([0; 256])[..],
72 &mut make_static!([0; 256])[..], 75 &mut CONFIG_DESC.init([0; 256])[..],
73 &mut make_static!([0; 256])[..], 76 &mut BOS_DESC.init([0; 256])[..],
74 &mut [], // no msos descriptors 77 &mut [], // no msos descriptors
75 &mut make_static!([0; 128])[..], 78 &mut CONTROL_BUF.init([0; 128])[..],
76 ); 79 );
77 80
78 // Our MAC addr. 81 // Our MAC addr.
@@ -81,14 +84,16 @@ async fn main(spawner: Spawner) {
81 let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; 84 let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88];
82 85
83 // Create classes on the builder. 86 // Create classes on the builder.
84 let class = CdcNcmClass::new(&mut builder, make_static!(State::new()), host_mac_addr, 64); 87 static STATE: StaticCell<State> = StaticCell::new();
88 let class = CdcNcmClass::new(&mut builder, STATE.init(State::new()), host_mac_addr, 64);
85 89
86 // Build the builder. 90 // Build the builder.
87 let usb = builder.build(); 91 let usb = builder.build();
88 92
89 unwrap!(spawner.spawn(usb_task(usb))); 93 unwrap!(spawner.spawn(usb_task(usb)));
90 94
91 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); 95 static NET_STATE: StaticCell<NetState<MTU, 4, 4>> = StaticCell::new();
96 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(NET_STATE.init(NetState::new()), our_mac_addr);
92 unwrap!(spawner.spawn(usb_ncm_task(runner))); 97 unwrap!(spawner.spawn(usb_ncm_task(runner)));
93 98
94 let config = embassy_net::Config::dhcpv4(Default::default()); 99 let config = embassy_net::Config::dhcpv4(Default::default());
@@ -102,11 +107,13 @@ async fn main(spawner: Spawner) {
102 let seed = 1234; // guaranteed random, chosen by a fair dice roll 107 let seed = 1234; // guaranteed random, chosen by a fair dice roll
103 108
104 // Init network stack 109 // Init network stack
105 let stack = &*make_static!(Stack::new( 110 static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new();
111 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
112 let stack = &*STACK.init(Stack::new(
106 device, 113 device,
107 config, 114 config,
108 make_static!(StackResources::<2>::new()), 115 RESOURCES.init(StackResources::<2>::new()),
109 seed 116 seed,
110 )); 117 ));
111 118
112 unwrap!(spawner.spawn(net_task(stack))); 119 unwrap!(spawner.spawn(net_task(stack)));
diff --git a/examples/rp/src/bin/usb_hid_keyboard.rs b/examples/rp/src/bin/usb_hid_keyboard.rs
index 569c9b12b..b5ac16245 100644
--- a/examples/rp/src/bin/usb_hid_keyboard.rs
+++ b/examples/rp/src/bin/usb_hid_keyboard.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::sync::atomic::{AtomicBool, Ordering}; 4use core::sync::atomic::{AtomicBool, Ordering};
6 5
diff --git a/examples/rp/src/bin/usb_logger.rs b/examples/rp/src/bin/usb_logger.rs
index 791f15e56..af401ed63 100644
--- a/examples/rp/src/bin/usb_logger.rs
+++ b/examples/rp/src/bin/usb_logger.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use embassy_executor::Spawner; 8use embassy_executor::Spawner;
10use embassy_rp::bind_interrupts; 9use embassy_rp::bind_interrupts;
diff --git a/examples/rp/src/bin/usb_midi.rs b/examples/rp/src/bin/usb_midi.rs
index d5cdae319..95306a35c 100644
--- a/examples/rp/src/bin/usb_midi.rs
+++ b/examples/rp/src/bin/usb_midi.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::{info, panic}; 8use defmt::{info, panic};
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/usb_raw.rs b/examples/rp/src/bin/usb_raw.rs
index f59262e5c..a6c8a5b2e 100644
--- a/examples/rp/src/bin/usb_raw.rs
+++ b/examples/rp/src/bin/usb_raw.rs
@@ -48,7 +48,6 @@
48 48
49#![no_std] 49#![no_std]
50#![no_main] 50#![no_main]
51#![feature(type_alias_impl_trait)]
52 51
53use defmt::info; 52use defmt::info;
54use embassy_executor::Spawner; 53use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/usb_raw_bulk.rs b/examples/rp/src/bin/usb_raw_bulk.rs
index 288be5a4e..0dc8e9f72 100644
--- a/examples/rp/src/bin/usb_raw_bulk.rs
+++ b/examples/rp/src/bin/usb_raw_bulk.rs
@@ -26,7 +26,6 @@
26 26
27#![no_std] 27#![no_std]
28#![no_main] 28#![no_main]
29#![feature(type_alias_impl_trait)]
30 29
31use defmt::info; 30use defmt::info;
32use embassy_executor::Spawner; 31use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/usb_serial.rs b/examples/rp/src/bin/usb_serial.rs
index 30347d920..ab24a994c 100644
--- a/examples/rp/src/bin/usb_serial.rs
+++ b/examples/rp/src/bin/usb_serial.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::{info, panic}; 8use defmt::{info, panic};
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/watchdog.rs b/examples/rp/src/bin/watchdog.rs
index b6af518af..b9d4ef22f 100644
--- a/examples/rp/src/bin/watchdog.rs
+++ b/examples/rp/src/bin/watchdog.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use defmt::info; 8use defmt::info;
10use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs
index ad1fa6462..1bd75607e 100644
--- a/examples/rp/src/bin/wifi_ap_tcp_server.rs
+++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs
@@ -3,7 +3,6 @@
3 3
4#![no_std] 4#![no_std]
5#![no_main] 5#![no_main]
6#![feature(type_alias_impl_trait)]
7#![allow(async_fn_in_trait)] 6#![allow(async_fn_in_trait)]
8 7
9use core::str::from_utf8; 8use core::str::from_utf8;
@@ -19,7 +18,7 @@ use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0};
19use embassy_rp::pio::{InterruptHandler, Pio}; 18use embassy_rp::pio::{InterruptHandler, Pio};
20use embassy_time::Duration; 19use embassy_time::Duration;
21use embedded_io_async::Write; 20use embedded_io_async::Write;
22use static_cell::make_static; 21use static_cell::StaticCell;
23use {defmt_rtt as _, panic_probe as _}; 22use {defmt_rtt as _, panic_probe as _};
24 23
25bind_interrupts!(struct Irqs { 24bind_interrupts!(struct Irqs {
@@ -59,7 +58,8 @@ async fn main(spawner: Spawner) {
59 let mut pio = Pio::new(p.PIO0, Irqs); 58 let mut pio = Pio::new(p.PIO0, Irqs);
60 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); 59 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0);
61 60
62 let state = make_static!(cyw43::State::new()); 61 static STATE: StaticCell<cyw43::State> = StaticCell::new();
62 let state = STATE.init(cyw43::State::new());
63 let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; 63 let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await;
64 unwrap!(spawner.spawn(wifi_task(runner))); 64 unwrap!(spawner.spawn(wifi_task(runner)));
65 65
@@ -79,11 +79,13 @@ async fn main(spawner: Spawner) {
79 let seed = 0x0123_4567_89ab_cdef; // chosen by fair dice roll. guarenteed to be random. 79 let seed = 0x0123_4567_89ab_cdef; // chosen by fair dice roll. guarenteed to be random.
80 80
81 // Init network stack 81 // Init network stack
82 let stack = &*make_static!(Stack::new( 82 static STACK: StaticCell<Stack<cyw43::NetDriver<'static>>> = StaticCell::new();
83 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
84 let stack = &*STACK.init(Stack::new(
83 net_device, 85 net_device,
84 config, 86 config,
85 make_static!(StackResources::<2>::new()), 87 RESOURCES.init(StackResources::<2>::new()),
86 seed 88 seed,
87 )); 89 ));
88 90
89 unwrap!(spawner.spawn(net_task(stack))); 91 unwrap!(spawner.spawn(net_task(stack)));
diff --git a/examples/rp/src/bin/wifi_blinky.rs b/examples/rp/src/bin/wifi_blinky.rs
index 14ace74e9..1ed74993c 100644
--- a/examples/rp/src/bin/wifi_blinky.rs
+++ b/examples/rp/src/bin/wifi_blinky.rs
@@ -4,7 +4,6 @@
4 4
5#![no_std] 5#![no_std]
6#![no_main] 6#![no_main]
7#![feature(type_alias_impl_trait)]
8 7
9use cyw43_pio::PioSpi; 8use cyw43_pio::PioSpi;
10use defmt::*; 9use defmt::*;
@@ -14,7 +13,7 @@ use embassy_rp::gpio::{Level, Output};
14use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; 13use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0};
15use embassy_rp::pio::{InterruptHandler, Pio}; 14use embassy_rp::pio::{InterruptHandler, Pio};
16use embassy_time::{Duration, Timer}; 15use embassy_time::{Duration, Timer};
17use static_cell::make_static; 16use static_cell::StaticCell;
18use {defmt_rtt as _, panic_probe as _}; 17use {defmt_rtt as _, panic_probe as _};
19 18
20bind_interrupts!(struct Irqs { 19bind_interrupts!(struct Irqs {
@@ -46,7 +45,8 @@ async fn main(spawner: Spawner) {
46 let mut pio = Pio::new(p.PIO0, Irqs); 45 let mut pio = Pio::new(p.PIO0, Irqs);
47 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); 46 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0);
48 47
49 let state = make_static!(cyw43::State::new()); 48 static STATE: StaticCell<cyw43::State> = StaticCell::new();
49 let state = STATE.init(cyw43::State::new());
50 let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; 50 let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await;
51 unwrap!(spawner.spawn(wifi_task(runner))); 51 unwrap!(spawner.spawn(wifi_task(runner)));
52 52
diff --git a/examples/rp/src/bin/wifi_scan.rs b/examples/rp/src/bin/wifi_scan.rs
index 7adf52b88..45bb5b76c 100644
--- a/examples/rp/src/bin/wifi_scan.rs
+++ b/examples/rp/src/bin/wifi_scan.rs
@@ -3,7 +3,6 @@
3 3
4#![no_std] 4#![no_std]
5#![no_main] 5#![no_main]
6#![feature(type_alias_impl_trait)]
7#![allow(async_fn_in_trait)] 6#![allow(async_fn_in_trait)]
8 7
9use core::str; 8use core::str;
@@ -16,7 +15,7 @@ use embassy_rp::bind_interrupts;
16use embassy_rp::gpio::{Level, Output}; 15use embassy_rp::gpio::{Level, Output};
17use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; 16use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0};
18use embassy_rp::pio::{InterruptHandler, Pio}; 17use embassy_rp::pio::{InterruptHandler, Pio};
19use static_cell::make_static; 18use static_cell::StaticCell;
20use {defmt_rtt as _, panic_probe as _}; 19use {defmt_rtt as _, panic_probe as _};
21 20
22bind_interrupts!(struct Irqs { 21bind_interrupts!(struct Irqs {
@@ -56,7 +55,8 @@ async fn main(spawner: Spawner) {
56 let mut pio = Pio::new(p.PIO0, Irqs); 55 let mut pio = Pio::new(p.PIO0, Irqs);
57 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); 56 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0);
58 57
59 let state = make_static!(cyw43::State::new()); 58 static STATE: StaticCell<cyw43::State> = StaticCell::new();
59 let state = STATE.init(cyw43::State::new());
60 let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; 60 let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await;
61 unwrap!(spawner.spawn(wifi_task(runner))); 61 unwrap!(spawner.spawn(wifi_task(runner)));
62 62
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs
index ec6b4ee74..c346f1ded 100644
--- a/examples/rp/src/bin/wifi_tcp_server.rs
+++ b/examples/rp/src/bin/wifi_tcp_server.rs
@@ -3,7 +3,6 @@
3 3
4#![no_std] 4#![no_std]
5#![no_main] 5#![no_main]
6#![feature(type_alias_impl_trait)]
7#![allow(async_fn_in_trait)] 6#![allow(async_fn_in_trait)]
8 7
9use core::str::from_utf8; 8use core::str::from_utf8;
@@ -19,7 +18,7 @@ use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0};
19use embassy_rp::pio::{InterruptHandler, Pio}; 18use embassy_rp::pio::{InterruptHandler, Pio};
20use embassy_time::{Duration, Timer}; 19use embassy_time::{Duration, Timer};
21use embedded_io_async::Write; 20use embedded_io_async::Write;
22use static_cell::make_static; 21use static_cell::StaticCell;
23use {defmt_rtt as _, panic_probe as _}; 22use {defmt_rtt as _, panic_probe as _};
24 23
25bind_interrupts!(struct Irqs { 24bind_interrupts!(struct Irqs {
@@ -62,7 +61,8 @@ async fn main(spawner: Spawner) {
62 let mut pio = Pio::new(p.PIO0, Irqs); 61 let mut pio = Pio::new(p.PIO0, Irqs);
63 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); 62 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0);
64 63
65 let state = make_static!(cyw43::State::new()); 64 static STATE: StaticCell<cyw43::State> = StaticCell::new();
65 let state = STATE.init(cyw43::State::new());
66 let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; 66 let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await;
67 unwrap!(spawner.spawn(wifi_task(runner))); 67 unwrap!(spawner.spawn(wifi_task(runner)));
68 68
@@ -82,11 +82,13 @@ async fn main(spawner: Spawner) {
82 let seed = 0x0123_4567_89ab_cdef; // chosen by fair dice roll. guarenteed to be random. 82 let seed = 0x0123_4567_89ab_cdef; // chosen by fair dice roll. guarenteed to be random.
83 83
84 // Init network stack 84 // Init network stack
85 let stack = &*make_static!(Stack::new( 85 static STACK: StaticCell<Stack<cyw43::NetDriver<'static>>> = StaticCell::new();
86 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
87 let stack = &*STACK.init(Stack::new(
86 net_device, 88 net_device,
87 config, 89 config,
88 make_static!(StackResources::<2>::new()), 90 RESOURCES.init(StackResources::<2>::new()),
89 seed 91 seed,
90 )); 92 ));
91 93
92 unwrap!(spawner.spawn(net_task(stack))); 94 unwrap!(spawner.spawn(net_task(stack)));
diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml
index ccc0a4afc..a4f306865 100644
--- a/examples/std/Cargo.toml
+++ b/examples/std/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["log"] } 8embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["log"] }
9embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] } 9embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "integrated-timers"] }
10embassy-time = { version = "0.2", path = "../../embassy-time", features = ["log", "std", ] } 10embassy-time = { version = "0.2", path = "../../embassy-time", features = ["log", "std", ] }
11embassy-net = { version = "0.2.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] } 11embassy-net = { version = "0.2.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] }
12embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" } 12embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" }
@@ -23,7 +23,7 @@ nix = "0.26.2"
23clap = { version = "3.0.0-beta.5", features = ["derive"] } 23clap = { version = "3.0.0-beta.5", features = ["derive"] }
24rand_core = { version = "0.6.3", features = ["std"] } 24rand_core = { version = "0.6.3", features = ["std"] }
25heapless = { version = "0.8", default-features = false } 25heapless = { version = "0.8", default-features = false }
26static_cell = { version = "2", features = ["nightly"]} 26static_cell = "2"
27 27
28[profile.release] 28[profile.release]
29debug = 2 29debug = 2
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs
index 8d8345057..dad93d0a1 100644
--- a/examples/std/src/bin/net.rs
+++ b/examples/std/src/bin/net.rs
@@ -1,5 +1,3 @@
1#![feature(type_alias_impl_trait)]
2
3use std::default::Default; 1use std::default::Default;
4 2
5use clap::Parser; 3use clap::Parser;
@@ -12,7 +10,7 @@ use embedded_io_async::Write;
12use heapless::Vec; 10use heapless::Vec;
13use log::*; 11use log::*;
14use rand_core::{OsRng, RngCore}; 12use rand_core::{OsRng, RngCore};
15use static_cell::{make_static, StaticCell}; 13use static_cell::StaticCell;
16 14
17#[derive(Parser)] 15#[derive(Parser)]
18#[clap(version = "1.0")] 16#[clap(version = "1.0")]
@@ -54,11 +52,13 @@ async fn main_task(spawner: Spawner) {
54 let seed = u64::from_le_bytes(seed); 52 let seed = u64::from_le_bytes(seed);
55 53
56 // Init network stack 54 // Init network stack
57 let stack = &*make_static!(Stack::new( 55 static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new();
56 static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
57 let stack = &*STACK.init(Stack::new(
58 device, 58 device,
59 config, 59 config,
60 make_static!(StackResources::<3>::new()), 60 RESOURCES.init(StackResources::<3>::new()),
61 seed 61 seed,
62 )); 62 ));
63 63
64 // Launch network task 64 // Launch network task
diff --git a/examples/std/src/bin/net_dns.rs b/examples/std/src/bin/net_dns.rs
index 6c19874d5..fca1e076e 100644
--- a/examples/std/src/bin/net_dns.rs
+++ b/examples/std/src/bin/net_dns.rs
@@ -1,5 +1,3 @@
1#![feature(type_alias_impl_trait)]
2
3use std::default::Default; 1use std::default::Default;
4 2
5use clap::Parser; 3use clap::Parser;
@@ -10,7 +8,7 @@ use embassy_net_tuntap::TunTapDevice;
10use heapless::Vec; 8use heapless::Vec;
11use log::*; 9use log::*;
12use rand_core::{OsRng, RngCore}; 10use rand_core::{OsRng, RngCore};
13use static_cell::{make_static, StaticCell}; 11use static_cell::StaticCell;
14 12
15#[derive(Parser)] 13#[derive(Parser)]
16#[clap(version = "1.0")] 14#[clap(version = "1.0")]
@@ -53,11 +51,13 @@ async fn main_task(spawner: Spawner) {
53 let seed = u64::from_le_bytes(seed); 51 let seed = u64::from_le_bytes(seed);
54 52
55 // Init network stack 53 // Init network stack
56 let stack: &Stack<_> = &*make_static!(Stack::new( 54 static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new();
55 static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
56 let stack: &Stack<_> = &*STACK.init(Stack::new(
57 device, 57 device,
58 config, 58 config,
59 make_static!(StackResources::<3>::new()), 59 RESOURCES.init(StackResources::<3>::new()),
60 seed 60 seed,
61 )); 61 ));
62 62
63 // Launch network task 63 // Launch network task
diff --git a/examples/std/src/bin/net_ppp.rs b/examples/std/src/bin/net_ppp.rs
index cee04e558..9ec0ea91f 100644
--- a/examples/std/src/bin/net_ppp.rs
+++ b/examples/std/src/bin/net_ppp.rs
@@ -7,7 +7,6 @@
7//! ping 192.168.7.10 7//! ping 192.168.7.10
8//! nc 192.168.7.10 1234 8//! nc 192.168.7.10 1234
9 9
10#![feature(type_alias_impl_trait)]
11#![allow(async_fn_in_trait)] 10#![allow(async_fn_in_trait)]
12 11
13#[path = "../serial_port.rs"] 12#[path = "../serial_port.rs"]
@@ -25,7 +24,7 @@ use heapless::Vec;
25use log::*; 24use log::*;
26use nix::sys::termios; 25use nix::sys::termios;
27use rand_core::{OsRng, RngCore}; 26use rand_core::{OsRng, RngCore};
28use static_cell::{make_static, StaticCell}; 27use static_cell::StaticCell;
29 28
30use crate::serial_port::SerialPort; 29use crate::serial_port::SerialPort;
31 30
@@ -88,7 +87,8 @@ async fn main_task(spawner: Spawner) {
88 let port = SerialPort::new(opts.device.as_str(), baudrate).unwrap(); 87 let port = SerialPort::new(opts.device.as_str(), baudrate).unwrap();
89 88
90 // Init network device 89 // Init network device
91 let state = make_static!(embassy_net_ppp::State::<4, 4>::new()); 90 static STATE: StaticCell<embassy_net_ppp::State<4, 4>> = StaticCell::new();
91 let state = STATE.init(embassy_net_ppp::State::<4, 4>::new());
92 let (device, runner) = embassy_net_ppp::new(state); 92 let (device, runner) = embassy_net_ppp::new(state);
93 93
94 // Generate random seed 94 // Generate random seed
@@ -97,11 +97,13 @@ async fn main_task(spawner: Spawner) {
97 let seed = u64::from_le_bytes(seed); 97 let seed = u64::from_le_bytes(seed);
98 98
99 // Init network stack 99 // Init network stack
100 let stack = &*make_static!(Stack::new( 100 static STACK: StaticCell<Stack<embassy_net_ppp::Device<'static>>> = StaticCell::new();
101 static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
102 let stack = &*STACK.init(Stack::new(
101 device, 103 device,
102 Config::default(), // don't configure IP yet 104 Config::default(), // don't configure IP yet
103 make_static!(StackResources::<3>::new()), 105 RESOURCES.init(StackResources::<3>::new()),
104 seed 106 seed,
105 )); 107 ));
106 108
107 // Launch network task 109 // Launch network task
diff --git a/examples/std/src/bin/net_udp.rs b/examples/std/src/bin/net_udp.rs
index 98dcc9925..bee91990d 100644
--- a/examples/std/src/bin/net_udp.rs
+++ b/examples/std/src/bin/net_udp.rs
@@ -1,5 +1,3 @@
1#![feature(type_alias_impl_trait)]
2
3use clap::Parser; 1use clap::Parser;
4use embassy_executor::{Executor, Spawner}; 2use embassy_executor::{Executor, Spawner};
5use embassy_net::udp::{PacketMetadata, UdpSocket}; 3use embassy_net::udp::{PacketMetadata, UdpSocket};
@@ -8,7 +6,7 @@ use embassy_net_tuntap::TunTapDevice;
8use heapless::Vec; 6use heapless::Vec;
9use log::*; 7use log::*;
10use rand_core::{OsRng, RngCore}; 8use rand_core::{OsRng, RngCore};
11use static_cell::{make_static, StaticCell}; 9use static_cell::StaticCell;
12 10
13#[derive(Parser)] 11#[derive(Parser)]
14#[clap(version = "1.0")] 12#[clap(version = "1.0")]
@@ -50,11 +48,13 @@ async fn main_task(spawner: Spawner) {
50 let seed = u64::from_le_bytes(seed); 48 let seed = u64::from_le_bytes(seed);
51 49
52 // Init network stack 50 // Init network stack
53 let stack = &*make_static!(Stack::new( 51 static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new();
52 static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
53 let stack = &*STACK.init(Stack::new(
54 device, 54 device,
55 config, 55 config,
56 make_static!(StackResources::<3>::new()), 56 RESOURCES.init(StackResources::<3>::new()),
57 seed 57 seed,
58 )); 58 ));
59 59
60 // Launch network task 60 // Launch network task
diff --git a/examples/std/src/bin/serial.rs b/examples/std/src/bin/serial.rs
index 0b289c74d..435089aad 100644
--- a/examples/std/src/bin/serial.rs
+++ b/examples/std/src/bin/serial.rs
@@ -1,5 +1,3 @@
1#![feature(type_alias_impl_trait)]
2
3#[path = "../serial_port.rs"] 1#[path = "../serial_port.rs"]
4mod serial_port; 2mod serial_port;
5 3
diff --git a/examples/std/src/bin/tcp_accept.rs b/examples/std/src/bin/tcp_accept.rs
index 79fa375cd..00ccd83a7 100644
--- a/examples/std/src/bin/tcp_accept.rs
+++ b/examples/std/src/bin/tcp_accept.rs
@@ -1,5 +1,3 @@
1#![feature(type_alias_impl_trait)]
2
3use core::fmt::Write as _; 1use core::fmt::Write as _;
4use std::default::Default; 2use std::default::Default;
5 3
@@ -13,7 +11,7 @@ use embedded_io_async::Write as _;
13use heapless::Vec; 11use heapless::Vec;
14use log::*; 12use log::*;
15use rand_core::{OsRng, RngCore}; 13use rand_core::{OsRng, RngCore};
16use static_cell::{make_static, StaticCell}; 14use static_cell::StaticCell;
17 15
18#[derive(Parser)] 16#[derive(Parser)]
19#[clap(version = "1.0")] 17#[clap(version = "1.0")]
@@ -65,11 +63,13 @@ async fn main_task(spawner: Spawner) {
65 let seed = u64::from_le_bytes(seed); 63 let seed = u64::from_le_bytes(seed);
66 64
67 // Init network stack 65 // Init network stack
68 let stack = &*make_static!(Stack::new( 66 static STACK: StaticCell<Stack<TunTapDevice>> = StaticCell::new();
67 static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
68 let stack = &*STACK.init(Stack::new(
69 device, 69 device,
70 config, 70 config,
71 make_static!(StackResources::<3>::new()), 71 RESOURCES.init(StackResources::<3>::new()),
72 seed 72 seed,
73 )); 73 ));
74 74
75 // Launch network task 75 // Launch network task
diff --git a/examples/std/src/bin/tick.rs b/examples/std/src/bin/tick.rs
index a3f99067e..f23cf3549 100644
--- a/examples/std/src/bin/tick.rs
+++ b/examples/std/src/bin/tick.rs
@@ -1,5 +1,3 @@
1#![feature(type_alias_impl_trait)]
2
3use embassy_executor::Spawner; 1use embassy_executor::Spawner;
4use embassy_time::Timer; 2use embassy_time::Timer;
5use log::*; 3use log::*;
diff --git a/examples/stm32c0/Cargo.toml b/examples/stm32c0/Cargo.toml
index 2d831ba5d..0fd3939c6 100644
--- a/examples/stm32c0/Cargo.toml
+++ b/examples/stm32c0/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32c031c6 to your chip name, if necessary. 8# Change stm32c031c6 to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13 13
14defmt = "0.3" 14defmt = "0.3"
diff --git a/examples/stm32c0/src/bin/blinky.rs b/examples/stm32c0/src/bin/blinky.rs
index cbeb0dee1..90e479aae 100644
--- a/examples/stm32c0/src/bin/blinky.rs
+++ b/examples/stm32c0/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32c0/src/bin/button.rs b/examples/stm32c0/src/bin/button.rs
index 72a3f5cbf..265200132 100644
--- a/examples/stm32c0/src/bin/button.rs
+++ b/examples/stm32c0/src/bin/button.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
@@ -13,7 +12,7 @@ fn main() -> ! {
13 12
14 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
15 14
16 let button = Input::new(p.PC13, Pull::Up); 15 let mut button = Input::new(p.PC13, Pull::Up);
17 16
18 loop { 17 loop {
19 if button.is_high() { 18 if button.is_high() {
diff --git a/examples/stm32c0/src/bin/button_exti.rs b/examples/stm32c0/src/bin/button_exti.rs
index ef32d4c4a..1e970fdd6 100644
--- a/examples/stm32c0/src/bin/button_exti.rs
+++ b/examples/stm32c0/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f0/Cargo.toml b/examples/stm32f0/Cargo.toml
index 2b066d731..9fdc4798a 100644
--- a/examples/stm32f0/Cargo.toml
+++ b/examples/stm32f0/Cargo.toml
@@ -15,9 +15,9 @@ defmt = "0.3"
15defmt-rtt = "0.4" 15defmt-rtt = "0.4"
16panic-probe = "0.3" 16panic-probe = "0.3"
17embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 17embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
18embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } 18embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
19embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 19embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
20static_cell = { version = "2", features = ["nightly"]} 20static_cell = "2"
21portable-atomic = { version = "1.5", features = ["unsafe-assume-single-core"] } 21portable-atomic = { version = "1.5", features = ["unsafe-assume-single-core"] }
22 22
23[profile.release] 23[profile.release]
diff --git a/examples/stm32f0/src/bin/adc.rs b/examples/stm32f0/src/bin/adc.rs
index 96f234402..8fef062b3 100644
--- a/examples/stm32f0/src/bin/adc.rs
+++ b/examples/stm32f0/src/bin/adc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f0/src/bin/blinky.rs b/examples/stm32f0/src/bin/blinky.rs
index 899394546..2572be1bc 100644
--- a/examples/stm32f0/src/bin/blinky.rs
+++ b/examples/stm32f0/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f0/src/bin/button_controlled_blink.rs b/examples/stm32f0/src/bin/button_controlled_blink.rs
index 306df1752..360d153c3 100644
--- a/examples/stm32f0/src/bin/button_controlled_blink.rs
+++ b/examples/stm32f0/src/bin/button_controlled_blink.rs
@@ -2,7 +2,6 @@
2 2
3#![no_std] 3#![no_std]
4#![no_main] 4#![no_main]
5#![feature(type_alias_impl_trait)]
6 5
7use core::sync::atomic::{AtomicU32, Ordering}; 6use core::sync::atomic::{AtomicU32, Ordering};
8 7
diff --git a/examples/stm32f0/src/bin/button_exti.rs b/examples/stm32f0/src/bin/button_exti.rs
index 40c0d5848..ce17c1a48 100644
--- a/examples/stm32f0/src/bin/button_exti.rs
+++ b/examples/stm32f0/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f0/src/bin/hello.rs b/examples/stm32f0/src/bin/hello.rs
index 0f98d9865..ccd6a0a39 100644
--- a/examples/stm32f0/src/bin/hello.rs
+++ b/examples/stm32f0/src/bin/hello.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f0/src/bin/multiprio.rs b/examples/stm32f0/src/bin/multiprio.rs
index 870c7c45b..e49951726 100644
--- a/examples/stm32f0/src/bin/multiprio.rs
+++ b/examples/stm32f0/src/bin/multiprio.rs
@@ -55,7 +55,6 @@
55 55
56#![no_std] 56#![no_std]
57#![no_main] 57#![no_main]
58#![feature(type_alias_impl_trait)]
59 58
60use cortex_m_rt::entry; 59use cortex_m_rt::entry;
61use defmt::*; 60use defmt::*;
diff --git a/examples/stm32f0/src/bin/wdg.rs b/examples/stm32f0/src/bin/wdg.rs
index b51dee8ee..b974bff91 100644
--- a/examples/stm32f0/src/bin/wdg.rs
+++ b/examples/stm32f0/src/bin/wdg.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml
index f04d41317..c933a4368 100644
--- a/examples/stm32f1/Cargo.toml
+++ b/examples/stm32f1/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32f103c8 to your chip name, if necessary. 8# Change stm32f103c8 to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any" ] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any" ] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
14embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } 14embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
diff --git a/examples/stm32f1/src/bin/adc.rs b/examples/stm32f1/src/bin/adc.rs
index 1edac3d83..1440460a9 100644
--- a/examples/stm32f1/src/bin/adc.rs
+++ b/examples/stm32f1/src/bin/adc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f1/src/bin/blinky.rs b/examples/stm32f1/src/bin/blinky.rs
index 3425b0536..cc43f85f4 100644
--- a/examples/stm32f1/src/bin/blinky.rs
+++ b/examples/stm32f1/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f1/src/bin/can.rs b/examples/stm32f1/src/bin/can.rs
new file mode 100644
index 000000000..c1c4f8359
--- /dev/null
+++ b/examples/stm32f1/src/bin/can.rs
@@ -0,0 +1,66 @@
1#![no_std]
2#![no_main]
3
4use defmt::*;
5use embassy_executor::Spawner;
6use embassy_stm32::can::bxcan::filter::Mask32;
7use embassy_stm32::can::bxcan::{Fifo, Frame, Id, StandardId};
8use embassy_stm32::can::{Can, Rx0InterruptHandler, Rx1InterruptHandler, SceInterruptHandler, TxInterruptHandler};
9use embassy_stm32::peripherals::CAN;
10use embassy_stm32::{bind_interrupts, Config};
11use {defmt_rtt as _, panic_probe as _};
12
13bind_interrupts!(struct Irqs {
14 USB_LP_CAN1_RX0 => Rx0InterruptHandler<CAN>;
15 CAN1_RX1 => Rx1InterruptHandler<CAN>;
16 CAN1_SCE => SceInterruptHandler<CAN>;
17 USB_HP_CAN1_TX => TxInterruptHandler<CAN>;
18});
19
20// This example is configured to work with real CAN transceivers on B8/B9.
21// See other examples for loopback.
22
23#[embassy_executor::main]
24async fn main(_spawner: Spawner) {
25 let p = embassy_stm32::init(Config::default());
26
27 // Set alternate pin mapping to B8/B9
28 embassy_stm32::pac::AFIO.mapr().modify(|w| w.set_can1_remap(2));
29
30 let mut can = Can::new(p.CAN, p.PB8, p.PB9, Irqs);
31
32 can.as_mut()
33 .modify_filters()
34 .enable_bank(0, Fifo::Fifo0, Mask32::accept_all());
35
36 can.as_mut()
37 .modify_config()
38 .set_loopback(false)
39 .set_silent(false)
40 .leave_disabled();
41
42 can.set_bitrate(250_000);
43
44 can.enable().await;
45
46 let mut i: u8 = 0;
47 loop {
48 let tx_frame = Frame::new_data(unwrap!(StandardId::new(i as _)), [i]);
49 can.write(&tx_frame).await;
50
51 match can.read().await {
52 Ok(env) => match env.frame.id() {
53 Id::Extended(id) => {
54 defmt::println!("Extended Frame id={:x}", id.as_raw());
55 }
56 Id::Standard(id) => {
57 defmt::println!("Standard Frame id={:x}", id.as_raw());
58 }
59 },
60 Err(err) => {
61 defmt::println!("Error {}", err);
62 }
63 }
64 i += 1;
65 }
66}
diff --git a/examples/stm32f1/src/bin/hello.rs b/examples/stm32f1/src/bin/hello.rs
index e63bcaae0..7b761ecc1 100644
--- a/examples/stm32f1/src/bin/hello.rs
+++ b/examples/stm32f1/src/bin/hello.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f1/src/bin/usb_serial.rs b/examples/stm32f1/src/bin/usb_serial.rs
index 31519555f..e28381893 100644
--- a/examples/stm32f1/src/bin/usb_serial.rs
+++ b/examples/stm32f1/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{panic, *}; 4use defmt::{panic, *};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f2/Cargo.toml b/examples/stm32f2/Cargo.toml
index 66cc1e15b..eaaadeec5 100644
--- a/examples/stm32f2/Cargo.toml
+++ b/examples/stm32f2/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32f207zg to your chip name, if necessary. 8# Change stm32f207zg to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13 13
14defmt = "0.3" 14defmt = "0.3"
diff --git a/examples/stm32f2/src/bin/blinky.rs b/examples/stm32f2/src/bin/blinky.rs
index f6d7a0005..d9833ba8b 100644
--- a/examples/stm32f2/src/bin/blinky.rs
+++ b/examples/stm32f2/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f2/src/bin/pll.rs b/examples/stm32f2/src/bin/pll.rs
index aae7637dc..e32f283d1 100644
--- a/examples/stm32f2/src/bin/pll.rs
+++ b/examples/stm32f2/src/bin/pll.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::convert::TryFrom; 4use core::convert::TryFrom;
6 5
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml
index ed1367858..d5ab0b25a 100644
--- a/examples/stm32f3/Cargo.toml
+++ b/examples/stm32f3/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32f303ze to your chip name, if necessary. 8# Change stm32f303ze to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
14embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } 14embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
@@ -24,7 +24,7 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa
24heapless = { version = "0.8", default-features = false } 24heapless = { version = "0.8", default-features = false }
25nb = "1.0.0" 25nb = "1.0.0"
26embedded-storage = "0.3.1" 26embedded-storage = "0.3.1"
27static_cell = { version = "2", features = ["nightly"]} 27static_cell = "2"
28 28
29[profile.release] 29[profile.release]
30debug = 2 30debug = 2
diff --git a/examples/stm32f3/src/bin/blinky.rs b/examples/stm32f3/src/bin/blinky.rs
index e71031b30..0ea10522d 100644
--- a/examples/stm32f3/src/bin/blinky.rs
+++ b/examples/stm32f3/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f3/src/bin/button.rs b/examples/stm32f3/src/bin/button.rs
index b55bf3901..2cd356787 100644
--- a/examples/stm32f3/src/bin/button.rs
+++ b/examples/stm32f3/src/bin/button.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
@@ -13,7 +12,7 @@ fn main() -> ! {
13 12
14 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
15 14
16 let button = Input::new(p.PA0, Pull::Down); 15 let mut button = Input::new(p.PA0, Pull::Down);
17 let mut led1 = Output::new(p.PE9, Level::High, Speed::Low); 16 let mut led1 = Output::new(p.PE9, Level::High, Speed::Low);
18 let mut led2 = Output::new(p.PE15, Level::High, Speed::Low); 17 let mut led2 = Output::new(p.PE15, Level::High, Speed::Low);
19 18
diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs
index 9df6d680d..2f7da4ef5 100644
--- a/examples/stm32f3/src/bin/button_events.rs
+++ b/examples/stm32f3/src/bin/button_events.rs
@@ -8,7 +8,6 @@
8 8
9#![no_std] 9#![no_std]
10#![no_main] 10#![no_main]
11#![feature(type_alias_impl_trait)]
12 11
13use defmt::*; 12use defmt::*;
14use embassy_executor::Spawner; 13use embassy_executor::Spawner;
diff --git a/examples/stm32f3/src/bin/button_exti.rs b/examples/stm32f3/src/bin/button_exti.rs
index 1266778c1..86ff68492 100644
--- a/examples/stm32f3/src/bin/button_exti.rs
+++ b/examples/stm32f3/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f3/src/bin/flash.rs b/examples/stm32f3/src/bin/flash.rs
index 236fb36c1..28125697d 100644
--- a/examples/stm32f3/src/bin/flash.rs
+++ b/examples/stm32f3/src/bin/flash.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f3/src/bin/hello.rs b/examples/stm32f3/src/bin/hello.rs
index b3285f3c1..fd54da53d 100644
--- a/examples/stm32f3/src/bin/hello.rs
+++ b/examples/stm32f3/src/bin/hello.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f3/src/bin/multiprio.rs b/examples/stm32f3/src/bin/multiprio.rs
index 74f3bb1c5..328447210 100644
--- a/examples/stm32f3/src/bin/multiprio.rs
+++ b/examples/stm32f3/src/bin/multiprio.rs
@@ -55,7 +55,6 @@
55 55
56#![no_std] 56#![no_std]
57#![no_main] 57#![no_main]
58#![feature(type_alias_impl_trait)]
59 58
60use cortex_m_rt::entry; 59use cortex_m_rt::entry;
61use defmt::*; 60use defmt::*;
diff --git a/examples/stm32f3/src/bin/spi_dma.rs b/examples/stm32f3/src/bin/spi_dma.rs
index a27c1d547..54498d53d 100644
--- a/examples/stm32f3/src/bin/spi_dma.rs
+++ b/examples/stm32f3/src/bin/spi_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6use core::str::from_utf8; 5use core::str::from_utf8;
diff --git a/examples/stm32f3/src/bin/usart_dma.rs b/examples/stm32f3/src/bin/usart_dma.rs
index ce8c212ae..5234e53b9 100644
--- a/examples/stm32f3/src/bin/usart_dma.rs
+++ b/examples/stm32f3/src/bin/usart_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6 5
diff --git a/examples/stm32f3/src/bin/usb_serial.rs b/examples/stm32f3/src/bin/usb_serial.rs
index d5d068d62..cf9ecedfa 100644
--- a/examples/stm32f3/src/bin/usb_serial.rs
+++ b/examples/stm32f3/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{panic, *}; 4use defmt::{panic, *};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f334/Cargo.toml b/examples/stm32f334/Cargo.toml
index 320cf7d7b..b29a08e7c 100644
--- a/examples/stm32f334/Cargo.toml
+++ b/examples/stm32f334/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 8embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
9embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } 9embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
10embassy-time = { version = "0.2.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 10embassy-time = { version = "0.2.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f334r8", "unstable-pac", "memory-x", "time-driver-any", "exti"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f334r8", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
12embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 12embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
@@ -23,4 +23,4 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa
23heapless = { version = "0.8", default-features = false } 23heapless = { version = "0.8", default-features = false }
24nb = "1.0.0" 24nb = "1.0.0"
25embedded-storage = "0.3.1" 25embedded-storage = "0.3.1"
26static_cell = { version = "2", features = ["nightly"]} 26static_cell = "2"
diff --git a/examples/stm32f334/src/bin/adc.rs b/examples/stm32f334/src/bin/adc.rs
index f259135d2..063ee9dac 100644
--- a/examples/stm32f334/src/bin/adc.rs
+++ b/examples/stm32f334/src/bin/adc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f334/src/bin/button.rs b/examples/stm32f334/src/bin/button.rs
index 501fb080c..256f9a44a 100644
--- a/examples/stm32f334/src/bin/button.rs
+++ b/examples/stm32f334/src/bin/button.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f334/src/bin/hello.rs b/examples/stm32f334/src/bin/hello.rs
index b3285f3c1..fd54da53d 100644
--- a/examples/stm32f334/src/bin/hello.rs
+++ b/examples/stm32f334/src/bin/hello.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f334/src/bin/opamp.rs b/examples/stm32f334/src/bin/opamp.rs
index 10e7b3543..850a0e335 100644
--- a/examples/stm32f334/src/bin/opamp.rs
+++ b/examples/stm32f334/src/bin/opamp.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f334/src/bin/pwm.rs b/examples/stm32f334/src/bin/pwm.rs
index 8040c3f18..c149cad92 100644
--- a/examples/stm32f334/src/bin/pwm.rs
+++ b/examples/stm32f334/src/bin/pwm.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml
index 6ea0018cd..a74e0f674 100644
--- a/examples/stm32f4/Cargo.toml
+++ b/examples/stm32f4/Cargo.toml
@@ -6,9 +6,9 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8# Change stm32f429zi to your chip name, if necessary. 8# Change stm32f429zi to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "chrono"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt" ] } 13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt" ] }
14embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", ] } 14embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", ] }
@@ -27,7 +27,7 @@ heapless = { version = "0.8", default-features = false }
27nb = "1.0.0" 27nb = "1.0.0"
28embedded-storage = "0.3.1" 28embedded-storage = "0.3.1"
29micromath = "2.0.0" 29micromath = "2.0.0"
30static_cell = { version = "2", features = ["nightly"]} 30static_cell = "2"
31chrono = { version = "^0.4", default-features = false} 31chrono = { version = "^0.4", default-features = false}
32 32
33[profile.release] 33[profile.release]
diff --git a/examples/stm32f4/src/bin/adc.rs b/examples/stm32f4/src/bin/adc.rs
index f19328727..699c29c05 100644
--- a/examples/stm32f4/src/bin/adc.rs
+++ b/examples/stm32f4/src/bin/adc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m::prelude::_embedded_hal_blocking_delay_DelayUs; 4use cortex_m::prelude::_embedded_hal_blocking_delay_DelayUs;
6use defmt::*; 5use defmt::*;
diff --git a/examples/stm32f4/src/bin/blinky.rs b/examples/stm32f4/src/bin/blinky.rs
index 4bfc5a50d..31cce8225 100644
--- a/examples/stm32f4/src/bin/blinky.rs
+++ b/examples/stm32f4/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/button.rs b/examples/stm32f4/src/bin/button.rs
index b13e64531..ad30a56a2 100644
--- a/examples/stm32f4/src/bin/button.rs
+++ b/examples/stm32f4/src/bin/button.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
@@ -13,7 +12,7 @@ fn main() -> ! {
13 12
14 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
15 14
16 let button = Input::new(p.PC13, Pull::Down); 15 let mut button = Input::new(p.PC13, Pull::Down);
17 let mut led1 = Output::new(p.PB0, Level::High, Speed::Low); 16 let mut led1 = Output::new(p.PB0, Level::High, Speed::Low);
18 let _led2 = Output::new(p.PB7, Level::High, Speed::Low); 17 let _led2 = Output::new(p.PB7, Level::High, Speed::Low);
19 let mut led3 = Output::new(p.PB14, Level::High, Speed::Low); 18 let mut led3 = Output::new(p.PB14, Level::High, Speed::Low);
diff --git a/examples/stm32f4/src/bin/button_exti.rs b/examples/stm32f4/src/bin/button_exti.rs
index dfe587d41..67751187d 100644
--- a/examples/stm32f4/src/bin/button_exti.rs
+++ b/examples/stm32f4/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/can.rs b/examples/stm32f4/src/bin/can.rs
index 20ce4edce..d074b4265 100644
--- a/examples/stm32f4/src/bin/can.rs
+++ b/examples/stm32f4/src/bin/can.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/dac.rs b/examples/stm32f4/src/bin/dac.rs
index 8f14d6078..9c7754c4f 100644
--- a/examples/stm32f4/src/bin/dac.rs
+++ b/examples/stm32f4/src/bin/dac.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/eth.rs b/examples/stm32f4/src/bin/eth.rs
index 088d83c06..7f5c8fdb1 100644
--- a/examples/stm32f4/src/bin/eth.rs
+++ b/examples/stm32f4/src/bin/eth.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -14,7 +13,7 @@ use embassy_stm32::time::Hertz;
14use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config}; 13use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config};
15use embassy_time::Timer; 14use embassy_time::Timer;
16use embedded_io_async::Write; 15use embedded_io_async::Write;
17use static_cell::make_static; 16use static_cell::StaticCell;
18use {defmt_rtt as _, panic_probe as _}; 17use {defmt_rtt as _, panic_probe as _};
19 18
20bind_interrupts!(struct Irqs { 19bind_interrupts!(struct Irqs {
@@ -63,8 +62,9 @@ async fn main(spawner: Spawner) -> ! {
63 62
64 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; 63 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
65 64
65 static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new();
66 let device = Ethernet::new( 66 let device = Ethernet::new(
67 make_static!(PacketQueue::<16, 16>::new()), 67 PACKETS.init(PacketQueue::<16, 16>::new()),
68 p.ETH, 68 p.ETH,
69 Irqs, 69 Irqs,
70 p.PA1, 70 p.PA1,
@@ -88,11 +88,13 @@ async fn main(spawner: Spawner) -> ! {
88 //}); 88 //});
89 89
90 // Init network stack 90 // Init network stack
91 let stack = &*make_static!(Stack::new( 91 static STACK: StaticCell<Stack<Device>> = StaticCell::new();
92 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
93 let stack = &*STACK.init(Stack::new(
92 device, 94 device,
93 config, 95 config,
94 make_static!(StackResources::<2>::new()), 96 RESOURCES.init(StackResources::<2>::new()),
95 seed 97 seed,
96 )); 98 ));
97 99
98 // Launch network task 100 // Launch network task
diff --git a/examples/stm32f4/src/bin/flash.rs b/examples/stm32f4/src/bin/flash.rs
index 93c54e943..1e8cabab4 100644
--- a/examples/stm32f4/src/bin/flash.rs
+++ b/examples/stm32f4/src/bin/flash.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -31,7 +30,7 @@ fn test_flash(f: &mut Flash<'_, Blocking>, offset: u32, size: u32) {
31 30
32 info!("Reading..."); 31 info!("Reading...");
33 let mut buf = [0u8; 32]; 32 let mut buf = [0u8; 32];
34 unwrap!(f.read(offset, &mut buf)); 33 unwrap!(f.blocking_read(offset, &mut buf));
35 info!("Read: {=[u8]:x}", buf); 34 info!("Read: {=[u8]:x}", buf);
36 35
37 info!("Erasing..."); 36 info!("Erasing...");
@@ -39,7 +38,7 @@ fn test_flash(f: &mut Flash<'_, Blocking>, offset: u32, size: u32) {
39 38
40 info!("Reading..."); 39 info!("Reading...");
41 let mut buf = [0u8; 32]; 40 let mut buf = [0u8; 32];
42 unwrap!(f.read(offset, &mut buf)); 41 unwrap!(f.blocking_read(offset, &mut buf));
43 info!("Read after erase: {=[u8]:x}", buf); 42 info!("Read after erase: {=[u8]:x}", buf);
44 43
45 info!("Writing..."); 44 info!("Writing...");
@@ -53,7 +52,7 @@ fn test_flash(f: &mut Flash<'_, Blocking>, offset: u32, size: u32) {
53 52
54 info!("Reading..."); 53 info!("Reading...");
55 let mut buf = [0u8; 32]; 54 let mut buf = [0u8; 32];
56 unwrap!(f.read(offset, &mut buf)); 55 unwrap!(f.blocking_read(offset, &mut buf));
57 info!("Read: {=[u8]:x}", buf); 56 info!("Read: {=[u8]:x}", buf);
58 assert_eq!( 57 assert_eq!(
59 &buf[..], 58 &buf[..],
diff --git a/examples/stm32f4/src/bin/flash_async.rs b/examples/stm32f4/src/bin/flash_async.rs
index f0a65a725..493a536f3 100644
--- a/examples/stm32f4/src/bin/flash_async.rs
+++ b/examples/stm32f4/src/bin/flash_async.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -48,7 +47,7 @@ async fn test_flash<'a>(f: &mut Flash<'a>, offset: u32, size: u32) {
48 47
49 info!("Reading..."); 48 info!("Reading...");
50 let mut buf = [0u8; 32]; 49 let mut buf = [0u8; 32];
51 unwrap!(f.read(offset, &mut buf)); 50 unwrap!(f.blocking_read(offset, &mut buf));
52 info!("Read: {=[u8]:x}", buf); 51 info!("Read: {=[u8]:x}", buf);
53 52
54 info!("Erasing..."); 53 info!("Erasing...");
@@ -56,7 +55,7 @@ async fn test_flash<'a>(f: &mut Flash<'a>, offset: u32, size: u32) {
56 55
57 info!("Reading..."); 56 info!("Reading...");
58 let mut buf = [0u8; 32]; 57 let mut buf = [0u8; 32];
59 unwrap!(f.read(offset, &mut buf)); 58 unwrap!(f.blocking_read(offset, &mut buf));
60 info!("Read after erase: {=[u8]:x}", buf); 59 info!("Read after erase: {=[u8]:x}", buf);
61 60
62 info!("Writing..."); 61 info!("Writing...");
@@ -73,7 +72,7 @@ async fn test_flash<'a>(f: &mut Flash<'a>, offset: u32, size: u32) {
73 72
74 info!("Reading..."); 73 info!("Reading...");
75 let mut buf = [0u8; 32]; 74 let mut buf = [0u8; 32];
76 unwrap!(f.read(offset, &mut buf)); 75 unwrap!(f.blocking_read(offset, &mut buf));
77 info!("Read: {=[u8]:x}", buf); 76 info!("Read: {=[u8]:x}", buf);
78 assert_eq!( 77 assert_eq!(
79 &buf[..], 78 &buf[..],
diff --git a/examples/stm32f4/src/bin/hello.rs b/examples/stm32f4/src/bin/hello.rs
index a2a287110..3c295612c 100644
--- a/examples/stm32f4/src/bin/hello.rs
+++ b/examples/stm32f4/src/bin/hello.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/i2c.rs b/examples/stm32f4/src/bin/i2c.rs
index 4f4adde28..4b5da774d 100644
--- a/examples/stm32f4/src/bin/i2c.rs
+++ b/examples/stm32f4/src/bin/i2c.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/i2c_async.rs b/examples/stm32f4/src/bin/i2c_async.rs
index 9f59e4d41..90d11d4b4 100644
--- a/examples/stm32f4/src/bin/i2c_async.rs
+++ b/examples/stm32f4/src/bin/i2c_async.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5// Example originally designed for stm32f411ceu6 reading an A1454 hall effect sensor on I2C1 4// Example originally designed for stm32f411ceu6 reading an A1454 hall effect sensor on I2C1
6// DMA peripherals changed to compile for stm32f429zi, for the CI. 5// DMA peripherals changed to compile for stm32f429zi, for the CI.
diff --git a/examples/stm32f4/src/bin/i2c_comparison.rs b/examples/stm32f4/src/bin/i2c_comparison.rs
index 6d23c0ed8..30cfbdf57 100644
--- a/examples/stm32f4/src/bin/i2c_comparison.rs
+++ b/examples/stm32f4/src/bin/i2c_comparison.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5// Example originally designed for stm32f411ceu6 with three A1454 hall effect sensors, connected to I2C1, 2 and 3 4// Example originally designed for stm32f411ceu6 with three A1454 hall effect sensors, connected to I2C1, 2 and 3
6// on the pins referenced in the peripheral definitions. 5// on the pins referenced in the peripheral definitions.
diff --git a/examples/stm32f4/src/bin/i2s_dma.rs b/examples/stm32f4/src/bin/i2s_dma.rs
index e8d7b5f77..97a04b2aa 100644
--- a/examples/stm32f4/src/bin/i2s_dma.rs
+++ b/examples/stm32f4/src/bin/i2s_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6 5
diff --git a/examples/stm32f4/src/bin/mco.rs b/examples/stm32f4/src/bin/mco.rs
index 3315e7652..eb7bb6261 100644
--- a/examples/stm32f4/src/bin/mco.rs
+++ b/examples/stm32f4/src/bin/mco.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/multiprio.rs b/examples/stm32f4/src/bin/multiprio.rs
index 74f3bb1c5..328447210 100644
--- a/examples/stm32f4/src/bin/multiprio.rs
+++ b/examples/stm32f4/src/bin/multiprio.rs
@@ -55,7 +55,6 @@
55 55
56#![no_std] 56#![no_std]
57#![no_main] 57#![no_main]
58#![feature(type_alias_impl_trait)]
59 58
60use cortex_m_rt::entry; 59use cortex_m_rt::entry;
61use defmt::*; 60use defmt::*;
diff --git a/examples/stm32f4/src/bin/pwm.rs b/examples/stm32f4/src/bin/pwm.rs
index 8e41d0e78..8844a9f0e 100644
--- a/examples/stm32f4/src/bin/pwm.rs
+++ b/examples/stm32f4/src/bin/pwm.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/pwm_complementary.rs b/examples/stm32f4/src/bin/pwm_complementary.rs
index d925f26d9..161f43c48 100644
--- a/examples/stm32f4/src/bin/pwm_complementary.rs
+++ b/examples/stm32f4/src/bin/pwm_complementary.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/rtc.rs b/examples/stm32f4/src/bin/rtc.rs
index 44b4303c0..abab07b6b 100644
--- a/examples/stm32f4/src/bin/rtc.rs
+++ b/examples/stm32f4/src/bin/rtc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use chrono::{NaiveDate, NaiveDateTime}; 4use chrono::{NaiveDate, NaiveDateTime};
6use defmt::*; 5use defmt::*;
diff --git a/examples/stm32f4/src/bin/sdmmc.rs b/examples/stm32f4/src/bin/sdmmc.rs
index 91747b2d5..66e4e527c 100644
--- a/examples/stm32f4/src/bin/sdmmc.rs
+++ b/examples/stm32f4/src/bin/sdmmc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/spi.rs b/examples/stm32f4/src/bin/spi.rs
index 0919e9874..dc9141c62 100644
--- a/examples/stm32f4/src/bin/spi.rs
+++ b/examples/stm32f4/src/bin/spi.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
diff --git a/examples/stm32f4/src/bin/spi_dma.rs b/examples/stm32f4/src/bin/spi_dma.rs
index f291f7dba..7249c831a 100644
--- a/examples/stm32f4/src/bin/spi_dma.rs
+++ b/examples/stm32f4/src/bin/spi_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6use core::str::from_utf8; 5use core::str::from_utf8;
diff --git a/examples/stm32f4/src/bin/usart.rs b/examples/stm32f4/src/bin/usart.rs
index 45e94715f..40d9d70f1 100644
--- a/examples/stm32f4/src/bin/usart.rs
+++ b/examples/stm32f4/src/bin/usart.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
diff --git a/examples/stm32f4/src/bin/usart_buffered.rs b/examples/stm32f4/src/bin/usart_buffered.rs
index 71abc2893..c99807f11 100644
--- a/examples/stm32f4/src/bin/usart_buffered.rs
+++ b/examples/stm32f4/src/bin/usart_buffered.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/usart_dma.rs b/examples/stm32f4/src/bin/usart_dma.rs
index dca25a78c..dd6de599c 100644
--- a/examples/stm32f4/src/bin/usart_dma.rs
+++ b/examples/stm32f4/src/bin/usart_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6 5
diff --git a/examples/stm32f4/src/bin/usb_ethernet.rs b/examples/stm32f4/src/bin/usb_ethernet.rs
index 6bf5b1cba..a196259a8 100644
--- a/examples/stm32f4/src/bin/usb_ethernet.rs
+++ b/examples/stm32f4/src/bin/usb_ethernet.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -14,7 +13,7 @@ use embassy_usb::class::cdc_ncm::embassy_net::{Device, Runner, State as NetState
14use embassy_usb::class::cdc_ncm::{CdcNcmClass, State}; 13use embassy_usb::class::cdc_ncm::{CdcNcmClass, State};
15use embassy_usb::{Builder, UsbDevice}; 14use embassy_usb::{Builder, UsbDevice};
16use embedded_io_async::Write; 15use embedded_io_async::Write;
17use static_cell::make_static; 16use static_cell::StaticCell;
18use {defmt_rtt as _, panic_probe as _}; 17use {defmt_rtt as _, panic_probe as _};
19 18
20type UsbDriver = Driver<'static, embassy_stm32::peripherals::USB_OTG_FS>; 19type UsbDriver = Driver<'static, embassy_stm32::peripherals::USB_OTG_FS>;
@@ -68,7 +67,8 @@ async fn main(spawner: Spawner) {
68 let p = embassy_stm32::init(config); 67 let p = embassy_stm32::init(config);
69 68
70 // Create the driver, from the HAL. 69 // Create the driver, from the HAL.
71 let ep_out_buffer = &mut make_static!([0; 256])[..]; 70 static OUTPUT_BUFFER: StaticCell<[u8; 256]> = StaticCell::new();
71 let ep_out_buffer = &mut OUTPUT_BUFFER.init([0; 256])[..];
72 let mut config = embassy_stm32::usb_otg::Config::default(); 72 let mut config = embassy_stm32::usb_otg::Config::default();
73 config.vbus_detection = true; 73 config.vbus_detection = true;
74 let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, ep_out_buffer, config); 74 let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, ep_out_buffer, config);
@@ -88,14 +88,18 @@ async fn main(spawner: Spawner) {
88 config.device_protocol = 0x01; 88 config.device_protocol = 0x01;
89 89
90 // Create embassy-usb DeviceBuilder using the driver and config. 90 // Create embassy-usb DeviceBuilder using the driver and config.
91 static DEVICE_DESC: StaticCell<[u8; 256]> = StaticCell::new();
92 static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
93 static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
94 static CONTROL_BUF: StaticCell<[u8; 128]> = StaticCell::new();
91 let mut builder = Builder::new( 95 let mut builder = Builder::new(
92 driver, 96 driver,
93 config, 97 config,
94 &mut make_static!([0; 256])[..], 98 &mut DEVICE_DESC.init([0; 256])[..],
95 &mut make_static!([0; 256])[..], 99 &mut CONFIG_DESC.init([0; 256])[..],
96 &mut make_static!([0; 256])[..], 100 &mut BOS_DESC.init([0; 256])[..],
97 &mut [], // no msos descriptors 101 &mut [], // no msos descriptors
98 &mut make_static!([0; 128])[..], 102 &mut CONTROL_BUF.init([0; 128])[..],
99 ); 103 );
100 104
101 // Our MAC addr. 105 // Our MAC addr.
@@ -104,14 +108,16 @@ async fn main(spawner: Spawner) {
104 let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; 108 let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88];
105 109
106 // Create classes on the builder. 110 // Create classes on the builder.
107 let class = CdcNcmClass::new(&mut builder, make_static!(State::new()), host_mac_addr, 64); 111 static STATE: StaticCell<State> = StaticCell::new();
112 let class = CdcNcmClass::new(&mut builder, STATE.init(State::new()), host_mac_addr, 64);
108 113
109 // Build the builder. 114 // Build the builder.
110 let usb = builder.build(); 115 let usb = builder.build();
111 116
112 unwrap!(spawner.spawn(usb_task(usb))); 117 unwrap!(spawner.spawn(usb_task(usb)));
113 118
114 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); 119 static NET_STATE: StaticCell<NetState<MTU, 4, 4>> = StaticCell::new();
120 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(NET_STATE.init(NetState::new()), our_mac_addr);
115 unwrap!(spawner.spawn(usb_ncm_task(runner))); 121 unwrap!(spawner.spawn(usb_ncm_task(runner)));
116 122
117 let config = embassy_net::Config::dhcpv4(Default::default()); 123 let config = embassy_net::Config::dhcpv4(Default::default());
@@ -128,11 +134,13 @@ async fn main(spawner: Spawner) {
128 let seed = u64::from_le_bytes(seed); 134 let seed = u64::from_le_bytes(seed);
129 135
130 // Init network stack 136 // Init network stack
131 let stack = &*make_static!(Stack::new( 137 static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new();
138 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
139 let stack = &*STACK.init(Stack::new(
132 device, 140 device,
133 config, 141 config,
134 make_static!(StackResources::<2>::new()), 142 RESOURCES.init(StackResources::<2>::new()),
135 seed 143 seed,
136 )); 144 ));
137 145
138 unwrap!(spawner.spawn(net_task(stack))); 146 unwrap!(spawner.spawn(net_task(stack)));
diff --git a/examples/stm32f4/src/bin/usb_raw.rs b/examples/stm32f4/src/bin/usb_raw.rs
index 719b22bb9..afff55187 100644
--- a/examples/stm32f4/src/bin/usb_raw.rs
+++ b/examples/stm32f4/src/bin/usb_raw.rs
@@ -48,7 +48,6 @@
48 48
49#![no_std] 49#![no_std]
50#![no_main] 50#![no_main]
51#![feature(type_alias_impl_trait)]
52 51
53use defmt::*; 52use defmt::*;
54use embassy_executor::Spawner; 53use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/usb_serial.rs b/examples/stm32f4/src/bin/usb_serial.rs
index e2ccc9142..58d994a61 100644
--- a/examples/stm32f4/src/bin/usb_serial.rs
+++ b/examples/stm32f4/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{panic, *}; 4use defmt::{panic, *};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/wdt.rs b/examples/stm32f4/src/bin/wdt.rs
index 0443b61c5..ea27ebce0 100644
--- a/examples/stm32f4/src/bin/wdt.rs
+++ b/examples/stm32f4/src/bin/wdt.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f4/src/bin/ws2812_pwm_dma.rs b/examples/stm32f4/src/bin/ws2812_pwm_dma.rs
new file mode 100644
index 000000000..4458b643f
--- /dev/null
+++ b/examples/stm32f4/src/bin/ws2812_pwm_dma.rs
@@ -0,0 +1,150 @@
1// Configure TIM3 in PWM mode, and start DMA Transfer(s) to send color data into ws2812.
2// We assume the DIN pin of ws2812 connect to GPIO PB4, and ws2812 is properly powered.
3//
4// The idea is that the data rate of ws2812 is 800 kHz, and it use different duty ratio to represent bit 0 and bit 1.
5// Thus we can set TIM overflow at 800 kHz, and let TIM Update Event trigger a DMA transfer, then let DMA change CCR value,
6// such that pwm duty ratio meet the bit representation of ws2812.
7//
8// You may want to modify TIM CCR with Cortex core directly,
9// but according to my test, Cortex core will need to run far more than 100 MHz to catch up with TIM.
10// Thus we need to use a DMA.
11//
12// This demo is a combination of HAL, PAC, and manually invoke `dma::Transfer`.
13// If you need a simpler way to control ws2812, you may want to take a look at `ws2812_spi.rs` file, which make use of SPI.
14//
15// Warning:
16// DO NOT stare at ws2812 directy (especially after each MCU Reset), its (max) brightness could easily make your eyes feel burn.
17
18#![no_std]
19#![no_main]
20
21use embassy_executor::Spawner;
22use embassy_stm32::gpio::OutputType;
23use embassy_stm32::pac;
24use embassy_stm32::time::khz;
25use embassy_stm32::timer::simple_pwm::{PwmPin, SimplePwm};
26use embassy_stm32::timer::{Channel, CountingMode};
27use embassy_time::{Duration, Ticker, Timer};
28use {defmt_rtt as _, panic_probe as _};
29
30#[embassy_executor::main]
31async fn main(_spawner: Spawner) {
32 let mut device_config = embassy_stm32::Config::default();
33
34 // set SYSCLK/HCLK/PCLK2 to 20 MHz, thus each tick is 0.05 us,
35 // and ws2812 timings are integer multiples of 0.05 us
36 {
37 use embassy_stm32::rcc::*;
38 use embassy_stm32::time::*;
39 device_config.enable_debug_during_sleep = true;
40 device_config.rcc.hse = Some(Hse {
41 freq: mhz(12),
42 mode: HseMode::Oscillator,
43 });
44 device_config.rcc.pll_src = PllSource::HSE;
45 device_config.rcc.pll = Some(Pll {
46 prediv: PllPreDiv::DIV6,
47 mul: PllMul::MUL80,
48 divp: Some(PllPDiv::DIV8),
49 divq: None,
50 divr: None,
51 });
52 device_config.rcc.sys = Sysclk::PLL1_P;
53 }
54
55 let mut dp = embassy_stm32::init(device_config);
56
57 let mut ws2812_pwm = SimplePwm::new(
58 dp.TIM3,
59 Some(PwmPin::new_ch1(dp.PB4, OutputType::PushPull)),
60 None,
61 None,
62 None,
63 khz(800), // data rate of ws2812
64 CountingMode::EdgeAlignedUp,
65 );
66
67 // construct ws2812 non-return-to-zero (NRZ) code bit by bit
68 // ws2812 only need 24 bits for each LED, but we add one bit more to keep PWM output low
69
70 let max_duty = ws2812_pwm.get_max_duty();
71 let n0 = 8 * max_duty / 25; // ws2812 Bit 0 high level timing
72 let n1 = 2 * n0; // ws2812 Bit 1 high level timing
73
74 let turn_off = [
75 n0, n0, n0, n0, n0, n0, n0, n0, // Green
76 n0, n0, n0, n0, n0, n0, n0, n0, // Red
77 n0, n0, n0, n0, n0, n0, n0, n0, // Blue
78 0, // keep PWM output low after a transfer
79 ];
80
81 let dim_white = [
82 n0, n0, n0, n0, n0, n0, n1, n0, // Green
83 n0, n0, n0, n0, n0, n0, n1, n0, // Red
84 n0, n0, n0, n0, n0, n0, n1, n0, // Blue
85 0, // keep PWM output low after a transfer
86 ];
87
88 let color_list = &[&turn_off, &dim_white];
89
90 let pwm_channel = Channel::Ch1;
91
92 // PAC level hacking, enable output compare preload
93 // keep output waveform integrity
94 pac::TIM3
95 .ccmr_output(pwm_channel.index())
96 .modify(|v| v.set_ocpe(0, true));
97
98 // make sure PWM output keep low on first start
99 ws2812_pwm.set_duty(pwm_channel, 0);
100
101 {
102 use embassy_stm32::dma::{Burst, FifoThreshold, Transfer, TransferOptions};
103
104 // configure FIFO and MBURST of DMA, to minimize DMA occupation on AHB/APB
105 let mut dma_transfer_option = TransferOptions::default();
106 dma_transfer_option.fifo_threshold = Some(FifoThreshold::Full);
107 dma_transfer_option.mburst = Burst::Incr8;
108
109 // flip color at 2 Hz
110 let mut ticker = Ticker::every(Duration::from_millis(500));
111
112 loop {
113 for &color in color_list {
114 // start PWM output
115 ws2812_pwm.enable(pwm_channel);
116
117 // PAC level hacking, enable timer-update-event trigger DMA
118 pac::TIM3.dier().modify(|v| v.set_ude(true));
119
120 unsafe {
121 Transfer::new_write(
122 // with &mut, we can easily reuse same DMA channel multiple times
123 &mut dp.DMA1_CH2,
124 5,
125 color,
126 pac::TIM3.ccr(pwm_channel.index()).as_ptr() as *mut _,
127 dma_transfer_option,
128 )
129 .await;
130
131 // Turn off timer-update-event trigger DMA as soon as possible.
132 // Then clean the FIFO Error Flag if set.
133 pac::TIM3.dier().modify(|v| v.set_ude(false));
134 if pac::DMA1.isr(0).read().feif(2) {
135 pac::DMA1.ifcr(0).write(|v| v.set_feif(2, true));
136 }
137
138 // ws2812 need at least 50 us low level input to confirm the input data and change it's state
139 Timer::after_micros(50).await;
140 }
141
142 // stop PWM output for saving some energy
143 ws2812_pwm.disable(pwm_channel);
144
145 // wait until ticker tick
146 ticker.next().await;
147 }
148 }
149 }
150}
diff --git a/examples/stm32f4/src/bin/ws2812_spi.rs b/examples/stm32f4/src/bin/ws2812_spi.rs
new file mode 100644
index 000000000..a280a3b77
--- /dev/null
+++ b/examples/stm32f4/src/bin/ws2812_spi.rs
@@ -0,0 +1,95 @@
1// Mimic PWM with SPI, to control ws2812
2// We assume the DIN pin of ws2812 connect to GPIO PB5, and ws2812 is properly powered.
3//
4// The idea is that the data rate of ws2812 is 800 kHz, and it use different duty ratio to represent bit 0 and bit 1.
5// Thus we can adjust SPI to send each *round* of data at 800 kHz, and in each *round*, we can adjust each *bit* to mimic 2 different PWM waveform.
6// such that the output waveform meet the bit representation of ws2812.
7//
8// If you want to save SPI for other purpose, you may want to take a look at `ws2812_pwm_dma.rs` file, which make use of TIM and DMA.
9//
10// Warning:
11// DO NOT stare at ws2812 directy (especially after each MCU Reset), its (max) brightness could easily make your eyes feel burn.
12
13#![no_std]
14#![no_main]
15
16use embassy_stm32::time::khz;
17use embassy_stm32::{dma, spi};
18use embassy_time::{Duration, Ticker, Timer};
19use {defmt_rtt as _, panic_probe as _};
20
21// we use 16 bit data frame format of SPI, to let timing as accurate as possible.
22// thanks to loose tolerance of ws2812 timing, you can also use 8 bit data frame format, thus you will need to adjust the bit representation.
23const N0: u16 = 0b1111100000000000u16; // ws2812 Bit 0 high level timing
24const N1: u16 = 0b1111111111000000u16; // ws2812 Bit 1 high level timing
25
26// ws2812 only need 24 bits for each LED,
27// but we add one bit more to keep SPI output low at the end
28
29static TURN_OFF: [u16; 25] = [
30 N0, N0, N0, N0, N0, N0, N0, N0, // Green
31 N0, N0, N0, N0, N0, N0, N0, N0, // Red
32 N0, N0, N0, N0, N0, N0, N0, N0, // Blue
33 0, // keep SPI output low after last bit
34];
35
36static DIM_WHITE: [u16; 25] = [
37 N0, N0, N0, N0, N0, N0, N1, N0, // Green
38 N0, N0, N0, N0, N0, N0, N1, N0, // Red
39 N0, N0, N0, N0, N0, N0, N1, N0, // Blue
40 0, // keep SPI output low after last bit
41];
42
43static COLOR_LIST: &[&[u16]] = &[&TURN_OFF, &DIM_WHITE];
44
45#[embassy_executor::main]
46async fn main(_spawner: embassy_executor::Spawner) {
47 let mut device_config = embassy_stm32::Config::default();
48
49 // Since we use 16 bit SPI, and we need each round 800 kHz,
50 // thus SPI output speed should be 800 kHz * 16 = 12.8 MHz, and APB clock should be 2 * 12.8 MHz = 25.6 MHz.
51 //
52 // As for my setup, with 12 MHz HSE, I got 25.5 MHz SYSCLK, which is slightly slower, but it's ok for ws2812.
53 {
54 use embassy_stm32::rcc::{Hse, HseMode, Pll, PllMul, PllPDiv, PllPreDiv, PllSource, Sysclk};
55 use embassy_stm32::time::mhz;
56 device_config.enable_debug_during_sleep = true;
57 device_config.rcc.hse = Some(Hse {
58 freq: mhz(12),
59 mode: HseMode::Oscillator,
60 });
61 device_config.rcc.pll_src = PllSource::HSE;
62 device_config.rcc.pll = Some(Pll {
63 prediv: PllPreDiv::DIV6,
64 mul: PllMul::MUL102,
65 divp: Some(PllPDiv::DIV8),
66 divq: None,
67 divr: None,
68 });
69 device_config.rcc.sys = Sysclk::PLL1_P;
70 }
71
72 let dp = embassy_stm32::init(device_config);
73
74 // Set SPI output speed.
75 // It's ok to blindly set frequency to 12800 kHz, the hal crate will take care of the SPI CR1 BR field.
76 // And in my case, the real bit rate will be 25.5 MHz / 2 = 12_750 kHz
77 let mut spi_config = spi::Config::default();
78 spi_config.frequency = khz(12_800);
79
80 // Since we only output waveform, then the Rx and Sck and RxDma it is not considered
81 let mut ws2812_spi = spi::Spi::new_txonly_nosck(dp.SPI1, dp.PB5, dp.DMA2_CH3, dma::NoDma, spi_config);
82
83 // flip color at 2 Hz
84 let mut ticker = Ticker::every(Duration::from_millis(500));
85
86 loop {
87 for &color in COLOR_LIST {
88 ws2812_spi.write(color).await.unwrap();
89 // ws2812 need at least 50 us low level input to confirm the input data and change it's state
90 Timer::after_micros(50).await;
91 // wait until ticker tick
92 ticker.next().await;
93 }
94 }
95}
diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml
index 4cca0d93c..b76a848a8 100644
--- a/examples/stm32f7/Cargo.toml
+++ b/examples/stm32f7/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32f767zi to your chip name, if necessary. 8# Change stm32f767zi to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } 13embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] }
14embedded-io-async = { version = "0.6.1" } 14embedded-io-async = { version = "0.6.1" }
@@ -27,7 +27,7 @@ nb = "1.0.0"
27rand_core = "0.6.3" 27rand_core = "0.6.3"
28critical-section = "1.1" 28critical-section = "1.1"
29embedded-storage = "0.3.1" 29embedded-storage = "0.3.1"
30static_cell = { version = "2", features = ["nightly"]} 30static_cell = "2"
31 31
32[profile.release] 32[profile.release]
33debug = 2 33debug = 2
diff --git a/examples/stm32f7/src/bin/adc.rs b/examples/stm32f7/src/bin/adc.rs
index 48c59eaf0..f8d7b691f 100644
--- a/examples/stm32f7/src/bin/adc.rs
+++ b/examples/stm32f7/src/bin/adc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f7/src/bin/blinky.rs b/examples/stm32f7/src/bin/blinky.rs
index 4bfc5a50d..31cce8225 100644
--- a/examples/stm32f7/src/bin/blinky.rs
+++ b/examples/stm32f7/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f7/src/bin/button.rs b/examples/stm32f7/src/bin/button.rs
index b13e64531..ad30a56a2 100644
--- a/examples/stm32f7/src/bin/button.rs
+++ b/examples/stm32f7/src/bin/button.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
@@ -13,7 +12,7 @@ fn main() -> ! {
13 12
14 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
15 14
16 let button = Input::new(p.PC13, Pull::Down); 15 let mut button = Input::new(p.PC13, Pull::Down);
17 let mut led1 = Output::new(p.PB0, Level::High, Speed::Low); 16 let mut led1 = Output::new(p.PB0, Level::High, Speed::Low);
18 let _led2 = Output::new(p.PB7, Level::High, Speed::Low); 17 let _led2 = Output::new(p.PB7, Level::High, Speed::Low);
19 let mut led3 = Output::new(p.PB14, Level::High, Speed::Low); 18 let mut led3 = Output::new(p.PB14, Level::High, Speed::Low);
diff --git a/examples/stm32f7/src/bin/button_exti.rs b/examples/stm32f7/src/bin/button_exti.rs
index dfe587d41..67751187d 100644
--- a/examples/stm32f7/src/bin/button_exti.rs
+++ b/examples/stm32f7/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f7/src/bin/can.rs b/examples/stm32f7/src/bin/can.rs
index 78b21ceaa..bcfdb67a8 100644
--- a/examples/stm32f7/src/bin/can.rs
+++ b/examples/stm32f7/src/bin/can.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -12,6 +11,7 @@ use embassy_stm32::can::{
12}; 11};
13use embassy_stm32::gpio::{Input, Pull}; 12use embassy_stm32::gpio::{Input, Pull};
14use embassy_stm32::peripherals::CAN3; 13use embassy_stm32::peripherals::CAN3;
14use static_cell::StaticCell;
15use {defmt_rtt as _, panic_probe as _}; 15use {defmt_rtt as _, panic_probe as _};
16 16
17bind_interrupts!(struct Irqs { 17bind_interrupts!(struct Irqs {
@@ -43,7 +43,8 @@ async fn main(spawner: Spawner) {
43 let rx_pin = Input::new(&mut p.PA15, Pull::Up); 43 let rx_pin = Input::new(&mut p.PA15, Pull::Up);
44 core::mem::forget(rx_pin); 44 core::mem::forget(rx_pin);
45 45
46 let can: &'static mut Can<'static, CAN3> = static_cell::make_static!(Can::new(p.CAN3, p.PA8, p.PA15, Irqs)); 46 static CAN: StaticCell<Can<'static, CAN3>> = StaticCell::new();
47 let can = CAN.init(Can::new(p.CAN3, p.PA8, p.PA15, Irqs));
47 can.as_mut() 48 can.as_mut()
48 .modify_filters() 49 .modify_filters()
49 .enable_bank(0, Fifo::Fifo0, Mask32::accept_all()); 50 .enable_bank(0, Fifo::Fifo0, Mask32::accept_all());
@@ -56,7 +57,8 @@ async fn main(spawner: Spawner) {
56 57
57 let (tx, mut rx) = can.split(); 58 let (tx, mut rx) = can.split();
58 59
59 let tx: &'static mut CanTx<'static, 'static, CAN3> = static_cell::make_static!(tx); 60 static CAN_TX: StaticCell<CanTx<'static, 'static, CAN3>> = StaticCell::new();
61 let tx = CAN_TX.init(tx);
60 spawner.spawn(send_can_message(tx)).unwrap(); 62 spawner.spawn(send_can_message(tx)).unwrap();
61 63
62 loop { 64 loop {
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs
index dd0069447..5bff48197 100644
--- a/examples/stm32f7/src/bin/eth.rs
+++ b/examples/stm32f7/src/bin/eth.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -15,7 +14,7 @@ use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config};
15use embassy_time::Timer; 14use embassy_time::Timer;
16use embedded_io_async::Write; 15use embedded_io_async::Write;
17use rand_core::RngCore; 16use rand_core::RngCore;
18use static_cell::make_static; 17use static_cell::StaticCell;
19use {defmt_rtt as _, panic_probe as _}; 18use {defmt_rtt as _, panic_probe as _};
20 19
21bind_interrupts!(struct Irqs { 20bind_interrupts!(struct Irqs {
@@ -64,8 +63,9 @@ async fn main(spawner: Spawner) -> ! {
64 63
65 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; 64 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
66 65
66 static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new();
67 let device = Ethernet::new( 67 let device = Ethernet::new(
68 make_static!(PacketQueue::<16, 16>::new()), 68 PACKETS.init(PacketQueue::<16, 16>::new()),
69 p.ETH, 69 p.ETH,
70 Irqs, 70 Irqs,
71 p.PA1, 71 p.PA1,
@@ -89,11 +89,13 @@ async fn main(spawner: Spawner) -> ! {
89 //}); 89 //});
90 90
91 // Init network stack 91 // Init network stack
92 let stack = &*make_static!(Stack::new( 92 static STACK: StaticCell<Stack<Device>> = StaticCell::new();
93 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
94 let stack = &*STACK.init(Stack::new(
93 device, 95 device,
94 config, 96 config,
95 make_static!(StackResources::<2>::new()), 97 RESOURCES.init(StackResources::<2>::new()),
96 seed 98 seed,
97 )); 99 ));
98 100
99 // Launch network task 101 // Launch network task
diff --git a/examples/stm32f7/src/bin/flash.rs b/examples/stm32f7/src/bin/flash.rs
index 06a94f1c8..885570478 100644
--- a/examples/stm32f7/src/bin/flash.rs
+++ b/examples/stm32f7/src/bin/flash.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f7/src/bin/hello.rs b/examples/stm32f7/src/bin/hello.rs
index a2a287110..3c295612c 100644
--- a/examples/stm32f7/src/bin/hello.rs
+++ b/examples/stm32f7/src/bin/hello.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::info; 4use defmt::info;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f7/src/bin/sdmmc.rs b/examples/stm32f7/src/bin/sdmmc.rs
index 990de0ab1..6d36ef518 100644
--- a/examples/stm32f7/src/bin/sdmmc.rs
+++ b/examples/stm32f7/src/bin/sdmmc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32f7/src/bin/usart_dma.rs b/examples/stm32f7/src/bin/usart_dma.rs
index ba064081e..fb604b34f 100644
--- a/examples/stm32f7/src/bin/usart_dma.rs
+++ b/examples/stm32f7/src/bin/usart_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6 5
diff --git a/examples/stm32f7/src/bin/usb_serial.rs b/examples/stm32f7/src/bin/usb_serial.rs
index 4991edbf0..97daf6bd1 100644
--- a/examples/stm32f7/src/bin/usb_serial.rs
+++ b/examples/stm32f7/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{panic, *}; 4use defmt::{panic, *};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32g0/Cargo.toml b/examples/stm32g0/Cargo.toml
index b1e749440..0abc0a638 100644
--- a/examples/stm32g0/Cargo.toml
+++ b/examples/stm32g0/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32g071rb to your chip name, if necessary. 8# Change stm32g071rb to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13 13
14defmt = "0.3" 14defmt = "0.3"
diff --git a/examples/stm32g0/src/bin/blinky.rs b/examples/stm32g0/src/bin/blinky.rs
index 4bfc5a50d..31cce8225 100644
--- a/examples/stm32g0/src/bin/blinky.rs
+++ b/examples/stm32g0/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32g0/src/bin/button.rs b/examples/stm32g0/src/bin/button.rs
index 72a3f5cbf..265200132 100644
--- a/examples/stm32g0/src/bin/button.rs
+++ b/examples/stm32g0/src/bin/button.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
@@ -13,7 +12,7 @@ fn main() -> ! {
13 12
14 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
15 14
16 let button = Input::new(p.PC13, Pull::Up); 15 let mut button = Input::new(p.PC13, Pull::Up);
17 16
18 loop { 17 loop {
19 if button.is_high() { 18 if button.is_high() {
diff --git a/examples/stm32g0/src/bin/button_exti.rs b/examples/stm32g0/src/bin/button_exti.rs
index ef32d4c4a..1e970fdd6 100644
--- a/examples/stm32g0/src/bin/button_exti.rs
+++ b/examples/stm32g0/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32g0/src/bin/flash.rs b/examples/stm32g0/src/bin/flash.rs
index ed9f2e843..acef87b92 100644
--- a/examples/stm32g0/src/bin/flash.rs
+++ b/examples/stm32g0/src/bin/flash.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32g0/src/bin/spi_neopixel.rs b/examples/stm32g0/src/bin/spi_neopixel.rs
index 214462d0e..c5ea51721 100644
--- a/examples/stm32g0/src/bin/spi_neopixel.rs
+++ b/examples/stm32g0/src/bin/spi_neopixel.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32g4/Cargo.toml b/examples/stm32g4/Cargo.toml
index c56a63623..987f23b3a 100644
--- a/examples/stm32g4/Cargo.toml
+++ b/examples/stm32g4/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32g491re to your chip name, if necessary. 8# Change stm32g491re to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
14embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } 14embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
diff --git a/examples/stm32g4/src/bin/adc.rs b/examples/stm32g4/src/bin/adc.rs
index 63b20c0d4..35324d931 100644
--- a/examples/stm32g4/src/bin/adc.rs
+++ b/examples/stm32g4/src/bin/adc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32g4/src/bin/blinky.rs b/examples/stm32g4/src/bin/blinky.rs
index cbeb0dee1..90e479aae 100644
--- a/examples/stm32g4/src/bin/blinky.rs
+++ b/examples/stm32g4/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32g4/src/bin/button.rs b/examples/stm32g4/src/bin/button.rs
index 15abd86d9..6f3db0819 100644
--- a/examples/stm32g4/src/bin/button.rs
+++ b/examples/stm32g4/src/bin/button.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
@@ -13,7 +12,7 @@ fn main() -> ! {
13 12
14 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
15 14
16 let button = Input::new(p.PC13, Pull::Down); 15 let mut button = Input::new(p.PC13, Pull::Down);
17 16
18 loop { 17 loop {
19 if button.is_high() { 18 if button.is_high() {
diff --git a/examples/stm32g4/src/bin/button_exti.rs b/examples/stm32g4/src/bin/button_exti.rs
index dfe587d41..67751187d 100644
--- a/examples/stm32g4/src/bin/button_exti.rs
+++ b/examples/stm32g4/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32g4/src/bin/pll.rs b/examples/stm32g4/src/bin/pll.rs
index 09ef59d44..46ebe0b0d 100644
--- a/examples/stm32g4/src/bin/pll.rs
+++ b/examples/stm32g4/src/bin/pll.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32g4/src/bin/pwm.rs b/examples/stm32g4/src/bin/pwm.rs
index a84394005..d4809a481 100644
--- a/examples/stm32g4/src/bin/pwm.rs
+++ b/examples/stm32g4/src/bin/pwm.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32g4/src/bin/usb_serial.rs b/examples/stm32g4/src/bin/usb_serial.rs
index 565b25d60..c26fa76b7 100644
--- a/examples/stm32g4/src/bin/usb_serial.rs
+++ b/examples/stm32g4/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{panic, *}; 4use defmt::{panic, *};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h5/Cargo.toml b/examples/stm32h5/Cargo.toml
index 0ed0ce3c0..8815b8e47 100644
--- a/examples/stm32h5/Cargo.toml
+++ b/examples/stm32h5/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32h563zi to your chip name, if necessary. 8# Change stm32h563zi to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32h563zi", "memory-x", "time-driver-any", "exti", "unstable-pac"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32h563zi", "memory-x", "time-driver-any", "exti", "unstable-pac"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] } 13embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] }
14embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 14embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
@@ -19,8 +19,8 @@ defmt-rtt = "0.4"
19cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } 19cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
20cortex-m-rt = "0.7.0" 20cortex-m-rt = "0.7.0"
21embedded-hal = "0.2.6" 21embedded-hal = "0.2.6"
22embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } 22embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.3" }
23embedded-hal-async = { version = "=1.0.0-rc.2" } 23embedded-hal-async = { version = "=1.0.0-rc.3" }
24embedded-io-async = { version = "0.6.1" } 24embedded-io-async = { version = "0.6.1" }
25embedded-nal-async = { version = "0.7.1" } 25embedded-nal-async = { version = "0.7.1" }
26panic-probe = { version = "0.3", features = ["print-defmt"] } 26panic-probe = { version = "0.3", features = ["print-defmt"] }
@@ -31,7 +31,7 @@ critical-section = "1.1"
31micromath = "2.0.0" 31micromath = "2.0.0"
32stm32-fmc = "0.3.0" 32stm32-fmc = "0.3.0"
33embedded-storage = "0.3.1" 33embedded-storage = "0.3.1"
34static_cell = { version = "2", features = ["nightly"]} 34static_cell = "2"
35 35
36# cargo build/run 36# cargo build/run
37[profile.dev] 37[profile.dev]
diff --git a/examples/stm32h5/src/bin/blinky.rs b/examples/stm32h5/src/bin/blinky.rs
index 1394f03fa..f37e8b1d8 100644
--- a/examples/stm32h5/src/bin/blinky.rs
+++ b/examples/stm32h5/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h5/src/bin/button_exti.rs b/examples/stm32h5/src/bin/button_exti.rs
index dfe587d41..67751187d 100644
--- a/examples/stm32h5/src/bin/button_exti.rs
+++ b/examples/stm32h5/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs
index b2758cba0..2370656e6 100644
--- a/examples/stm32h5/src/bin/eth.rs
+++ b/examples/stm32h5/src/bin/eth.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -18,7 +17,7 @@ use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config};
18use embassy_time::Timer; 17use embassy_time::Timer;
19use embedded_io_async::Write; 18use embedded_io_async::Write;
20use rand_core::RngCore; 19use rand_core::RngCore;
21use static_cell::make_static; 20use static_cell::StaticCell;
22use {defmt_rtt as _, panic_probe as _}; 21use {defmt_rtt as _, panic_probe as _};
23 22
24bind_interrupts!(struct Irqs { 23bind_interrupts!(struct Irqs {
@@ -67,8 +66,9 @@ async fn main(spawner: Spawner) -> ! {
67 66
68 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; 67 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
69 68
69 static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new();
70 let device = Ethernet::new( 70 let device = Ethernet::new(
71 make_static!(PacketQueue::<4, 4>::new()), 71 PACKETS.init(PacketQueue::<4, 4>::new()),
72 p.ETH, 72 p.ETH,
73 Irqs, 73 Irqs,
74 p.PA1, 74 p.PA1,
@@ -92,11 +92,13 @@ async fn main(spawner: Spawner) -> ! {
92 //}); 92 //});
93 93
94 // Init network stack 94 // Init network stack
95 let stack = &*make_static!(Stack::new( 95 static STACK: StaticCell<Stack<Device>> = StaticCell::new();
96 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
97 let stack = &*STACK.init(Stack::new(
96 device, 98 device,
97 config, 99 config,
98 make_static!(StackResources::<2>::new()), 100 RESOURCES.init(StackResources::<2>::new()),
99 seed 101 seed,
100 )); 102 ));
101 103
102 // Launch network task 104 // Launch network task
diff --git a/examples/stm32h5/src/bin/i2c.rs b/examples/stm32h5/src/bin/i2c.rs
index 31783a2bf..31e83cbb5 100644
--- a/examples/stm32h5/src/bin/i2c.rs
+++ b/examples/stm32h5/src/bin/i2c.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h5/src/bin/rng.rs b/examples/stm32h5/src/bin/rng.rs
index 7c8c50eca..9c0d704b5 100644
--- a/examples/stm32h5/src/bin/rng.rs
+++ b/examples/stm32h5/src/bin/rng.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h5/src/bin/usart.rs b/examples/stm32h5/src/bin/usart.rs
index db04d4e55..f9cbad6af 100644
--- a/examples/stm32h5/src/bin/usart.rs
+++ b/examples/stm32h5/src/bin/usart.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
diff --git a/examples/stm32h5/src/bin/usart_dma.rs b/examples/stm32h5/src/bin/usart_dma.rs
index bafe50839..caae0dd18 100644
--- a/examples/stm32h5/src/bin/usart_dma.rs
+++ b/examples/stm32h5/src/bin/usart_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6 5
diff --git a/examples/stm32h5/src/bin/usart_split.rs b/examples/stm32h5/src/bin/usart_split.rs
index d9037c014..92047de8d 100644
--- a/examples/stm32h5/src/bin/usart_split.rs
+++ b/examples/stm32h5/src/bin/usart_split.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h5/src/bin/usb_serial.rs b/examples/stm32h5/src/bin/usb_serial.rs
index 7d45818af..208493d8c 100644
--- a/examples/stm32h5/src/bin/usb_serial.rs
+++ b/examples/stm32h5/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{panic, *}; 4use defmt::{panic, *};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml
index baa530cf6..31feeda45 100644
--- a/examples/stm32h7/Cargo.toml
+++ b/examples/stm32h7/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32h743bi to your chip name, if necessary. 8# Change stm32h743bi to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743bi", "time-driver-any", "exti", "memory-x", "unstable-pac", "chrono"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743bi", "time-driver-any", "exti", "memory-x", "unstable-pac", "chrono"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6", "dns"] } 13embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6", "dns"] }
14embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 14embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
@@ -19,8 +19,8 @@ defmt-rtt = "0.4"
19cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } 19cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
20cortex-m-rt = "0.7.0" 20cortex-m-rt = "0.7.0"
21embedded-hal = "0.2.6" 21embedded-hal = "0.2.6"
22embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } 22embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.3" }
23embedded-hal-async = { version = "=1.0.0-rc.2" } 23embedded-hal-async = { version = "=1.0.0-rc.3" }
24embedded-nal-async = { version = "0.7.1" } 24embedded-nal-async = { version = "0.7.1" }
25embedded-io-async = { version = "0.6.1" } 25embedded-io-async = { version = "0.6.1" }
26panic-probe = { version = "0.3", features = ["print-defmt"] } 26panic-probe = { version = "0.3", features = ["print-defmt"] }
@@ -31,7 +31,7 @@ critical-section = "1.1"
31micromath = "2.0.0" 31micromath = "2.0.0"
32stm32-fmc = "0.3.0" 32stm32-fmc = "0.3.0"
33embedded-storage = "0.3.1" 33embedded-storage = "0.3.1"
34static_cell = { version = "2", features = ["nightly"]} 34static_cell = "2"
35chrono = { version = "^0.4", default-features = false } 35chrono = { version = "^0.4", default-features = false }
36 36
37# cargo build/run 37# cargo build/run
diff --git a/examples/stm32h7/src/bin/adc.rs b/examples/stm32h7/src/bin/adc.rs
index e367827e9..fe6fe69a1 100644
--- a/examples/stm32h7/src/bin/adc.rs
+++ b/examples/stm32h7/src/bin/adc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/blinky.rs b/examples/stm32h7/src/bin/blinky.rs
index a9cab1ff4..1ee90a870 100644
--- a/examples/stm32h7/src/bin/blinky.rs
+++ b/examples/stm32h7/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/button_exti.rs b/examples/stm32h7/src/bin/button_exti.rs
index dfe587d41..67751187d 100644
--- a/examples/stm32h7/src/bin/button_exti.rs
+++ b/examples/stm32h7/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/camera.rs b/examples/stm32h7/src/bin/camera.rs
index 489fb03dd..e5a104baf 100644
--- a/examples/stm32h7/src/bin/camera.rs
+++ b/examples/stm32h7/src/bin/camera.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use embassy_executor::Spawner; 4use embassy_executor::Spawner;
6use embassy_stm32::dcmi::{self, *}; 5use embassy_stm32::dcmi::{self, *};
diff --git a/examples/stm32h7/src/bin/dac.rs b/examples/stm32h7/src/bin/dac.rs
index f66268151..a9bf46de0 100644
--- a/examples/stm32h7/src/bin/dac.rs
+++ b/examples/stm32h7/src/bin/dac.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
diff --git a/examples/stm32h7/src/bin/dac_dma.rs b/examples/stm32h7/src/bin/dac_dma.rs
index c19fdd623..8e5c41a43 100644
--- a/examples/stm32h7/src/bin/dac_dma.rs
+++ b/examples/stm32h7/src/bin/dac_dma.rs
@@ -1,11 +1,10 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
7use embassy_stm32::dac::{DacCh1, DacCh2, ValueArray}; 6use embassy_stm32::dac::{DacCh1, DacCh2, ValueArray};
8use embassy_stm32::pac::timer::vals::{Mms, Opm}; 7use embassy_stm32::pac::timer::vals::Mms;
9use embassy_stm32::peripherals::{DAC1, DMA1_CH3, DMA1_CH4, TIM6, TIM7}; 8use embassy_stm32::peripherals::{DAC1, DMA1_CH3, DMA1_CH4, TIM6, TIM7};
10use embassy_stm32::rcc::low_level::RccPeripheral; 9use embassy_stm32::rcc::low_level::RccPeripheral;
11use embassy_stm32::time::Hertz; 10use embassy_stm32::time::Hertz;
@@ -79,7 +78,7 @@ async fn dac_task1(mut dac: DacCh1<'static, DAC1, DMA1_CH3>) {
79 TIM6::regs().arr().modify(|w| w.set_arr(reload as u16 - 1)); 78 TIM6::regs().arr().modify(|w| w.set_arr(reload as u16 - 1));
80 TIM6::regs().cr2().modify(|w| w.set_mms(Mms::UPDATE)); 79 TIM6::regs().cr2().modify(|w| w.set_mms(Mms::UPDATE));
81 TIM6::regs().cr1().modify(|w| { 80 TIM6::regs().cr1().modify(|w| {
82 w.set_opm(Opm::DISABLED); 81 w.set_opm(false);
83 w.set_cen(true); 82 w.set_cen(true);
84 }); 83 });
85 84
@@ -116,7 +115,7 @@ async fn dac_task2(mut dac: DacCh2<'static, DAC1, DMA1_CH4>) {
116 TIM7::regs().arr().modify(|w| w.set_arr(reload as u16 - 1)); 115 TIM7::regs().arr().modify(|w| w.set_arr(reload as u16 - 1));
117 TIM7::regs().cr2().modify(|w| w.set_mms(Mms::UPDATE)); 116 TIM7::regs().cr2().modify(|w| w.set_mms(Mms::UPDATE));
118 TIM7::regs().cr1().modify(|w| { 117 TIM7::regs().cr1().modify(|w| {
119 w.set_opm(Opm::DISABLED); 118 w.set_opm(false);
120 w.set_cen(true); 119 w.set_cen(true);
121 }); 120 });
122 121
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs
index dbddfc22f..cd9a27fcd 100644
--- a/examples/stm32h7/src/bin/eth.rs
+++ b/examples/stm32h7/src/bin/eth.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -14,7 +13,7 @@ use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config};
14use embassy_time::Timer; 13use embassy_time::Timer;
15use embedded_io_async::Write; 14use embedded_io_async::Write;
16use rand_core::RngCore; 15use rand_core::RngCore;
17use static_cell::make_static; 16use static_cell::StaticCell;
18use {defmt_rtt as _, panic_probe as _}; 17use {defmt_rtt as _, panic_probe as _};
19 18
20bind_interrupts!(struct Irqs { 19bind_interrupts!(struct Irqs {
@@ -64,8 +63,9 @@ async fn main(spawner: Spawner) -> ! {
64 63
65 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; 64 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
66 65
66 static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new();
67 let device = Ethernet::new( 67 let device = Ethernet::new(
68 make_static!(PacketQueue::<16, 16>::new()), 68 PACKETS.init(PacketQueue::<4, 4>::new()),
69 p.ETH, 69 p.ETH,
70 Irqs, 70 Irqs,
71 p.PA1, 71 p.PA1,
@@ -89,11 +89,13 @@ async fn main(spawner: Spawner) -> ! {
89 //}); 89 //});
90 90
91 // Init network stack 91 // Init network stack
92 let stack = &*make_static!(Stack::new( 92 static STACK: StaticCell<Stack<Device>> = StaticCell::new();
93 static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
94 let stack = &*STACK.init(Stack::new(
93 device, 95 device,
94 config, 96 config,
95 make_static!(StackResources::<3>::new()), 97 RESOURCES.init(StackResources::<3>::new()),
96 seed 98 seed,
97 )); 99 ));
98 100
99 // Launch network task 101 // Launch network task
diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs
index 17e1d9fb7..dcc6e36e2 100644
--- a/examples/stm32h7/src/bin/eth_client.rs
+++ b/examples/stm32h7/src/bin/eth_client.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -15,7 +14,7 @@ use embassy_time::Timer;
15use embedded_io_async::Write; 14use embedded_io_async::Write;
16use embedded_nal_async::{Ipv4Addr, SocketAddr, SocketAddrV4, TcpConnect}; 15use embedded_nal_async::{Ipv4Addr, SocketAddr, SocketAddrV4, TcpConnect};
17use rand_core::RngCore; 16use rand_core::RngCore;
18use static_cell::make_static; 17use static_cell::StaticCell;
19use {defmt_rtt as _, panic_probe as _}; 18use {defmt_rtt as _, panic_probe as _};
20 19
21bind_interrupts!(struct Irqs { 20bind_interrupts!(struct Irqs {
@@ -65,8 +64,9 @@ async fn main(spawner: Spawner) -> ! {
65 64
66 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; 65 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
67 66
67 static PACKETS: StaticCell<PacketQueue<16, 16>> = StaticCell::new();
68 let device = Ethernet::new( 68 let device = Ethernet::new(
69 make_static!(PacketQueue::<16, 16>::new()), 69 PACKETS.init(PacketQueue::<16, 16>::new()),
70 p.ETH, 70 p.ETH,
71 Irqs, 71 Irqs,
72 p.PA1, 72 p.PA1,
@@ -90,11 +90,13 @@ async fn main(spawner: Spawner) -> ! {
90 //}); 90 //});
91 91
92 // Init network stack 92 // Init network stack
93 let stack = &*make_static!(Stack::new( 93 static STACK: StaticCell<Stack<Device>> = StaticCell::new();
94 static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
95 let stack = &*STACK.init(Stack::new(
94 device, 96 device,
95 config, 97 config,
96 make_static!(StackResources::<3>::new()), 98 RESOURCES.init(StackResources::<3>::new()),
97 seed 99 seed,
98 )); 100 ));
99 101
100 // Launch network task 102 // Launch network task
diff --git a/examples/stm32h7/src/bin/flash.rs b/examples/stm32h7/src/bin/flash.rs
index 89c0c8a66..4f9f6bb0a 100644
--- a/examples/stm32h7/src/bin/flash.rs
+++ b/examples/stm32h7/src/bin/flash.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/fmc.rs b/examples/stm32h7/src/bin/fmc.rs
index 54e2c3629..5e5e6ccc8 100644
--- a/examples/stm32h7/src/bin/fmc.rs
+++ b/examples/stm32h7/src/bin/fmc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/i2c.rs b/examples/stm32h7/src/bin/i2c.rs
index aea21ec6f..3bf39eb44 100644
--- a/examples/stm32h7/src/bin/i2c.rs
+++ b/examples/stm32h7/src/bin/i2c.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs
index e0be495d1..cc508c3cf 100644
--- a/examples/stm32h7/src/bin/low_level_timer_api.rs
+++ b/examples/stm32h7/src/bin/low_level_timer_api.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -85,7 +84,7 @@ impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> {
85 84
86 let mut this = Self { inner: tim }; 85 let mut this = Self { inner: tim };
87 86
88 this.set_freq(freq); 87 this.set_frequency(freq);
89 this.inner.start(); 88 this.inner.start();
90 89
91 let r = T::regs_gp32(); 90 let r = T::regs_gp32();
@@ -102,14 +101,14 @@ impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> {
102 } 101 }
103 102
104 pub fn enable(&mut self, channel: Channel) { 103 pub fn enable(&mut self, channel: Channel) {
105 T::regs_gp32().ccer().modify(|w| w.set_cce(channel.raw(), true)); 104 T::regs_gp32().ccer().modify(|w| w.set_cce(channel.index(), true));
106 } 105 }
107 106
108 pub fn disable(&mut self, channel: Channel) { 107 pub fn disable(&mut self, channel: Channel) {
109 T::regs_gp32().ccer().modify(|w| w.set_cce(channel.raw(), false)); 108 T::regs_gp32().ccer().modify(|w| w.set_cce(channel.index(), false));
110 } 109 }
111 110
112 pub fn set_freq(&mut self, freq: Hertz) { 111 pub fn set_frequency(&mut self, freq: Hertz) {
113 <T as embassy_stm32::timer::low_level::GeneralPurpose32bitInstance>::set_frequency(&mut self.inner, freq); 112 <T as embassy_stm32::timer::low_level::GeneralPurpose32bitInstance>::set_frequency(&mut self.inner, freq);
114 } 113 }
115 114
@@ -119,6 +118,6 @@ impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> {
119 118
120 pub fn set_duty(&mut self, channel: Channel, duty: u32) { 119 pub fn set_duty(&mut self, channel: Channel, duty: u32) {
121 defmt::assert!(duty < self.get_max_duty()); 120 defmt::assert!(duty < self.get_max_duty());
122 T::regs_gp32().ccr(channel.raw()).modify(|w| w.set_ccr(duty)) 121 T::regs_gp32().ccr(channel.index()).modify(|w| w.set_ccr(duty))
123 } 122 }
124} 123}
diff --git a/examples/stm32h7/src/bin/mco.rs b/examples/stm32h7/src/bin/mco.rs
index c023f4584..a6ee27625 100644
--- a/examples/stm32h7/src/bin/mco.rs
+++ b/examples/stm32h7/src/bin/mco.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/pwm.rs b/examples/stm32h7/src/bin/pwm.rs
index c55d780a0..1e48ba67b 100644
--- a/examples/stm32h7/src/bin/pwm.rs
+++ b/examples/stm32h7/src/bin/pwm.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/rng.rs b/examples/stm32h7/src/bin/rng.rs
index 1fb4cfec0..a9ef7200d 100644
--- a/examples/stm32h7/src/bin/rng.rs
+++ b/examples/stm32h7/src/bin/rng.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/rtc.rs b/examples/stm32h7/src/bin/rtc.rs
index 78cea9c89..c6b9cf57e 100644
--- a/examples/stm32h7/src/bin/rtc.rs
+++ b/examples/stm32h7/src/bin/rtc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use chrono::{NaiveDate, NaiveDateTime}; 4use chrono::{NaiveDate, NaiveDateTime};
6use defmt::*; 5use defmt::*;
diff --git a/examples/stm32h7/src/bin/sdmmc.rs b/examples/stm32h7/src/bin/sdmmc.rs
index be968ff77..abe2d4ba7 100644
--- a/examples/stm32h7/src/bin/sdmmc.rs
+++ b/examples/stm32h7/src/bin/sdmmc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/signal.rs b/examples/stm32h7/src/bin/signal.rs
index b5f583289..b73360f32 100644
--- a/examples/stm32h7/src/bin/signal.rs
+++ b/examples/stm32h7/src/bin/signal.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/spi.rs b/examples/stm32h7/src/bin/spi.rs
index a8db0ff77..aed27723a 100644
--- a/examples/stm32h7/src/bin/spi.rs
+++ b/examples/stm32h7/src/bin/spi.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6use core::str::from_utf8; 5use core::str::from_utf8;
diff --git a/examples/stm32h7/src/bin/spi_dma.rs b/examples/stm32h7/src/bin/spi_dma.rs
index 561052e48..54d4d7656 100644
--- a/examples/stm32h7/src/bin/spi_dma.rs
+++ b/examples/stm32h7/src/bin/spi_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6use core::str::from_utf8; 5use core::str::from_utf8;
diff --git a/examples/stm32h7/src/bin/usart.rs b/examples/stm32h7/src/bin/usart.rs
index db04d4e55..f9cbad6af 100644
--- a/examples/stm32h7/src/bin/usart.rs
+++ b/examples/stm32h7/src/bin/usart.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
diff --git a/examples/stm32h7/src/bin/usart_dma.rs b/examples/stm32h7/src/bin/usart_dma.rs
index 249050fd1..ae1f3a2e9 100644
--- a/examples/stm32h7/src/bin/usart_dma.rs
+++ b/examples/stm32h7/src/bin/usart_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6 5
diff --git a/examples/stm32h7/src/bin/usart_split.rs b/examples/stm32h7/src/bin/usart_split.rs
index 61c9f1954..b98c40877 100644
--- a/examples/stm32h7/src/bin/usart_split.rs
+++ b/examples/stm32h7/src/bin/usart_split.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/usb_serial.rs b/examples/stm32h7/src/bin/usb_serial.rs
index f80cf63ec..d81efb541 100644
--- a/examples/stm32h7/src/bin/usb_serial.rs
+++ b/examples/stm32h7/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{panic, *}; 4use defmt::{panic, *};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32h7/src/bin/wdg.rs b/examples/stm32h7/src/bin/wdg.rs
index 76fd9dfc0..a4184aa96 100644
--- a/examples/stm32h7/src/bin/wdg.rs
+++ b/examples/stm32h7/src/bin/wdg.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml
index 7c8264739..739aa6cb1 100644
--- a/examples/stm32l0/Cargo.toml
+++ b/examples/stm32l0/Cargo.toml
@@ -4,10 +4,6 @@ name = "embassy-stm32l0-examples"
4version = "0.1.0" 4version = "0.1.0"
5license = "MIT OR Apache-2.0" 5license = "MIT OR Apache-2.0"
6 6
7[features]
8default = ["nightly"]
9nightly = ["embassy-executor/nightly"]
10
11[dependencies] 7[dependencies]
12# Change stm32l072cz to your chip name, if necessary. 8# Change stm32l072cz to your chip name, if necessary.
13embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "memory-x"] }
diff --git a/examples/stm32l0/src/bin/blinky.rs b/examples/stm32l0/src/bin/blinky.rs
index ea40bfc48..caca5759f 100644
--- a/examples/stm32l0/src/bin/blinky.rs
+++ b/examples/stm32l0/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l0/src/bin/button.rs b/examples/stm32l0/src/bin/button.rs
index 9d194471e..165a714a5 100644
--- a/examples/stm32l0/src/bin/button.rs
+++ b/examples/stm32l0/src/bin/button.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -12,7 +11,7 @@ async fn main(_spawner: Spawner) {
12 let p = embassy_stm32::init(Default::default()); 11 let p = embassy_stm32::init(Default::default());
13 info!("Hello World!"); 12 info!("Hello World!");
14 13
15 let button = Input::new(p.PB2, Pull::Up); 14 let mut button = Input::new(p.PB2, Pull::Up);
16 let mut led1 = Output::new(p.PA5, Level::High, Speed::Low); 15 let mut led1 = Output::new(p.PA5, Level::High, Speed::Low);
17 let mut led2 = Output::new(p.PB5, Level::High, Speed::Low); 16 let mut led2 = Output::new(p.PB5, Level::High, Speed::Low);
18 17
diff --git a/examples/stm32l0/src/bin/button_exti.rs b/examples/stm32l0/src/bin/button_exti.rs
index ffede253e..f517fce04 100644
--- a/examples/stm32l0/src/bin/button_exti.rs
+++ b/examples/stm32l0/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l0/src/bin/flash.rs b/examples/stm32l0/src/bin/flash.rs
index 86f6c70b9..1865748fd 100644
--- a/examples/stm32l0/src/bin/flash.rs
+++ b/examples/stm32l0/src/bin/flash.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l0/src/bin/spi.rs b/examples/stm32l0/src/bin/spi.rs
index 583e3d127..f23a537b8 100644
--- a/examples/stm32l0/src/bin/spi.rs
+++ b/examples/stm32l0/src/bin/spi.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l0/src/bin/usart_dma.rs b/examples/stm32l0/src/bin/usart_dma.rs
index 62c9b5595..74889c838 100644
--- a/examples/stm32l0/src/bin/usart_dma.rs
+++ b/examples/stm32l0/src/bin/usart_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l0/src/bin/usart_irq.rs b/examples/stm32l0/src/bin/usart_irq.rs
index 5107a1a0a..2c96a8bc2 100644
--- a/examples/stm32l0/src/bin/usart_irq.rs
+++ b/examples/stm32l0/src/bin/usart_irq.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l1/Cargo.toml b/examples/stm32l1/Cargo.toml
index 23dd0ef87..071d6a502 100644
--- a/examples/stm32l1/Cargo.toml
+++ b/examples/stm32l1/Cargo.toml
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 8embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
9embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 9embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
10embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 10embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] }
12 12
diff --git a/examples/stm32l1/src/bin/blinky.rs b/examples/stm32l1/src/bin/blinky.rs
index 06f732eb7..da6777b2d 100644
--- a/examples/stm32l1/src/bin/blinky.rs
+++ b/examples/stm32l1/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l1/src/bin/flash.rs b/examples/stm32l1/src/bin/flash.rs
index aeb535cca..e9ce4eae8 100644
--- a/examples/stm32l1/src/bin/flash.rs
+++ b/examples/stm32l1/src/bin/flash.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l1/src/bin/spi.rs b/examples/stm32l1/src/bin/spi.rs
index 905b4d75c..8be686c5a 100644
--- a/examples/stm32l1/src/bin/spi.rs
+++ b/examples/stm32l1/src/bin/spi.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml
index a936d27c3..8a5fb5749 100644
--- a/examples/stm32l4/Cargo.toml
+++ b/examples/stm32l4/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32l4s5vi to your chip name, if necessary. 8# Change stm32l4s5vi to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32l4s5qi", "memory-x", "time-driver-any", "exti", "chrono"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32l4s5qi", "memory-x", "time-driver-any", "exti", "chrono"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768", ] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768", ] }
13embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } 13embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" }
14embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 14embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
@@ -24,15 +24,15 @@ defmt-rtt = "0.4"
24cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } 24cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
25cortex-m-rt = "0.7.0" 25cortex-m-rt = "0.7.0"
26embedded-hal = "0.2.6" 26embedded-hal = "0.2.6"
27embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } 27embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.3" }
28embedded-hal-async = { version = "=1.0.0-rc.2" } 28embedded-hal-async = { version = "=1.0.0-rc.3" }
29embedded-hal-bus = { version = "=0.1.0-rc.2", features = ["async"] } 29embedded-hal-bus = { version = "=0.1.0-rc.3", features = ["async"] }
30panic-probe = { version = "0.3", features = ["print-defmt"] } 30panic-probe = { version = "0.3", features = ["print-defmt"] }
31futures = { version = "0.3.17", default-features = false, features = ["async-await"] } 31futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
32heapless = { version = "0.8", default-features = false } 32heapless = { version = "0.8", default-features = false }
33chrono = { version = "^0.4", default-features = false } 33chrono = { version = "^0.4", default-features = false }
34rand = { version = "0.8.5", default-features = false } 34rand = { version = "0.8.5", default-features = false }
35static_cell = { version = "2", features = ["nightly"]} 35static_cell = "2"
36 36
37micromath = "2.0.0" 37micromath = "2.0.0"
38 38
diff --git a/examples/stm32l4/src/bin/adc.rs b/examples/stm32l4/src/bin/adc.rs
index a0ec5c33e..d01e9f1b3 100644
--- a/examples/stm32l4/src/bin/adc.rs
+++ b/examples/stm32l4/src/bin/adc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_stm32::adc::{Adc, Resolution}; 5use embassy_stm32::adc::{Adc, Resolution};
diff --git a/examples/stm32l4/src/bin/blinky.rs b/examples/stm32l4/src/bin/blinky.rs
index 6202fe2f7..b55dfd35e 100644
--- a/examples/stm32l4/src/bin/blinky.rs
+++ b/examples/stm32l4/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l4/src/bin/button.rs b/examples/stm32l4/src/bin/button.rs
index 73b1962e8..15288c61e 100644
--- a/examples/stm32l4/src/bin/button.rs
+++ b/examples/stm32l4/src/bin/button.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_stm32::gpio::{Input, Pull}; 5use embassy_stm32::gpio::{Input, Pull};
@@ -12,7 +11,7 @@ fn main() -> ! {
12 11
13 let p = embassy_stm32::init(Default::default()); 12 let p = embassy_stm32::init(Default::default());
14 13
15 let button = Input::new(p.PC13, Pull::Up); 14 let mut button = Input::new(p.PC13, Pull::Up);
16 15
17 loop { 16 loop {
18 if button.is_high() { 17 if button.is_high() {
diff --git a/examples/stm32l4/src/bin/button_exti.rs b/examples/stm32l4/src/bin/button_exti.rs
index ef32d4c4a..1e970fdd6 100644
--- a/examples/stm32l4/src/bin/button_exti.rs
+++ b/examples/stm32l4/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l4/src/bin/dac.rs b/examples/stm32l4/src/bin/dac.rs
index d6a7ff624..fdbf1d374 100644
--- a/examples/stm32l4/src/bin/dac.rs
+++ b/examples/stm32l4/src/bin/dac.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_stm32::dac::{DacCh1, Value}; 5use embassy_stm32::dac::{DacCh1, Value};
diff --git a/examples/stm32l4/src/bin/dac_dma.rs b/examples/stm32l4/src/bin/dac_dma.rs
index dc86dbf43..8e5098557 100644
--- a/examples/stm32l4/src/bin/dac_dma.rs
+++ b/examples/stm32l4/src/bin/dac_dma.rs
@@ -1,11 +1,10 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
7use embassy_stm32::dac::{DacCh1, DacCh2, ValueArray}; 6use embassy_stm32::dac::{DacCh1, DacCh2, ValueArray};
8use embassy_stm32::pac::timer::vals::{Mms, Opm}; 7use embassy_stm32::pac::timer::vals::Mms;
9use embassy_stm32::peripherals::{DAC1, DMA1_CH3, DMA1_CH4, TIM6, TIM7}; 8use embassy_stm32::peripherals::{DAC1, DMA1_CH3, DMA1_CH4, TIM6, TIM7};
10use embassy_stm32::rcc::low_level::RccPeripheral; 9use embassy_stm32::rcc::low_level::RccPeripheral;
11use embassy_stm32::time::Hertz; 10use embassy_stm32::time::Hertz;
@@ -50,7 +49,7 @@ async fn dac_task1(mut dac: DacCh1<'static, DAC1, DMA1_CH3>) {
50 TIM6::regs().arr().modify(|w| w.set_arr(reload as u16 - 1)); 49 TIM6::regs().arr().modify(|w| w.set_arr(reload as u16 - 1));
51 TIM6::regs().cr2().modify(|w| w.set_mms(Mms::UPDATE)); 50 TIM6::regs().cr2().modify(|w| w.set_mms(Mms::UPDATE));
52 TIM6::regs().cr1().modify(|w| { 51 TIM6::regs().cr1().modify(|w| {
53 w.set_opm(Opm::DISABLED); 52 w.set_opm(false);
54 w.set_cen(true); 53 w.set_cen(true);
55 }); 54 });
56 55
@@ -87,7 +86,7 @@ async fn dac_task2(mut dac: DacCh2<'static, DAC1, DMA1_CH4>) {
87 TIM7::regs().arr().modify(|w| w.set_arr(reload as u16 - 1)); 86 TIM7::regs().arr().modify(|w| w.set_arr(reload as u16 - 1));
88 TIM7::regs().cr2().modify(|w| w.set_mms(Mms::UPDATE)); 87 TIM7::regs().cr2().modify(|w| w.set_mms(Mms::UPDATE));
89 TIM7::regs().cr1().modify(|w| { 88 TIM7::regs().cr1().modify(|w| {
90 w.set_opm(Opm::DISABLED); 89 w.set_opm(false);
91 w.set_cen(true); 90 w.set_cen(true);
92 }); 91 });
93 92
diff --git a/examples/stm32l4/src/bin/i2c.rs b/examples/stm32l4/src/bin/i2c.rs
index 07dc12e8c..f553deb82 100644
--- a/examples/stm32l4/src/bin/i2c.rs
+++ b/examples/stm32l4/src/bin/i2c.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l4/src/bin/i2c_blocking_async.rs b/examples/stm32l4/src/bin/i2c_blocking_async.rs
index 60a4e2eb3..1b8652bcc 100644
--- a/examples/stm32l4/src/bin/i2c_blocking_async.rs
+++ b/examples/stm32l4/src/bin/i2c_blocking_async.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_embedded_hal::adapter::BlockingAsync; 5use embassy_embedded_hal::adapter::BlockingAsync;
diff --git a/examples/stm32l4/src/bin/i2c_dma.rs b/examples/stm32l4/src/bin/i2c_dma.rs
index 4c2c224a6..794972a33 100644
--- a/examples/stm32l4/src/bin/i2c_dma.rs
+++ b/examples/stm32l4/src/bin/i2c_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l4/src/bin/mco.rs b/examples/stm32l4/src/bin/mco.rs
index 504879887..36c002952 100644
--- a/examples/stm32l4/src/bin/mco.rs
+++ b/examples/stm32l4/src/bin/mco.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l4/src/bin/rng.rs b/examples/stm32l4/src/bin/rng.rs
index e5ad56fb9..638b3e9e4 100644
--- a/examples/stm32l4/src/bin/rng.rs
+++ b/examples/stm32l4/src/bin/rng.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l4/src/bin/rtc.rs b/examples/stm32l4/src/bin/rtc.rs
index d2a2aa1f2..526620bfb 100644
--- a/examples/stm32l4/src/bin/rtc.rs
+++ b/examples/stm32l4/src/bin/rtc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use chrono::{NaiveDate, NaiveDateTime}; 4use chrono::{NaiveDate, NaiveDateTime};
6use defmt::*; 5use defmt::*;
diff --git a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs
index 4826e0bed..9565ae168 100644
--- a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs
+++ b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs
@@ -1,10 +1,7 @@
1#![deny(clippy::pedantic)]
2#![allow(clippy::doc_markdown)]
3#![no_main] 1#![no_main]
4#![no_std] 2#![no_std]
5// Needed unitl https://github.com/rust-lang/rust/issues/63063 is stablised. 3#![deny(clippy::pedantic)]
6#![feature(type_alias_impl_trait)] 4#![allow(clippy::doc_markdown)]
7#![feature(associated_type_bounds)]
8#![allow(clippy::missing_errors_doc)] 5#![allow(clippy::missing_errors_doc)]
9 6
10// This example works on a ANALOG DEVICE EVAL-ADIN110EBZ board. 7// This example works on a ANALOG DEVICE EVAL-ADIN110EBZ board.
@@ -36,7 +33,7 @@ use hal::rng::{self, Rng};
36use hal::{bind_interrupts, exti, pac, peripherals}; 33use hal::{bind_interrupts, exti, pac, peripherals};
37use heapless::Vec; 34use heapless::Vec;
38use rand::RngCore; 35use rand::RngCore;
39use static_cell::make_static; 36use static_cell::StaticCell;
40use {embassy_stm32 as hal, panic_probe as _}; 37use {embassy_stm32 as hal, panic_probe as _};
41 38
42bind_interrupts!(struct Irqs { 39bind_interrupts!(struct Irqs {
@@ -114,8 +111,8 @@ async fn main(spawner: Spawner) {
114 let led_uc4_blue = Output::new(dp.PG15, Level::High, Speed::Low); 111 let led_uc4_blue = Output::new(dp.PG15, Level::High, Speed::Low);
115 112
116 // Read the uc_cfg switches 113 // Read the uc_cfg switches
117 let uc_cfg0 = Input::new(dp.PB2, Pull::None); 114 let mut uc_cfg0 = Input::new(dp.PB2, Pull::None);
118 let uc_cfg1 = Input::new(dp.PF11, Pull::None); 115 let mut uc_cfg1 = Input::new(dp.PF11, Pull::None);
119 let _uc_cfg2 = Input::new(dp.PG6, Pull::None); 116 let _uc_cfg2 = Input::new(dp.PG6, Pull::None);
120 let _uc_cfg3 = Input::new(dp.PG11, Pull::None); 117 let _uc_cfg3 = Input::new(dp.PG11, Pull::None);
121 118
@@ -133,8 +130,8 @@ async fn main(spawner: Spawner) {
133 130
134 // Setup IO and SPI for the SPE chip 131 // Setup IO and SPI for the SPE chip
135 let spe_reset_n = Output::new(dp.PC7, Level::Low, Speed::Low); 132 let spe_reset_n = Output::new(dp.PC7, Level::Low, Speed::Low);
136 let spe_cfg0 = Input::new(dp.PC8, Pull::None); 133 let mut spe_cfg0 = Input::new(dp.PC8, Pull::None);
137 let spe_cfg1 = Input::new(dp.PC9, Pull::None); 134 let mut spe_cfg1 = Input::new(dp.PC9, Pull::None);
138 let _spe_ts_capt = Output::new(dp.PC6, Level::Low, Speed::Low); 135 let _spe_ts_capt = Output::new(dp.PC6, Level::Low, Speed::Low);
139 136
140 let spe_int = Input::new(dp.PB11, Pull::None); 137 let spe_int = Input::new(dp.PB11, Pull::None);
@@ -180,7 +177,8 @@ async fn main(spawner: Spawner) {
180 } 177 }
181 }; 178 };
182 179
183 let state = make_static!(embassy_net_adin1110::State::<8, 8>::new()); 180 static STATE: StaticCell<embassy_net_adin1110::State<8, 8>> = StaticCell::new();
181 let state = STATE.init(embassy_net_adin1110::State::<8, 8>::new());
184 182
185 let (device, runner) = embassy_net_adin1110::new( 183 let (device, runner) = embassy_net_adin1110::new(
186 MAC, 184 MAC,
@@ -217,11 +215,13 @@ async fn main(spawner: Spawner) {
217 }; 215 };
218 216
219 // Init network stack 217 // Init network stack
220 let stack = &*make_static!(Stack::new( 218 static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new();
219 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
220 let stack = &*STACK.init(Stack::new(
221 device, 221 device,
222 ip_cfg, 222 ip_cfg,
223 make_static!(StackResources::<2>::new()), 223 RESOURCES.init(StackResources::<2>::new()),
224 seed 224 seed,
225 )); 225 ));
226 226
227 // Launch network task 227 // Launch network task
diff --git a/examples/stm32l4/src/bin/spi.rs b/examples/stm32l4/src/bin/spi.rs
index 54cf68f7b..6653e4516 100644
--- a/examples/stm32l4/src/bin/spi.rs
+++ b/examples/stm32l4/src/bin/spi.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_stm32::dma::NoDma; 5use embassy_stm32::dma::NoDma;
diff --git a/examples/stm32l4/src/bin/spi_blocking_async.rs b/examples/stm32l4/src/bin/spi_blocking_async.rs
index f1b80087c..a989a5a4a 100644
--- a/examples/stm32l4/src/bin/spi_blocking_async.rs
+++ b/examples/stm32l4/src/bin/spi_blocking_async.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_embedded_hal::adapter::BlockingAsync; 5use embassy_embedded_hal::adapter::BlockingAsync;
@@ -30,7 +29,7 @@ async fn main(_spawner: Spawner) {
30 let _wake = Output::new(p.PB13, Level::Low, Speed::VeryHigh); 29 let _wake = Output::new(p.PB13, Level::Low, Speed::VeryHigh);
31 let mut reset = Output::new(p.PE8, Level::Low, Speed::VeryHigh); 30 let mut reset = Output::new(p.PE8, Level::Low, Speed::VeryHigh);
32 let mut cs = Output::new(p.PE0, Level::High, Speed::VeryHigh); 31 let mut cs = Output::new(p.PE0, Level::High, Speed::VeryHigh);
33 let ready = Input::new(p.PE1, Pull::Up); 32 let mut ready = Input::new(p.PE1, Pull::Up);
34 33
35 cortex_m::asm::delay(100_000); 34 cortex_m::asm::delay(100_000);
36 reset.set_high(); 35 reset.set_high();
diff --git a/examples/stm32l4/src/bin/spi_dma.rs b/examples/stm32l4/src/bin/spi_dma.rs
index ff9b5b43b..7922165df 100644
--- a/examples/stm32l4/src/bin/spi_dma.rs
+++ b/examples/stm32l4/src/bin/spi_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -25,7 +24,7 @@ async fn main(_spawner: Spawner) {
25 let _wake = Output::new(p.PB13, Level::Low, Speed::VeryHigh); 24 let _wake = Output::new(p.PB13, Level::Low, Speed::VeryHigh);
26 let mut reset = Output::new(p.PE8, Level::Low, Speed::VeryHigh); 25 let mut reset = Output::new(p.PE8, Level::Low, Speed::VeryHigh);
27 let mut cs = Output::new(p.PE0, Level::High, Speed::VeryHigh); 26 let mut cs = Output::new(p.PE0, Level::High, Speed::VeryHigh);
28 let ready = Input::new(p.PE1, Pull::Up); 27 let mut ready = Input::new(p.PE1, Pull::Up);
29 28
30 cortex_m::asm::delay(100_000); 29 cortex_m::asm::delay(100_000);
31 reset.set_high(); 30 reset.set_high();
diff --git a/examples/stm32l4/src/bin/usart.rs b/examples/stm32l4/src/bin/usart.rs
index f4da6b5ae..7bab23950 100644
--- a/examples/stm32l4/src/bin/usart.rs
+++ b/examples/stm32l4/src/bin/usart.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_stm32::dma::NoDma; 5use embassy_stm32::dma::NoDma;
diff --git a/examples/stm32l4/src/bin/usart_dma.rs b/examples/stm32l4/src/bin/usart_dma.rs
index 2f3b2a0f0..031888f70 100644
--- a/examples/stm32l4/src/bin/usart_dma.rs
+++ b/examples/stm32l4/src/bin/usart_dma.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::fmt::Write; 4use core::fmt::Write;
6 5
diff --git a/examples/stm32l4/src/bin/usb_serial.rs b/examples/stm32l4/src/bin/usb_serial.rs
index 4baf5f05d..8cc9a7aed 100644
--- a/examples/stm32l4/src/bin/usb_serial.rs
+++ b/examples/stm32l4/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{panic, *}; 4use defmt::{panic, *};
6use defmt_rtt as _; // global logger 5use defmt_rtt as _; // global logger
diff --git a/examples/stm32l5/Cargo.toml b/examples/stm32l5/Cargo.toml
index 2557ef42d..0d236ec90 100644
--- a/examples/stm32l5/Cargo.toml
+++ b/examples/stm32l5/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32l552ze to your chip name, if necessary. 8# Change stm32l552ze to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "memory-x"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "memory-x"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
14embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] } 14embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"] }
@@ -26,7 +26,7 @@ futures = { version = "0.3.17", default-features = false, features = ["async-awa
26heapless = { version = "0.8", default-features = false } 26heapless = { version = "0.8", default-features = false }
27rand_core = { version = "0.6.3", default-features = false } 27rand_core = { version = "0.6.3", default-features = false }
28embedded-io-async = { version = "0.6.1" } 28embedded-io-async = { version = "0.6.1" }
29static_cell = { version = "2", features = ["nightly"]} 29static_cell = "2"
30 30
31[profile.release] 31[profile.release]
32debug = 2 32debug = 2
diff --git a/examples/stm32l5/src/bin/button_exti.rs b/examples/stm32l5/src/bin/button_exti.rs
index e80ad2b3a..91d0ccc2e 100644
--- a/examples/stm32l5/src/bin/button_exti.rs
+++ b/examples/stm32l5/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l5/src/bin/rng.rs b/examples/stm32l5/src/bin/rng.rs
index 279f4f65d..50da6c946 100644
--- a/examples/stm32l5/src/bin/rng.rs
+++ b/examples/stm32l5/src/bin/rng.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs
index 0b0a0e2db..88060b6b0 100644
--- a/examples/stm32l5/src/bin/usb_ethernet.rs
+++ b/examples/stm32l5/src/bin/usb_ethernet.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -15,7 +14,7 @@ use embassy_usb::class::cdc_ncm::{CdcNcmClass, State};
15use embassy_usb::{Builder, UsbDevice}; 14use embassy_usb::{Builder, UsbDevice};
16use embedded_io_async::Write; 15use embedded_io_async::Write;
17use rand_core::RngCore; 16use rand_core::RngCore;
18use static_cell::make_static; 17use static_cell::StaticCell;
19use {defmt_rtt as _, panic_probe as _}; 18use {defmt_rtt as _, panic_probe as _};
20 19
21type MyDriver = Driver<'static, embassy_stm32::peripherals::USB>; 20type MyDriver = Driver<'static, embassy_stm32::peripherals::USB>;
@@ -76,14 +75,18 @@ async fn main(spawner: Spawner) {
76 config.device_protocol = 0x01; 75 config.device_protocol = 0x01;
77 76
78 // Create embassy-usb DeviceBuilder using the driver and config. 77 // Create embassy-usb DeviceBuilder using the driver and config.
78 static DEVICE_DESC: StaticCell<[u8; 256]> = StaticCell::new();
79 static CONFIG_DESC: StaticCell<[u8; 256]> = StaticCell::new();
80 static BOS_DESC: StaticCell<[u8; 256]> = StaticCell::new();
81 static CONTROL_BUF: StaticCell<[u8; 128]> = StaticCell::new();
79 let mut builder = Builder::new( 82 let mut builder = Builder::new(
80 driver, 83 driver,
81 config, 84 config,
82 &mut make_static!([0; 256])[..], 85 &mut DEVICE_DESC.init([0; 256])[..],
83 &mut make_static!([0; 256])[..], 86 &mut CONFIG_DESC.init([0; 256])[..],
84 &mut make_static!([0; 256])[..], 87 &mut BOS_DESC.init([0; 256])[..],
85 &mut [], // no msos descriptors 88 &mut [], // no msos descriptors
86 &mut make_static!([0; 128])[..], 89 &mut CONTROL_BUF.init([0; 128])[..],
87 ); 90 );
88 91
89 // Our MAC addr. 92 // Our MAC addr.
@@ -92,14 +95,16 @@ async fn main(spawner: Spawner) {
92 let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88]; 95 let host_mac_addr = [0x88, 0x88, 0x88, 0x88, 0x88, 0x88];
93 96
94 // Create classes on the builder. 97 // Create classes on the builder.
95 let class = CdcNcmClass::new(&mut builder, make_static!(State::new()), host_mac_addr, 64); 98 static STATE: StaticCell<State> = StaticCell::new();
99 let class = CdcNcmClass::new(&mut builder, STATE.init(State::new()), host_mac_addr, 64);
96 100
97 // Build the builder. 101 // Build the builder.
98 let usb = builder.build(); 102 let usb = builder.build();
99 103
100 unwrap!(spawner.spawn(usb_task(usb))); 104 unwrap!(spawner.spawn(usb_task(usb)));
101 105
102 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); 106 static NET_STATE: StaticCell<NetState<MTU, 4, 4>> = StaticCell::new();
107 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(NET_STATE.init(NetState::new()), our_mac_addr);
103 unwrap!(spawner.spawn(usb_ncm_task(runner))); 108 unwrap!(spawner.spawn(usb_ncm_task(runner)));
104 109
105 let config = embassy_net::Config::dhcpv4(Default::default()); 110 let config = embassy_net::Config::dhcpv4(Default::default());
@@ -114,11 +119,13 @@ async fn main(spawner: Spawner) {
114 let seed = rng.next_u64(); 119 let seed = rng.next_u64();
115 120
116 // Init network stack 121 // Init network stack
117 let stack = &*make_static!(Stack::new( 122 static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new();
123 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
124 let stack = &*STACK.init(Stack::new(
118 device, 125 device,
119 config, 126 config,
120 make_static!(StackResources::<2>::new()), 127 RESOURCES.init(StackResources::<2>::new()),
121 seed 128 seed,
122 )); 129 ));
123 130
124 unwrap!(spawner.spawn(net_task(stack))); 131 unwrap!(spawner.spawn(net_task(stack)));
diff --git a/examples/stm32l5/src/bin/usb_hid_mouse.rs b/examples/stm32l5/src/bin/usb_hid_mouse.rs
index 3614a8e0a..7c8a8ebfb 100644
--- a/examples/stm32l5/src/bin/usb_hid_mouse.rs
+++ b/examples/stm32l5/src/bin/usb_hid_mouse.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32l5/src/bin/usb_serial.rs b/examples/stm32l5/src/bin/usb_serial.rs
index f2b894b68..75053ce4b 100644
--- a/examples/stm32l5/src/bin/usb_serial.rs
+++ b/examples/stm32l5/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{panic, *}; 4use defmt::{panic, *};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32u5/Cargo.toml b/examples/stm32u5/Cargo.toml
index 1afbd8db4..029b2cfe0 100644
--- a/examples/stm32u5/Cargo.toml
+++ b/examples/stm32u5/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32u585ai to your chip name, if necessary. 8# Change stm32u585ai to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 13embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
14 14
diff --git a/examples/stm32u5/src/bin/blinky.rs b/examples/stm32u5/src/bin/blinky.rs
index 4b44cb12b..7fe88c183 100644
--- a/examples/stm32u5/src/bin/blinky.rs
+++ b/examples/stm32u5/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32u5/src/bin/boot.rs b/examples/stm32u5/src/bin/boot.rs
index e2112ce5c..23c7f8b22 100644
--- a/examples/stm32u5/src/bin/boot.rs
+++ b/examples/stm32u5/src/bin/boot.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use {defmt_rtt as _, embassy_stm32 as _, panic_probe as _}; 5use {defmt_rtt as _, embassy_stm32 as _, panic_probe as _};
diff --git a/examples/stm32u5/src/bin/usb_serial.rs b/examples/stm32u5/src/bin/usb_serial.rs
index 839d6472f..44d1df4f1 100644
--- a/examples/stm32u5/src/bin/usb_serial.rs
+++ b/examples/stm32u5/src/bin/usb_serial.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{panic, *}; 4use defmt::{panic, *};
6use defmt_rtt as _; // global logger 5use defmt_rtt as _; // global logger
diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml
index ada1f32e9..bce53c440 100644
--- a/examples/stm32wb/Cargo.toml
+++ b/examples/stm32wb/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wb55rg", "time-driver-any", "memory-x", "exti"] }
10embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wb55rg"] } 10embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wb55rg"] }
11embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 11embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
12embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 12embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
13embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 13embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
14embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", ], optional=true } 14embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", ], optional=true }
15 15
@@ -22,7 +22,7 @@ embedded-hal = "0.2.6"
22panic-probe = { version = "0.3", features = ["print-defmt"] } 22panic-probe = { version = "0.3", features = ["print-defmt"] }
23futures = { version = "0.3.17", default-features = false, features = ["async-await"] } 23futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
24heapless = { version = "0.8", default-features = false } 24heapless = { version = "0.8", default-features = false }
25static_cell = { version = "2", features = ["nightly"]} 25static_cell = "2"
26 26
27[features] 27[features]
28default = ["ble", "mac"] 28default = ["ble", "mac"]
diff --git a/examples/stm32wb/src/bin/blinky.rs b/examples/stm32wb/src/bin/blinky.rs
index 1394f03fa..f37e8b1d8 100644
--- a/examples/stm32wb/src/bin/blinky.rs
+++ b/examples/stm32wb/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wb/src/bin/button_exti.rs b/examples/stm32wb/src/bin/button_exti.rs
index 3648db6ff..d34dde3e9 100644
--- a/examples/stm32wb/src/bin/button_exti.rs
+++ b/examples/stm32wb/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wb/src/bin/eddystone_beacon.rs b/examples/stm32wb/src/bin/eddystone_beacon.rs
index e58da8e35..cf9a5aa28 100644
--- a/examples/stm32wb/src/bin/eddystone_beacon.rs
+++ b/examples/stm32wb/src/bin/eddystone_beacon.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::time::Duration; 4use core::time::Duration;
6 5
diff --git a/examples/stm32wb/src/bin/gatt_server.rs b/examples/stm32wb/src/bin/gatt_server.rs
index 80e835c1d..5ce620350 100644
--- a/examples/stm32wb/src/bin/gatt_server.rs
+++ b/examples/stm32wb/src/bin/gatt_server.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use core::time::Duration; 4use core::time::Duration;
6 5
diff --git a/examples/stm32wb/src/bin/mac_ffd.rs b/examples/stm32wb/src/bin/mac_ffd.rs
index 881dc488d..5cd660543 100644
--- a/examples/stm32wb/src/bin/mac_ffd.rs
+++ b/examples/stm32wb/src/bin/mac_ffd.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wb/src/bin/mac_ffd_net.rs b/examples/stm32wb/src/bin/mac_ffd_net.rs
index f8c76b5a4..7a42bf577 100644
--- a/examples/stm32wb/src/bin/mac_ffd_net.rs
+++ b/examples/stm32wb/src/bin/mac_ffd_net.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
@@ -12,7 +11,7 @@ use embassy_stm32_wpan::mac::typedefs::{MacChannel, PanId, PibId};
12use embassy_stm32_wpan::mac::{self, Runner}; 11use embassy_stm32_wpan::mac::{self, Runner};
13use embassy_stm32_wpan::sub::mm; 12use embassy_stm32_wpan::sub::mm;
14use embassy_stm32_wpan::TlMbox; 13use embassy_stm32_wpan::TlMbox;
15use static_cell::make_static; 14use static_cell::StaticCell;
16use {defmt_rtt as _, panic_probe as _}; 15use {defmt_rtt as _, panic_probe as _};
17 16
18bind_interrupts!(struct Irqs{ 17bind_interrupts!(struct Irqs{
@@ -154,15 +153,21 @@ async fn main(spawner: Spawner) {
154 .unwrap(); 153 .unwrap();
155 defmt::info!("{:#x}", mbox.mac_subsystem.read().await.unwrap()); 154 defmt::info!("{:#x}", mbox.mac_subsystem.read().await.unwrap());
156 155
156 static TX1: StaticCell<[u8; 127]> = StaticCell::new();
157 static TX2: StaticCell<[u8; 127]> = StaticCell::new();
158 static TX3: StaticCell<[u8; 127]> = StaticCell::new();
159 static TX4: StaticCell<[u8; 127]> = StaticCell::new();
160 static TX5: StaticCell<[u8; 127]> = StaticCell::new();
157 let tx_queue = [ 161 let tx_queue = [
158 make_static!([0u8; 127]), 162 TX1.init([0u8; 127]),
159 make_static!([0u8; 127]), 163 TX2.init([0u8; 127]),
160 make_static!([0u8; 127]), 164 TX3.init([0u8; 127]),
161 make_static!([0u8; 127]), 165 TX4.init([0u8; 127]),
162 make_static!([0u8; 127]), 166 TX5.init([0u8; 127]),
163 ]; 167 ];
164 168
165 let runner = make_static!(Runner::new(mbox.mac_subsystem, tx_queue)); 169 static RUNNER: StaticCell<Runner> = StaticCell::new();
170 let runner = RUNNER.init(Runner::new(mbox.mac_subsystem, tx_queue));
166 171
167 spawner.spawn(run_mac(runner)).unwrap(); 172 spawner.spawn(run_mac(runner)).unwrap();
168 173
diff --git a/examples/stm32wb/src/bin/mac_rfd.rs b/examples/stm32wb/src/bin/mac_rfd.rs
index 000355de6..7949211fb 100644
--- a/examples/stm32wb/src/bin/mac_rfd.rs
+++ b/examples/stm32wb/src/bin/mac_rfd.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wb/src/bin/tl_mbox.rs b/examples/stm32wb/src/bin/tl_mbox.rs
index 9d0e0070c..cb92d462d 100644
--- a/examples/stm32wb/src/bin/tl_mbox.rs
+++ b/examples/stm32wb/src/bin/tl_mbox.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wb/src/bin/tl_mbox_ble.rs b/examples/stm32wb/src/bin/tl_mbox_ble.rs
index 12c6aeebb..2599e1151 100644
--- a/examples/stm32wb/src/bin/tl_mbox_ble.rs
+++ b/examples/stm32wb/src/bin/tl_mbox_ble.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wb/src/bin/tl_mbox_mac.rs b/examples/stm32wb/src/bin/tl_mbox_mac.rs
index f32e07d96..5d868412a 100644
--- a/examples/stm32wb/src/bin/tl_mbox_mac.rs
+++ b/examples/stm32wb/src/bin/tl_mbox_mac.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wba/Cargo.toml b/examples/stm32wba/Cargo.toml
index c97605937..84eb6c831 100644
--- a/examples/stm32wba/Cargo.toml
+++ b/examples/stm32wba/Cargo.toml
@@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
7[dependencies] 7[dependencies]
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba52cg", "time-driver-any", "memory-x", "exti"] } 8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba52cg", "time-driver-any", "memory-x", "exti"] }
9embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 9embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
10embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 10embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
11embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 11embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
12embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", ], optional=true } 12embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", ], optional=true }
13 13
@@ -20,7 +20,7 @@ embedded-hal = "0.2.6"
20panic-probe = { version = "0.3", features = ["print-defmt"] } 20panic-probe = { version = "0.3", features = ["print-defmt"] }
21futures = { version = "0.3.17", default-features = false, features = ["async-await"] } 21futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
22heapless = { version = "0.8", default-features = false } 22heapless = { version = "0.8", default-features = false }
23static_cell = { version = "2", features = ["nightly"]} 23static_cell = "2"
24 24
25[profile.release] 25[profile.release]
26debug = 2 26debug = 2
diff --git a/examples/stm32wba/src/bin/blinky.rs b/examples/stm32wba/src/bin/blinky.rs
index 6b9635e66..0d803b257 100644
--- a/examples/stm32wba/src/bin/blinky.rs
+++ b/examples/stm32wba/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wba/src/bin/button_exti.rs b/examples/stm32wba/src/bin/button_exti.rs
index ef32d4c4a..1e970fdd6 100644
--- a/examples/stm32wba/src/bin/button_exti.rs
+++ b/examples/stm32wba/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wl/Cargo.toml b/examples/stm32wl/Cargo.toml
index 070d27cb6..62c34b792 100644
--- a/examples/stm32wl/Cargo.toml
+++ b/examples/stm32wl/Cargo.toml
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
8# Change stm32wl55jc-cm4 to your chip name, if necessary. 8# Change stm32wl55jc-cm4 to your chip name, if necessary.
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti", "chrono"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti", "chrono"] }
10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 12embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } 13embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" }
14 14
diff --git a/examples/stm32wl/src/bin/blinky.rs b/examples/stm32wl/src/bin/blinky.rs
index 5bd5745f0..347bd093f 100644
--- a/examples/stm32wl/src/bin/blinky.rs
+++ b/examples/stm32wl/src/bin/blinky.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wl/src/bin/button.rs b/examples/stm32wl/src/bin/button.rs
index 982a7a112..3397e5ba6 100644
--- a/examples/stm32wl/src/bin/button.rs
+++ b/examples/stm32wl/src/bin/button.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use cortex_m_rt::entry; 4use cortex_m_rt::entry;
6use defmt::*; 5use defmt::*;
@@ -13,7 +12,7 @@ fn main() -> ! {
13 12
14 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
15 14
16 let button = Input::new(p.PA0, Pull::Up); 15 let mut button = Input::new(p.PA0, Pull::Up);
17 let mut led1 = Output::new(p.PB15, Level::High, Speed::Low); 16 let mut led1 = Output::new(p.PB15, Level::High, Speed::Low);
18 let mut led2 = Output::new(p.PB9, Level::High, Speed::Low); 17 let mut led2 = Output::new(p.PB9, Level::High, Speed::Low);
19 18
diff --git a/examples/stm32wl/src/bin/button_exti.rs b/examples/stm32wl/src/bin/button_exti.rs
index 1f02db5cf..e6ad4b80b 100644
--- a/examples/stm32wl/src/bin/button_exti.rs
+++ b/examples/stm32wl/src/bin/button_exti.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wl/src/bin/flash.rs b/examples/stm32wl/src/bin/flash.rs
index 5e52d49ec..0b7417c01 100644
--- a/examples/stm32wl/src/bin/flash.rs
+++ b/examples/stm32wl/src/bin/flash.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::{info, unwrap}; 4use defmt::{info, unwrap};
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wl/src/bin/random.rs b/examples/stm32wl/src/bin/random.rs
index 2fd234966..3610392be 100644
--- a/examples/stm32wl/src/bin/random.rs
+++ b/examples/stm32wl/src/bin/random.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/stm32wl/src/bin/rtc.rs b/examples/stm32wl/src/bin/rtc.rs
index 4ffb0bb58..4738d5770 100644
--- a/examples/stm32wl/src/bin/rtc.rs
+++ b/examples/stm32wl/src/bin/rtc.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use chrono::{NaiveDate, NaiveDateTime}; 4use chrono::{NaiveDate, NaiveDateTime};
6use defmt::*; 5use defmt::*;
diff --git a/examples/stm32wl/src/bin/uart_async.rs b/examples/stm32wl/src/bin/uart_async.rs
index 44e8f83a2..8e545834c 100644
--- a/examples/stm32wl/src/bin/uart_async.rs
+++ b/examples/stm32wl/src/bin/uart_async.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4 3
5use defmt::*; 4use defmt::*;
6use embassy_executor::Spawner; 5use embassy_executor::Spawner;
diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml
index c96a428b9..305ebd526 100644
--- a/examples/wasm/Cargo.toml
+++ b/examples/wasm/Cargo.toml
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
9 9
10[dependencies] 10[dependencies]
11embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["log"] } 11embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["log"] }
12embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-wasm", "executor-thread", "log", "nightly", "integrated-timers"] } 12embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["arch-wasm", "executor-thread", "log", "integrated-timers"] }
13embassy-time = { version = "0.2", path = "../../embassy-time", features = ["log", "wasm", ] } 13embassy-time = { version = "0.2", path = "../../embassy-time", features = ["log", "wasm", ] }
14 14
15wasm-logger = "0.2.0" 15wasm-logger = "0.2.0"
diff --git a/examples/wasm/src/lib.rs b/examples/wasm/src/lib.rs
index 1141096fb..71cf980dd 100644
--- a/examples/wasm/src/lib.rs
+++ b/examples/wasm/src/lib.rs
@@ -1,5 +1,3 @@
1#![feature(type_alias_impl_trait)]
2
3use embassy_executor::Spawner; 1use embassy_executor::Spawner;
4use embassy_time::Timer; 2use embassy_time::Timer;
5 3