I'm kind of beyond the blinking LED phase with this chip, but I have to admit it has been one of the most difficult architectures I've ever worked with (and I'm including parallel processors, DSPs, and many other micros). I suppose the difficulty comes from never having to worry about every little detail of the system in the past, including boot code, etc. PICS, for example, are easy-peasy to create boot code for as there are no peripherals.
With the current system, I'm actually forced to deal with things like external RAM access timing, reset sequences, etc. I've muddled my way through it with an occasional dose of help from my boss (who is intimately familiar with these chips), but I can't keep relying on him to solve my problems. I'm a wiz at writing highly optimized assembly code for DSPs, parallel processors, and the like, but never having taken a proper computer architecture or algorithms class during my school days is starting to show the cracks in my armor. All it takes is a single non-obvious problem and I'm stuck for days/weeks until I either get lucky or someone comes to my rescue. Hell, not being able to figure out that RAM timing was an issue caused a two week delay in the boot code many months back, and that was only resolved with the correct suggestion from my boss. Not a good situation for job security.
At the moment, I'm working on a bootloader to allow for field upgrades. The main app works by itself on the system just fine and has been running in the field for several months. The bootloader does its job loading the main app code into flash (verified by looking at it byte for byte).
If I run both together in debug mode using JTAG, the bootloader works like a charm, allows me to download new code, erase flash, etc. and the main app starts without issue. Without the debugger, the bootloader still works, but the main app refuses to start. My boss has suggested the only difference between the two setups is the Startup.s file that gets the clocks running, sets up memory timing, etc. I have removed all of the similar stuff from the main app's .s file (memory timing doesn't need to be set up twice, clocks are already running, etc.), but that still hasn't resolved the problem.
VERY frustrating!
Dan - Owner