Embedded Swift on Raspberry Pi Pico W

Sdílet
Vložit
  • čas přidán 27. 08. 2024
  • My little journey in using Swift on the Pico W... lets just say it could be better....

Komentáře • 2

  • @ShivarajD25
    @ShivarajD25 Před měsícem +1

    I agree with many of the limitations that you pointed out here, but getting it running on Linux is pretty straight forward. I have created a simple docker with just the packages listed in the Raspberry Pi Pico SDK GitHub repository and it just works fine for the examples that uses the SDK, setting up the Dev environment of the baremetal example is the tough one.

    • @joseph-montanez
      @joseph-montanez  Před měsícem +1

      I ended up giving up on using Swift on the pico. Using the debug probe causes issues with sleep timers (it never ends). However the nail in the coffin, anymore more than their examples, you have to implement a custom dynamic memory allocation and atomic operations. I tried but they all result in panics. So I used -no-allocations, and this was fine with a big exception. Every fixed-sized buffer I created needed its own swift implementation for every single fixed sized. This includes things like splitting a buffer, reversing, etc. Unlike Rust where I can use lifetimes and generics, Swifts generic or even macro system cannot handle this. I was writing swift code to generate more swift code for every sized buffer.