- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.