cancel
Showing results for 
Search instead for 
Did you mean: 

I can't access to model from one concrete view.

Fran Marala
Associate III

Hi all

First of all I'm working with STM32F469I-DISCO board and I'm using TouchGFX Designer- 4.15.0.

I have the next problem

My application have 4 different screens, I'm storing in the model general information, and I can access to it without any problem in three of this screen but in one of them I can't.

I've been using the same code and even trying to access at the same data stored in the model but has been impossible.

In this screen the program crash but not in the view but in the presenter, the next is the sequence of my problem:

First step:

Here as you can see below, I'm in a view trying to get _ptr_system from model, so I call to presenter->getsystem();

ScreenSetSubsystemView::ScreenSetSubsystemView() :

scrollListSubsystemSelectedCallback(this, &ScreenSetSubsystemView::scrollListSubsystemSelectedHandler),

_ptr_system (0)

 {

    touchgfx_printf("\n\nEntrando: Constructor clase ScreenSetSubsystemView\n");

    touchgfx_printf("ScreenSetSubsystemView.cpp ScreenSetSubsystemView(): Befor asking _ptr_system to model\n");

    _ptr_system = presenter->getsystem();

Second step:

As you can see here, I'm in presenter and I'm trying to access to model->getsystem(), and this the point where problem begin. I can see the touchgfx_printf message but then then program crash.

CSystem* ScreenSetSubsystemPresenter::getsystem() {

    touchgfx_printf("ScreenSetSubsystemPresenter::getsystem(): While asking _ptr_system to model\n");  

    return model->getsystem();

}

And last, I'm in model where I'm trying to get _ptr_system

CSystem* Model::getsystem() {

    touchgfx_printf("Model::getsystem(): Returning _ptr_system from model\n");  

    return _ptr_system;

}

The strange is that I can get for this information without problem through the rest of screens, but not in ScreenSetSubsystemView.cpp

Any idea about of this problem?

Thank you very much for your help.

Regards

Francisco García

1 ACCEPTED SOLUTION

Accepted Solutions
Fran Marala
Associate III

Hi all, I have fixed the problem!!! ;)

The problem was that I was trying to call model during the construction (inside the constructor) of the view (as you can see in the code) and that is an inconsistency action.

View solution in original post

3 REPLIES 3
MM..1
Chief III

Try change your heap , stack ,task size memory...

Fran Marala
Associate III

Hi all, I have fixed the problem!!! ;)

The problem was that I was trying to call model during the construction (inside the constructor) of the view (as you can see in the code) and that is an inconsistency action.

Great to hear that :thumbs_up:

Could you close this post by selecting your answer as Best Answer ?

/Romain