Hi Andrea
To make SPI or I2C available in a new target, source code needs to be modified and rebuit.
I have built a new version of ldmicro32 (5.5a), derived from official ldmicro 5.4.0.4, with SPI and I2C available for AtMega328 in 32 bit package:
https://github.com/joegil95/LdMicro32
Dowload first zip file and get the french / english or spanish version you want of LdMicro32 exe file to replace old one.
Note that your SPI must be called "SPI" (not "SPI1"). You need external libraries included in the zip file (no modification).
Read txt files in zip if you need help.
Make your ladder, compile it for Avr-Gcc, and run flashMcu.
I haven't tested it because I don't have an AtMega328 in 32 pins package, but it worked with normal 28 pins and I believe there should be no difficulty...
Let us know ?
I'll see next with Ihor if he wants to include it to the official release.
Jose