Skip to content

Application won't start after flashing #232

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

Closed
Curclamas opened this issue Feb 24, 2017 · 6 comments
Closed

Application won't start after flashing #232

Curclamas opened this issue Feb 24, 2017 · 6 comments

Comments

@Curclamas
Copy link
Contributor

Since I build and flash on separate machines I won't run make flash. Rather I will make and then copy over bootloader.bin, default.bin, boot_app0.bin and app-template.bin to the "flash machine".
I will then flash them with:

python esptool.py --chip esp32 --port COM3 --baud 921600 --before default_reset --after hard_reset write_flash -u --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 boot_app0.bin 0x1000 bootloader.bin 0x10000 app-template.bin 0x8000 default.bin

This succeedes. On the console the ESP32 (devKit J) will print out:

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0008,len:8
load:0x3fff0010,len:2488
load:0x40078000,len:6920
load:0x40080000,len:252
entry 0x40080034
I (578) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (579) heap_alloc_caps: At 3FFC52C0 len 0001AD40 (107 KiB): DRAM
I (588) heap_alloc_caps: At 3FFE8000 len 00018000 (96 KiB): D/IRAM
I (609) heap_alloc_caps: At 40097B40 len 000084C0 (33 KiB): IRAM
I (630) cpu_start: Pro cpu up.
I (641) cpu_start: Single core mode
I (654) cpu_start: Pro cpu start user code
I (715) cpu_start: Starting scheduler on PRO CPU.

After that nothing else is printed to the console. My App looks like:

//file: main.cpp
#include "Arduino.h"

#define BLINK_PIN 5

void setup(){
  Serial.begin(115200);
  Serial.println("hello");
  pinMode(BLINK_PIN, OUTPUT);
}

void loop(){
  Serial.println("loop");
  digitalWrite(BLINK_PIN, LOW);
  delay(1000);
  digitalWrite(BLINK_PIN, HIGH);
  delay(1000);
}

I see neither the console logs nor any level changes on IO5.

What could have gone wrong here?

Could it be that "make flash" does some other stuff? I also checked the binary app-template.bin, it contains the strings "loop" and "hello" so at least it is the correct file.

Just to be complete here is the arduino part from sdconfig:

#
# Arduino Configuration
#
CONFIG_ENABLE_ARDUINO_DEPENDS=y
CONFIG_AUTOSTART_ARDUINO=y
# CONFIG_DISABLE_HAL_LOCKS is not set
@me-no-dev
Copy link
Member

You have in menuconfig an option that says something like "start scheduler on CPU0 only" and that is selected. Arduino runs on CPU1

@Curclamas
Copy link
Contributor Author

That did indeed fix the problem, found the option in the FreeRTOS-Settings. Is there a way to make the "correct" selection a default option? Or maybe this should be noted in the doc since I'm quite sure many people try to use the default template and then run into this problem.

@me-no-dev
Copy link
Member

there are two ways to do it. One is to detect that CORE1 is off and run on core 0, the other is to force CORE1 on. Both exclude each other and can not exists in Arduino at the same time, so I need to pick one, but have not decided which one yet.

@me-no-dev
Copy link
Member

have to think about it more, maybe it's doable through option in Arduino's menuconfig

@lonerzzz
Copy link
Contributor

@me-no-dev Any update on this issue or suggestions to solve in terms of choosing the correct setting?

@copercini
Copy link
Contributor

@lonerzzz It was solved here: 5f2b002

darkxst pushed a commit to darkxst/arduino-esp32 that referenced this issue Dec 5, 2024
* Fixes Matter over WiFi to disable OpenThread

* fix flag value

* disables Matter Stack WiFi manager

* rollback Matter WiFi Manager changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants