platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.69k stars 779 forks source link

Z-Uno (Z-Wave Arduino prototyping board) #1326

Open kreucher opened 6 years ago

kreucher commented 6 years ago

Z-Uno is a Arduino compatible board with built in Z-Wave support, details on the board itself are here: https://z-uno.z-wave.me/technical/

They currently support the Arduino IDE: https://z-uno.z-wave.me/install

PJTS commented 6 years ago

This would be a great addition, having to go back to Arduino IDE 1.6.5 isnt a great experience.

seanybaggins commented 5 years ago

Don't know if this should be in a separate issue but debug support for the Arduino Uno would be nice as well.

samturner3 commented 4 years ago

This has been open for two years, any updates?

Mierse commented 4 years ago

I'm also interested in support for that board. Is there any plan for?

PeterOsterdahl commented 3 years ago

+10 for this

PoltoS commented 1 year ago

@ivankravets Could you please guide us on how to add support of Z-Uno 2 in PlatformIO? Can we do it ourselves? Z-Uno 2 already has the support of Arduino IDE and VS Code.

robin-thoni commented 4 months ago

@PoltoS , unfortunately, VSCode support is through a custom extension, and still uses zme_make under the hood, which is a huge blackbox... I kinda managed to make a toolchain with zme_make, but it only builds basic stuff. For example, it fails when using ESPHome

PoltoS commented 4 months ago

Of course, it will fail on ESPHome if the latter expects ESP-specific (toolchain-specific headers and libs). So you certainly need to port it to raw C or add those libs and headers as a lib in Z-Uno toolchain.

zme_make has no big secrets inside: it uses CLang to compile things and adds parsing of some custom macros. And knows how to burn the result. Your problem is not the zme_make, but a library/project that depends on toolchain-specific things.

robin-thoni commented 4 months ago

zme_make has no big secrets inside

Not sure about that. It seems to magically, conditionally add some (LLCore, etc) libraires at build time. Also, it seems to fail to build when using something as simple as std::vector :/

PoltoS commented 4 months ago

Please provide the code you have problems with and our developers will look at it

robin-thoni commented 4 months ago

I didn't realize you were part of Z-Wave.me. Is there any chance you, as Z-Wave.me as a whole, to work on pio support? Especially since Home Assistant has now joined the Z-Wave Alliance, you would get WAY more visibility (and sells) if ESPHome would support it (https://github.com/esphome/feature-requests/issues/1839). Making a Z-Wave custom device in seconds, like w/ ESP32 is a killer feature. Now Zigbee is built in new ESP32 chips, that's what's gonna happen for Zigbee. But IMHO, Z-Wave > Zigbee :)

For the vector issue, just #include <vector> makes it crash:

#include <vector>

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}
/home/robin/tools/arduino-1.8.15/arduino-builder -dump-prefs -logger=machine -hardware /home/robin/tools/arduino-1.8.15/hardware -hardware /home/robin/.arduino15/packages -tools /home/robin/tools/arduino-1.8.15/tools-builder -tools /home/robin/tools/arduino-1.8.15/hardware/tools/avr -tools /home/robin/.arduino15/packages -built-in-libraries /home/robin/tools/arduino-1.8.15/libraries -libraries /home/robin/Arduino/libraries -fqbn=Z-Uno2:zw_cm4f:zuno2:Frequency=Eu,TXPower=Normal,RFLogging=Off,CleanNVM=Off,UpdateLicense=On -ide-version=10815 -build-path /tmp/arduino_build_52682 -warnings=none -build-cache /tmp/arduino_cache_948672 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.zme_make.path=/home/robin/.arduino15/packages/Z-Uno2/tools/zme_make/0.4.1 -prefs=runtime.tools.zme_make-0.4.1.path=/home/robin/.arduino15/packages/Z-Uno2/tools/zme_make/0.4.1 -prefs=runtime.tools.libClang.path=/home/robin/.arduino15/packages/Z-Uno2/tools/libClang/11.0.1 -prefs=runtime.tools.libClang-11.0.1.path=/home/robin/.arduino15/packages/Z-Uno2/tools/libClang/11.0.1 -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/robin/.arduino15/packages/Z-Uno2/tools/arm-none-eabi-gcc/7.2.4 -prefs=runtime.tools.arm-none-eabi-gcc-7.2.4.path=/home/robin/.arduino15/packages/Z-Uno2/tools/arm-none-eabi-gcc/7.2.4 -verbose /tmp/arduino_modified_sketch_540012/sketch_mar03a.ino
/home/robin/tools/arduino-1.8.15/arduino-builder -compile -logger=machine -hardware /home/robin/tools/arduino-1.8.15/hardware -hardware /home/robin/.arduino15/packages -tools /home/robin/tools/arduino-1.8.15/tools-builder -tools /home/robin/tools/arduino-1.8.15/hardware/tools/avr -tools /home/robin/.arduino15/packages -built-in-libraries /home/robin/tools/arduino-1.8.15/libraries -libraries /home/robin/Arduino/libraries -fqbn=Z-Uno2:zw_cm4f:zuno2:Frequency=Eu,TXPower=Normal,RFLogging=Off,CleanNVM=Off,UpdateLicense=On -ide-version=10815 -build-path /tmp/arduino_build_52682 -warnings=none -build-cache /tmp/arduino_cache_948672 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.zme_make.path=/home/robin/.arduino15/packages/Z-Uno2/tools/zme_make/0.4.1 -prefs=runtime.tools.zme_make-0.4.1.path=/home/robin/.arduino15/packages/Z-Uno2/tools/zme_make/0.4.1 -prefs=runtime.tools.libClang.path=/home/robin/.arduino15/packages/Z-Uno2/tools/libClang/11.0.1 -prefs=runtime.tools.libClang-11.0.1.path=/home/robin/.arduino15/packages/Z-Uno2/tools/libClang/11.0.1 -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/robin/.arduino15/packages/Z-Uno2/tools/arm-none-eabi-gcc/7.2.4 -prefs=runtime.tools.arm-none-eabi-gcc-7.2.4.path=/home/robin/.arduino15/packages/Z-Uno2/tools/arm-none-eabi-gcc/7.2.4 -verbose /tmp/arduino_modified_sketch_540012/sketch_mar03a.ino
Using board 'zuno2' from platform in folder: /home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10
Using core '/' from platform in folder: /home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10
Detecting libraries used...
/home/robin/.arduino15/packages/Z-Uno2/tools/zme_make/0.4.1/zme_make arduino_preproc /tmp/arduino_build_52682/sketch/sketch_mar03a.ino.cpp /home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/cores
Found 1.8.x project structure (File:sketch_mar03a.ino.cpp). Converting it...
Generating function prototypes...
/home/robin/.arduino15/packages/Z-Uno2/tools/zme_make/0.4.1/zme_make arduino_preproc /tmp/arduino_build_52682/sketch/sketch_mar03a.ino.cpp /home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/cores
Found 1.8.x project structure (File:sketch_mar03a.ino.cpp). Converting it...
          INCREMENTAL PREPROC. The sketch is the same.
/home/robin/tools/arduino-1.8.15/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_52682/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/home/robin/.arduino15/packages/Z-Uno2/tools/zme_make/0.4.1/zme_make build /tmp/arduino_build_52682/sketch_mar03a.ino -S /home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/cores -S /home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries -S /home/robin/.arduino15/packages/Z-Uno2/tools/arm-none-eabi-gcc/7.2.4/lib/gcc/arm-none-eabi/7.2.1/include -B /tmp/arduino_build_52682 -T /home/robin/.arduino15/packages/Z-Uno2/tools/arm-none-eabi-gcc/7.2.4/bin -O arduino_ide -lcl /home/robin/.arduino15/packages/Z-Uno2/tools/libClang/11.0.1 -O BO:-DARDUINO=152 -O BO:-DARDUINO_ARCH_ZUNOG2 -O BO:-DZME_ZUNOG2 -O LO:-lm
          ***** Building sketch:/tmp/arduino_build_52682/sketch_mar03a.ino *****
          -----------------------------------------------------------------------------------------------
SOURCE LIST:['/tmp/arduino_build_52682/', '/tmp/arduino_build_52682/zuno_preproc/', '/tmp/arduino_build_52682/libraries/', '/tmp/arduino_build_52682/core/', '/tmp/arduino_build_52682/sketch/', '/tmp/arduino_build_52682/preproc/', '/tmp/arduino_build_52682/sketch/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/cores/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/cores/includes/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/cores/ZWSupport/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/cores/emlib/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/cores/libft/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/cores/LLCore/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/PN7160/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/DallasTemperature/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_NeoPixel/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_LEDS/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/Z-Uno-2G/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_HDC1080/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_DHTlib/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_SHIELD/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_DS18B20/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_MCP23XS17/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/PN7150/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_Buttons/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_FRAM/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_DAC102S085/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_MERCURY206R/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_LCD/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_SGP30/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_BMP280/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_CCS811/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_AM2320/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ModBusRtu/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_U8G2/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/Ds1307Rtc/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/SpiFlash/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_BMP180/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_Neptun/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_OneWire/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_SOMFY/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_ModBus/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/RF24/', '/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/libraries/ZUNO_GFX/', '/home/robin/.arduino15/packages/Z-Uno2/tools/arm-none-eabi-gcc/7.2.4/lib/gcc/arm-none-eabi/7.2.1/include/']
preprocessing "sketch_mar03a.ino"        ..............................2) MODERN MCH+
MODERN MCH+
preprocessing "sketch_mar03a.ino"        ..............................                            OK
          Core version: 03.10 Channels:0
Gathering project files                  ..............................                            OK
compiling "LLCore.c"                     ..............................                            OK
compiling "ZWCCMeterTbl.cpp"             ..............................                            OK
compiling "sketch_mar03a_ino.cpp"        ..............................                        FAILED
/home/robin/.arduino15/packages/Z-Uno2/hardware/zw_cm4f/3.0.10/cores/LLCore/LLCore.c:313:17: note: #pragma message: ZUNO_PIN_V==6
 #pragma message "ZUNO_PIN_V==6"
                 ^~~~~~~~~~~~~~~

In file included from /home/robin/.arduino15/packages/Z-Uno2/tools/arm-none-eabi-gcc/7.2.4/arm-none-eabi/include/c++/7.2.1/vector:60:0,
                 from /tmp/arduino_modified_sketch_540012/sketch_mar03a.ino:1:
stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^
stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^
In file included from /tmp/arduino_build_52682//sketch_mar03a_ino.cpp:10:0:
stl_algobase.h:195:5: error: expected unqualified-id before 'const'
     min(const _Tp& __a, const _Tp& __b)
     ^
stl_algobase.h:195:5: error: expected ')' before 'const'
stl_algobase.h:195:5: error: expected ')' before 'const'
stl_algobase.h:195:5: error: expected initializer before 'const'
stl_algobase.h:219:5: error: expected unqualified-id before 'const'
     max(const _Tp& __a, const _Tp& __b)
     ^
stl_algobase.h:219:5: error: expected ')' before 'const'
stl_algobase.h:219:5: error: expected ')' before 'const'
stl_algobase.h:219:5: error: expected initializer before 'const'
In file included from /home/robin/.arduino15/packages/Z-Uno2/tools/arm-none-eabi-gcc/7.2.4/arm-none-eabi/include/c++/7.2.1/vector:60:0,
                 from /tmp/arduino_modified_sketch_540012/sketch_mar03a.ino:1:
stl_algobase.h:246:7: error: expected primary-expression before 'if'
       if (__comp(__b, __a))
       ^~
stl_algobase.h:246:7: error: expected '}' before 'if'
stl_algobase.h:246:7: error: expected ';' before 'if'
stl_algobase.h:248:7: error: expected unqualified-id before 'return'
       return __a;
       ^~~~~~
stl_algobase.h:268:7: error: expected primary-expression before 'if'
       if (__comp(__a, __b))
       ^~
stl_algobase.h:268:7: error: expected '}' before 'if'
stl_algobase.h:268:7: error: expected ';' before 'if'
stl_algobase.h:270:7: error: expected unqualified-id before 'return'
       return __a;
       ^~~~~~
stl_algobase.h:271:5: error: expected declaration before '}' token
     }
     ^

exit status 10
/home/robin/tools/arduino-1.8.15/arduino-builder returned 10
Error compiling for board Z-Wave>ME Z-Uno2.

Board is Z-Uno 2, programmer is Z-Uno-2G Programmer, using Arduiono IDE. I can repro the same with my custom pio toolchain.

I also tried to run it w/ arm-none-eabi-gcc 7.2.4 coming from pio (in case you would have tweaked it), same result

PoltoS commented 4 months ago

Okay, I see the issue. For whatever reason vector relies on min and max with three arguments, which is insane. We will check it and fix. And __comp is missing or wrong.

@p0lyg0n1

Frankly speaking, it is hard for us to do pio support as we never used it. But we can actively assist if you could guide us.

On the other side, we have our new Z-Uno configurator just released. Currently it is for the Z-Uno Shield only, but we hope to add the simple Z-Uno too.

It is only clicks to get your sketch generated and even uploaded right from the browser - no programming, no Arduino IDE, no soldering. Easy as 1-2-3.

Check it at https://z-uno.z-wave.me/configurator/#/shield

robin-thoni commented 2 months ago

We will check it and fix. And __comp is missing or wrong.

@PoltoS Is there any news on this? Sounds like a big blocker for PIO adoption

PoltoS commented 2 months ago

Hello! Sorry for the delay. We checked it and your compilation line looks weired.

  1. Please try to use the latest beta package from our site.
  2. Take the GCC provided in the package.
  3. Your line contains /home/robin/.arduino15/packages/Z-Uno2/tools/arm-none-eabi-gcc/7.2.4/lib/gcc/arm-none-eabi/7.2.1/include - there should be no 7.2.1 in 7.2.4. Looks you messed it up.
  4. Take the compilation line from platform.txt: recipe.hooks.sketch.prebuild.1.pattern = "{tools.zprog.cmd.path}" build "{build.path}/{build.project_name}" -S "{tools.zprog.cmd.cores}" -S "{tools.zprog.cmd.libraries}" -S "{tools.zprog.cmd.include}" -B "{build.path}" -T "{tools.zprog.cmd.bin}" -O "arduino_ide" -lcl "{tools.zprog.cmd.clang_lib}" -O BO:-DARDUINO=152 -O BO:-DARDUINO_ARCH_ZUNOG2 -O BO:-DZME_ZUNOG2 -O LO:-lm -C "{build.chiptype}" (in your case the problem is in {tools.zprog.cmd.include})
  5. In the latest beta we already use gcc 10.3.1: tools.zprog.cmd.include={runtime.tools.arm-none-eabi-gcc.path}/lib/gcc/arm-none-eabi/10.3.1/include - please try it.

Hope this helps!