0

My question is explained below.

enter image description here

  1. Build the main image.
  2. Download main image using JTAG.
  3. Build the application image.
  4. Download app image using RS232.
  5. Run main image.
  6. Call the func_a in the application image from the main().

Is it possible on this system? Please let me know what to do if possible.

Thank you, Regards, Henk

  • Just *jump* to the function? Or define a variable that is a pointer to a function, assign it to point to the location of the function you want to call, and use the function pointer variable as an actual function? – Some programmer dude May 31 '17 at 02:16
  • It does not matter which one. What I want to know is how to use other image functions. – Henk Jeong May 31 '17 at 02:32
  • You should know at which address the image is loaded. You also should know (or can easily find out) the offset of the function in the image. Add the two and you have the address to the function, which you can then initialize the function pointer to point to the address and can then call the function. – Some programmer dude May 31 '17 at 02:41
  • My suggestion if you have two images, is to have one being just a "boot image" that initializes the hardware, then jumps to (or calls) a function in the second image which then is the application image which does all the work. Then all you need is to call a single function in the second image from the first, simplifying everything quite a bit. – Some programmer dude May 31 '17 at 02:42
  • Thanks for the friendly answer. But unfortunately, the main program continues. Then i have to replace it with a function created by an external program. Therefore, it is difficult to simplify. – Henk Jeong May 31 '17 at 02:50
  • are you saying you have 'boot loader' image that loads the 'function image via RS232? If so, then run the boot loader, Amongst the items loaded is the 'start' address (not necessarily the first address) of the function image. At the reboot address, save the 'start' address, then force a reboot of the processor. As the processor reboots, it gets the 'start' address of the 'function image' and executes that image. Note: this assumes each image can run by itself. – user3629249 May 31 '17 at 15:36
  • It will load and run the image from the boot loader. That's not what I want. I just call the function and then return to the original image. It is okay to call a function, but the simple operation function is executed, but it is killed when it tries to process the string. This means that the '.data' area is not loaded.I am looking for a way to load the image's data, sdata, bss, etc. into RAM. – Henk Jeong Jun 01 '17 at 08:42

0 Answers0