So even when you program the correct fuses via Atmel Studio to enable 1.8V operation, the microcontroller / firmware still doesn’t work? But then how can it be solved with PIO by programming the same fuses o_o?
The JLink upload option doesn’t change the fuses of the SAMD21G18 (or, any other devices, it never toches them for the Atmel SAM platform), see here. It just tells JLink.exe to write the firmware into it.
I suggest you change the fuses once in Atmel Studio and flash a working firmware from there or identify the problem why it won’t run at 1.8V. If PIO is supposed to burn / check the fuses, this is currently not implemented for atmel-sam as far as I can tell. You can create an issue there (Issues · platformio/platform-atmelsam · GitHub) or use advanced scripting to write an extenion script which checks / burns the right fuses using the JLink tool.
I only change the fuse BOD33 using Atmel studio and i upload again the code. If i set VCC to 1.8v or 3.3v , the firm can be uploaded using jlink.
If i set the vcc, the hw works fine and execute the code. A simple code that put one pin in hihg/low and send a message by UART interface. When i set VCC=1.8v, the hw not work.
I have solder the ucontroller and passive components that they are neccessary to run.
In datahseet i found that NVM Wait States should be modified to run at 48mhz and VCC less than 2.7v [NVM characteristics - Table 37-42. Maximum Operating Frequency]. I tried to change clock speed to 28mhz and when i set vcc to 1.8v not work but with 3.3v works well.