Hi I would like to run a function in microcontroller_1 in another microcontroller_2 is it possible? For example i want to execute this code in microcontroller_2 via microcontroller_1:
LPC_GPIO2->FIOSET=0xffffffff;
or for another example i want to ruuning this code from micro_1 to micro_2:
__disable_irq(); command[0] = 57; // Reinvoke ISP command iap_entry (command, result);
I mean i want to sent above code from micro_1 to micro_2 and expect to running this code in micro_2. Is it possible?
Possible - but probably not desirable.
The more common approach would probably be to have a command/response protocol - so that microcontroller_1 asks microcontroller_2 to do some specified action; microcontroller_2 does it, and returns the result to microcontroller_1
Something like this: http://firmata.org
Perhaps if you explain what you're actually trying to achieve by this, people would be able to make appropriate suggestions:
www.catb.org/.../smart-questions.html
Suppose that microcontroller_2 is a LPC2300 protected in CRP3 or CRP2 and i want to run an application code to it(For example:
iap_entry (command, result);
) in order to reinvoke ISP command from microcontroller_1. Have you any solution?
Unless you've provided a method to inject machine code into the target device, probably not.
Is this device yours, or are you attempting to hack or reverse engineer someone elses?
If you have code-protected the chip, then you are limited to the documented ways to unlock it - or spend own time trying to figure out design errors.
A good rule - make sure you have a way to erase a chip or have an interface for sending commands to do IAP before you code-protect it.
If you did CRP2 - then connect using serial port (FlashMagic) and do a complete erase.
If you did CRP3 - use the IAP-interface you have already carefully implemented and tested to erase the chip or change firmware or copy repair code into RAM and run or jump into the ISP boot loader. You didn't implement a working IAP interface or a way to enter the ISP? Consider getting a new chip. Or a new board if you don't like soldering.
This is my own device but i forgot disable CRP3.Is there any solution to reinvoke ISP command?
www.nxp.com/.../AN10968.pdf "Be aware that there is no built-in recovery for designs once CRP Level 3 is enabled."
So basically if you didn't rough-in a trapdoor, then assume you don't have one. Throw away the chip, and learn from the experience.
View all questions in Keil forum