Using arduino framework I am running out of memory with my atmega32 project on custom board.
I require to program using the usbasp ICSP board and to not use bootloader. At the moment the AVR is fresh from the fab house and untouched by any programmer.
I have in platformio.ini (excluding all the lib_deps)
platform = atmelavr
board = ATmega32
framework = arduino
upload_protocol = custom
upload_port = usb
; use "tool-avrdude-megaavr" for the atmelmegaavr platform
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
I have spent some hours searching for how to build and upload this project to my newly recevied atmega32 boards without the bootloader being present. To my simple mind there are a mish-mash of concepts and instructions around bootloaders, fuses and avrdude and platformio, the atmel framework and the arduino framework. It seems straightofrward in the arduino IDE but I never want to go back to that !
Would some knowledgeable person be able to just tell me what I do to my project so that run pio --target upload will actually compile and upload my file and not use a bootloader. Is it just a few lines in the platformio.ini ? Is it a few terminal commands ? A combination ?
Thank you very much. That makes sense and is what I originally thought.
I am distracted by the fact that whether I select a USBasp programmer, or use a bootloader option the generated hexfile is identical. To reiterate:
Start a new project with a board, ATmega32 in my case. Build and get a hexfile.
Now intorduce the previously mentioned directives in platformio.ini to identify that we are using a programmer.
Clean (tried cleanall too) and repeat build to obtain new hexfile.
Both hexfiles are identical.
I must be misunderstanding something, but I was expecting the second hexfile to be different, and smaller.
Using avr-objectdump to dissassemble the hex files I can see they are identical.
If they are identical how does that fit with the idea that there is no bootloader added to the code ?
Thanks again for taking the time and trouble to deal with this.
And here’s what terminal says after uploading the code:
Flash: [====== ] 61.2% (used 19728 bytes from 32256 bytes)
Notice I’m not yet next to the limit, either way I would like to know how to achive this because I also have other projects using the Arduino IDE (which I don’t want to use anymore) and are closer to the limit. Thank you!