-
-
Notifications
You must be signed in to change notification settings - Fork 801
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 support for BouffaloLab chips #4046
Comments
pine64/ArduinoCore-bouffalo looks like the start of an ArduinoCore Core for BL602 (found via mkroman/awesome-bouffalo) |
Funny, I thought about a possible PlatformIO integration for these types of boards too after they were featured in a YouTube video yesterday. I think these boards will gain more attention through that soon. But I think this issue should be moved to https://github.com/platformio/platform-sifive, the existing PlatformIO integration for SiFive boards. In fact it shouldn't be too hard to add a simple board definition + builder script for Arduino to that platform. I'll give it a try soon.. |
I've completed writing the PlatformIO support for the pine64 Boufallo core, which supports its BL602-based Pinecone board. The core isn't really specific to that board though, any BL602 board should work. @normanr do you have a board and can test https://github.com/maxgerhardt/pio-bl602-boufallo-arduino-test? |
I have a MagicHome LED controller with the BL602 chip, but I don't have anything set up to flash it at the moment. (The FTDI cable I used to flash the ESP8285 based MagicHome I bought a year ago has since been used to interface with an air quality sensor). I'd like to find some time in the next couple of weeks to try it out. |
I got around to testing it today and initially it couldn't find One thing I noticed was that the ROM and RAM numbers listed in Platform IO don't match the docs at https://wiki.pine64.org/wiki/PineCone. I'm not sure how much that matters. Now to try and see if ESPHome or Tasmota will build! (or how badly they don't) |
You might want to delete |
Yep I found that, and that's what inspired me to manually trigger the update of the sifive package. One issue I found during the process of trying to get Tasmota to build: The SPI and Wire libraries in ArduinoCore-bouffalo set architectures to riscv, so a mapping of Also I noticed that in https://github.com/maxgerhardt/platform-sifive/blob/develop/boards/pinecone.json, |
The Arduino core is in an extremely early stage, with not even the base Arduino-API implemented, lest any WiFi library etc. I'm sure it's impossible to build at this stage without developing the Arduino core further first.
Thanks, that's very interesting. The Arduino core might be just using the wrong architecture here, or I need to adapt the platform.. |
I have interest in contributing to this project. Just converted from arduino to platform IO. Also, I typically code on linux and am having trouble navigating windows. Could someone point me in the right direction on how to add "https://github.com/maxgerhardt/pio-bl602-boufallo-arduino-test.git" to my platform IO installation? |
Just |
I was making it way harder than it needed to be haha. Thanks, its working now. |
I am working on getting wifi up. It looks like the bl_iot_sdk libraries are only partially compiled and linked. I built the libraries from https://github.com/bouffalolab/bl_iot_sdk.git and am trying to link against those. If I can get this to work, would the next steps be writing "wrappers" for the arduino framework classes? |
note that if you're using blflash instead of the Dev Cube uploader, then you may need to patch the bin file (with bl_rfbin) before uploading, see apache/nuttx#4336 for more info. |
I'm stuck on a prebuilt static library, components/network/wifi/lib/libwifi.a It was compiled using a different version and I am getting the following error when I attempt to link. This might be why the additional static libraries were not included. This is my first time messing with risc architecture though. I'll look at it more tomorrow. lib\libwifi.a(arch_main.o): conflicting priv spec version (major/minor/revision). |
The Arduino core is in an extremely primitive, early stage, in which the WiFi libraries are not yet linked in. The BL-IoT SDK package comes from here as listed in their board index, which might already contain mistakes leading to linker errors. I'll try to link in the library and / or add support for the native SDK. And have a look at that other flasher tool. |
Oh well, actually that could very well be the source of the error then. If you're taking the latest master branch of that, it may not work, because the Arduino core is based on this older SDK version, as linked above. |
It looks like the newest version of the SDK from the bouffalolab git has an updated toolchain which is causing their precompiled wifi libraries to be ABI incompatible with binaries built using the sifive toolchain. Updating platformio to use the toolchain thats included in https://github.com/bouffalolab/bl_iot_sdk.git should in theory work. I'm a platformio noob though so I have lots of reading to do. |
Oh yes, if you want PlatformIO to use the same toolchain, you need to make the compiler available to PlatformIO as a "package". You can read up on some of it here. In this case, you would have to upload the toolchain for a specific OS (e.g., this Windows toolchain here in a repo, and add {
"name": "toolchain-riscv",
"version": "1.100200.211109",
"description": "GNU toolchain for RISC-V, including GCC",
"keywords": [
"build tools",
"compiler",
"assembler",
"linker",
"preprocessor",
"risc-v"
],
"license": "GPL-2.0-or-later",
"system": [
"windws_amd64"
],
"repository": {
"type": "git",
"url": "https://github.com/riscv/riscv-gnu-toolchain"
}
} Then use
Sadly the platformio registry does not have the 10.2.0 RISC-V compiler yet. |
I created packages for the 10.2.0 RISC-V toolchain and I am no longer getting those compiling errors. It's unfortunately not going to be as easy as just replacing the precompiled libs in "framework-bl-iot-sdk-arduino". They were modified from the original bouffalo code and some of the functions were moved to "framework-arduinobouffalo" package code. libwifi.a is closed source. We need the original libwifi.a that was distributed with that version of the sdk. Without that, we are going to have to use the newer version from the bouffalo sdk. Using the newer version is going to require a rework of much of the things folks have done here. What probably should be done is to take the bits from the bouffalo sdk along with libwifi, the work that the pine64 folks did, and create a single new Arduino framework package. This is a lot of work and may be out of my technical abilities. Also, the pine64 folks are reverse engineering the closed source blobs which could make using libwifi irrelevant. Anyhow, here are the repos in case anyone wants to use the updated toolchain.
|
This RE work is likely not going to be completed anytime soon because of its complexity. If we want to create an Arduino core for BL60x that people are wanting to use, it needs to have WiFi, and the easiest way is to link in the proprietary libray. When a free, open-source implementation of it becomes available, it can be easily switched out, especially if it's API compatible. If you have a new, precompiled version of framework-bl-iot-sdk-arduino and the needed adaptions for that SDK that the Arudino core needs, I'd be very happy to see that as a PR in https://github.com/maxgerhardt/ArduinoCore-bouffalo and https://github.com/maxgerhardt/pio-bl-iot-sdk-arduino. (Or at the Arduino upstream repo). Updating that and further implementing features in the Arduino core would already be a huge step forward. |
I started a repo to build a framework package out of the bouffalo SDK. I feel like a working implementation there would be a good place to start. The sdk is surprising similar to the espidf at first glance. |
Thanks for the invite, and good work. It may make sense to create a Github organization like I have for the GigaDevice Arduino core project and create a Discord server (or, something) for collaboration. We could definitely push the Arduino core implementation and general BL60x (and BL70x?) integration in PlatformIO and the Arduino IDE forward by a ton. |
That sounds like a great idea. And I am pretty much glued to discord these days: https://discord.gg/NT7fx6R2 Thank you |
Are there any progress reports on BouffaloLabs Chips Platformio support? |
At least I have not further worked on this due to lack of time and other projects. The repos are completely open for forking + development though. |
How can one test it? Do I need to build my own PlatformIO extension from source to use this? |
No the VSCode extension stays constant. It's all handled dynamically by pointing PlatformIO to use a new platform url. Easiest is to just download https://github.com/Community-BL-IOT/pio-bl602-boufallo-arduino-test and open it in VSCode. |
This discussion seems to be mostly about BL60x chips. Does anyone know how compatible these tests are with BL616? |
I'm looking for that also I just bought 2x Ai Thinker AiPi-VOICE Ai-M61-32S Boards with speaker & mic too cheap to resist! 😁 Here there is NO BL616/BL618 mentioned 🙄 https://github.com/sifive/freedom-u-sdk Now i'm "stuck" i don't want to download their SDK CLI or even 'worst' use Ai Thinker HTTP website?! 😨 |
Please add support for BL602/BL604 made by BouffaloLab
Notice that it's only based on the SiFive E24 Core, so I don't think the existing SiFive platform will work for this chip.
There's a lot of documentation and SDK's avaiable:
There is a "Nutcracker challenge" to re-implement the Wifi and BLE blobs as open source, but I hope that the official SDKs (with the closed blobs) will be sufficient to get it working with PlatformIO in the meantime.
Related requests:
The text was updated successfully, but these errors were encountered: