Tuesday, May 22nd 2018, 9:54am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

v01d

Beginner

Date of registration: Feb 29th 2016

Posts: 121

1

Friday, March 9th 2018, 12:31pm

[SOLVED] Ways of setting Starting Stack Pointer Value

Currently in SES you can use symbol or hex value to set initial stack pointer value (Debug-> Debugger .. ).

It would be great if there were other ways to do this - particularly through script or SES' macros expansion & execution.

E.g. I would like to use this l33t script function (with emScript):

function get_sp_val_from_bin(){
//Note: bin_file_full_path must be defined when calling the script with -define
//The bin file for a Cortex M will have SP value as first word / 32bit
BinaryFile.load( bin_file_full_path );
var val = BinaryFile.peekUint32(0, true);
return val;
}
spval = get_sp_val_from_bin();

WScript.Echo( "0x" + spval.toString(16) );

and then in SES specify the intial SP value with possibly something like:

$(StudioDir)/bin/$(StudioScriptToolExeName) -define 'bin_file_full_path'='$(ProjectDir)/$(OutDir)/hello_world.bin' -load $(ProjectDir)/initial_sp.js

:whistling:

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

2

Tuesday, March 13th 2018, 9:25am

Hello,

Thank you for your suggestion.
We will discuss this approach in our next meeting.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/


v01d

Beginner

Date of registration: Feb 29th 2016

Posts: 121

3

Monday, April 23rd 2018, 2:57am

Thanks Nino.

Did it make it into the upcoming release?

Issue closed.

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

4

Monday, April 23rd 2018, 9:35am

Hello,

Quoted

Did it make it into the upcoming release?

This will not be implemented yet as the final decision is not made yet.

For now if the SP is not set correctly through download as it is usually expected we recommend setting it through the application.

We will consider this thread as solved now.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/