Os.bundle(myapp.mpy) leads to soft reboot

Hi,

I plan to embed 17 pieces of mpy’s to flash before running main app. this operation shall be executed only once, So in boot.py I wrote following line:

os.bundle(‘myapp1.mpy’, ‘myapp2.mpy’,…)
os.remove(‘boot.mpy’)

However my XBee device will soft reboot immediately after os.bundle(‘myapp.mpy’, …). so I never get the chance to remove boot.mpy. if I remove boot.mpy before os.bundle(…), there is a chance that if user power-off during executing os.bundle(…), then the operation will never get fully executed.

Can you help me to solve this?

I am not sure that the os.bundle is fully supported on the modules yet. I would suggest performing that function externally on your PC via the IDE and then upload the finished code to the module.

never mind. I can workaround this issue. Just check the bundled file list in boot to see if it is as expected. if true, destroy self, else execute os.bundle(…)