NON-OS 1.5.4 (16_05_20) PWM bug

eriksl
Posts: 157
Joined: Fri May 22, 2015 6:22 pm

NON-OS 1.5.4 (16_05_20) PWM bug

Postby eriksl » Sun Jun 19, 2016 6:24 pm

If you use PWM on this version, the ESP will restart in about 15 minutes (exact time will vary) due to "hardware watchdog timeout". If you switch to one version earlier (ESP8266_NONOS_SDK_V1.5.3_16_04_18) the problem is gone.

I am very grateful for the IRAM cleanup btw. Gained about 4 Kbytes from 1.5.2 to 1.5.3.

ESP_Faye
Posts: 1641
Joined: Mon Oct 27, 2014 11:08 am

Re: NON-OS 1.5.4 (16_05_20) PWM bug

Postby ESP_Faye » Mon Jun 20, 2016 9:26 am

Hi,

Can you provide your test code ? We will have a try.

Thanks for your interest in ESP8266 !

eriksl
Posts: 157
Joined: Fri May 22, 2015 6:22 pm

Re: NON-OS 1.5.4 (16_05_20) PWM bug

Postby eriksl » Fri Jul 01, 2016 10:12 pm

That's a bit difficult, because it's part of a huge project (image is > 256 kbytes, mostly actual code). It also includes an alternative boot loader (rboot) which makes OTA actually possible in this case. It's here if you still want to try: http://github.com/eriksl/esp8266-universal-io-bridge

But, the PWM code like it is now, has been working fine in several SDK releases, for at least half a year, maybe longer. Only with the last update of the SDK the crashing started. When I go back one SDK version (or more), recompile+link everything, the problem is completely gone, exactly the same code and the same flow.

eriksl
Posts: 157
Joined: Fri May 22, 2015 6:22 pm

Re: NON-OS 1.5.4 (16_05_20) PWM bug

Postby eriksl » Sun Jul 03, 2016 3:22 pm

It shouldn't be too hard to reproduce. Connect PWM channels to io 14 and io 15, activate one of them (or both) and wait.

User avatar
pratik
Posts: 467
Joined: Wed Jun 29, 2016 7:17 pm
Location: India
Contact:

Re: NON-OS 1.5.4 (16_05_20) PWM bug

Postby pratik » Mon Jul 04, 2016 12:12 pm

Hello,

If you use only GPIO14 for PWM, does it still cause a watchdog reset after some time?

I'll see if I can reproduce the issue. What hardware are you using?
Regards,
Pratik Panda
Website: http://www.PratikPanda.com

Custom firmware, Knowledge base and freelancing (ESP8266/ESP32):
http://www.iot-bits.com

eriksl
Posts: 157
Joined: Fri May 22, 2015 6:22 pm

Re: NON-OS 1.5.4 (16_05_20) PWM bug

Postby eriksl » Wed Jul 06, 2016 2:21 am

Hello Pradik.

I have configured IO 14 and IO 15 for PWM but in practise only IO 14 is used. So both IO 14 and IO 15 are in the gpio_info_t struct array, but only IO 14 has a duty cycle > 0 normally.

I can reconfigure, so IO 15 isn't included into the struct array at all, so the struct array only has one member -> IO 14? Should that make a difference?

I have been using up to four PWM channels in the past and that was never a problem, btw.

User avatar
pratik
Posts: 467
Joined: Wed Jun 29, 2016 7:17 pm
Location: India
Contact:

Re: NON-OS 1.5.4 (16_05_20) PWM bug

Postby pratik » Wed Jul 06, 2016 7:58 pm

Hello,

I could not reproduce the problem.
I'd suggest that you use an SDK version released just before the latest one available for stability reaons in end products.
I'll let you know if I find a solution to this or if I am able to reproduce the issue.

One thing you could try is wipe the flash clean and reprogram init_data and blank sectors and firmware. Sometimes that sorts some unexplained problems.
Regards,
Pratik Panda
Website: http://www.PratikPanda.com

Custom firmware, Knowledge base and freelancing (ESP8266/ESP32):
http://www.iot-bits.com

eriksl
Posts: 157
Joined: Fri May 22, 2015 6:22 pm

Re: NON-OS 1.5.4 (16_05_20) PWM bug

Postby eriksl » Fri Jul 08, 2016 12:58 am

This is not "production" stuff, and for the moment it's not a problem because I can fall back to the older SDK version.

But in future SDK versions, I really hope this will get fixed, so I can make use of new features.

User avatar
rudi
Posts: 197
Joined: Fri Oct 24, 2014 7:55 pm

Re: NON-OS 1.5.4 (16_05_20) PWM bug

Postby rudi » Fri Jul 08, 2016 2:53 am

eriksl wrote:This is not "production" stuff, and for the moment it's not a problem because I can fall back to the older SDK version.

But in future SDK versions, I really hope this will get fixed, so I can make use of new features.


hi erik

not sure - my unthink vision :P
15 min = 15 * 60 = 900 / 6.5 ns ( 0,0000000065 ) = 138461538461,5385 ( clk )
duty? ( 10 ) / 10
freq? ( 10 ) / 10
intval? ( 3 ) / 3
total 15 min ..= diff 3 sec ..

try to use/add

Code: Select all


while(1) {

// try this..
system_soft_wdt_feed();

// your pwm call
}


perhabs it helps

best wishes
rudi ;-)

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

ESP_Yuhao
Posts: 14
Joined: Wed Jun 29, 2016 11:30 am

Re: NON-OS 1.5.4 (16_05_20) PWM bug

Postby ESP_Yuhao » Fri Jul 15, 2016 4:53 pm

Hi Erik!
I'm so sorry that ESP engineer could not reproduce the problem, either.

Code: Select all

/*
 * ESPRSSIF MIT License
 *
 * Copyright (c) 2015 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
 *
 * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
 * it is free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
 * to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

#include "esp_common.h"
#include "../sample_lib/wifi/wifi_test.h"
#include "uart.h"

#include "gpio_test.h"


/*Definition of GPIO PIN params, for GPIO initialization*/

#define PWM_4_OUT_IO_MUX PERIPHS_IO_MUX_MTDI_U
#define PWM_4_OUT_IO_NUM 12
#define PWM_4_OUT_IO_FUNC  FUNC_GPIO12

#define PWM_1_OUT_IO_MUX PERIPHS_IO_MUX_MTDO_U
#define PWM_1_OUT_IO_NUM 15
#define PWM_1_OUT_IO_FUNC  FUNC_GPIO15

#define PWM_2_OUT_IO_MUX PERIPHS_IO_MUX_GPIO4_U
#define PWM_2_OUT_IO_NUM 4
#define PWM_2_OUT_IO_FUNC  FUNC_GPIO4

#define PWM_3_OUT_IO_MUX PERIPHS_IO_MUX_MTMS_U
#define PWM_3_OUT_IO_NUM 14
#define PWM_3_OUT_IO_FUNC  FUNC_GPIO14

//#define PWM_4_OUT_IO_MUX PERIPHS_IO_MUX_GPIO5_U
//#define PWM_4_OUT_IO_NUM 5
//#define PWM_4_OUT_IO_FUNC  FUNC_GPIO5


uint32 io_info[][3] = {
    {PWM_1_OUT_IO_MUX,PWM_1_OUT_IO_FUNC,PWM_1_OUT_IO_NUM},
    {PWM_2_OUT_IO_MUX,PWM_2_OUT_IO_FUNC,PWM_2_OUT_IO_NUM},
    {PWM_3_OUT_IO_MUX,PWM_3_OUT_IO_FUNC,PWM_3_OUT_IO_NUM},
    {PWM_4_OUT_IO_MUX,PWM_4_OUT_IO_FUNC,PWM_4_OUT_IO_NUM}
};

void user_init(void)
{
   uint32 duty[3]={0,0,0},i;


      pwm_init(1000,duty,4,io_info);//1000us
      pwm_set_duty(20,0);/*20us */
      pwm_set_duty(10,1);/*10us This is IO4*/
      pwm_set_duty(15,2);/*15us */
      pwm_set_duty(5,3);/*5us */
      pwm_start();
   

}

Espressif Systems

#204, Block 2, 690 Bibo Road,
Zhang Jiang High-Tech Park, Shanghai, China
www.espressif.com

Who is online

Users browsing this forum: Google [Bot] and 7 guests