I have myself an at91sam7x256-ek IAR kickstart dev kit, including the IAR branded j-link.
I’ve downloaded pretty much everything related to GNU ARM development i can find, so i have all the tools, and i can just about get them to work (though it did take me a week to discover that you had to d/l the .bin via sam-ba before you could use the GDB stuff!). My set up is eclipse with the cdt and embedded debugger, using the GNUARM toolchain, and while i have the 30-day licence, the segger jlink gdb server, as it works better then the yahoo groups version.
Anywho, i’ve been trying to get the lwIP_Demo_Rowley_ARM7 to work, but it’s failing on the portRESTORE_CONTEXT() macro.
Now i’ve searched, and it seems to be a common problem, but i have seen any ‘this is how to fix it’ posts apart from make sure it’s in supervisor mode. Well, as far as i can tell it is. I’m using the demo pretty much right out of the box, i’ve just move a couple of directories around, and edited the makefile accordingly.
In portRESTORE_CONTEXT(), when you execute the line
LDMFD LR, {R0-R14}^
the ***user/system mode*** registers should get loaded with values such that R1 contains 0x01010101, R2 contains 0x02020202, up to R14 which should contain 0xaaaaaaaa.
If executing this line causes any of the Supervisor mode registers to change then you are not in the right mode. Especially, if the Supervisor mode LR contains 0xaaaaaaaa after the execution of the above line then its a dead give away.
I presume you are using the start up code form the demo?
Inspecting the mode bits of the CPSR should show that the last last 5 bits are set to 10011 binary.
If you are in the right mode then can you say which line within portRESTORE_CONTEXT causes the problem?
at the point restore_context is executed the cpsr is 0b11110111, and R1-14 are alsorts of values, so not at all correct.
My mind doesn’t work too well in asm, but the last access to that register in boot.s look to be setting SVR mode…
Ok, the fresh demo does the same compiled under GCC, but compiling under Rowley Crossworks and using the same tools (eclipse, arm-elf-gdb, jlinkgdb, etc) for debugging works just fine. Devils in the detail, somewhere.
update: i used Winarm and info from here: http://en.mikrocontroller.net/topic/67145
to compile and run the project which got past the portRESTORE() bit, but then locked up somewhere in the yeild section (both co-op and pre-emp).
even tried using the startup script, liner script and makefile of a similar project http://en.mikrocontroller.net/topic/87535 to no avail - locked up as above.
I simply don’t have the experience or knowledge of the ARM arch. or the AT91SAM7 to be able to fiddle with the assembly start-up scripts (where surely the problem lies). To that end I’m giving up and using rowley - it worked first time!