quick question about COGINIT (asm)
pems
Posts: 70
Hi, i tried searching but couldn't find answer
I am working on a way to load a binary into the hub ram (via a small bootloader written in pasm over a byte-wide parallel IO lines), then, once received, starting this binary using COGINIT.
The binary that i am transferring is a binary file generated by the proptool.
I am unclear as to what location in memory i should be pointing COGINIT to to get the asm code. I've tried offset 0x18 from the start of the binary (as it seems thats where the first asm command resides) but that didn't work for me.
Thanks
I am working on a way to load a binary into the hub ram (via a small bootloader written in pasm over a byte-wide parallel IO lines), then, once received, starting this binary using COGINIT.
The binary that i am transferring is a binary file generated by the proptool.
I am unclear as to what location in memory i should be pointing COGINIT to to get the asm code. I've tried offset 0x18 from the start of the binary (as it seems thats where the first asm command resides) but that didn't work for me.
Thanks
Comments
I'm guessing you're not using ANY spin in this binary download?
also, I'm gonna take a stab at your coginit instruction, and guess that you're possibly not pointing it to a cogram long which has the ( baseaddress and the PAR value in and which cog to start it in ) ?
eg
hope that helps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
I completely missed the part that the hub address that specifies the start execution address for coginit is supposed to be a LONG ADDRESS
It works now!
btw, now i have a framework that would potentially allow very fast propeller bootloading speeds.
essentially a tiny bootloader that loads up first via p30, 31, then sucks in the actual firmware over the 8bit parallel bus as fast as it can
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
I have another COGINIT question for gurus: i know it's a hub instruction: Is it guaranteed that when the COGINIT returns, the cog is up and running and hub isn't using the 2k binary chunk anymore? (i.e can one clobber the 2k block that was passed to COGINIT, as soon as COGINIT returns?) or does COGINIT simply schedules the initialization of a cog and doesn't wait (doesn't block) until the cog is finished initializing?
Cheers
You can include a waitloop after coginit. The time for loading the whole cog is the same as 512 contiguous RDLONGs (8192 clocks, or 102.5us at 80MHz).
Andy
Post Edited (Ariba) : 11/3/2008 10:30:38 PM GMT