user88055: I need to upload code on atmega328 wihout bootloader
https://github.com/EasyOne2030/test
but see Sketch uses 33218 bytes (102%) of program storage space. Maximum is 32256 bytes ?

user31043: In the case where the size of the program (sketch) has become too large for the available program storage space (flash memory), there are a number of options. Note that this is not the same case as exceeding the amount of dynamic memory (RAM) which requires a different set of solutions.
_1. Microcontroller (MCU) upgrade.
This can be a solution. The closer
the architecture of the new MCU matches that that of the old MCU the
easier this is likely to be. However, this approach can become
complex, even when using a different MCU in the same series as the
original, if low level configuration of (and access to) hardware
peripherals such as timers, ports etc. has been used. Be aware that
any libraries used may not be compatible with the new MCU so testing
is important. In the worst case, there may be no supporting Arduino
core available for the new MCU. Major incompatibilities can be
tested with a simple compilation of a sketch for the new target MCU
and this does not even require the new MCU to be present.
In the
specific case of the ATmega328P, this is already the highest
specified MCU in its series so a new MCU is required to increase
resources such as Flash memory, RAM etc. An ATMega1284 may be a
possible replacement within the AVR range. Also to consider is an
ATmega4809 (newer megaAVR range) based board such as the Nano Every
but here there are more significant architectural differences
_2. Optimising the use of flash memory.
_2.1 Bootloader.
Sometimes, changing the bootloader for a smaller one can help. For example, with some Arduino Nanos, this can free 1.5KB of flash memory by changing to the same bootloader which is used on the Arduino Uno (Optiboot). Dropping the bootloader altogether and using an ISP programmer (or an Arduino configured as one) to program the MCU can also save flash memory. Here it is important to select an Arduino core which supports a "No Bootloader" option to achieve the maximum benefits from this approach. The core "Minicore" https://github.com/MCUdude/MiniCore is such an example. Important to note is the the Arduino IDE (base 1.8.19) has a special upload procedure when using a programmer (Sketch--> Upload using programmer).
Note also that the target (AVR) MCU must have the fuses correctly set for "no bootloader" operation. That is the fuse BOOTRST must be unset. This is achieved by using the "burn bootloader" option supplied by the core. Despite its (inappropriate) name this has the effect of setting the fuses. Alternatively, the fuses can be set manually using the AVRDUDE command line.
_2.2 General.
The compiler is quite good at optimising code however, it is important to be aware that the use of some program features can have a one time penalty when used. Examples are the String class, sprintf(), floating point handling etc. which force a large amount of code to be added to the compiled sketch. Some libraries can consume a large amount of program memory. Graphic libraries are notorious for this because often these include large font tables etc. Here the options are limited to looking for a lighter weight library or a hacking out unused parts of an existing library.

88055: <p>I need to upload code on atmega328 wihout bootloader<br />
<a href="https://github.com/EasyOne2030/test" rel="nofollow noreferrer">https://github.com/EasyOne2030/test</a>
but see Sketch uses 33218 bytes (102%) of program storage space. Maximum is 32256 bytes ?</p>
 31043: <p>In the case where the size of the program (sketch) has become too large for the available program storage space (flash memory), there are a number of options. Note that this is not the same case as exceeding the amount of dynamic memory (RAM) which requires a different set of solutions.</p>
<p><strong>_1. Microcontroller (MCU) upgrade.</strong></p>
<p>This can be a solution. The closer
the architecture of the new MCU matches that that of the old MCU the
easier this is likely to be. However, this approach can become
complex, even when using a different MCU in the same series as the
original, if low level configuration of (and access to) hardware
peripherals such as timers, ports etc. has been used. Be aware that
any libraries used may not be compatible with the new MCU so testing
is important. In the worst case, there may be no supporting Arduino
core available for the new MCU. Major incompatibilities can be
tested with a simple compilation of a sketch for the new target MCU
and this does not even require the new MCU to be present.</p>
<p>In the
specific case of the ATmega328P, this is already the highest
specified MCU in its series so a new MCU is required to increase
resources such as Flash memory, RAM etc. An ATMega1284 may be a
possible replacement within the AVR range. Also to consider is an
ATmega4809 (newer megaAVR range) based board such as the Nano Every
but here there are more significant architectural differences</p>
<p><strong>_2. Optimising the use of flash memory.</strong></p>
<p><strong>_2.1 Bootloader.</strong></p>
<p>Sometimes, changing the bootloader for a smaller one can help. For example, with some Arduino Nanos, this can free 1.5KB of flash memory by changing to the same bootloader which is used on the Arduino Uno (Optiboot). Dropping the bootloader altogether and using an ISP programmer (or an Arduino configured as one) to program the MCU can also save flash memory. Here it is important to select an Arduino core which supports a &quot;No Bootloader&quot; option to achieve the maximum benefits from this approach. The core &quot;Minicore&quot; <a href="https://github.com/MCUdude/MiniCore" rel="nofollow noreferrer">https://github.com/MCUdude/MiniCore</a> is such an example. Important to note is the the Arduino IDE (base 1.8.19) has a special upload procedure when using a programmer (Sketch--&gt; Upload using programmer).
Note also that the target (AVR) MCU must have the fuses correctly set for &quot;no bootloader&quot; operation. That is the fuse BOOTRST must be unset. This is achieved by using the &quot;burn bootloader&quot; option supplied by the core. Despite its (inappropriate) name this has the effect of setting the fuses. Alternatively, the fuses can be set manually using the AVRDUDE command line.</p>
<p><strong>_2.2 General.</strong></p>
<p>The compiler is quite good at optimising code however, it is important to be aware that the use of some program features can have a one time penalty when used. Examples are the String class, sprintf(), floating point handling etc. which force a large amount of code to be added to the compiled sketch. Some libraries can consume a large amount of program memory. Graphic libraries are notorious for this because often these include large font tables etc. Here the options are limited to looking for a lighter weight library or a hacking out unused parts of an existing library.</p>
