I’m having issues on my laptop using framework-arduino-avr-minicore.
I’ve installed it on Arduino 2.2.1 and it works OK and managed to burn bootloaders in some Pro Minis.
When I try to use Mini core on platformio I get the message
avrdude: Can't find programmer id "urclock"
so I’m assuming that I need to install it under platformio.
This where I’m having problems.
Using the command
pio pkg install --global --tool "platformio/framework-arduino-avr-minicore@^3.0.0"
Gives the response
MissingPackageManifestError: Could not find one of 'package.json' manifest files in the package
So it may not be installed where platformio can find it.
I’ve tried
Run package command
Open PlatformIO Core CLI
Copy the following pio pkg exec command, replace <CMD> and [ARGS], paste into the CLI shell, press Enter:
pio pkg exec --package "platformio/framework-arduino-avr-minicore" -- <CMD> [ARGS]
but this fails because I don’t know what [ARGS] should be.
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
;[env:pro8MHzatmega328]
;platform = atmelavr
;board = pro8MHzatmega328
;framework = arduino
; PlatformIO Project Configuration File for MiniCore
; https://github.com/MCUdude/MiniCore/
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed, and extra flags
; Library options: dependencies, extra library storage
; Advanced options: extra scripting
;
; Please visit the documentation for the other options
; https://github.com/MCUdude/MiniCore/blob/master/PlatformIO.md
; https://docs.platformio.org/page/projectconf.html
[platformio]
default_envs = Upload_UART ; Default build target
; Common settings for all environments
[env]
platform = atmelavr
framework = arduino
; TARGET SETTINGS
; Chip in use
board = pro8MHzatmega328
; Clock frequency in [Hz]
board_build.f_cpu = 8000000L
; BUILD OPTIONS
; Comment out to enable LTO (this line unflags it)
build_unflags = -flto
; Extra build flags
build_flags =
; SERIAL MONITOR OPTIONS
; Serial monitor port defined in the Upload_UART environment
monitor_port = ${env:Upload_UART.upload_port}
; Serial monitor baud rate
monitor_speed = 9600
; Run the following command to upload with this environment
; pio run -e Upload_UART -t upload
[env:Upload_UART]
; Serial bootloader protocol
upload_protocol = urclock
; Serial upload port
upload_port = COM7
; Set upload baudrate. Can be changed on the fly if using Urboot
board_upload.speed = ${env:fuses_bootloader.board_bootloader.speed}
; Run the following command to upload with this environment
; pio run -e Upload_ISP -t upload
[env:Upload_ISP]
; Custom upload procedure
upload_protocol = custom
; Avrdude upload flags
upload_flags =
-C$PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf
; -C:\Users\andy\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1\avrdude.conf
-C$PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf
-p$BOARD_MCU
-PUSB
-cusbasp
; Avrdude upload command
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
; Run the following command to set fuses
; pio run -e fuses_bootloader -t fuses
; Run the following command to set fuses + burn bootloader
; pio run -e fuses_bootloader -t bootloader
[env:fuses_bootloader]
board_hardware.oscillator = external ; Oscillator type
board_bootloader.type = urboot ; urboot, optiboot or no_bootloader
board_bootloader.speed = 115200 ; Bootloader baud rate
board_hardware.uart = uart0 ; Set UART to use for serial upload
board_hardware.bod = BOD Disabled ; Set brown-out detection
board_hardware.eesave = yes ; Preserve EEPROM when uploading using programmer
upload_protocol = usbasp ; Use the USBasp as programmer
upload_flags = ; Select USB as upload port and divide the SPI clock by 8
-PUSB
-B8
PACKAGES plus bits around it
Processing Upload_UART (platform: atmelavr; framework: arduino; board: pro8MHzatmega328)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/pro8MHzatmega328.html
PLATFORM: Atmel AVR (5.0.0) > Arduino Pro or Pro Mini ATmega328 (3.3V, 8 MHz)
HARDWARE: ATMEGA328P 8MHz, 2KB RAM, 30KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
- framework-arduino-avr @ 5.2.0
- tool-avrdude @ 1.60300.200527 (6.3.0)
- toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
I hope this shows what the problem is as I’ve been at this for two days, mainly from lack of experience with platformio.
This is where my knowledge falls down. I don’t know how to do that.
I assume it means adding a line in platformio.ini but I don’t know where to place it or the format of the statement. There are no paths already defined in platformio.ini for the project so I can’t edit them.
I’m guessing it’s something like
-C$PROJECT_PACKAGES_DIR/tool-avrdude@1.60300.200527/avrdude.conf
under
[env:Upload_UART]
Struggling with that a bit. I had duplicated the -C$PROJECT… bit.
This setting is under the [env:Upload_ISP] which I’m not using at the moment. I’m using a FTDI (genuine) USB serial converter.
I will continue looking in the morning.
Many thanks for your help. I see where your going with this and it’s given me a greater understanding of how the platformio.ini file works.
So I have found that there were 3 instances of avrdude.exe under packages.
I moved them and when I tried to upload the my test program, platformio installed
I’m assuming that platformio defaults to an earlier version and gives the error
avrdude: Can't find programmer id "urclock"
So I think this comes back to my original post on how to install minicore on platformio?
I’m guessing my installation of platformio has no knowledge of Microcore yet.