I have a problem when in Cm3Start.c when calling main function

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
damoc_1344541
Level 2
Level 2

We are two developers.

I'm trying to continue working with the project made by my coworker.

At the beggining I debbug it with no modification and it runs well, but when I begin to make advances the call to main function at Cm3Start.c fails.

    /* Invoke static objects constructors */

    __libc_init_array();

    (void) main();

0 Likes
20 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Can you please mention what do you mean by advances the call to main function.

I wish to tell that you are not supposed to make any changes in Cm3Start.c file

0 Likes

Thanks for your answer Anks.

I’ve made any change in Cm3Start.c file, I’ve only placed a check point just before calling main function and then I debug step by step.

main.jpg

missingCall.jpg

We are using segger embos real time system, with your PSoC5LP.

0 Likes

Any update?

0 Likes

Are you getting any specific error message after putting the breakpoint in Cm3Start.c.

Can you please check this link, here also they used an address breakpoint for Reset function in Cm0Start.c, it may be useful:

PSoC4 Boot Sequence (Part 1) - Debugging to the Reset Vector - IoT Expert

0 Likes

I'm not getting an specific error message. After calling the main() function the thread of the program misses out somewhere that is not the main() function.

The link that you send me is very useful for better understanding the boot sequence, I'll try to follow this sequence to find out where exactly the program is missing out.

Anywhere it's very strange that the problem comes when I take the project shared with my coworker. He makes the same modifications than me in the same project and he has no problem.

0 Likes

Do you have experience with projects working with Segger RTOS for PSoC5LP?

0 Likes

Hi Anks,

This is a link to the owncloud with the project.

https://www.distromel.org/distrocloud/index.php/s/PLLKEbfjWWXYdxG

Please, try to debbug it for better understanding.

0 Likes

Hi David,

Can you send these missing files for project to build on Creator:

pastedImage_0.png

0 Likes

You can remove them from the project.

They are actually not used.

0 Likes

In my Coworker's PC is working fine, after calling the main() the program goes to the first line of the main()

The problem comes when he shares the project with me.

The screeshots are up in my answer 12/11/18

0 Likes

Is it possible for you to  share the project which has been archived (using "Complete" option in PSoC Creator) from your coworker's system  to us (without unarchiving or rebuilding it in your system).

0 Likes

The archived project doesn't include the embOS. The above link is the complete project direct from my coworker which runs fine also in my computer. But when I coment some lines it

This link is the archived project.

https://www.distromel.org/distrocloud/index.php/s/WxD8H5BAVhWUm1X

0 Likes

Can you please mention which are those lines that you commented in order to make the project to be debugged properly on your system

0 Likes

The lines in bold were commented

static void HPTask(void) {

 

    ExternalSerialPort_Start();

    i2cHelper_Start         ();

   

    while (1)

    {

        NT3H2111_ReadUID (nfcUIDBuff);

     

        sprintf (Task1LogBuff,"NT3H2111 UID = %s  \r\n",nfcUIDBuff);

        ExternalSerialPort_PutString(Task1LogBuff);

   

   

        if(NFC_FD_Read()==0)

        {

            if(NT3H2111_ReadNDefTextMsg((char*)NDefBuff,(char*)NFC_ConfigMsg)==TRUE)

            {

               

                ExternalSerialPort_PutString((char*)NFC_ConfigMsg);

                ExternalSerialPort_PutString("\r\n");

               

                ExternalSerialPort_PutString("Esperando no detectar campo NFC...\r\n");

               

                while(NFC_FD_Read()==0);

               

                ExternalSerialPort_PutString("Campo NFC desactivado...\r\n");

               

                NT3H2111_Wipe_Tag();

               

                sprintf (Task1LogBuff,"%s OK",NFC_ConfigMsg);

                NT3H2111_WriteNDefTextMsg (Task1LogBuff);

                      

                //NT3H2111_Wipe_Tag         ();

            }

        }

   

      OS_TASK_Delay(2000);

    }

}

0 Likes

Any update?

0 Likes

Hi,

Is your coworker  able to  reach to first line of main.c during debug without  commenting lines as mentioned in bold above.

If yes, then it is system specific issue otherwise this appears as a embos specific issue.Presently, we don't have much experience with embos.

Can you please try to get help from Segger from this link:

embOS related - SEGGER - Forum

0 Likes

I'm also able to reach the first line of main.c without commenting lines. The problem comes when I comment these lines.

I'm actually working with a not shared project (I have begun this project from the beginning). When I add some code to the project it comes the same problem.

it seems to be a debbug problem because the program in release mode seem to work fine.

0 Likes

I just wish to inform that I am able to reproduce the issue as mentioned in above interactions on CY8CKIT-050

0 Likes