Forum >Scratch for Arduino
General Robotics

Scratch for Arduino

userHead Mares Jaroslav 2016-02-26 08:13:02 5590 Views2 Replies
After getting good experience with Scratch for Vortex I’d like to try the Scratch for Arduino functionality now. The DF4Scratch Manual contains all necessary instructions but uploading the StandardFirmata to Vortex board seems to me rather risky. Before doing it I want to be sure that I will be able to restore the original firmware, which is necessary for running both Scratch for Vortex and the Android VortexBot.apk.

Xia Rex informed me that the firmware hex file is available on DFResources and can be simply uploaded using a freeware utility called Xloader. I tried it very carefully, by “updating” the original firmware, but did not succeed. With Vortex connected by usb cable (connected to COM1, rate 9600, device specified as UNO) the Xloader started, displayed “Uploading” for more than an hour and nothing visible happened all the time except that the Vortex woke up about every five minutes and produced a short music and dance. Discussion on Xloader website proves that many other people have experienced similarly hanging and unresponsive Xloader, too. Fortunately, when I stopped it, switched Vortex off /on and started the VortexBot, the Vortex connected, asked for firmware update and after it completion worked as before.

So I would like to ask here three questions:

1) The Vortex.2.hex file contains 1745 lines with code that should rewrite flash memory from address 0000, i.e. including the bootloader. At the same time the author of Xloader specifies it as “a small program that can be used to upload your own *.hex files to arduino boards using the bootloader”. If that mean that in my case the bootloader rewrites itself, may be within a locked memory section, couldn’t this make the trouble?

2) The firmware update option in VortexBot.apk can upload firmware as well. Could it perhaps recognize Firmata or other Arduino sketch as “wrong firmware” version and ask for its update?

3) I do not own any iOS device but just for completeness: WhenDo application also can restore firmware when the user wishes to return to VortexBot. Would this function work for any sketch uploaded to Vortex or just for sketches produced by WhenDo itself?
2016-02-27 00:15:58 Many thanks for your prompt reply! The answer #2 might be the best option for me.

I understand you protect your intellectual property and do not publish Vortex source libraries. My motivation, on the other hand, is the fact that kids like Scratch. As you already mentioned before, Scratch for Arduino is often rather slow. Therefore I seek the opportunity to try its almost identical, but faster and more powerful “dfrobot”, Snap for Arduino, which needs firmata to work. It's just an attempt, maybe a blind alley, I know. By the way, I am looking forward to two Bluno adapters ordered at DFRobot.

Regards, Jaroslav
userHeadPic Mares Jaroslav
2016-02-26 21:28:53 Hi,

For one thing, Vortex core is an Uno chip, it can handle firmata but it may not behave well because all those peripheral devices needs proper driver that is not included in standard firmata. That's why we use our own firmware in the first place.

The firmata version of Scratch is designed for the general Uno chip, especially our Bluno series.

But I can still answer your questions:

1. I have successfully uploaded firmware using XLoader, it may be slow or fail on occasions, but you can always try again to upload new firmware. Vortex firmware hex file is application file, bootloader code is not included and will not be wiped during the process.
Bootloader code address is located at the end of the address space, not the beginning.

2. The mobile app will prompt for firmware upgrade when the code in Vortex is not the latest official firmware. Does not matter if you put firmata, blink or older version of firmware on it, it will prompt for upgrade. Detection process is protocol based.

3. WhenDo no longer can restore firmware. We migrated this function to the Vortex mobile app. Before the migration, it can restore the firmware regardless of the present code inside Vortex. This is the same for the mobile apps, firmware upgrade or rewrite is clean, complete, idempotent, independent and up-to-date.

Mares Jaroslav wrote:After getting good experience with Scratch for Vortex I’d like to try the Scratch for Arduino functionality now. The DF4Scratch Manual contains all necessary instructions but uploading the StandardFirmata to Vortex board seems to me rather risky. Before doing it I want to be sure that I will be able to restore the original firmware, which is necessary for running both Scratch for Vortex and the Android VortexBot.apk.

Xia Rex informed me that the firmware hex file is available on DFResources and can be simply uploaded using a freeware utility called Xloader. I tried it very carefully, by “updating” the original firmware, but did not succeed. With Vortex connected by usb cable (connected to COM1, rate 9600, device specified as UNO) the Xloader started, displayed “Uploading” for more than an hour and nothing visible happened all the time except that the Vortex woke up about every five minutes and produced a short music and dance. Discussion on Xloader website proves that many other people have experienced similarly hanging and unresponsive Xloader, too. Fortunately, when I stopped it, switched Vortex off /on and started the VortexBot, the Vortex connected, asked for firmware update and after it completion worked as before.

So I would like to ask here three questions:

1) The Vortex.2.hex file contains 1745 lines with code that should rewrite flash memory from address 0000, i.e. including the bootloader. At the same time the author of Xloader specifies it as “a small program that can be used to upload your own *.hex files to arduino boards using the bootloader”. If that mean that in my case the bootloader rewrites itself, may be within a locked memory section, couldn’t this make the trouble?

2) The firmware update option in VortexBot.apk can upload firmware as well. Could it perhaps recognize Firmata or other Arduino sketch as “wrong firmware” version and ask for its update?

3) I do not own any iOS device but just for completeness: WhenDo application also can restore firmware when the user wishes to return to VortexBot. Would this function work for any sketch uploaded to Vortex or just for sketches produced by WhenDo itself?
userHeadPic Xia Rex