[C.CC USERS] TVM can not load an occam program on an Arduino MEGA 2560 board

Matt Jadud matt at jadud.com
Fri Nov 4 14:50:24 GMT 2011


On Fri, Nov 4, 2011 at 10:19, Pierre-Yves Lucas
<pierre-yves.lucas at univ-brest.fr> wrote:
> I am wondering if the tvm machine reads the occam code at the wrong
> memory address.
>
> I need some help please in order to go further in my work.

Hi Pierre-Yves,

I have several 2560s that don't work. This is because the original
bootloader was broken. Specifically, this is what is happening:

1. The TVM is uploaded to address zero. We have verified this works
fine on the 2560.
2. The bytecode is uploaded to the correct address (somewhere around
0x6000 or so). This works fine.
3. Unfortunately, when the bootloader is uploading the bytecode, it
begins writing the bytecode at 0x6000, but begins erasing blocks
(before writing) starting at address 0x0000. Therefore, when you
upload bytecode, you overwrite the firmware.

We actually have a fix. That fix is to have a Python script mangle the
VM and bytecode into one file, and upload the whole thing at once
every time. It is an unfortunate fix, but it is a stopgap until we
decide how to more permanently handle the fact that many, many 2560s
exist in the wild with this problem.

Christian: my weekend is bad (I have a college roommate visiting for
several days), but could we push a fix into the tree that helps
Pierre? In truth, this is a Linux issue, which means:

1. We need to double-check the addresses for the platform (I know we
were playing with them a while back), and
2. it would be best fixed in "plumb" (and the documentation updated
accordingly). For Pierre-Yves: there is actually a cute little wrapper
script for Linux that does all the hard work for you, but I've never
really documented it. It allows you to do "plumb -port /dev/ttyUSB0
<prog>.occ" (or something close to that), and it compiles, checks that
a new hex file was created, and does the upload for you. A minor tweak
to that will be necessary, I think (or to occbuild), but it would
simplify the process.

Either way, we're happy to make this work for you. I've been meaning
to get this fixed for myself, but external pressure always works
better than internal pressure.

Sound good? (Anyone else who wants to jump in and help fix, that would
be fine, too. My weekend is taken over by social obligations... and,
FWIW, I'm perfectly happy given how busy this semester has been, to
have two days where I hang out with an old friend. :D ) After that,
though, I can dive in and help get this fixorized.

Cheers,
Matt



More information about the users mailing list