Skip to content

Commit

Permalink
Merge pull request #1115 from palainp/fix-flash
Browse files Browse the repository at this point in the history
Permit fburn for esp8266
  • Loading branch information
EtchedPixels authored Dec 5, 2024
2 parents 62b745c + ccde82b commit 445ce9a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Kernel/platform/platform-esp8266/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ image.elf: kernel.ld addresses.ld $(KOBJS)
$(CROSS_CC) -T kernel.ld -T addresses.ld -flto -mlongcalls -nostdlib -o image.elf \
$(KOBJS)

filesystem.img::
filesystem.img:
./update-flash.sh

filesystem.ftl: filesystem.img
Expand All @@ -81,6 +81,8 @@ filesystem.ftl: filesystem.img

filesystem.elf: filesystem.ftl
xtensa-lx106-elf-objcopy -I binary -O elf32-xtensa-le --change-section-vma .data=0x40220000 filesystem.ftl filesystem.elf
xtensa-lx106-elf-ld -Tdata 0x40220000 -o filesystem2.elf filesystem.elf
mv filesystem2.elf filesystem.elf

fburn: filesystem.elf
esptool elf2image filesystem.elf
Expand Down
12 changes: 8 additions & 4 deletions Kernel/platform/platform-esp8266/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ for further file storage and swap.

## Building

The kernel needs to know the boot device, therefore, depending on your setup,
you will need to run one of the following. If your root device is the flash,
you must edit Kernel/platform/platform-esp8266/config.h.
Otherwise, if your root device is the SD card, the default is fine for you.
```
make TARGET=esp866 kernel diskimage
```
Expand Down Expand Up @@ -63,13 +67,13 @@ Remember to also connect the SD card's GND to any ESP8266 GND pin and Vcc to

The console is UART0, and runs at 115200 baud.

Doing `make -C Kernel/platform-esp8266 burn` will flash the kernel onto the device
connected on `/dev/ttyUSB0` with this command:
Doing `make -C Kernel/platform/platform-esp8266 burn` will flash the kernel
onto the device connected on `/dev/ttyUSB0` with this command:

`esptool --port /dev/ttyUSB0 write_flash 0x00000 image.elf-0x00000.bin 0x10000 image.elf-0x10000.bin -ff 80m -fm dio'

Doing `make -C Kernel/platform-esp8266 fburn` will flash the filesystem onto
the device in the same manner.
Doing `make -C Kernel/platform/platform-esp8266 fburn` will flash the
filesystem onto the device in the same manner.

## Swap

Expand Down
6 changes: 6 additions & 0 deletions Kernel/platform/platform-esp8266/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ extern uint8_t _code_top[];
/* We need a tidier way to do this from the loader */
#define CMDLINE NULL /* Location of root dev name */

//#define BOOTDEVICE 0x0000 /* hda */
//#define BOOTDEVICE 0x0011 /* hdb1 */
#ifndef BOOTDEVICE
#define BOOTDEVICE 0x0011 /* hdb1 */
#warning "Default boot device is hdb1, if you want to change that you can edit Kernel/platform/platform-esp8266/config.h"
#endif

#define SWAPDEV (swap_dev) /* wherever */

#define CONFIG_DYNAMIC_SWAP
Expand Down

0 comments on commit 445ce9a

Please sign in to comment.