PSoC_Creator_4.2_es100_b641 build issue

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

cross mob
lock attach
Attachments are accessible only for community members.
SuRa_2245351
Level 4
Level 4
First like received First like given

I had created project attached below using PSoC creator(PSoCCreatorSetup_4.2_b574) and it is working fine, but now I have  updated to PSoC creator(PSoCCreatorSetup_4.2_es100_b641) and simply built the project and programmed PSoC 6 BLE (CY8CKIT-062-BLE)

with the ".hex" file. Now its not working, even UART is also not working , I checked using both methods by replacing

and without replacing files when window for updated configuration files popped. Hardware remains same for both the cases.

0 Likes
1 Solution
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

"I tested your project. It's fine about UART printing function.

There is no printing just because code execution is halted in init_RTC(). More specifically, the halt is caused by below code snippet:

if(RTC_DateTime.year > CY_RTC_MAX_YEAR) /* If user input 4 digits Year information, set 2 digits Year */

    {

        RTC_DateTime.year = RTC_DateTime.year % 100u;

    }

RTC_DateTime.year then becomes 0, and beyond range defined in CY_RTC_IS_YEAR_LONG_VALID(year).

Comment the above code snippet, code can executed smoothly with normal printing function.

Please check your code logic. "

From

FWAN

View solution in original post

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

"I tested your project. It's fine about UART printing function.

There is no printing just because code execution is halted in init_RTC(). More specifically, the halt is caused by below code snippet:

if(RTC_DateTime.year > CY_RTC_MAX_YEAR) /* If user input 4 digits Year information, set 2 digits Year */

    {

        RTC_DateTime.year = RTC_DateTime.year % 100u;

    }

RTC_DateTime.year then becomes 0, and beyond range defined in CY_RTC_IS_YEAR_LONG_VALID(year).

Comment the above code snippet, code can executed smoothly with normal printing function.

Please check your code logic. "

From

FWAN

0 Likes

Thank you FWAN!

you are correct there is same mistake in my code as you had listed above, I appreciate you found the exact bug and after commenting above mentioned code snippet ,code started working using PSoC creator 4.2_es100_b641. But same code without any modification is working perfectly fine while using PSoC creator 4.2_b574 for build. It should halt according to CY_RTC_IS_YEAR_LONG_VALID(year) but its not.

0 Likes

Sunny,

Not really sure about the reason. I am not able to test it on v574 since only v641 is installed on my platform.

You can debug it step by step, specifically on the line:

CY_ASSERT_L3(CY_RTC_IS_YEAR_LONG_VALID(year));

I debugged and found that problem is with CY_RTC_IS_YEAR_LONG_VALID(year) as follows:

1. In PSoC creator V574 CY_RTC_IS_YEAR_LONG_VALID(year) is defined as

   #define CY_RTC_IS_YEAR_LONG_VALID(year)          (((year) >= CY_RTC_TWO_THOUSAND_YEARS) || \

                                                  ((year) <= CY_RTC_TWENTY_ONE_HUNDRED_YEARS))

2. In PSoC creator V641 CY_RTC_IS_YEAR_LONG_VALID(year) is defined as

   #define CY_RTC_IS_YEAR_LONG_VALID(year)          (((year) >= CY_RTC_TWO_THOUSAND_YEARS) && \

                                                  ((year) <= CY_RTC_TWENTY_ONE_HUNDRED_YEARS))

This was mistake in PSoC creator V574 library file hence my code was working fine in it.

Thank you fwan, once again.

0 Likes