I am going to need to program attiny chips, prefrably the attiny404 as those are memory/price-wise the winners.
What do I need to type in after
arduino-cli core search .....
[code]
I googled my behind off, but could not find the answer.
Also for the bonus. I suppose I can use an arduino uno as ISP programmer right?
Can you help me out here?
Kind regards,
Bas
By default, Arduino CLI only provides the cores for the boards in the primary package index (e.g., Arduino AVR Boards, Arduino SAMD Boards, etc.). This does not include a core that provides support for the ATtiny404. However, the amazing Arduino community has created many other cores that provide support for many other boards and microcontrollers. There is a very nice one for the ATtiny404:
3rd party cores are able to offer Boards Manager installation (arduino-cli core install) support by providing their own package index. When they do this, you only need to add the URL of that package index (which you will find in the core's installation instructions) to the board_manager.additional_urls key of your Arduino CLI configuration to get access to installation of that core via arduino-cli core install.
There are several ways of setting the board_manager.additional_urls configuration value, which you can learn about here and here, but I think the most convenient is a new feature added in Arduino CLI 0.14.0, so I'll give you the command for doing it using that method:
bask185:
I suppose I can use an arduino uno as ISP
For the ATtiny404, I don't believe this is possible. The reason is because this family of chips uses UPDI programming rather than ISP. But don't worry. DrAzzy has you covered with support and documentation in MegaTinyCore for making your own UPDI programmer:
I see that I am still using cli version 0.9.0. So I will update that first thing. I am seeing no update option in 0.9.0, so I suppose I have to replace arduino-cli.exe manually. The new version seems to have an update function, that is neat.
I decided to upgrade to an attiny85 for my first batch of PCB's later I will most likely downgrade to a 13 instead. Saves me 50c per pcb.
Yeah, as I said this feature was added in Arduino CLI 0.14.0.
bask185:
The new version seems to have an update function, that is neat.
Yes, but note this command is about updating the installed cores and libraries. It does not update Arduino CLI itself.
bask185:
I have to replace arduino-cli.exe manually.
There is an installation script, but it's a shell script, so only usable on Windows if you're using one of the Bash versions for Windows (e.g., Git Bash) or WSL.
bask185:
I decided to upgrade to an attiny85 for my first batch of PCB's
You'll have no problem using Arduino as ISP with the ATtiny85. Since this is the most popular ATtiny chip in the Arduino world, I think you'll find it to be the most well supported. DrAzzy/SpenceKonde also provides a nice core for this chip, so you can still follow the same instructions I provided above, but run the command arduino-cli core install ATTinyCore:avr to get the ATtiny85 support.
bask185:
I will most likely downgrade to a 13 instead.
I found myself a new inconvenience. I finally updated arduino cli to version 0.14.0. At first I got terror because my command line tools would not find the arduino-cli.exe. after I properly altered the system path variables like last time. Eventually I copied the folder to program files as a hot fix. Got me cursing on Windows again .
I do can compile using the same build scripts but I am not going any hex files anymore. So I enabled the verbose flag to see what was going on.
It is clear that I am getting hex files, but I get them in...
AppData\\Local\\Temp\\arduino-sketch.....
...this folder instead of my project folder. And with different names than I am used?
Is this perhaps a new bug feature? Do I need to alter all my build scripts now? Or can I configure arduino-cli to do what it used to do? I did replicate every step in the getting started guide.
I suppose I will install me some attiny cores in the meantime
Kind regards,
Bas
I am still having problems, when I try to anything with arduino-cli I get
C:\Users\Gebruiker\AppData\Local\Arduino15\package_drazzy.com_index.json: open C:\Users\Gebruiker\AppData\Local\Arduino15\package_drazzy.com_index.json: The system cannot find the file specified
Because this one needs atleast 1 extra argument, and I do not know what to enter. From the help page
Also I have read the link you sent me, from what I understand I can use
--export-binaries
or -e flag to get what I want.
This part however I could not comprehend entirely
A related settings and env var has been added to avoid the need to always specify the
--export-binaries
flag:
sketch.always_export_binaries
and
ARDUINO_SKETCH_ALWAYS_EXPORT_BINARIES
I am not entirely sure what to do with this last two phrases. Can I look up arduino cli in program files -> right click -> properties and this
I manually downloaded the correct JSON file and put it in the spot in that strange hidden windows appdata folder where arduino-cli is looking for it. Now I can compile again. The -e flag is also working. Still have to alter my buildscripts though.
I have also succesfully installed cores for atleast the attiny85. That is if the command line output didn't lie to me :
With some luck I may be able to program one this weekend. My lovely pcb design uses a soic attiny and has no program pins breakout. A soic clamp is on it's way for programming, but I am gonna do prototype X the hardway by soldering wires to the chip and than solder the PCB on it's final destination.
build/arduino.avr.nano/SAS.ino.hex: line 1: :100000000C9462000C945D030C9436030C948A00EB: command not found
And there are 260 more of these lines. In the build folder I have:
SAS.ino.eep
SAS.ino.elf
SAS.ino.hex
SAS.ino.with_bootloader.bin
SAS.ino.with_bootloader.hex
I altered my script to upload the 3r one. Using this command:
I only altered the path, the rest remained the same.
Some months ago I tried the hex with the bootloader I bricked 2 Nano.
The IDE still can flash it, so this one is not bricked.. yet
What is it that I am doing wrong?
Bas
So if you wanted to avoid having to always use the -e flag in your arduino-cli commands, you could add these lines to your arduino-cli.yaml file:
sketch:
always_export_binaries: true
bask185:
and
ARDUINO_SKETCH_ALWAYS_EXPORT_BINARIES
As explained at this section of the configuration documentation: https://arduino.github.io/arduino-cli/latest/configuration/#environment-variables
any configuration key can also be set via an environment variable. So a third alternative to -e or sketch.always_export_binaries is setting the equivalent environment variable. On Windows cmd, that is done like this:
set ARDUINO_SKETCH_ALWAYS_EXPORT_BINARIES=true
bask185:
I am not entirely sure what to do with this last two phrases. Can I look up arduino cli in program files -> right click -> properties and this
--export-binaries
behind the .exe?
That will only work if you are executing Arduino CLI by clicking on that shortcut.
bask185:
When trying to upload a sketch I get:
build/arduino.avr.nano/SAS.ino.hex: line 1: :100000000C9462000C945D030C9436030C948A00EB: command not found
That is odd. I wasn't able to reproduce that. Please run the command with the -v flag added for verbose output and then paste the full output here.
If the text exceeds the forum's 9000 character limit, save it to a .txt file and post it as an attachment. If you click the "Reply" button here, you will see an "Attachments and other settings" link that will allow you to make the attachment.
Also, please tell me which shell you're using (e.g., cmd, PowerShell, Bash).
bask185:
Some months ago I tried the hex with the bootloader I bricked 2 Nano.
Interesting. That .hex file is intended to be used with an ISP programmer, but I wouldn't expect it to brick the board on a normal upload. You should be able to recover it by setting up one of your working Arduino boards as an "Arduino as ISP" programmer and then burning the bootloader. Even though I wouldn't expect a normal upload to be able to affect the bootloader, the burn bootloader process also erases the flash memory on the chip, so it gets it back to a fresh state. More information on that subject here:
I know to unbrick arduinos and burn new bootloaders via ICSP, I just haven't done it yet. I have like 30+ Nano's in reserve so the bricked ones still lie on my desk underneath my analog oscilloscope
I will post the output of the compiler this evening.