Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: HOWTO develop teensy framework in structured manner?

  1. #1

    HOWTO develop teensy framework in structured manner?

    Hi All,
    I'm editing and updating code in the teensy framework, fixing buts, etc.

    Is there a preferred way to check out all the teensy repos from github, and edit them, rather than use the auto-downloaded code from the Arduino/platformio tools?

    My current method is using platformio command line tools, so I do this:

    Code:
    # pio init --board teensy41
    Edit some code and compile

    Code:
    # pio run
    Then,
    Code:
    cd ~.platformio/.../framework-aurduinoteensy/library
    mv Audio Audio.old
    git https://github.com/clone my_audio_library.git
    And do edits from there. It's really kind of icky.

    I'd prefer to

    Code:
    git clone my_teensy_repo.git  # <--- includes all needed repos as submodules
    Then point platformio to this newly checked out place.

    Any thoughts?

    Thanks,
    -Caleb

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,322
    Sorry I don't normally do anything with platform IO, so don't know it's limitations or the like.


    But what I typically do is:
    git clone stuff for the different libraries, core, ...
    Make edits and the like and submit Pull request on github...

    My work pattern is probably different than most, but I download most of my github projects to d:\github\<project>

    Note I am talking windows for commands but do something similar on Linus
    I then for libraries:
    I make a symbolic link in my case:
    cd \users\kurte\documents\arduino\libraries
    mklink /D audio d:\github\audio

    When you build on Arduino it will choose the directories in the <sketches>/libraries over the ones that teensyduino installed in the arduino/hardware/teensy... directories.

    For core: I end up renaming the cores directory to something like cores_release, and do the mklink in <arduino install/hardware/teensy/avr directory

    Then when updating to new releases I remove the links ...

  3. #3
    Ah! Thanks for the reply. Sounds about as ad-hoc as what I was doing :-)

    I just found a method with platformio that actually works reasonably well:

    I do a clone like you did of the libraries, but put them into <mylibdir>/framework-teensyduino, so it includes framework-teensyduino/cores, librarries, etc.

    Then, I can point platformio over to get the files directly from my local directory instead of git by doing something like this:

    platformio.ini
    Code:
    [env:teensy41-dev]
    board = teensy41
    framework = arduino
    
    platform = git@gitlab.com:signal-essence/teensy/platform-teensy.git
    
    ; For local development, use a local checkout of the framework                                                                                                                                                     
    platform_packages = framework-arduinoteensy @ file:///home/caleb/se/framework-arduinoteensy
    ;                                                                                                                                                                                                                  
    ; for non-local develoopment, use this one.                                                                                                                                                                               
    ;platform_packages = framework-arduinoteensy @ git@gitlab.com:<your local copy of the stuff>/framework-arduinoteensy.git
    Then when building I
    Code:
    rm -rf  ~/.platformio/packages/framework-arduinoteensy .pio/ && pio run
    to rebuild and make sure it picks up the latest edits.

    Thanks!

  4. #4
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    355
    Here's what I do:

    make the project directory:

    Code:
    mkdir audiotest
    initialize it:

    Code:
    cd audiotest
    pio init --board teensy41
    add the library to the lib directory:

    Code:
    cd lib
    git clone https://github.com/PaulStoffregen/Audio.git
    and put the project source in
    Code:
    src
    , for example I'll use the WavFilePLayer.ino:

    Code:
    cp Audio/examples/WavFilePlayer/WavFilePlayer.ino ../src
    This should, by default, use the Audio in the lib folder instead of downloading its own copy.

    Code:
    cd ..
    pio run
    If you make changes in lib/Audio/ then platformio should pick them up automatically.

  5. #5
    I should have known you'd have an easy way to do it my friend!

    Does it work for cores as well? I suppose I could test it myself ;-)

  6. #6
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    355
    Quote Originally Posted by caleb View Post
    I should have known you'd have an easy way to do it my friend!

    Does it work for cores as well? I suppose I could test it myself ;-)
    In that case you need to customize the framework-arduinoteensy (which is where cores lives), which I haven't done. There seems to be some good advice to get started here:

    https://community.platformio.org/t/c...atform/14600/2

  7. #7
    Quote Originally Posted by blackketter View Post
    In that case you need to customize the framework-arduinoteensy (which is where cores lives), which I haven't done. There seems to be some good advice to get started here:

    https://community.platformio.org/t/c...atform/14600/2
    Yup, that's pretty much what I ended up doing.

    Thanks, -C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •