Magic Lantern Forum

Developing Magic Lantern => General Development Discussion => Topic started by: sonic on May 31, 2013, 03:56:13 AM

Title: Install build via USB
Post by: sonic on May 31, 2013, 03:56:13 AM
Hello!

Do you developers remove the memory card each time you install your autoexec.bin build?

I want to try to implement the HIJACK_CACHE_HACK_*_SIZE_* boot hack to free memory on the 550D. Since this is still quite obscure to me, I'm afraid I have to install many builds until it works. And since I'm too lazy to remove the SD Card each time, I was wondering if anyone else would be interested in something like

Code: [Select]
ruby contrib/mlusb/write2card.rb platform/550D.109/autoexec.bin autoexec.bin
to transfer a new build via USB to the memory card.
If so, I'd try to implement this. Or are there other ways already?
Title: Re: Install build via USB
Post by: a1ex on May 31, 2013, 06:46:07 AM
make ptpinstall, but wasn't touched for years...
Title: Re: Install build via USB
Post by: 1% on May 31, 2013, 10:19:13 AM
It was tried months ago... would fail transferring. Loading different bins off the card worked at one point.
Title: Re: Install build via USB
Post by: sonic on May 31, 2013, 02:14:37 PM
It was tried months ago... would fail transferring. Loading different bins off the card worked at one point.

Oh, it was already done ::)
And it actually works:
Code: [Select]
sonic@sonic-VGN-Z41WD-B:~/ptp-dir/mweerden-CHDK-5273d12/tools/ptpcam$ ls -lh autoexec.bin
-rwxr-xr-x 1 sonic sonic 453K Mai 31 13:14 autoexec.bin
sonic@sonic-VGN-Z41WD-B:~/ptp-dir/mweerden-CHDK-5273d12/tools/ptpcam$ time echo "upload autoexec.bin B:/ULTEST.BIN" | ./ptpcam --chdk
real    0m18.585s
sonic@sonic-VGN-Z41WD-B:~/ptp-dir/mweerden-CHDK-5273d12/tools/ptpcam$ time echo "download B:/ULTEST.BIN ULTEST.BIN" | ./ptpcam --chdk
real    0m4.162s
sonic@sonic-VGN-Z41WD-B:~/ptp-dir/mweerden-CHDK-5273d12/tools/ptpcam$ diff ULTEST.BIN autoexec.bin
sonic@sonic-VGN-Z41WD-B:~/ptp-dir/mweerden-CHDK-5273d12/tools/ptpcam$

...but only with this autoexec.bin binary from Alex (https://groups.google.com/d/msg/ml-devel/A9kwAACsj34/DkszGTRh7u4J). Where might be the source code for it?
Title: Re: Install build via USB
Post by: sonic on May 31, 2013, 04:51:07 PM
Where might be the source code for it?

Never mind, got it (http://magiclantern.wikia.com/wiki/PTP-CHDK) :)
Title: Re: Install build via USB
Post by: sonic on June 03, 2013, 02:10:49 AM
Never mind, got it (http://magiclantern.wikia.com/wiki/PTP-CHDK) :)

...at least the upload. The download has strange difference patterns. I already tried to shrink BUF_SIZE to 32 bytes, FIO_WriteFile() at the same time (works correct) and msleep(10) after send_data(). Strange things going on with the latter. I wonder what the difference from the current repository to the correctly working version magiclantern-2011Mar11.550d.fw109.AudioMon.PTP.alex.zip is...
(http://sven.killig.de/screenshots/dhex.png)
Title: Re: Install build via USB
Post by: a1ex on June 03, 2013, 09:02:55 AM
You may need to allocate the buffers with alloc_dma_memory / free_dma_memory, this should fix it. Make them larger too.
Title: Re: Install build via USB
Post by: sonic on June 03, 2013, 12:33:25 PM
You may need to allocate the buffers with alloc_dma_memory / free_dma_memory, this should fix it.

It works :D I also thought about this, but saw that only the filename was allocated this way in PTP_CHDK_UploadFile.
Pull requested.

Make them larger too.

Testing 128K...
Title: Re: Install build via USB
Post by: sonic on June 03, 2013, 12:50:46 PM
Testing 128K...

Wow:

Code: [Select]
sonic@sonic-VGN-Z41WD-B:~/ML/sonic74/magic-lantern/platform/550D.109$ ls -lh autoexec.bin
-rwxrwxr-x 1 sonic sonic 523K Jun  3 12:41 autoexec.bin
sonic@sonic-VGN-Z41WD-B:~/ML/sonic74/magic-lantern/platform/550D.109$ time cat ../../src/ptpcam.txt | ptpcam --chdk
real    0m1.257s

:D
Title: Re: Install build via USB
Post by: a1ex on June 03, 2013, 01:38:34 PM
Too slow... a USB 3 card reader is faster

:P