Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial PlatformIO support #6

Merged
merged 8 commits into from
Sep 29, 2021
Merged

Conversation

maxgerhardt
Copy link
Contributor

@maxgerhardt maxgerhardt commented Sep 13, 2021

This adds a PlatformIO builder script (platformio-build.py) and a package.json to the project, which enables PlatformIO to compile the project.

PlatformIO is a SCons-based build system tool and VSCode extension that makes developing embedded fimwares much easier since it integrates nicely with a lot of IDEs, automates all toolchain and SDK download and unifies configuration files. Practically all Arduino cores have a PlatformIO integration, e.g., Arduino/esp8266, Arduino-ESP32, STM32Duino, etc.

These changes go along with custom extensions of the SiFive PlatformIO integration where the board definition for the pinecone board lives.

A full example project is at https://github.com/maxgerhardt/pio-bl602-boufallo-arduino-test.

Note: I do not yet have a BL602 based board for testing (shipping is in progress), but the current state is that it already builds the firmware like the Arduino IDE would and attempts uploading via the same serial flasher tool used in this core. So it should all work. I'm opening this PR preliminary so that I hopefully can just confirm it to be working on hardware after it arrives (or / and someone else tests it along with me) and then it can be merged. Thus this is marked as a darft PR.

People have been requesting PlatformIO support for a BL602 Arduino core in e.g. in esphome/feature-requests#1049 (comment) and platformio/platformio-core#4046.

(The URL in the package.json should be changed after merge)

@gamelaster
Copy link
Member

Hello and thank you for your work!

It looks amazing. My timeframe for BL602 is quite limited, but I will try to find some time to test this.
If in meantime you receive your BL602 and confirm it works just fine, please let me know, so we can merge this.

Thanks :)

@maxgerhardt
Copy link
Contributor Author

maxgerhardt commented Sep 29, 2021

Haha, it works! Thanks to a fix PR for the uploader someone did in the meantime (Community-BL-IOT/pio-bl60x-flash#1), I was just able to compile & upload & open serial monitor for my "DT-BL-10" BL602-based dev board and see

RAM:   [===       ]  27.2% (used 89224 bytes from 327680 bytes)
Flash: [          ]   3.3% (used 42786 bytes from 1310720 bytes)
Configuring upload protocol...
AVAILABLE: bl60x-flash, ftdi, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = bl60x-flash
Looking for upload port...
Auto-detected: COM15
Uploading .pio\build\pinecone_bl602\firmware.bin
Loading helper binary
21872 bytes @ 0x22010000

  0%|          | 0.00/21.9k [00:00<?, ?byte/s]
 37%|███▋      | 8.16k/21.9k [00:00<00:00, 48.5kbyte/s]
 75%|███████▍  | 16.3k/21.9k [00:00<00:00, 48.2kbyte/s]
100%|██████████| 21.9k/21.9k [00:00<00:00, 48.3kbyte/s]
100%|██████████| 21.9k/21.9k [00:00<00:00, 48.2kbyte/s]

Erased 47100 bytes @ 0x10000

Programming 47100 bytes @ 0x10000
  0%|          | 0.00/47.1k [00:00<?, ?byte/s]
 30%|███       | 14.3k/47.1k [00:00<00:00, 135kbyte/s]
 61%|██████    | 28.7k/47.1k [00:00<00:00, 135kbyte/s]
 91%|█████████▏| 43.0k/47.1k [00:00<00:00, 135kbyte/s]
100%|██████████| 47.1k/47.1k [00:00<00:00, 135kbyte/s]
Verified by XIP SHA256 hash
=============================================================================== [SUCCESS] Took 11.55 seconds ===============================================================================
--- Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Miniterm on COM15  115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
Hello from BL602!
Hello from BL602!

So, this builder script is good to merge :)

@maxgerhardt maxgerhardt changed the title [DRAFT] Add initial PlatformIO support Add initial PlatformIO support Sep 29, 2021
@gamelaster gamelaster merged commit c99a138 into pine64:main Sep 29, 2021
pfeerick added a commit to pfeerick/ArduinoCore-bouffalo that referenced this pull request Oct 8, 2021
Per the mention in the PR of:
> The URL in the package.json should be changed after merge
gamelaster added a commit that referenced this pull request Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants