Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spiffs-two-roms hardware profile fails to boot #2310

Closed
kmihaylov opened this issue Apr 20, 2021 · 5 comments
Closed

spiffs-two-roms hardware profile fails to boot #2310

kmihaylov opened this issue Apr 20, 2021 · 5 comments

Comments

@kmihaylov
Copy link
Contributor

With Sming 07ecd3b (older too) Basic_Blink using HWCONFIG := spiffs-two-roms set in component.mk fails to run on the device.
At boot this happens:

--- DTR inactive ---
--- RTS inactive ---
rd$ܾ���l�|���
            ��$��p�r�����{����
                              c��no�$no����b�p��$rdrlp�o���

                                                           �
                                                            l
                                                             �


                                                              �"
                                                                o�|�l���
                                                                        c��no�$��d ����no�$`��Nr���N

                                                                                                    r�l`�p�N�����s�����

and it continues forever.

With standard hwconfig the device boots sucessfully.

@mikee47
Copy link
Contributor

mikee47 commented Apr 20, 2021

I've attempted to reproduce this issue as follows:

  1. Edit component.mk
HWCONFIG = standard
  1. Build and flash
make flash
  1. Edit component.mk
HWCONFIG = spiffs-two-roms
SPIFF_FILES =
  1. Clean, build and flash
make config-clean
make flash

No problem so far...

@mikee47
Copy link
Contributor

mikee47 commented Apr 20, 2021

Note: to see that actual error above set COM_SPEED=74880

@slaff
Copy link
Contributor

slaff commented Apr 20, 2021

I guess you can try:

make flashinit

and then flash the application on the device.

@kmihaylov
Copy link
Contributor Author

kmihaylov commented Apr 20, 2021

I did

make flashinit

Modified component.mk with these changes:

## Select source of content for default `spiffs` partition when built
SPIFF_FILES = 

## Refer to Basic_rBoot sample for options relating to rBoot
HWCONFIG = spiffs-two-roms

Then

make config-clean
make flash

And this is the result:

--- DTR inactive ---
--- RTS inactive ---

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 1240, room 16 
tail 8
chksum 0xc5
load 0x3ffe8000, len 640, room 0 
tail 0
chksum 0x07
csum 0x07

rBoot v1.4.2 - richardaburton@gmail.com
Flash Size:   32 Mbit
Flash Mode:   DIO
Flash Speed:  40 MHz

Resetting boot config.
Invalid rom selected, defaulting to 0.
Rom 0 at 0 is bad.
Rom -1 at 0 is bad.
Rom -1 at 0 is bad.
Rom -1 at 0 is bad.

According to this output it should have flashed the partition table...

WriteFlash 0x00000=out/Esp8266/debug/firmware/rboot.bin 0x003fa000=out/Esp8266/debug/firmware/partitions.bin 0x00002000=out/Esp8266/debug/firmware/rom0.bin 0x00108000=out/Esp8266/debug/firmware/rom1.bin 0x00200000=out/Esp8266/debug/firmware/spiff_rom.bin  0x003fc000=/opt/Sming/Sming/Arch/Esp8266/Components/esp8266/ESP8266_NONOS_SDK/bin/esp_init_data_default.bin 
python3 /opt/Sming/Sming/Components/esptool/esptool/esptool.py -p /dev/ttyUSB0 -b 115200 --chip esp8266 --before default_reset --after hard_reset write_flash -z -fs 4MB -ff 40m -fm dio 0x00000 out/Esp8266/debug/firmware/rboot.bin 0x003fa000 out/Esp8266/debug/firmware/partitions.bin 0x00002000 out/Esp8266/debug/firmware/rom0.bin 0x00108000 out/Esp8266/debug/firmware/rom1.bin 0x00200000 out/Esp8266/debug/firmware/spiff_rom.bin  0x003fc000 /opt/Sming/Sming/Arch/Esp8266/Components/esp8266/ESP8266_NONOS_SDK/bin/esp_init_data_default.bin

Btw is there a shortcut to read the partition table?
make readpart PART=rom0 is for the slot, but for the partition table?

Edit:

md5sum out/Esp8266/debug/firmware/rom0.bin out/Esp8266/debug/rom0.read.bin 
034525860d2e4a88eb9d91b4cb9de626  out/Esp8266/debug/firmware/rom0.bin
de1765b14a2e381d9b11a46b0abaa5db  out/Esp8266/debug/rom0.read.bin

Also tried

make flashpart PART=rom0

without success.

===========

Edit 2:

Aaargh, here it is:

Partition map read from device:
Device            Start       End         Size        Type      SubType   Name              Filename
----------------  ----------  ----------  ----------  --------  --------  ----------------  ------------
spiFlash          0x00002000  0x000f9fff        992K  app       ota_0     rom0              
spiFlash          0x000fa000  0x00107fff         56K                      (unused)          
spiFlash          0x00108000  0x001fffff        992K  app       ota_1     rom1              
spiFlash          0x00200000  0x0027ffff        512K  data      spiffs    spiffs0           
spiFlash          0x00280000  0x003fafff       1516K                      (unused)          
spiFlash          0x003fb000  0x003fbfff          4K  data      rfcal     rf_cal            
spiFlash          0x003fc000  0x003fcfff          4K  data      phy       phy_init          
spiFlash          0x003fd000  0x003fffff         12K  data      sysparam  sys_param

And

Basic_Blink: Invoking 'map' for Esp8266 (debug) architecture
Partition map: spiffs-two-roms
options: 4m, spiffs
Device            Start       End         Size        Type      SubType   Name              Filename
----------------  ----------  ----------  ----------  --------  --------  ----------------  ------------
spiFlash          0x00000000  0x00001fff          8K                      Boot Sector       
spiFlash          0x00002000  0x000f9fff        992K  app       ota_0     rom0              $(RBOOT_ROM_0_BIN)
spiFlash          0x000fa000  0x00107fff         56K                      (unused)          
spiFlash          0x00108000  0x001fffff        992K  app       ota_1     rom1              $(RBOOT_ROM_1_BIN)
spiFlash          0x00200000  0x0027ffff        512K  data      spiffs    spiffs0           $(SPIFF_BIN_OUT)
spiFlash          0x00280000  0x003f9fff       1512K                      (unused)          
spiFlash          0x003fa000  0x003fafff          4K                      Partition Table   
spiFlash          0x003fb000  0x003fbfff          4K  data      rfcal     rf_cal            
spiFlash          0x003fc000  0x003fcfff          4K  data      phy       phy_init          $(FLASH_INIT_DATA)
spiFlash          0x003fd000  0x003fffff         12K  data      sysparam  sys_param

Why wouldn't it flash the new map?

@kmihaylov
Copy link
Contributor Author

The problem was due to my (mis)use of EQT gnu23 instead of the supported gnu20 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants