ESP8266 Developer Zone The Official ESP8266 Forum 2016-01-19T17:10:54+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=871 2016-01-19T17:10:54+08:00 2016-01-19T17:10:54+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=5434#p5434 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]> Statistics: Posted by eriksl — Tue Jan 19, 2016 5:10 pm


]]>
2016-01-18T23:44:25+08:00 2016-01-18T23:44:25+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=5427#p5427 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
My handler does call gpio_output_set (which is in the bootrom) -- I guess that that is ok.

On further investigation, it appears that the handler does access a data structure, and this has been placed into irom0 -- the compiler figured out that I never modified this data structure so it could make it const and put it in irom0. Argh!!

It seems to be working much better now -- hasn't crashed yet.

Thank you.

Statistics: Posted by philip — Mon Jan 18, 2016 11:44 pm


]]>
2016-01-18T23:20:22+08:00 2016-01-18T23:20:22+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=5426#p5426 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
Are you returning within a few instructions from the handler?

Is the handler in iram?

Statistics: Posted by eriksl — Mon Jan 18, 2016 11:20 pm


]]>
2016-01-14T11:50:54+08:00 2016-01-14T11:50:54+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=5372#p5372 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
dkinzer: Did you get your issue solved? Or is the solution to use the FRC1_SOURCE instead?

Thanks

Philip

Statistics: Posted by philip — Thu Jan 14, 2016 11:50 am


]]>
2015-08-12T19:51:27+08:00 2015-08-12T19:51:27+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3177#p3177 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
Please have a try with the attachment.
compilation.jpg

download into flash.jpg
esp_iot_sdk_v1.3.0.zip

Statistics: Posted by ESP_Faye — Wed Aug 12, 2015 7:51 pm


]]>
2015-08-12T16:46:35+08:00 2015-08-12T16:46:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3168#p3168 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]> It seems there is no NmiTimSetFunc(func).

Kindly look the bellow error and let me know of header files which I need to point NmiTimSetFunc.

I am getting bellow error

Code:

CLEAN SUCCESSFUL (total time: 4s)
C+ app/application.cpp
C+ app/hw_timer.cpp
In file included from c:/tools/Sming/Sming/system/include/esp_systemapi.h:6:0,
                 from include/user_config.h:29,
                 from app/hw_timer.cpp:1:
app/hw_timer.cpp: In function 'void hw_timer_init(FRC1_TIMER_SOURCE_TYPE, u8)':
c:/Espressif/ESP8266_SDK/include/ets_sys.h:55:20: error: 'NmiTimSetFunc' was not declared in this scope
  NmiTimSetFunc(func)
                    ^
app/hw_timer.cpp:65:9: note: in expansion of macro 'ETS_FRC_TIMER1_NMI_INTR_ATTACH'
         ETS_FRC_TIMER1_NMI_INTR_ATTACH(hw_timer_isr_cb);
         ^
c:/Espressif/ESP8266_SDK/include/ets_sys.h:52:62: error: invalid conversion from 'void (*)()' to 'void*' [-fpermissive]
     ets_isr_attach(ETS_FRC_TIMER1_INUM, (func), (void *)(arg))
                                                              ^
app/hw_timer.cpp:67:9: note: in expansion of macro 'ETS_FRC_TIMER1_INTR_ATTACH'
         ETS_FRC_TIMER1_INTR_ATTACH(hw_timer_isr_cb, NULL);
         ^
In file included from include/user_config.h:29:0,
                 from app/hw_timer.cpp:1:
c:/tools/Sming/Sming/system/include/esp_systemapi.h:46:13: error:   initializing argument 2 of 'void ets_isr_attach(int, void*, void*)' [-fpermissive]
 extern void ets_isr_attach(int intr, void *handler, void *arg);
             ^
make.exe": *** [out/build/app/hw_timer.o] Error 1

BUILD FAILED (exit value 2, total time: 9s)

Statistics: Posted by hrsavla — Wed Aug 12, 2015 4:46 pm


]]>
2015-08-12T02:52:10+08:00 2015-08-12T02:52:10+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3157#p3157 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
Espressif_Faye wrote:
If your problem is still unsolved, please offer your entire project.
I've attached a .zip file containing a simple makefile and the source code. The makefile uses the esptool-ck utility (lines 24 and 25 of the Makefile) to produce the image files from the ELF file. The code was compiled on a Windows 7 system using the v1.3.0 SDK. The makefile will probably need to be modified slightly to account for the installation directories of the compiler and SDK (lines 4 and 5 of "Makefile"). Beyond that, the makefile should build the app on either Windows or Linux.

In the .zip file, there are two subdirectories - "regInterrupt" and "nmiInterrupt" which contain the generated ELF file and image files for the regular interrupt build and the NMI build, respectively. The only difference between the two was changing the conditional on line 84 of user_main.c so that it uses either a normal interrupt or an NMI.

The images were flashed to an ESP8266 with a 512KB Flash chip and the "regInterrupt" version works exactly as expected while the "nmiInterrupt" version starts with a small amount of the normal boot-up output and then output garbage.

Thanks for looking into this. It's probably something simple but I don't see it. I believe that I've provided everything (other than the compiler, SDK and esptool-ck) to allow you to build exactly the same ELF and image files to confirm the observation.
testApp.zip

Statistics: Posted by dkinzer — Wed Aug 12, 2015 2:52 am


]]>
2015-08-11T17:15:02+08:00 2015-08-11T17:15:02+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3148#p3148 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
So sorry that we can not duplicate your problem. We tried your test code, it works fine.

Here is our test code and test log, please have a try.

Try it with baudrate 74880.

If your problem is still unsolved, please offer your entire project (esp_iot_sdk) and your test log.
nmi_issue1.zip

app_NMI_Customer_issue1.zip

Statistics: Posted by ESP_Faye — Tue Aug 11, 2015 5:15 pm


]]>
2015-08-06T23:03:18+08:00 2015-08-06T23:03:18+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3071#p3071 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
Espressif_Faye wrote:
Please do not call “os_printf” in NMI timer callback,use “printf” instead.
OK, I completely eliminated all printf-like functions. I am not at all surprised to find that the test app still does not work when using NMI_SOURCE but works fine using a regular interrupt. The new test code is attached.
test_app.zip

Statistics: Posted by dkinzer — Thu Aug 06, 2015 11:03 pm


]]>
2015-08-06T09:34:12+08:00 2015-08-06T09:34:12+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3062#p3062 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
Please do not call “os_printf” in NMI timer callback,use “printf” instead.

If your problem is still unsolved, please feel free to let us know.

Thanks for your interest in ESP8266 !

Statistics: Posted by ESP_Faye — Thu Aug 06, 2015 9:34 am


]]>
2015-08-05T23:00:18+08:00 2015-08-05T23:00:18+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3060#p3060 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
Espressif_Faye wrote:
Could you please provide your test code ? We will have a try.
The user_main.c file is in the attached .zip file. Thanks.
test_app.zip

Statistics: Posted by dkinzer — Wed Aug 05, 2015 11:00 pm


]]>
2015-08-05T15:18:01+08:00 2015-08-05T15:18:01+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3054#p3054 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]> Statistics: Posted by eriksl — Wed Aug 05, 2015 3:18 pm


]]>
2015-08-05T11:04:25+08:00 2015-08-05T11:04:25+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3047#p3047 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
Could you please provide your test code ? We will have a try.

Please notice that do not call “os_printf” in NMI timer callback,use “printf” instead.

Statistics: Posted by ESP_Faye — Wed Aug 05, 2015 11:04 am


]]>
2015-08-03T23:26:34+08:00 2015-08-03T23:26:34+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3030#p3030 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
Espressif_Faye wrote:
Here is an example [...]
Thanks. That is the "test" code from the hw_timer.c example with the addition of two missing definitions. Building that test application produces the same result as my derived application - outputting garbage and WDT resets.

Statistics: Posted by dkinzer — Mon Aug 03, 2015 11:26 pm


]]>
2015-08-03T09:38:47+08:00 2015-08-03T09:38:47+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=3015#p3015 <![CDATA[Re: ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
Thanks for your interest in Espressif Systems and ESP8266 !

Here is an example,

Code:

#define REG_READ(_r) (*(volatile uint32 *)(_r))
#define WDEV_NOW()\
    REG_READ(0x3ff20c00)
static u32 tick_now2 = 0;
void   hw_test_timer_cb(void)
{
    static uint16 j = 0;
    j++;
   
    if( (WDEV_NOW() - tick_now2) >= 1000000 )
    {
    static u32 idx = 1;
        tick_now2 = WDEV_NOW();
        printf("b%u:%d\n",idx++,j);
        j = 0;
    }
    //hw_timer_arm(50);
}

typedef enum {
    FRC1_SOURCE = 0,   
    NMI_SOURCE = 1,   
} FRC1_TIMER_SOURCE_TYPE;
void ICACHE_FLASH_ATTR user_init(void)
{

        hw_timer_init(NMI_SOURCE,1);
        hw_timer_set_func(hw_test_timer_cb);
        hw_timer_arm(100);
}

Statistics: Posted by ESP_Faye — Mon Aug 03, 2015 9:38 am


]]>
2015-07-31T07:58:29+08:00 2015-07-31T07:58:29+08:00 https://bbs.espressif.com:443/viewtopic.php?t=871&p=2946#p2946 <![CDATA[ETS_FRC_TIMER1_NMI_INTR_ATTACH does not work]]>
I'm using the esp_iot_sdk_v1.2.0_15_07_03 SDK and I did have to create a prototype for NmiTimSetFunc() to get the code to compile as it is missing from the SDK includes. I used this:

Code:

void NmiTimSetFunc(void (*handler)(void));


Can anyone suggest what I might be doing wrong or point me to a full working example that uses the Timer1 NMI?

Statistics: Posted by dkinzer — Fri Jul 31, 2015 7:58 am


]]>