Upload error on Arduino Pro mini ATmega 32u4

I tried to upload Blink example on Arduino Pro mini ATmega 32u4
I’ve got this error:

avrdude: stk500_recv(): programmer is not respondingavrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

However the same example work fine on Arduino IDE.
I’ve selected Arduino Leonardo in the two cases.

I’m using IDE 1.3.6 | CLI 2.11.2 under Ubuntu 16.04

  1. Please share here your platformio.ini
  2. Try upload again, when you see errors above, run this command in PlatformIO IDE Temrinal pio serialports list. Share here output
  3. You need to install this script https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules

I’ve solver the problem by removing

platform = atmelavr
framework = arduino
board = uno

from platformio.ini and re-initializing the project with leonardo board.

Thank you.