Active HW-Timer and writing SPI_FLASH does not work any more

Klaus W.
Posts: 2
Joined: Mon Nov 30, 2015 2:26 am

Active HW-Timer and writing SPI_FLASH does not work any more

Postby Klaus W. » Mon Nov 30, 2015 2:36 am

Hello,

i'm investigating an issue the whole day and can not fix following situation:

Witihn user_init() following hw-timer is initialized:
hw_timer_init(FRC1_SOURCE, 1);
hw_timer_set_func(hw_pwm_timer_cb);
hw_timer_arm(100);

The httpd triggers following lines at an incoming http-request:

spi_flash_erase_sector(0x3D);
spi_flash_write((0x3D) * SPI_FLASH_SEC_SIZE,(uint32 *)&data, sizeof(struct SettingsData));

I recognized that this lines are not finished. So erase is not finished. The processor restart with a fatal exception.

In case of deactivated hw_timer, writing to spi flash works without any problems.

Do you know this issue? How can i deactivate the hw_timer to write or do you what's the problem?

Thx.

Klaus

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

Re: Active HW-Timer and writing SPI_FLASH does not work any more

Postby ESP_Faye » Tue Dec 01, 2015 4:00 pm

Hi,

Please do not add "ICACHE_FLASH_ATTR" for your timer callback (hw_pwm_timer_cb), do not put it into Flash.

If your problem is still unsolved, please provide your test code, we will help debug it.

Who is online

Users browsing this forum: No registered users and 5 guests