OK, got it with the registers but now I have a new problem -
In RLP I have while(1) loop. It works fine, but now I cannot deploy new code. VS2010 writes “Preparing to deploy assemblies to the device” and nothing happens.
Anyone have an idea, how to work it around?
@ Stargazer - others might have better advice, but for me I just reset the device while deploying or just as the deploy starts. It might take a few attempts, but normally it will catch the device before at the right time and manage to deploy.
Depends upon what is within the while loop. If the processor gets into a tight loop, then it is difficult for Visual Studio and the debugger to attach to your device.
As I had no other ideas, issue was solved by FW update, though it was a bit tricky, as FW updater couldn’t connect to the device either. I know it’s overkill, but I couldn’t come with better solution.
Tight loop and debugger not attaching - simplest way to deal with that is to hit reset and hope you have enough spare cycles in your app startup that allows the debugger to attach before it hits your tight loop again. Harder way is to go into bootloader and erase all. Best solution, like Mike says, don’t do a tight loop and return back up to managed code and rest
If I’m testing tight RLP code, then I write this managed code in the very beginning:
bool wait = true;
while (wait) Thread.Sleep(500);
This way I need to manually set wait to false using watch or immediate window before the program starts. But if you press reset, the board will stick in that loop and you can deploy easily .
I’m working on an RLP solution with Hydra. AFAIK, there’s not libraries I can include, which will make my life easier. If there is, PLEASE let me know.
Now one more thing - I couldn’t find any simple code examples for RLPLite, which would explain simple things like setting ON and OFF a pin, reading data from a pin and so on. I’m trying to work with AT91SAM9RL64 chip, which is used on Hydra and it’s a bit complicated. The only thing I could find is AT91SAM9RL64.h which maps the CPU API, while it’s complicated too.
@ Stargazer - You need to go back to the chosen answer for this thread and download the user manual for the Hydra’s uC. It will give you all the info you need.