Load sketch code from SD Card

I am interested too. How much flash memory is left for the actual application (sketch)? Can you choose what to load or it loads a default hex file? Thanks.

The bootloader takes up less than 4K total. This means that you'll have 28K at your disposal (on the '328). I'm actually using the bootloader on one of our AVR boards - with an ATmega644P - which means I have 60K left for goodies.

Right now, you can only load a hex file named "sketch.hex". The file is in native hex format which is parsed inside the bootloader - so no fiddly changes - just copy onto the card and go.

Tw34kd: I needed to load code on a remote installation (maybe that's obvious). Specifically, they are for POP (point of purchase) units that play music and capture metrics.

I'll put together a page with the bootloader and other info in the next couple of days.

b

Yiehha, i am really interested.
Sounds damn cool. I read about all the questions and halftries in this Forum, and gave up hope that somebody enough skilled programmer has the need for this :slight_smile:

Waiting excitedly for this! Wanted this ability for a long time.

I guess I’ll have to get over my fear of burning the 644P bootloader with a parallel programmer.

Can the hex file live on the card with other files?
(Guess I can wait till Christmas to find out.)

Thanks again for your great work. This for sure is a chick magnet! You should score mightily.

I think we are all interested in seeing your work Are you using any of the popular FAT libraries? Does it handle verification? How does it handle verification (page by page or all at once at the end)? What does it do when there is a mismatch?

This for sure is a chick magnet! You should score mightily.

Maybe if you are looking really geeky chicks ;D

Mowcius

Maybe if you are looking really geeky chicks

Right! And I can certainly appreciate your firm grasp on the obvious. The comment was made with regard to bhagman's tag line.

Right! And I can certainly appreciate your firm grasp on the obvious.

Life is obvious, i have a firm grasp on life, oh wait, maybe not ;D

Mowcius

ping.... for any more information regarding this boot loader.

Really interested in learning more.

Awesome! I was looking for something like this back when I was playing with the Basic Stamp. I had Palm, and would have loved to be able to program the device out in the field. There wasn't a straight forward method to doing it though. Of course, at that time there wasn't anything like an XBee.

Now is there any way to edit a .pde file from a smart phone?

You might be able to edit a .pde file on your smart phone, but how would you compile it? You need to write the resulting .hex file to the SD card, to be loaded by the Arduino, not the edited .pde file.

That's what I was looking into some time ago. I was looking at an arduino doing the compiling and then programming another arduino.

I didn't get very far becuase I realised that that was rather out of my reach with limited knowledge (none) of the bootloader/chip architecture/arduino IDE etc.

I got as far as that you could make sketches to run on arduino but you would need something on the arduino to interpret it (bitlash or similar). Then you could change the code and run different programs at different times, create them on anything as long as you could save it as a text file on a microSD card (or any media that can be interfaced with an arduino). With the new arduino chips (on the mega etc) with a lot more space, bitlash (or similar) could be made so that it could run most commands that you would ever want to run on an arduino.

In theory, you could make your own program that could interpret C++ code and run it using a program on your arduino. Then you wouldn't need to compile it as a hex (or whatever the chip uses), you could have your arduino interpret it as it runs it. It would not be as fast as straight forward 'code' but for most things, that would not matter too much.

Anyone want to embark on a C++ interpreter version of bitlash with me? It is a project on my list but I have been a bit busy recently and not had much chance to start on this (possibly massive) project.

Mowcius

You might be able to edit a .pde file on your smart phone, but how would you compile it?

Just get a Linux-based smartphone, and install arduino-0017 on it ;)

Just get a Linux-based smartphone, and install arduino-0017 on it

Hehe, maybe another project for the arduino team, a mobile friendly version (if there could be such a thing!)

Mowcius

Anyone want to embark on a C++ interpreter version of bitlash with me?

Nobody that you'd trust unsupervised with sharp objects 8-)

A C++ (or even C) interpreter or compiler is completely impossible: it just doesn't have the needed memory resources to load or run one, even slowly.

If you want to run an interpreter on an Arduino, you need to scale back your expectations to a language like FORTH or Tiny BASIC. Or something like bitlash.

Ran

A C++ (or even C) interpreter or compiler is completely impossible: it just doesn't have the needed memory resources to load or run one, even slowly.

If you want to run an interpreter on an Arduino, you need to scale back your expectations to a language like FORTH or Tiny BASIC. Or something like bitlash.

Ok, I thought it would be difficult...

Now I think about it, I see what you mean. It is not just simple commands, you are asking it to interpret curly brackets, variables and everything in between.

I will look more into bitlash. I think I saw another attempt at an interpreter type thingy somewhere? Anyone know what it was?

Mowcius

FYI: I'm still working on documenting it better, but here's the code and a short write-up. I'll make up some fancy connection diagrams and such.

http://www.roguerobotics.com/wikidocs/code/bootloader_using_ummc

b

Regarding the interpreter you were talking about earlier, I was thinking about that a couple of days ago and I belive that it is perfectly doable if the script is compiled to some form of bytecode before being copied to the storage medium. It would be slow even if "interpreting" compiled code that could run natively on the board, but I'm positive it could work. Probably this sounds weird, but: - I think that "interpreting" native code would have the lowest overhead - The AVR being a Harvard architecture, you can't just load the code into RAM and then jump to it (this is how the von Neumann architecture works because it doesn't differentiate between program storage and data storage).

I'm still working on documenting it better, but here's the code and a short write-up. I'll make up some fancy connection diagrams and such.

http://www.roguerobotics.com/wikidocs/code/bootloader_using_ummc

Can it work with any SD card storage? I do not have the roguerobotics board (I am thinking of getting the rMP3). Is there something specific that is needed on the rr board?

How are you getting your hex files for putting on the microSD card, are you taking them from the file folder that the arduino IDE creates?

Mowcius

The AVR being a Harvard architecture, you can’t just load the code into RAM and then jump to it (this is how the von Neumann architecture works because it doesn’t differentiate between program storage and data storage).

Is there any way that we could have a Von Neumann arduino? What chips use the Von Neumann architecture?

Some ARM processors can do that can they not? I presume the ARM arduino that I saw a bit ago will be using a harvard ARM chip…

Mowcius