cancel
Showing results for 
Search instead for 
Did you mean: 

ST-Link Utility ''Run Application'' from CLI?

chrisnielsen9
Associate II
Posted on October 04, 2017 at 19:31

Our application (SensorTile L476) works well when programmed and run from our SWD programmer (Nucleo 476).  However, once untethered from SWD, if we disconnect and reconnect the battery, the CPU stays in Reset and never exits.

We discovered a fix, check 'Run Application' in 'Automatic Mode' in ST-Link GUI, then program device.  This works.

What bit(s) is 'Run Applcation' changing in our device's FLASH to allow it to function?  My suspicion is the Option Bytes but I haven't yet found a bit to perform this function.

Does CLI support 'Run Application'? (I've looked and can't find it)

The command line is quite efficient and our preferred interface and we are hoping for the same functionality in both interfaces.

Thanks, Chris

3 REPLIES 3
chrisnielsen9
Associate II
Posted on October 04, 2017 at 22:26

I watched the ST video on Option Bytes via the Utility.  I inspected the Option Bytes (at least those shown by ST-Link) and they are IDENTICAL between my failing board (hung in reset) and my successful board (boots normally).

However, there must be some difference in FLASH somewhere because I am removing power (battery) and reapplying it...confused.  Are there other bytes/bits hidden somewhere that 'Run Applications sets/alters?

Thanks

chrisnielsen9
Associate II
Posted on October 04, 2017 at 22:40

I think I figured it out.  Our app starts at 08004000, but I did a memory dump back to 0x00000000.  My bad, I think.  It appears that 'Run Application' loads the low FLASH with vectors and run-time code (I think) -- is this right?

I'd rather get full control over all the code/vector-tables.  I haven't done any research yet (I will) but I'm guessing I need to alter something in the link process so it includes the vector tables and run-time code.

Did I get it right?  Is there a good example of this process?  Thanks

Posted on October 06, 2017 at 18:27

 ,

 ,

Hi,

you can have a look at chapter 1.5 (The boot process) of the FP-SNS-ALLMEMS1 User Manual (

http://www.st.com/resource/en/user_manual/dm00287877.pdf

 ,) that explain how to setup the application in order to run from address 0x08004000 (provided that a bootloader is present at base address 0x08000000).

On the contrary, if you want the application to run from base address just define the Vector table offset to 0

 ,  ,  , ♯ define VECT_TAB_OFFSET 0x0

and define ROM section start address and vector table address to

0x08000000

 ,in the linker script.