Search This Blog

Saturday 29 September 2007

Getting there...

So the i.MX21 is working fine. Next up is the Multimedia COG...

First thing I tried was the 'touch' example. I used uMon, via Hyperterm, to download the elf and set it up to be executable from the flash memory. Ran it and hay-presto the touchscreen sprang into life :)

Next up I thought I'd try the 'lcd' example. Trouble is I can't get the entire elf transfered via xmodem. The Hyperterm file transfer dialog looks like it sends all of the elf, but the 'tfs ls' only showed ~4kB transfered. Of course trying to run the truncated elf throws up a simple error :(

After removing the lcd file from the flash ('tfs rm lcd') the same thing is happening with the xmodem transfer. I even tried deleting the elf and cleaning the flash 'tfs clean'. Still no joy. Even 'tfs check' says that the files in the flash are OK. Which is strange in that the 4k lcd elf should have at least check sum failed??

So next... I downloaded the HAB Toolkit from the Freescale web site (the i.MX21 variant linked from the wiki, albeit a page hidden in the wiki history). Annoyingly this only allows for setting COM 1-4. The laptop has the Silabs USB to UART mapped to COM5!!! :S And the Device Manager says that COM1-4 are in use.

Gonna take a break and see if the sub-conscious kicks in and throws up something else to try.

UPDATE:
As this blog entry comments show, Tarun from VC made a valuable suggestion. I need to have a look further, and see if this could become a common problem or not, but the lcd elf contents was terminating the xmodem transfer :( Adding some additional code to alter the final elf sorted out the transfer problems, and I am able to upload images to the LCD :) Thank you Tarun.

I can't get VC's Booter to work. It's possible that that is suffering from the flow control problem I faced when first getting started?? I'll get in touch with the author and see if problems I face with it can be sorted, and help advance the tool. Although probably after the trip to Egypt next week.

5 comments:

Tarun said...

Hi Richard, try using our Booter software. It has both Ymodem capabilities and a better version of the HAB.

http://wiki.virtualcogs.com/tiki-view_blog.php?blogId=7

The download link is at the very top of the page.

Unknown said...

Hi Tarun,

Thanks for the support. How on earth did you find this blog so fast? :)

I tried Booter earlier on before your comment, and had no joy with it either.

In Booter I've chosen the COM5 port from the drop down (this agrees with the Device Manager, Silabs driver). Tried three different speeds; 115200, 230400, and 460800. The Y-Download prompts for the Filename but then does nothing. The HAB Download option asks for an init and bin file. I created the following init file;

#init script

#set usb power to 500mA
usb.setpower 500

#load elf
umon.waitforprompt
umon{xmodem -dy
umon.ydownload D:\Robotics\Workspace\VC21\touch\touch
umon$tfs ls
umon$tfs -fe cp touch touch
umon$touch

(Note: In above $ is < daft HTML tagging in this comment box)
And give it the touch.bin (just trying something I know works, and can give immediate visual feedback, on the lcd).

But the terminal window says;
Downloading: D:\Robotics\Workspace\VC21\touch\touch.bin

then nothing else.

This was tried with the boot jumper on and off. No joy either way.

Is it normal for all three LEDs to remain lit when using the internal bootloader? They all go out when using uMon way.

Btw; I can still download touch elf via the Hyperterm route. So I know that works. Just Booter and downloading the lcd elf don't.

Unknown said...

Update:

I added
booter.setbaud 230400
to the start of the init file, and changed the last line to
umon{touch
Still no joy using this via the HAB Download button.

Also tried this via the script 'play' at the top of the Booter window. This ouputs the first three commands;
booter.setbaud, usb.setpower, and umon.waitforprompt
but if stops on the wait for prompt.

This is with the boot jumper open.

Tarun said...

Hi Richard. How did I find it fast? Google Alerts ;-)

230400 is the correct speed. The LEDs will turn on for a short period and then extinguish themselves when running under uMon mode. In HAB mode, they will stay lit.

To use the Ymodem stuff, you need to manually type the "xmodem -dy" on the uMon prompt and then start your Ymodem download.

When using the HAB stuff, the boot jumper must be INSTALLED. Otherwise it should be LEFT OFF (uMon mode).

If I understand correct, you have no problems loading/running the touch screen demo program? You do have problems with the LCD demo program though, correct? Have you installed your toolchain? Could you do a "make clean" and then do a "make" again? I've run into issues in the past where if the file you are uploading is corrupt in a certain way, uMon doesn't like it (it finds the TFS end of file marker, hence why the full sized file doesn't appear to be present).

If none of this works, can you post this question on the mailing list? Dan should pick it up (he put together Booter).
http://groups.google.com/group/virtualcogs

Unknown said...

Hi Tarun,

Many thanks for the advice. This morning I gave it another try and through a suggestion you made got it to work :)

I had tried a clean and make on the lcd example, but ran into the same problems with the truncated xmodem upload. So first thing I tried was to add some additional code to the example, rebuild, and it worked first time.

Thank you, Richard.