Fabien
Posts: 2
Joined: Sat Nov 07, 2015 3:55 pm

Format file system

Sat Nov 07, 2015 3:58 pm

Hello everybody,

I did the dumbest mistake on my EWM3165 with WiFiMCU loaded on it. I've created an init.lua file that doesn't terminate, the result is that I cannot get to the prompt anymore, I cannot remove or change init.lua, I'm blocked...

Do you know a way to format the file system or skip the execution on init.lua?

Thanks in advance,

loboris
Posts: 40
Joined: Tue Sep 15, 2015 7:47 am
Location: Zagreb, Croatia

Re: Format file system

Sun Nov 08, 2015 10:41 am

Fabien wrote:Hello everybody,

I did the dumbest mistake on my EWM3165 with WiFiMCU loaded on it. I've created an init.lua file that doesn't terminate, the result is that I cannot get to the prompt anymore, I cannot remove or change init.lua, I'm blocked...

Do you know a way to format the file system or skip the execution on init.lua?

Thanks in advance,

Enter the bootloader, then use FLASHUPDATE (4) function to erase SPI filesystem area ( -s -e options ).

Code: Select all

4 -s -e -start 0x00C0000 -end 0x01fffff

Reboot, the filesystem will be formated automaticaly.

Fabien
Posts: 2
Joined: Sat Nov 07, 2015 3:55 pm

Re: Format file system

Mon Nov 09, 2015 9:48 pm

Thanks a lot. I ended up patching the binary so that the initialization would look for a "plop.lua" instead of "init.lua" so I can get to the prompt, but your solution looks much simpler :)

To avoid this kind of problem I recommend the following "init.lua":

--- init.lua ---
gpio.mode(0, gpio.INPUT_PULL_DOWN)
if gpio.read(0) == 1 then
dofile("main.lua")
end

"main.lua" will be executed only if the boot/easylink button is not pressed.

doit_yp
Posts: 21
Joined: Wed Aug 19, 2015 1:06 am

Re: Format file system

Fri Nov 13, 2015 6:32 am

Nice solution.

We ususally test the lua scripts manually by using dofile() , after everything goes ok, then use init.lua to setup the file.

Or, use a timer to call dofile() in init.lua, in order to get a chance to intterrupt the auto procedure.
Software engineer from DoIT
yangping@doit.am


Return to “WiFiMCU”

Who is online

Users browsing this forum: No registered users and 1 guest