Tool/software: Code Composer Studio
Here's the situation. I have created a CAN based flash kernel that resides in flash sector A. It is able to flash a new application in sectors B - H. The device boots to the flash kernel, then after some time if it doesn't receive a specific CAN message, it jumps to the application. If it does receive the CAN message, it remains in the flash kernel allowing the user to flash a new application via CAN. I am also able to jump back to the flash kernel from the application at any time. All this works great.
However, there are some extra steps I need to take when initializing the flash kernel (CAN baud rate, cpu counter interrupts, etc.) if coming from a cold start vs coming from the application. I don't need to take these extra steps when jumping from the application because the application already sets the correct CAN baud rate and I want the kernel to use the application's baud rate no matter what it is. From a cold start, the kernel will use a pre-defined baud rate that may differ from the application, and that's ok.
Is there any way for the flash kernel to figure out if it just started from a cold start, or was called by the application? I thought about writing to some seldom used register in the application that the kernel could then read. If the register is set to a non-default value, it knows the application called it. Or maybe define a location in RAM in both the kernel and the application's linker files that I can store data in to be shared between the two apps? Would that work, assuming I can figure out how to do that? I assume RAM isn't initialized to some known value on startup so there'd be some very small chance that, on a cold start, it would be set to the value I would write in the application.
In summary, I guess I'm asking how to pass information between two different applications running from different flash sectors.
Any suggestions? Does my predicament make sense?