Bug in Plugin for Visual Studio Code

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
davidtheITGuy
Posts: 25
Joined: 24 Sep 2021 03:55

Bug in Plugin for Visual Studio Code

Post by davidtheITGuy »

Hello,

I am using a Rev2 Z-Uno board trying to get it to work with Visual Studio Code as a development platform. It works in terms of development, but when uploading to the chip, some of the settings do not seem to be working properly and therefore the board cannot be included into my controller. I am a US user.

Here is the DEVICE CFG output from Arduino IDE ver 2.x which WORKS:

Code: Select all

          DEVICE CFG
          	Z-Wave Region:US
          	Security mode:00 Freqi:01 maxTxDb:00 adjTxDb:00 LRTxDb:00 extra_flags:00
The following is from Visual Studio Code output after upload and the board does NOT WORK for controller inclusion:

Code: Select all

          DEVICE CFG
          	Z-Wave Region:US
          	Security mode:01 Freqi:01 maxTxDb:2d adjTxDb:00 LRTxDb:00 extra_flags:00
There are slight differences on the device configuration out. I am selecting default settings in Visual Studio Code for my region (US, 0 dbM output, S0 security). I am selecting the same attributes in the Arduino IDE but again getting different device configuration results which I believe is affecting the controller inclusion.

It appears that the settings in the VSC plugin are not making it to the toolchain for the exact same sketch.
amatilda
Posts: 58
Joined: 26 Sep 2021 22:09

Re: Bug in Plugin for Visual Studio Code

Post by amatilda »

Hello.
First, let's take a look at what we have. Do you have the latest VSC plugin?
What software version for the z-uno 2 board are you using?
davidtheITGuy
Posts: 25
Joined: 24 Sep 2021 03:55

Re: Bug in Plugin for Visual Studio Code

Post by davidtheITGuy »

Hello, thank you for your reply.

VSC plugin version (latest): v0.2.11
VSC version (latest): 1.74.3
Toolchain compiler path:

Code: Select all

 \\Z-Uno\\Z-Uno2\\tools\\gcc\\bin\\arm-none-eabi-gcc.exe
zuno.json:

Code: Select all

{
    "port": "COM6",
    "frequency": "US",
    "security": "S0",
    "power": "0"
}
Note above that there is an error in the "power" dictionary setting, the "0" was not in quotes which I have corrected manually above.

Board selection: Z-Uno2 (not beta)

Board info:

Code: Select all

------------------------------------------------------------------------------------
                                        Z-Uno board information
          ------------------------------------------------------------------------------------
          
          FIRMWARE
          
          	 VERSION:		03.10
          	 BUILD_SEQUENCE:	00001842
          	 BUILD_DATETIME:	2023-01-17T10:38:12(MSK)
          	 SUPPORTED_HWREV:	0704
          
          LIMITS
          
          	 CODE:	178176 Bytes
          	 RAM:	16384 Bytes
          
          HARDWARE
          
          	 CHIP_UID:	 84 2E 14 FF FE 6A 25 D6
          	 PROD_TIME:	 2021-07-08T10:18:35(MSK)
          	 PROD_SN:	 102
          	 LOCK:		 DBG_LOCKED
          
          LICENSE
          
          	 SUB_VENDOR:	0000
          	 BITMASK:	0000000000000000
          	 FEATURES:	[]
          	 CRC16:		84f9
Finally, I have two bootloaders installed in VSC:
zuno_bootloader_HW0703.bin
zuno_bootloader_HW0704.bin

It's unclear to me which one gets used when I select to flash the bootloader.

Please let me know if I can provide additional information. Thank you!
amatilda
Posts: 58
Joined: 26 Sep 2021 22:09

Re: Bug in Plugin for Visual Studio Code

Post by amatilda »

zuno_bootloader_HW0704.bin
Is used for Z-Uno2
Note above that there is an error in the "power" dictionary setting, the "0" was not in quotes which I have corrected manually above.
No - it must be a number. Not '"power": "40"' but '"power": 40'
At zero power, the antenna practically does not radiate - try to specify, for example, 40
"Radio transmission power, by default: +0dBm - normal" - description is wrong.



Try to flash with more power and exclude from the controller.
davidtheITGuy
Posts: 25
Joined: 24 Sep 2021 03:55

Re: Bug in Plugin for Visual Studio Code

Post by davidtheITGuy »

Hi, you are correct there is definitely an issue with the Zuno2 power setting of zero.

When I use the Arduino IDE, the chip gets the correct power setting when a sketch is uploaded (0x2D)
(and inclusion works).

However, the VSC sets it to 0 regardless of what I set in the zuno.json file (whatever I set there is ignored).

Further, in VSC under the extension's "Additional settings and features" option, I cannot enter any power setting there either.
ExtensionUtilities.png
ExtensionUtilities.png (63.1 KiB) Viewed 2244 times
I think there is an issue setting power through the VSC extension.
amatilda
Posts: 58
Joined: 26 Sep 2021 22:09

Re: Bug in Plugin for Visual Studio Code

Post by amatilda »

Hello.
Hi, you are correct there is definitely an issue with the Zuno2 power setting of zero.
In json, when changing, you need to use a number, not a string when changing the power. Otherwise, it turns the string to zero.
Further, in VSC under the extension's "Additional settings and features" option, I cannot enter any power setting there either.
There is a strict check for a fraction: 4.0 is good, 4 is bad.
Perhaps this behavior should be changed.
davidtheITGuy
Posts: 25
Joined: 24 Sep 2021 03:55

Re: Bug in Plugin for Visual Studio Code

Post by davidtheITGuy »

Ok using the VSC, Zuno2 Utilities menu option and entering in a floating point value (e.g. 4.0) worked! The power value in the zuno.json file seems to be ignored (currently I have it set to 40, does it need to be a floating point value as well such as 4.0?). Regardless, setting the power value in the utilities seems to have done the trick. Thank you for your assistance.
amatilda
Posts: 58
Joined: 26 Sep 2021 22:09

Re: Bug in Plugin for Visual Studio Code

Post by amatilda »

The power value in the zuno.json file seems to be ignored
no, it doesn't ignore - it takes it into account at the start of the project.
does it need to be a floating point value as well such as 4.0
An ordinary number is enough, for example:

Code: Select all

{
    "port": "COM6",
    "frequency": "US",
    "security": "S0",
    "power": 45
}
Post Reply