Yesterday and today I’ve spent many hours trying to build my programming enviroment for at91SAM7X256 using Cygwin + OpenOCD + GNUARM + insight + JTAGKEY clone.
I managed to debug an easy example in RAM and it worked fine (not very well, but could be worse).
Now i need to run flash programming using OpenOCD and JTAGKey and it doesnt work. I’ve used “Using OpenOCD as flash-programming tool” by Martin Thomas. The problem is that everything looks OK, OpenOCD uploads data into ARM, but program doesnt run (that is led doesnt want to flash ;).
The same program, uploaded into flash with SAM-BA software works OK (that is, led is flashing ;). I’ve read about configuration bit that tells the uC to boot from Flash, not ROM. And I set it to logic 1 in SAM-BA. But then, after running OpenOCD and uploading program into Flash, it stll doesnt work.
Even when I have an working program in Flash, uploaded by SAM-BA, and I overwrite it with same program using OpenOCD, it dies.
Can anybody help me with this problem? Or maybe, if you managed to program sam7x256 flash using OpenOCD, could you give me your scripts?
Without knowing what the core does when it “doesnt run”, I can’t say what the reason is. I can also speculate that it’s related to the NV bits you mention, which the current SVN version of OpenOCD doesn’t handle. There’s already a patch that allows modifying of the NV bits in the patch tracking system at Berlios, but I haven’t had time to integrate it into mainline. If you’ve built your version (which is it, btw?) from source you can add the patch manually.
Once I’m done with integrating support for that unholy native Windows stuff, I’ll add the at91sam7 nv patch, too.
I’ve downloaded my windows build of openocd from usbdip, its: openocd-2006re76-setup-rc01.exe.
I’ll try to add compile a new version with this NV bit patch but I’m almost sure that it is set to 1 because when I read Flash Status Register (0xFFFFFF68) with mdw command, I get: 0x00000401 (4 means programmed GPNVM2, am I right?).
I dont know where can be the problem… and why it work with the same binary programmed with SAM-BA. Maybe OpenOCD changes also something else…
Anyway, thanks for help. I’ll work on this problem tomorrow. I’m new to ARM and everything is difficult to me, but I’m still learning ;D