Bootloader-less Pro - Advanced AVR 3.0 Core - Part 3 - SPM - App Writes to App section - programmer

Channel:
Subscribers:
580
Published on ● Video Link: https://www.youtube.com/watch?v=SEWlk-NnoHA



Duration: 2:20
6 views
0


Boot header from AVR-c actually suck BBC, (Probably written by someone from Britain?) thus SPM and LPM code are rewritten. Bootloader mechanism found in the AVR is good only for the protection part of the feature. Self-program can be done without it with a little bit extra care. Beside on being able to update its own source code, the flash memory can be easily used as flash to store data, for instance a logger that requires a lot of memory can store its data to the flash memory.

Finally succeed after many failed attempts, now even though the filling and erasing code are using avr-c boot header, a better approach had been rewritten. Here demonstrates how application is able to write to its application section. The little led blink code has actually being completely removed and replaced with my typed-in of data. In a real application, the flash page is allocated way down the memory lane so the actual application code will not be over-written.

Getting naked attribute is what made this works, but the spm function needs to go back to application manually, since naked has no return path. This can be easily done in 5 known ways.

PS. similar thing can be done using the badly written avr-c boot header file as well. Writing to itself is actually very simple. It's really just the first step to implementing the program memory space as normal memory for the application.

PPS. Here application section is written to without a bootloader, thus the name Bootloader-less. Technically the code that write to application is still within the bootloader section, since spm instruction only works there for security reason. The advantages of writing to self Bootloader-less are: 1, bootloader can be programmed in combination with the application code at the same time or separately or whatever; 2, Bootloader-less can allocate program memory as normal flash memory easily. 3, The Bootloader-less idea is tested in preparation for creating a programmer which is also self-programmable




Other Videos By Flyandance


2023-03-22Cutting board is over-rated: Cut half onion by hand w/o one
2023-03-21Bare Minimal 2 | .init0 | naked | .ctors | signal | -nostartfiles - Advanced AVR 3.0 Core
2023-03-20Bootloader self-program - Juno AVR109 Rewrite Part 1 - Advanced AVR 3.0 Core
2023-03-19Bootloader self-program - AVR109 speed test avrdude - Advanced AVR 3.0 Core - 1Mbps with 8MHz CPU
2023-03-18Bootloader self-program - AVR109 w/ AVROSP and avrdude - Advanced AVR 3.0 Core
2023-03-17SPM 3.0 writes to self - Advanced AVR 3.0 Core Bootloader
2023-03-16SPM 2.0 writes to self - Advanced AVR 3.0 Core Bootloader
2023-03-14You jump, ijmp - Inline asm Indirect Jump - Advanced AVR 3.0 Core Bootloader
2023-03-05yt-dlp - A ultimate guide (The result of 2 weeks of hard work)
2023-03-03True bare Minimal code - Advanced AVR 3.0 Core Bootloader Pro Part 4 Size does matters getting naked
2023-02-28Bootloader-less Pro - Advanced AVR 3.0 Core - Part 3 - SPM - App Writes to App section - programmer
2023-02-27Bootloader-less Pro - Advanced AVR 3.0 Core - Part 2 - SPM erase self destruction code
2023-02-26Inline ASM - Advanced AVR 3.0 Core - LMP read from flash Load Program Memory
2023-02-25Inline ASM - Advanced AVR 3.0 Core - Finalizing
2023-02-22Inline ASM - Advanced AVR 3.0 Core
2023-02-19Bootloader-less Pro - Advanced AVR 3.0 Core - Part 1 - GCC Sections functions attribute
2023-02-17Script cowboy - the power of one line of code
2023-02-15Bootloader Pro - Advanced AVR 3.0 Core - AVR-C 2.0 sucks BBC
2023-02-11Juno ABC - Advanced Button Core 4.0 - Sleep mode ultra low power
2023-02-07My Coffee ritual 2.0 - Simple Minimalistic - Dry milk + sugar
2023-02-03Sleep mode - Advanced AVR 3.0 - Atiny13 watchdog less than 100nA - Peripheral leakage current Button