Topic

FAQ
Login Register
tl_zigbee_sdk 3.8.6.4 issue
Jul 21, 2023 07:27

/

A

/A

I have updated to the latest SDK and found the following issue:


Compilation fails - E:/Telink/Project/tl_zigbee_sdk/proj/drivers/drv_hw.c:256:23: error: 'VOLTAGE_DETECT_ADC_PIN' undeclared


In drw_hw.c in line 252 there is the following code for 8258:

#if defined(MCU_CORE_8258)
  if(flash_is_zb()){

#if (!VOLTAGE_DETECT_ENABLE) || !defined(VOLTAGE_DETECT_ENABLE)

   voltage_detect_init(VOLTAGE_DETECT_ADC_PIN);

   flash_safe_voltage_set(BATTERY_SAFETY_THRESHOLD);

#endif

   flash_unlock_mid13325e(); //add it for the flash which sr is expired
  }
#endif

This doesn't make sense.  if VOLTAGE_DETECT_ENABLE is not defined then why would you call voltage_detect_init?

if VOLTAGE_DETECT_ENABLE is not defined this means that VOLTAGE_DETECT_ADC_PIN is not defined as well.


And in line 239 there was:

/* ADC */
#if VOLTAGE_DETECT_ENABLE
  voltage_detect_init(VOLTAGE_DETECT_ADC_PIN);
  voltage_detect((state == SYSTEM_BOOT) ? 1 : 0);
#endif


So, voltage_detect_init is called twice- once if VOLTAGE_DETECT_ENABLE is defined and second time if VOLTAGE_DETECT_ENABLE is not defined?


Could Telink fix the SDK?







2 replies
TL_Soyo Jul 21, 2023 10:34
0
/A

Hi,

  the part of code is used for zb manufacturer flash,if your flash is not belong to zb(read by the flash_is_zb()),you can delet the code,or you must keep it,the flash write function need adc value to ensure safety of write..

#if defined(MCU_CORE_8258) 
  if(flash_is_zb()){

#if (!VOLTAGE_DETECT_ENABLE) || !defined(VOLTAGE_DETECT_ENABLE)

   voltage_detect_init(VOLTAGE_DETECT_ADC_PIN);

   flash_safe_voltage_set(BATTERY_SAFETY_THRESHOLD);

#endif

   flash_unlock_mid13325e(); //add it for the flash which sr is expired
  }
#endif

wes58 [Author] Jul 21, 2023 13:59
0
/A

Well, so I don't understand.

I am using TLSR8258, and compiling fails.

That means that function flash_is_zb() returns 1 and that's why it fails. So is it zb flash?

Should flash_is_zb() return 0?


What is "zb manufacturer flash"? Can you explain?