xlfe/spiffy

spiffy & srec_cat question

AutomationD opened this issue · 7 comments

Thanks for the tool, really nice.
I'm trying to use srec_cat in conjunction with spiffy. I'm building a spiffy_out.bin and trying to add it to a regular nodemcu_release.bin.
I'm getting my offset this way:

main_firmware_offset=0x$(echo "obase=16; $(($(stat -f%z 0x10000.bin)))" | bc)
spiff_start_offset=0x$(echo "obase=16; $(($(stat -f%z 0x10000.bin) + 16384))" | bc)
srec_cat -output nodemcu-firmware.out.bin -binary 0x10000.bin -fill 0xff $main_firmware_offset $spiff_start_offset ${spiff_start_offset}.bin -binary -offset $spiff_start_offset

my errors are:

srec_cat: 0x10000.bin: 1: warning: ignoring garbage lines
srec_cat: 0x10000.bin: 659: hexadecimal digit expected

Thank you!

looks like I missed a '-binary' parameter. Here's the script, I'm not 100% sure it will align everything properly, but I'll try to flash it tonight.

main_firmware_offset=0x$(echo "obase=16; $(($(stat -f%z 0x00000.bin)))" | bc)
spiff_start_offset=0x$(echo "obase=16; $(($(stat -f%z 0x00000.bin) + 16384))" | bc)
cp spiff_rom.bin ${spiff_start_offset}.bin
srec_cat -output nodemcu-firmware.out.bin -binary 0x00000.bin -binary -fill 0xff $main_firmware_offset $spiff_start_offset ${spiff_start_offset}.bin -binary -offset $spiff_start_offset
xlfe commented

@kireevco great - I had not seen how to do that previously - let me know how you get on

I'm trying to build it here https://travis-ci.org/kireevco/luasense-sensor. I'll ping back when I'll test the results on the actual controller

Testing it here https://travis-ci.org/kireevco/luasense-sensor/builds/53422507. I'm getting a valid firmware I can flash, but spiffs is empty. Any advice?
I'm confused about & (0xFFFFC000), how would I align to it?...

Looks like I need to do something like this:

spiff_start_offset=0x$(echo "obase=16; $((($(stat --format="%s" $TRAVIS_BUILD_DIR/bin/0x00000.bin) + 16384) & (0xFFFFC000))) " | bc)

let me test it...

remove the bin and export again.
i have met the same issue.hope this can help.

yangbo

在 2015年3月7日,09:55,Dmitry Kireev notifications@github.com 写道:

Testing it here https://travis-ci.org/kireevco/luasense-sensor/builds/53422507. I'm getting a valid firmware I can flash, but spiffs is empty. Any advice?


Reply to this email directly or view it on GitHub.

Alright,
https://github.com/kireevco/luasense-sensor/releases/tag/0.0.4 worked.
@xlfe thanks for putting spiffy together, appreciate it!

xlfe commented

Thanks guys