cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

YuMa_1534086
Contributor

Hello.

 

Customer used CY8C5868LTI-LP039.

And they used EEPROM and DieTemp components.

 

When die temperature measurement is started, writing to EEPROM becomes fail.

 

If DieTemp_1_Start () is not called, EEPROM_1_Write () will succeed.

But EEPROM_1_Write () will fail if there is DieTemp_1_Start ().

Error status is CYRET_UNKNOWN.

 

Why is EEPROM_1_Write () an error?

And could you please let us know a method that EEPROM_1_Write () will succeed even if there is DieTemp_1_Start ().

 

Best Regards.

Yutaka Matsubara

0 Likes
1 Solution
BiBi_1928986
Valued Contributor

Hello.

SPC is used to program/erase the FLASH, EEPROM and Nonvolatile Latches.  This is detailed in PSoC 5 Programming Specification.  It's highly advised to follow the proper algorithm/API's when writing to these components.  Again, this is detailed in PSoC 5 Programming Specification and in the corresponding component datasheet.

Do not focus on Die Temp SPC transfers alone.  ALL SPC transfers that must be executed properly.

Example: can't write to an NVL followed by writing to EEPROM until the write to NVL is completed.  Both components rely on SPC but, need to wait for the first SPC transfer to complete before a subsequent transfer can begin.

View solution in original post

0 Likes
11 Replies
Alakananda_BG
Moderator
Moderator

Hi,

I can see something in the datasheet(page3):

It is necessary to acquire the die temperature by calling the EEPROM_UpdateTemperature()function before a series of EEPROM write operations. The function queries SPC for the die temperature and stores it in a global variable, which is used the die temperature and stores it in a global variable.

Regards

 

Alakananda
0 Likes
YuMa_1534086
Contributor

Hi Alakananda-san.

 

Thank you for your response.

 

If debugged attached file, return value of EEPROM_1_Write() becomes CYRET_UNKNOWN.

So program stops at breakpoint of 36 line.

 

If comment out from 26 line to 30 line, return value of EEPROM_1_Write() becomes CYRET_SUCCESS.

So program does not stop at breakpoint of 36 line.

 

What is the reason for this issue?

 

Is it because both DieTemp and EEPROM use SPC?

Will EEPROM write API fail because DieTemp is still using SPC(DieTemp does not unlock SPC?)?

 

But I think that error code becomes not CYRET_UNKNOWN but CYRET_LOCKED if the reason of this issue is DieTemp using SPC.

Why is the error code CYRET_UNKNOWN?

 

Best Regards.

Yutaka Matsubara

0 Likes
YuMa_1534086
Contributor

Hello Infineon

 

Can you update this subscription?

 

Best Regards.

Yutaka Matsubara

0 Likes
Alakananda_BG
Moderator
Moderator

Hi,

I have attached a project below which is working at our end.

Please let us know if this helps.

Regards

Alakananda
0 Likes
YuMa_1534086
Contributor

Hi Alakananda-san.

 

I'm asking about the reason for the error, not the workaround.

 

Please confirm previous my questions

===================================================

If debugged attached file, return value of EEPROM_1_Write() becomes CYRET_UNKNOWN.

So program stops at breakpoint of 36 line.

 

If comment out from 26 line to 30 line, return value of EEPROM_1_Write() becomes CYRET_SUCCESS.

So program does not stop at breakpoint of 36 line.

 

What is the reason for this issue?

 

Is it because both DieTemp and EEPROM use SPC?

Will EEPROM write API fail because DieTemp is still using SPC(DieTemp does not unlock SPC?)?

 

But I think that error code becomes not CYRET_UNKNOWN but CYRET_LOCKED if the reason of this issue is DieTemp using SPC.

Why is the error code CYRET_UNKNOWN?

===================================================

 

Best Regards.

Yutaka Matsubara

0 Likes
YuMa_1534086
Contributor

Hello Infineon

 

If there is EEPROM_1_Write between DieTemp_1_Start() and DieTemp_1_Query(), EEPROM_1_Write() will fail.

DieTemp_1_Query() after DieTemp_1_Start() is commented in the file I attached before.

(DieTemp_1_Query have been disabled.)

 

So EEPROM_1_Write() is called after DieTemp_1_Start() without DieTemp_1_Query().

 

In this case(below), EEPROM_1_Write() becomes fail.

EEPROM_1_Write() fails even if EEPROM_1_UpdateTemperature() is called before EEPROM_1_Write()

=========================

1. DieTemp_1_Start()

2. EEPROM_1_Write()     =>          Fail(CYRET_UNKNOWN)

=========================

 

But EEPROM_1_Write() succeeds if DieTemp_1_Query() is called between DieTemp_1_Start() and EEPROM_1_Write().

If program wait until return value of DieTemp_1_Query() becomes CYRET_SUCCESS and then call EEPROM_1_Write(), EEPROM_1_Write() will succeed.

In below case, EEPROM_1_Write() becomes success.

=========================

1. DieTemp_1_Start()

2. DieTemp_1_Query() – wait until return value becomes CYRET_SUCCESS.

2. EEPROM_1_Write()     =>          Success(CYRET_SUCCESS)

=========================

 

I know how EEPROM_1_Write() can be successful.

But I don't understand why EEPROM_1_Write() fails.

 

 

Q1)

Could you please let us know the reason why EEPROM_1_Write() fails?

 

Q2)

Could you please let us know why error code is CYRET_UNKNOWN?

If this error cause is that SPC is busy by Die temp, isn't the error code CYRET_LOCKED?

 

 

Your quick response will be highly appreciated.

We have to answer this question ASAP.

 

Best Regards.

Yutaka Matsubara

0 Likes
Alakananda_BG
Moderator
Moderator

Hi,

The DieTemperature Component datasheet mentions 

>>In die temp datasheet start api definition it says that Sends the command and parameters to the SPC to start a Die Temperature reading. This function returns before the SPC finishes. This function call must always be paired with a call to the DieTemp_Query() API to complete the Die Temperature reading.

>>Checks to see if the SPC command started by DieTemp_Start() has finished. If the command has not finished, the temperature value is not read and returned. The caller will need to poll this function while the return status remains CYRET_STARTED. This can be used only in conjunction with the DieTemp_Start() API to successfully get the correct Die Temperature. The Die Temperature reading returned on the first sequence of DieTemp_Start() followed by DieTemp_Query() can be unreliable, so you must do this sequence twice and use the value returned from the second sequence.

So this is the recommended way of using the die temperature and make sure the mentioned points are met.

I have attached the link to the datasheet you can refer page number  2 and 3 for more information.

Die Temperature (DieTemp) (cypress.com)

Regards

So this is the recommended way of using the die temperature.

Alakananda
0 Likes
YuMa_1534086
Contributor

Hi Alakananda-san.

 

Thank you for your response.

 

But what I'm asking is not how to use Die Temp API, but why does EEPROM_1_Write() becomes error.

 

You explained how to use Die Temp API.

I understand that too.

 

This question is why EEPROM_1_Write fails by Die Temp API?

Why does EEPROM_1_Write fail when EEPROM_1_Write is called before DieTemp_1_Query?

Why does Die Temp API processing affect EEPROM_1_Write results?

 

Could you please let us know the relationship between EEPROM component and Die Temp component.

I'm asking why EEPROM_1_Write is an error.(Not how to use Die Temp API)

 

Best Regards.

Yutaka Matsubara.

0 Likes
BiBi_1928986
Valued Contributor

Hello.

Yes, Die Temperature reading and EEPROM writing, both make use of SPC.  It's necessary to read the Die temp before writing EEPROM (or Flash) memory.  Die temp is a parameter used by PSoC 'write' algorithm (that's what Cypress doc's lead me to believe).

Reading Die Temp is not a blocking function, so you need to query it for results.  SPC is not available until this function completes.  Hence, EEPROM writing can't take place until Die Temp read function has completed.

You can read some of this in PSoC 5 Programming Specification:
https://www.cypress.com/documentation/programming-specifications/psoc-5lp-device-programming-specifi...

 Just search for EEPROM and you'll find the code for writing to EEPROM.  You'll find the interaction with Die Temp there using SPC.

regards.

0 Likes
YuMa_1534086
Contributor

Hello.

 

Thank you for your response.

 

They understood that EEPROM Write function during die temperature measurement is not available.

But many other features such as USB, UART, DA, AMP etc work during die temperature measurement.

 

What components, APIs, processes, etc. cannot be used while measuring die temperature?

Could you please send the list of items that should not be performed during die temperature measurements?

They want to clarify what they should and should not do during die temperature measurement.

 

Is there anything other than EEPROM and DieTemp that uses SPC?(Flash?)

Do only EEPROM and DieTemp use SPC?

So is it only EEPROM related that causes an error during die temperature measurement?

 

Best Regards.

Yutaka Matsubara

0 Likes
BiBi_1928986
Valued Contributor

Hello.

SPC is used to program/erase the FLASH, EEPROM and Nonvolatile Latches.  This is detailed in PSoC 5 Programming Specification.  It's highly advised to follow the proper algorithm/API's when writing to these components.  Again, this is detailed in PSoC 5 Programming Specification and in the corresponding component datasheet.

Do not focus on Die Temp SPC transfers alone.  ALL SPC transfers that must be executed properly.

Example: can't write to an NVL followed by writing to EEPROM until the write to NVL is completed.  Both components rely on SPC but, need to wait for the first SPC transfer to complete before a subsequent transfer can begin.

View solution in original post

0 Likes