Help getting Codrone to work with PlatformIO

Indeed, as @manuelbl and @pfeerick noted, a different Arduino core seems to be used, right? You also installed this Arduino core and selected the “SmartInventor” board for compilation?

Anyway, try the following:

  • Download the RokitSmartInventor ZIP file for above and extract it
  • Copy the “cores\atmega32” folder as “Rokit” into C:\Users\<user>\.platformio\packages\framework-arduinoavr\cores
  • copy all folders from “variants” into C:\Users\<user>\.platformio\packages\framework-arduinoavr\variants
  • use the following platformio.ini
[env:ATmega32]
board = ATmega32
platform = atmelavr
board_build.core = Rokit
board_build.variant = SmartInventor
framework = arduino
lib_deps =
  CoDrone
  • compile and observe
DATA:    [=====     ]  47.0% (used 963 bytes from 2048 bytes)
PROGRAM: [==        ]  24.4% (used 7868 bytes from 32256 bytes)

With that the new Arduino core is successfully hacked in PlatformIO’s framework-arduinoavr package, and we can also see that the compiled binary size has increased, though it’s still not at the level of the Arduino IDE. But now we are at least using the correct core and variant, which might help…

Edit: I also notice that SmartInventor-mega32_v2.build.f_cpu=7372800L line in the boards.txt, so if you are using that variant, you need to additionally add

board_build.f_cpu = 7372800L
1 Like