Forum Rule: Always post complete source code & details to reproduce any issue!
Page 7 of 9 FirstFirst ... 5 6 7 8 9 LastLast
Results 151 to 175 of 206

Thread: Raspberry Pi Pico

  1. #151
    Senior Member
    Join Date
    Oct 2015
    Location
    Roma (IT, EU)
    Posts
    357
    Quote Originally Posted by PaulStoffregen View Post
    I definitely don't love the Java IDE's editor. I almost always use the "external editor" preference.
    I use VisualStudio 2017 + VisualMicro for most of my work (minus TI and Microchip stuff). I like it a lot!
    I fire up the Arduino IDE only for very simple stuff and trying example sketches on the fly.

  2. #152
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    276
    Quote Originally Posted by luni View Post
    Boards.txt and platform.txt are a nightmare to parse. Having the relevant information in a xml / json format would be much easier
    I have just now made a boards.txt parser in javascript that outputs a json

    Code:
    var treeData = {};
    function parse(fileData) {
        treeData = {};
        const t0 = performance.now();
        var lines = fileData.split('\n');
    
        for (var i = 0; i < lines.length; i++) {
            var line = lines[i].trim();
            if (line.length == 0) continue; // empty line
            if (line[0] == '#') continue; // comment line
            var lio = line.indexOf('=');
            if (lio == -1) continue; // invalid line
            var key = line.substring(0, lio);
            var value = line.substring(lio + 1);
    
            var keySplit = key.split('.');
    
            var obj = treeData;
            for (var ksi = 0; ksi < keySplit.length; ksi++) {
                var keySplitKey = keySplit[ksi];
                if (obj[keySplitKey] == undefined)
                    obj[keySplitKey] = {};
    
                if (ksi == keySplit.length - 1)
                    obj[keySplitKey].value = value;
                obj = obj[keySplitKey];
            }
        }
        
        const t1 = performance.now();
        console.warn("parse took " + (t1-t0) + " milliseconds"); // around 9 milliseconds
    
        RED.main.download("tree.teensy.boards.json", JSON.stringify(treeData, null, 4));
        console.warn(treeData);
    }

  3. #153
    Junior Member
    Join Date
    Feb 2021
    Posts
    1
    Are there any good resources to assist with using VSCode with Teensy?

  4. #154
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    276
    Platformio is the best way, and I don't think there is any good guide how to set it up and how it works.
    I was thinking the same yesterday and was planning to do a simple guide (with pictures) how to do it.
    The resources on platformio is not that good and have to much information.

  5. #155
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,023
    Quote Originally Posted by manicksan View Post
    Platformio is the best way, and I don't think there is any good guide how to set it up and how it works.
    I was thinking the same yesterday and was planning to do a simple guide (with pictures) how to do it.
    I will admit, at least a few times I've considered giving PlatformIO on VS Code a try, but it's always turned into "don't have time to fiddle with this right now" when how to set it up wasn't intuitive.

  6. #156
    Maybe it was because I already had some of the necessary dependencies and tools installed, but for me it was as simple as installing the PlatformIO extension in VSCode and clicking the “new project” button. After selecting the board I wanted to use, it automatically downloaded the necessary cores and toolchains and initialized the config file and a basic main.cpp file. Everything just worked.

    I already used VSCode as my main editor before, but I gave PlatformIO a try because of their debugging support. I must say it's quite impressive: I have the two SWD pins of an Arduino Nano 33 BLE connected to an ST-Link adapter, and it allows me to set breakpoints, inspect variables, single-step through the code, step through the assembly, inspect the registers (including peripheral registers with meaningful names), read any address in RAM, etc. Pretty much anything you can do with a standard (non-embedded) debugger. It already saved me a lot of time, being able to just hover over a variable name in your IDE to see its value is orders of magnitude faster than adding a print statement and recompiling+uploading every time you want to inspect a variable.

    Are there any plans to include an SWD header on future Teensies? I've seen some articles about breaking out the pins on T3, but they were quite destructive, and as far as I could tell from the forum threads here, the T4 doesn't allow SWD debugging at all because of how its fuses are configured.
    Given how easy it is to start a debugger with PlatformIO, and since Arduino also seems to be adding debugging support in their Arduino Pro IDE, it could be a nice feature to have on a Teensy as well.

  7. #157
    On a related note: Raspberry Pi also boasts about the SWD debugging support on the Pico. A $4 SWD debugger sounds pretty nice.

    I've tried their “Picoprobe” firmware and their fork of OpenOCD to connect to my Arduino Nano 33 BLE. It detects the Pico correctly, but it seems to crash when selecting the nRF52840 as the target (the ST-Link has no such issues), so it looks like they only support the Pico itself as a target right now, not other types of ARM chips.

  8. #158
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,127
    Quote Originally Posted by deeztroyer View Post
    Are there any good resources to assist with using VSCode with Teensy?
    visualteensy https://github.com/luni64/VisualTeensy

  9. #159
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,621
    Quote Originally Posted by macrosii View Post
    FYI. The second core is working ok so far in micropython using _thread.
    in the SDK there are multicore examples, pico-examples/multicore/
    I don't have a pico yet, so I haven't tried any thing except some compiles.

    attached is a UF2 of coremark for pico ... anyone want to run it for me?

    Update: I've run a multicore rectangle rule and get a 1.9 speedup. The 2nd core adds about 2.8 ma (5.8 ma for micromod pico on ATP carrier).
    Another test with multicore CoreMark in RAM where single core gets 249.8 iterations/sec (21.9 ma), dual core get 484.3 iterations/sec (25.3 ma). Speedup up 1.9 at a cost of 2.4 ma. See post #174 for more coremark results.
    Attached Files Attached Files
    Last edited by manitou; 04-05-2021 at 10:56 AM.

  10. #160
    Member
    Join Date
    Jan 2014
    Location
    New Jersey, USA
    Posts
    63
    Quote Originally Posted by manitou View Post
    ... attached is a UF2 of coremark for pico ... anyone want to run it for me?
    Sure. Here is the output:

    Code:
    2K performance run parameters for coremark.
    CoreMark Size    : 666
    Total ticks      : 12129313
    Total time (secs): 12.129313
    Iterations/Sec   : 247.334701
    Iterations       : 3000
    Compiler version : GCC6.3.1 20170620
    Compiler flags   : (flags unknown)
    Memory location  : STACK
    seedcrc          : 0xe9f5
    [0]crclist       : 0xe714
    [0]crcmatrix     : 0x1fd7
    [0]crcstate      : 0x8e3a
    [0]crcfinal      : 0xcc42
    Correct operation validated. See README.md for run and reporting rules.
    CoreMark 1.0 : 247.334701 / GCC6.3.1 20170620 (flags
    Last edited by mlewus; 02-07-2021 at 04:46 PM. Reason: Additional info

  11. #161
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,621
    thanks. did the program report the CPU clock speed (clk_sys)? 125mhz?

  12. #162
    Member
    Join Date
    Jan 2014
    Location
    New Jersey, USA
    Posts
    63
    No, I posted everything that was sent to the terminal. I attached to the Pico with CoolTerm on a Mac (115200, 8 N 1).

  13. #163
    Quote Originally Posted by PaulStoffregen View Post
    I will admit, at least a few times I've considered giving PlatformIO on VS Code a try, but it's always turned into "don't have time to fiddle with this right now" when how to set it up wasn't intuitive.
    It's completely worth your time to set up PlatformIO on VS code for the Teensy. I wouldn't do it any other way. Like really, I simply wouldn't have used the Teensy 4 on a new project if I had to use the Arduino IDE. Setup is not difficult:

    Install Visual Studio Code and set up for C++/C development according to: https://code.visualstudio.com/docs/cpp/config-mingw
    Install Platform IO by searching for it in the extensions search area from within VS code
    Install teensy extension (platform-teensy) inside Platform IO
    In the PIO Home tab, click "new project", select the board, and you're on your way!

    I use VS Code for all my Python work, too. It's super flexible. Sometimes the configuration in its .json files is a little head-scratching, but at worst a few google searches have always fixed my problems. It's incredibly easy to setup and use with git, too.


    Quote Originally Posted by PaulStoffregen View Post
    Lately I've been reconsidering whether to keep the Arduino IDE as Teensy's primarily supported platform, or switch to VS Code (perhaps with Luni's makefile, maybe PlatformIO, or something else....)
    You would be wise to consider new options. IMO, VS Code (or similar) is the future. It's professional.
    Last edited by kingforger; 02-10-2021 at 10:06 PM.

  14. #164
    Member
    Join Date
    Jan 2014
    Location
    New Jersey, USA
    Posts
    63
    @kingforger is right. I set up Teensy on VS Code and never looked back. It was easy to do and it is so much easier to use than Arduino, even for simple programs.

  15. #165
    @mlewus and @mkingforger, can you comment on the process of updating your VSCode/PlatformIO environment when there is a new release of Arduino and/or TeensyDuino? I tried VSCode/PlatformIO twice, with about a year in between. I was able to get up and running and build simple projects, but decided it wasn't worth the time to adopt a platform that wasn't supported by Arduino or PJRC.

    I'm still relatively new to Arduino and Teensy, and while the IDE drove me crazy at first, I'm pretty okay with it now. I figured out how to specify locations for my sketch and library folders and for Arduino's temporary folders, and that helped a lot.

    Yes, it's clunky, and I'd like to have good integration with the editor, but I've learned to live with it. I use the IDE for simple sketches and testing, and switch to Notepad++ as my editor for larger projects. I plan to hold out for the new Arduino IDE, or possibly Arduino CLI and integration with Notepad++. The most important thing to me is to have a clear and simple procedure for installation and updates, and to be able to bring all existing sketches and libraries forward with new releases.

  16. #166
    Member
    Join Date
    Jan 2014
    Location
    New Jersey, USA
    Posts
    63
    @joepasquariello, Platformio allows you to configure the version of the framework that you’re installing. Here is the doc page that shows how to use the release, or latest build, versions of teensyduino for Platformio:https://docs.platformio.org/en/lates...ms/teensy.html . The teensyduino version can be selected in the platform.ini file on a project by project basis.

    You can also select whether to use the libraries in the teensyduino version you have installed, or select a different version of any library for your project. This is discussed here: https://docs.platformio.org/en/lates...ger/index.html

  17. #167
    Thanks for the info, @mlewus. I'm sure it's just a matter of investing the time to get past the initial hurdles. One of these days I'll give it another go.

  18. #168
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,435
    Sparkfun now has a MicroMod version of the Pico: https://www.sparkfun.com/products/17720. Looks like the MicroMod form factor is getting traction. Looking forward to the first MM T4 :-) (I already prepared the first board for it https://forum.pjrc.com/threads/65234...l=1#post266836 , which I currently use for a solder paste dispenser... kind of bootstrapping myself into working with this tiny stuff)

  19. #169
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,791
    Went for a MMod RP2040 with stuff in my SFun cart since I'll have to get carrier boards to see the Teensy4.MMod.

    There was a note once about making an rPi breakout for Teensy to work with Pi Hats?

    There is this PICO Pi Hat adapter : hackster.io/news/the-pico-2-pi-adaptor-plate

    Not that I have more than 1 or two of those Hat things ... But with PICO folks into rPi's that could make it handy.

  20. #170
    Senior Member
    Join Date
    Mar 2016
    Posts
    325
    I got my RP2020 MMod boards yesterday. Haven't done anything with them yet, though.

  21. #171
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,907
    Mine is on a FedEx truck to be delivered in town today... It will probably be several days before I go into town to pick it up.

  22. #172
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,791
    RP2040.MM has a tracking number to me ... maybe next week? Hopefully by the time it arrives and unboxed the path to C/C++ building on Windows will be ready

    SFun doesn't appear to have any unique answer yet for c/c++ just links to rPi docs and nothing Arduino?

  23. #173
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    338
    Quote Originally Posted by defragster View Post
    RP2040.MM has a tracking number to me ... maybe next week? Hopefully by the time it arrives and unboxed the path to C/C++ building on Windows will be ready

    SFun doesn't appear to have any unique answer yet for c/c++ just links to rPi docs and nothing Arduino?
    There's an early bit of development being done for RP2040 support on Platform.io. I was able to do a basic blink application using the Arduino framework with it. Might be worth looking at and/or pitching in:

    https://github.com/Wiz-IO/wizio-pico

  24. #174
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,621
    Using rpi pico, I've run some circuitpython/micropython tests and run a few C benchmarks via cmake and SDK (-O3 gcc 6.3.1). Here are some coremark plots
    Click image for larger version. 

Name:	pico.png 
Views:	6 
Size:	35.3 KB 
ID:	24366
    Click image for larger version. 

Name:	picoa.png 
Views:	11 
Size:	34.4 KB 
ID:	24162
    Compile options iterations/sec @125MHz, -Os 144.606175, -O 199.637605, -O2 242.092629, -O3 247.347813
    (The Sparkfun ATP micromod carrier adds about 5.7ma to pico power.)


    I've updated the micropython/circuitpython table (Teensy 4, STM32F405, M4, pyboard)

    Some other performance data points at https://github.com/manitou48/DUEZoo/...aster/perf.txt

    Update: multicore CoreMark on 125mhz pico (in RAM) achieves 484.3 iterations/sec for a 1.9 speedup on 2 cores, costing an additional 2.4 ma. A stack needs to be provided to start the 2nd core:
    multicore_launch_core1_with_stack(core1_entry,(uin t32_t *)536936448,100000);
    Last edited by manitou; 04-07-2021 at 08:06 PM.

  25. #175
    Member
    Join Date
    Jan 2014
    Location
    New Jersey, USA
    Posts
    63
    For anyone who's interested, Adafruit now has their Feather Rp2040 board available. They were in stock as of a few hours ago and I just ordered a couple. Like the other Feather boards it has a reset button so you can load code without having to unplug the USB cable

Posting Permissions

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