Using PlatformIO on a custom board with ATSAMD21G17A

We have built a custom board that’s using ATSAMD21G17A instead of ATSAMD21G18A used in most of the Arduino and similar boards.
We have changed it because there’s not stock of the G18A version of the chip but we have coded all our firmware using Arduino framework.

Our current process it to build the binary on PlatformIO and then upload it to the board using Microchip ICD-4 and MPLab X.

This process use to work when I tried it burning our custom firmware on an Arduino board, but when we try to upload it to the G17A version of the chip it doesn’t work. Our guess it that the memory mapping is wrong because the G17 has half of the memory of the G18.

Anyone have tried to build code for ATSAMD21G17A? Any suggestion on how can we build/upload our binary to it?

An alternative is to build the same platformio code in MPLabX but for now we haven’t had any success.

The uploading doesn’t work? Or that does work but the resulting firmware doesn’t operate correctly? In what exact way, if yes?