Skip to content

Commit a33109d

Browse files
committed
Give more space to the bootloader (0x200 bytes)
1 parent b047340 commit a33109d

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

bootloaders/atmega4809_uart_bl.hex

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
:10000000112480911F138B3E09F05BC08FEF80930A
1+
:10000000112480911F138B3E09F05FC08FEF809306
22
:100010001F1393E08DE984BF90930010809102102C
33
:1000200081FDFCCF80EC80930608A09123110A2E5D
4-
:10003000000CBB0BBC5F2CE530E00E946800DC01CB
4+
:10003000000CBB0BBC5F2CE530E00E946C00DC01C7
55
:10004000CB019E5FAF4FBF4F2AE0B595A79597951F
66
:1000500087952A95D1F78093080890930908809195
7-
:10006000E20581608093E205049A669A8091040813
8-
:1000700087FFFCCF80910008E0E0F1E49DE923E0F8
9-
:1000800030E48091040887FFFCCF809100088093C2
10-
:1000900002088193AF014F775527452B51F494BF48
11-
:1000A000209300108091021080FDFCCF8DB183273A
12-
:1000B0008DB9309731F791E088ED84BF909341007E
13-
:1000C00007C082E080930110E0E8F0E00995AACF34
14-
:1000D0000E946F00B7FF0895821B930B0895A29FA3
15-
:1000E000B001B39FC001A39F700D811D1124911D0C
16-
:0C00F000B29F700D811D1124911D089518
7+
:10006000E20581608093E205049A669AE0E0F2E49A
8+
:100070002DE933E040E41EC08091040887FFFCCFE7
9+
:1000800080910008E11552E4F50711F4882391F0FE
10+
:10009000809302088193CF018F779927892B51F4A0
11+
:1000A00024BF309300108091021080FDFCCF8DB1F1
12+
:1000B00084278DB9CF0190548115904CE8F291E0DE
13+
:1000C00088ED84BF9093410007C082E080930110C7
14+
:1000D000E0E0F1E00995A6CF0E947300B7FF089514
15+
:1000E000821B930B0895A29FB001B39FC001A39FF1
16+
:1000F000700D811D1124911DB29F700D811D112461
17+
:04010000911D0895B0
1718
:02000004008278
1819
:00000001FF

bootloaders/boot.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* For the code to be placed in the constructors section it is necessary
2929
* to disable standard startup files in Toolchain->AVR/GNU Linker->General.
3030
*
31-
* The example is written for ATtiny817 with the following pinout:
31+
* This file is targeted to UNO WiFi REV2 (ATmega4809)
3232
* USART0 TxD PA4
3333
* USART0 RxD PA5
3434
* LED0 PD6
@@ -49,7 +49,7 @@
4949
* BOOTEND_FUSE * 256 must be above Bootloader Program Memory Usage,
5050
* this is 194 bytes at optimization level -O3, so BOOTEND_FUSE = 0x01
5151
*/
52-
#define BOOTEND_FUSE (0x01)
52+
#define BOOTEND_FUSE (0x02)
5353
#define BOOT_SIZE (BOOTEND_FUSE * 0x100)
5454
#define MAPPED_APPLICATION_START (MAPPED_PROGMEM_START + BOOT_SIZE)
5555
#define MAPPED_APPLICATION_SIZE (MAPPED_PROGMEM_SIZE - BOOT_SIZE)
@@ -102,9 +102,6 @@ __attribute__((naked)) __attribute__((section(".ctors"))) void boot(void)
102102
init_uart();
103103
init_status_led();
104104

105-
/* HACK: esp32 seems to send an extra byte at the beginning */
106-
uart_receive();
107-
108105
/*
109106
* Start programming at start for application section
110107
* Subtract MAPPED_PROGMEM_START in condition to handle overflow on large flash sizes
@@ -113,12 +110,10 @@ __attribute__((naked)) __attribute__((section(".ctors"))) void boot(void)
113110
while(app_ptr - MAPPED_PROGMEM_START <= (uint8_t *)PROGMEM_END) {
114111
/* Receive and echo data before loading to memory */
115112
uint8_t rx_data = uart_receive();
116-
#if 0
117113
if (app_ptr == (uint8_t *)MAPPED_APPLICATION_START && rx_data == 0) {
118114
// skip first character if 0x00
119115
continue;
120116
}
121-
#endif
122117
uart_send(rx_data);
123118

124119
/* Incremental load to page buffer before writing to Flash */

fuses/fuses_4809.bin

0 Bytes
Binary file not shown.

platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ compiler.warning_flags.all=-Wall -Wextra
2121
compiler.path={runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path}/bin/
2222
compiler.c.cmd=avr-gcc
2323
compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects
24-
compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -Wl,--section-start=.text=0x100
24+
compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -Wl,--section-start=.text=0x200
2525
compiler.c.elf.cmd=avr-gcc
2626
compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD
2727
compiler.cpp.cmd=avr-g++

0 commit comments

Comments
 (0)