This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Starting an on Flash application on second run with a different entry then main

Other Parts Discussed in Thread: TMS320F28335

Hello

I have the following problem:

I am planning to set up a project which will actually hold two project in one. The idea is like this I will have a project, we call it the ipl (initial program loader), which will decide on start up which other software will be loaded from flash. It will also have the possibility if there is no other software available yet to start the flash algorithm which it self will be part of the ipl project. 

My question now is how would it be possible, once one of the other applications is running, to start the flash algorithm within the ipl code without actually starting the main of the ipl again.

Is it possible to rerun the c_init of the ipl project so that all variables are initialized again and then actually start a different routine than main?

Remark: the flash algorithms have to be on the system since we have to keep the flash cycle as short as possible since this is a medical device and uploading the bootloader takes precious time.

regards

douncon

  • douncon said:
    Is it possible to rerun the c_init of the ipl project so that all variables are initialized again and then actually start a different routine than main?

    Not by using the c_int00 routine as supplied in the compiler RTS library.  Though, you could make a copy of it, rename it, customize it to call something other than main, then invoke it when it makes sense.  

    That said, we compiler experts are not very good at system issues like this.  Which processor is this for?  I'd be happy to move this thread to the forum for that processor.

    Thanks and regards,

    -George

  • Its for the TMS320F28335.

  • I beleive common way of returning to a boot loader or another form of start-up software is to write a "magic number" into a RAM location and reset the device (with the watchdog for example). Upon startup, the boot loader checks this "magic number" location and decides what to do (start another app, reprogram or whatever).

    This way you can avoid all the hassle of re-running init routines, set up stack pointers and other CPU states. But - if you want to keep all CPU peripherals running you have to do it the hard way...

    /Mikael