Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No-WiFi flash fixes #2353

Merged
merged 2 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Sming/Arch/Esp8266/Components/esp_no_wifi/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ If you want to disassemble other SDK libraries, do this::
Known issues
------------

- Call to `spi_flash_get_id()` hangs in application code
- ROMs must be located below 1M
SDK implementation of `Cache_Read_Enable_New()` has internal flag which doesn't get initialised (default is 0xff, must be 1 or the function does nothing).

Further work is required to implement the following (list incomplete):

- Sleep/power saving modes
Expand Down
12 changes: 12 additions & 0 deletions Sming/Arch/Esp8266/Components/esp_no_wifi/app_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,24 @@ void set_pll(void)
}
}

static void init_flash_code()
{
spi_flash_set_read_func(NULL);
// Variable resets to 0xff, must be 0 or Cache_Read_Enable_New hangs
uint32_t addr = (uint32_t)&Cache_Read_Enable_New;
addr -= 8;
uint32_t** varptr = (uint32_t**)addr;
**varptr = 0;
}

static void user_start(void)
{
ets_isr_mask(0x3FE); // disable interrupts 1..9
sleep_reset_analog_rtcreg_8266(); // spoils the PLL!
set_pll();

init_flash_code();

memset(&_bss_start, 0, &_bss_end - &_bss_start);

ets_timer_init();
Expand Down
2 changes: 1 addition & 1 deletion Sming/Arch/Esp8266/Components/esp_no_wifi/user_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void system_print_meminfo(void)
#undef ADDR
}

bool system_os_post(uint8_t prio, os_signal_t sig, os_param_t par)
bool IRAM_ATTR system_os_post(uint8_t prio, os_signal_t sig, os_param_t par)
{
if(prio >= USER_TASK_PRIO_MAX) {
os_printf("err: post prio >= %u\n", USER_TASK_PRIO_MAX);
Expand Down
3 changes: 0 additions & 3 deletions samples/Basic_Storage/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ void listDevices()
Serial.print(toString(dev.getType()));
Serial.print(_F(", size = 0x"));
Serial.print(dev.getSize(), HEX);
#ifndef DISABLE_WIFI
// KNOWN ISSUE: Call to `spi_flash_get_id()` hangs in application code
Serial.print(_F(", ID = 0x"));
Serial.print(dev.getId(), HEX);
#endif
Serial.println();
}
Serial.println();
Expand Down