You are here

Code issues related to reset | Cypress Semiconductor

Code issues related to reset

Summary: 20 Replies, Latest post by Alex101 on 03 Nov 2016 08:03 AM PDT
Verified Answers: 3
Last post
Log in to post new comments.
Alex101's picture
User
131 posts

Hi Every one

Thank you for the possibility to ask questions here.

This may be a silly question.

Assume  that  you are verified that all  project's components  are  correctly started and the variables that should be initialized are OK.

What can be the reason  that certain code  just  run ok one time  after the  end of chip's program from PSoC Creator or after Power on Reset ?

Thank you very much foe any help.

Regards

 

user_1377889's picture
User
9581 posts

Stack corruption is the most probable reason for that. Post your project and we check it.

 

Bob

Alex101's picture
User
131 posts

Hi Bob

Thank you.

I will do some cosmetic to the code because  comments are a mix between English/Spanish and I will post it.

thank you again

Regards,

 

Alex101's picture
User
131 posts

 

Hi Bob

 

Please see attached bundle.

The project is about a star network through Infrared link with a kind of RC5 encoding scheme.

The attached project has an IrGateway Project which send messages  to the different  sensors in loop fashion , with a time gap between messages.

That message is to address a different sensor through the sensor number and sensor type.

The sensor 'answer sending  data trough a payload is not yet implemented.

I'm stuck at this point: Sending the request -  the sensor  board capability  to recognize that the message is for it.

How the project is implemented:

For the IrGateway project  I am using a CY8CIKit-050.

Currently I have implemented  only two sensors with CY8CKIT-059 each one.

Actually there is not sensor at all at this point.

I 'm only sending a constant value as request for  each sensor.

That constant  value include Sensor  number and sensor type plus Header/ Preamble and CRC.

Facts:

1-Trough Debugging I verified that each sensor receive its payload  correctly .

1-Trough the scope I verified that the pulse train send to each sensor is OK.

2-Each sensor board has an additional led which show me with short blink  that the message was not addressed to it and  with long Blink when the message was addressed to it.

3-At IrGateway Project the main loop is just  set sensor number in a SN variable and call a function which does the request first for sensor #0  wait 2 seconds  and  it does a same with sensor #1.

Issue #1: each sensor board recognize that a payload was received  but issue a short blink showing me that the message was not addressed to it, which is not  true (point 1).

Issue #2: While the IrGateway board is sending messages , if  I do a power cycle the code run correctly just once afterward. 

Issue #3: The same as issue #2 happens once I finish to flash the code.

Note: I am not  professional programmer  neither Psoc 5 expert.

I hope it is clear enough so you can help me with that.

Thank you so much.

Best regards,

Alex

 

Alex101's picture
User
131 posts

Hi Bob again !

I forgot  to tell you that each couple IrGateway - Sensor#  is working OK separately beside that it is necessary to do a power cycle or  flash the code  so that it start running. 

 

I only get the code running with the following to conditions:

Condition #1

Gateway - Sensor #0  is  working Ok  -  Sensor 1 just recognize a wrong request.(Payload)
int main()

     SN=0;
      RqtsAnswer( SN );
      CyDelay(2000);
      
   //   SN=1;
   //  RqtsAnswer( SN );
    //  CyDelay(2000);
    
      

 

Condition #2

 

 

Gateway - Sensor #1  is Ok  - Sensor 0 just recognize a wrong request (  Payload)

int main()
      SN=0;
      RqtsAnswer( SN );
      CyDelay(2000);
      
    SN=1;
    RqtsAnswer( SN );
    CyDelay(2000);
   

 

 

The worse issue is as I mentioned in the last post.:

 

int  main()

 

      SN=0;
      RqtsAnswer( SN );
      CyDelay(2000);
      
      SN=1;
     RqtsAnswer( SN );
     CyDelay(2000);
    

 

Additional info     

The receiver is a TSOP 36436 hooked up to Demod_input on each receiver,

 

Thank you very much

Alex

 

 

 

user_1377889's picture
User
9581 posts

Alex, it is too difficult to follow with just some code snippets.

 

Bob

Alex101's picture
User
131 posts

Hi Bob

How should I send you the 344 MB bundle ?

user_1377889's picture
User
9581 posts

Delete the generated files and clean the project before building the bundle.

 

Bob

Alex101's picture
User
131 posts

 

Hi Bob

Ok

Alex

Alex101's picture
User
131 posts

Hi Bob

I did like you told me, but in spite to deleted all generated source and clean all project, the zip  is very heavy, around 340 MB.

Please see the attached one which has the Standard Cypress Libraries deleted.

Let me know if it does work, if doesn't I can send PDF for each file

Thank you very much.

Alex

ANKS's picture
Cypress Employee
88 posts

Please debug your project and check whether it is going to an infinite loop-

CY_ISR(IntDefaultHandler)
{

    while(1)
    {
        /***********************************************************************
        * We must not get here. If we do, a serious problem occurs, so go
        * into an infinite loop.
        ***********************************************************************/
    }
}

Log in to post new comments.