cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

Anva_2903386
New Contributor II

I have a working project using PSOC5LP, EmWin, and a TFT display.  When I copy and paste the working project in the same workspace, the newly copied project compiles without errors but the TFT does not work when the program runs.

I use the same "Project/Build Settings, compiler and linker" for both projects pointing to the Emwin graphics library.

As another option, I moved the working folder away from "c:\users\myname\project" to c:\sync\PSOC to ensure the path is shorter.

I also tried the "Archive bundle" and restore it as a new project in the same folder and workspace with the same results.

I have no idea where to find the issue, any assistance will be appreciated.

Update - Running the debugger the code get stuck in the GUI_Init(); function

Code getting stuck here - Increasing the Heap size does not solve the problem.

CY_ISR(IntDefaultHandler)

{

    /***************************************************************************

    * We must not get here. If we do, a serious problem occurs, so go into

    * an infinite loop.

    ***************************************************************************/

    #if defined(__GNUC__)

        if (errno == ENOMEM)

        {

            #ifdef CY_BOOT_INT_DEFAULT_HANDLER_ENOMEM_EXCEPTION_CALLBACK

                CyBoot_IntDefaultHandler_Enomem_Exception_Callback();

            #endif /* CY_BOOT_INT_DEFAULT_HANDLER_ENOMEM_EXCEPTION_CALLBACK */

           

            while(1)

            {

                /* Out Of Heap Space

                 * This can be increased in the System tab of the Design Wide Resources.

                 */

            }

        }

        else

    #endif

        {

            #ifdef CY_BOOT_INT_DEFAULT_HANDLER_EXCEPTION_ENTRY_CALLBACK

                CyBoot_IntDefaultHandler_Exception_EntryCallback();

            #endif /* CY_BOOT_INT_DEFAULT_HANDLER_EXCEPTION_ENTRY_CALLBACK */

            while(1)

            {

            }

        }

}

0 Likes
Reply
15 Replies
Rakshith
Moderator
Moderator

Hello Anva_2903386​,

Can you confirm that your original project is still working? Please share your project so that we can debug and provide you with a solution.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes
Reply
Anva_2903386
New Contributor II

Hi Rakshith

Thank you for your reply, Yes the original project is working, the TFT

operate as intended.   Copy_01 is not working, the program compile

without error but the TFT is not working.  I use the same hardware for

both projects

https://www.dropbox.com/sh/a1wjb0u0ijdkozk/AAC6DxsDK7c2nQeZ1bi-ULqca?dl=0

Regards

Andre

0 Likes
Reply
Len_CONSULTRON
Honored Contributor

Andre,

Check to make sure the pin assignments match between the original and the copy.  I've found on many occasions that the pin outs assigned in my original are not always reassigned to the same pins in the copy.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
Anva_2903386
New Contributor II

Hi Len

I checked and the pins are the same for both projects

Regards

Andre

0 Likes
Reply
DheerajK_81
Moderator
Moderator

Hello Andre,

Can you remove and add the path to the source directories and additional libraries again for the copy_01 project?

Basically remove the existing configurations you used to integrate emWin and follow the steps mentioned in the section "Integrating the Library into PSoC Creator" of this document again for the copy_01 project.

Let me know if it works.

Regards,

Dheeraj

0 Likes
Reply
Anva_2903386
New Contributor II

Hi Dheeraj

I removed and add the path to the sources, I tried both relative paths

and absolute paths, the results are still the same.  The original

program work Copy_01 doesn't work.

I decided to start a new project using the latest version of Emwin and

the same hardware PSOC5LP.

I followed the PSOC Creator document (SEGGER emWin Graphic Library

(emWinGraphics)5.46) to the letter.

I see that the code get stuck in GUI_Init(); routine

When I debug I see I get a hardfault.

The code runs up to 0x00002A02 blx    r3

then jumps to

90: CY_ISR(IntDefaultHandler)

Disassembly

0x000029CC

0x000029DE str    r0,

0x000029E0 cbnz    r0, 29f2

0x000029E6 ldr    r3,     ; (2a54 <LCD_Init+0x88>)

0x000029E8 ldr    r2,

0x000029EA ldr    r3,     ; (2a58 <LCD_Init+0x8c>)

0x000029EC cmp    r2, r3

0x000029EE bne.n    2a0a <LCD_Init+0x3e>

0x000029F0 b.n    2a48 <LCD_Init+0x7c>

0x000029F2 ldr    r3,

0x000029F4 movs    r1, #c

0x000029F6 ldr    r3,     ; 0x24

0x000029F8 add    r0, sp, #4

0x000029FA blx    r3

0x000029FC mov    r3, r0

0x000029FE cbz    r0, 2a4c <LCD_Init+0x80>

0x00002A00 ldr    r0,

0x00002A02 blx    r3

0x00002A04 cmp    r0, #0

0x00002A06 beq.n    29e2

0x00002A10 str    r0,

0x00002A12 cbz    r0, 2a48

0x00000466 ldr    r3,

0x00000468 cmp    r3, #c

0x0000046A bne.n    46e <IntDefaultHandler+0xe>

0x0000046C b.n    46c <IntDefaultHandler+0xc>

0x0000046E b.n    46e <IntDefaultHandler+0xe>

I added the project to the same DropBox folder

https://www.dropbox.com/sh/a1wjb0u0ijdkozk/AAC6DxsDK7c2nQeZ1bi-ULqca?dl=0

Regards

Andre

0 Likes
Reply
Len_CONSULTRON
Honored Contributor

Andre,

I've downloaded your projects from the dropbox.  I've built both projects.  All warnings.  No Errors.

You know your project.  I don't have the peripherals required.  Is it possible for me to run this on a PSoC5 without the peripherals?  Would I run into the "CY_ISR(IntDefaultHandler)" very early in execution?

I noticed there were some significant differences in the two projects.   One of them has more files at the project root including a "CortexM0p".  Was this project originally targeted for a PSoC6?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
Anva_2903386
New Contributor II

Hi Len

Thank you for your prompt response.  I will build a new project with no

peripherals and minimum code, will send back asap

The project that is working is about Two years old, I had less

experience then and added many files (maybe unnecessary) to get it to

work.  What I don't understand, if I copy the project in the same

workspace in PSOC Creator the copy don't work.

Regards

Andre

0 Likes
Reply
Len_CONSULTRON
Honored Contributor

Andre,

I'll give the minimized projects a try when you have it available.

One thing to note if you were not aware of it:  In debug mode, there is a "Call Stack" window

pastedImage_0.png

Once you enter the "CY_ISR(IntDefaultHandler)", you might be able to trace from the Call Stack what was executed before.  This is not a guarantee since the IntDefaultHandler may have come from an attempt to call a "real" interrupt.  The IntDefaultHandler is also called when program faults occur such as DivideByZero math, some stack overflows and other conditions.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
Anva_2903386
New Contributor II

Thanks Len I will check this

0 Likes
Reply
Anva_2903386
New Contributor II

Hi Len

Below the Call stack -

I am still working on a new project with minimal peripherals

From below does this mean the last call was -*2 GUI_F6x8_TL8859_1()

?????? ?????? 0x000057B2 (All) *

Regards

Andre

0 Likes
Reply
Len_CONSULTRON
Honored Contributor

Andre,

I suspect since you are using emWin lib calls, this is a call to a function in that library.  The "??????" in the File and Line columns of the "GUI_" stack levels are due to not having File and Line references in the library.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
DheerajK_81
Moderator
Moderator

Hello Andre,

Please provide the project with minimum peripherals. I am unable to recreate the issue. Can you try creating the project in another folder which is directly under the drive folder and see if that helps?


Regards,

Dheeraj

0 Likes
Reply
Len_CONSULTRON
Honored Contributor

Dheeraj,

When a project copy occurs, does the heap and stack size also get copied.

I sometimes receive a "CY_ISR(IntDefaultHandler)" if my stack is too small for the libraries being run.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
Anva_2903386
New Contributor II

Hi Dheeraj

I also changed the heap and stack size from the default values 0x80 and

0x0800 incremental all the way up to 0x800 and 0x8000 with the same results.

Regards

Andre

0 Likes
Reply