{"id":2634,"date":"2025-08-08T23:00:12","date_gmt":"2025-08-08T21:00:12","guid":{"rendered":"https:\/\/www.sciencetronics.com\/greenphotons\/?p=2634&#038;lang=en"},"modified":"2025-08-08T23:13:05","modified_gmt":"2025-08-08T21:13:05","slug":"update-on-the-avr-dx-chips-and-platformio","status":"publish","type":"post","link":"https:\/\/www.sciencetronics.com\/greenphotons\/?p=2634","title":{"rendered":"Update on the AVR-Dx chips and PlatformIO"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Changes to the system files<\/h1>\n\n\n\n<p>When removing the link to the Arduino framework from the <em>platformio.ini<\/em>, PlatformIO reverts back to the older 1.7 toolchain, which still lacks support for the AVR-Dx microcontrollers. You can override this in the <em>platformio.ini<\/em>:<\/p>\n\n\n\n<pre>[env:AVR64DA28]<br \/>platform_packages = platformio\/toolchain-atmelavr@^3.70300.220127<br \/>platform = atmelmegaavr<br \/>board = AVR64DA28<br \/>board_build.f_cpu = 4000000UL<br \/>upload_protocol = custom<br \/>upload_flags = -cserialupdi<br \/>-p64da28<br \/>-PCOM4<br \/>upload_command = \"C:\\Program Files (x86)\\AVRDUDESS\\avrdude.exe\" $UPLOAD_FLAGS -U flash:w:$SOURCE:i<\/pre>\n\n\n\n<p>But there is another option as well, you can change the file <em>.platformio\/platforms\/atmelmegaavr\/platform.json<\/em><\/p>\n\n\n\n<p>from<\/p>\n\n\n\n<pre> \"packages\": {<br \/>   \"toolchain-atmelavr\": {<br \/>     \"type\": \"toolchain\",<br \/>     \"owner\": \"platformio\",<br \/>     \"version\": \"~1.70300.0\",<br \/>     \"optionalVersions\": [\"~3.70300.0\"]<br \/>   },<\/pre>\n\n\n\n<p>to<\/p>\n\n\n\n<pre> \"packages\": {<br \/>   \"toolchain-atmelavr\": {<br \/>     \"type\": \"toolchain\",<br \/>     \"owner\": \"platformio\",<br \/>     \"version\": \"~3.70300.0\"<br \/>   },<\/pre>\n\n\n\n<p>and then have your <em>platformio.ini<\/em> simply as<\/p>\n\n\n\n<pre>[env:AVR64DA28]<br \/>platform = atmelmegaavr<br \/>board = AVR64DA28<br \/>board_build.f_cpu = 4000000UL<br \/>upload_protocol = custom<br \/>upload_flags = -cserialupdi<br \/>-p64da28<br \/>-PCOM4<br \/>upload_command = \"C:\\Program Files (x86)\\AVRDUDESS\\avrdude.exe\" $UPLOAD_FLAGS -U flash:w:$SOURCE:i<\/pre>\n\n\n\n<p>Finally you can create a new board manifest in order to default to the <em>serialupdi<\/em> upload protocol and the 4 MHz default clock frequency:<\/p>\n\n\n\n<p>file <em>.platformio\/platforms\/atmelmegaavr\/boards\/AVR64DA28_serialupdi.json<\/em><\/p>\n\n\n\n<pre>{<br \/>\"build\": {<br \/>\"f_cpu\": \"4000000L\",<br \/>\"mcu\": \"avr64da28\",<br \/>\"variant\": \"28pin-standard\"<br \/>},<br \/>\"hardware\": {<br \/>\"oscillator\": \"internal\"<br \/>},<br \/>\"name\": \"AVR64DA28 serial UPDI\",<br \/>\"upload\": {<br \/>\"maximum_ram_size\": 8192,<br \/>\"maximum_size\": 65536,<br \/>\"protocol\": \"serialupdi\"<br \/>},<br \/>\"url\": \"https:\/\/www.microchip.com\/wwwproducts\/en\/AVR64DA28\",<br \/>\"vendor\": \"Microchip\"<br \/>}<\/pre>\n\n\n\n<p>now you can shrink your <em>platformio.ini<\/em> to<\/p>\n\n\n\n<pre>[env:AVR64DA28_serialupdi]<br \/>platform = atmelmegaavr<br \/>board = AVR64DA28_serialupdi<\/pre>\n\n\n\n<p>You can find the corresponding files here:  <a href=\"https:\/\/github.com\/uwezi\/AVR-Dx\/tree\/main\/platformio\">https:\/\/github.com\/uwezi\/AVR-Dx\/tree\/main\/platformio<\/a><\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Changes to the system files When removing the link to the Arduino framework from the platformio.ini, PlatformIO reverts back to the older 1.7 toolchain, which still lacks support for the AVR-Dx microcontrollers. You can override this in the platformio.ini: [env:AVR64DA28]platform_packages = platformio\/toolchain-atmelavr@^3.70300.220127platform = atmelmegaavrboard = AVR64DA28board_build.f_cpu = 4000000ULupload_protocol = customupload_flags = -cserialupdi-p64da28-PCOM4upload_command = &#8220;C:\\Program Files [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[8],"tags":[],"class_list":["post-2634","post","type-post","status-publish","format-standard","hentry","category-everything_en","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p48grL-Gu","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/posts\/2634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2634"}],"version-history":[{"count":5,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/posts\/2634\/revisions"}],"predecessor-version":[{"id":2642,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/posts\/2634\/revisions\/2642"}],"wp:attachment":[{"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}