### The problem
Enabling LD2420 on ESP8266 triggers a boot loop
### Which vers…ion of ESPHome has the issue?
2023.11.0
### What type of installation are you using?
pip
### Which version of Home Assistant has the issue?
_No response_
### What platform are you using?
ESP8266
### Board
d1_mini
### Component causing the issue
ld2420
### Example YAML snippet
```yaml
substitutions:
systemName: "garazs-temp"
device_name: "${systemName}"
esphome:
name: $systemName
esp8266:
board: d1_mini
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
password: !secret ota_password
safe_mode: yes
logger:
level: info
ld2420:
uart:
id: ld2420_uart
tx_pin: D1
rx_pin: D2
baud_rate: 256000
parity: NONE
stop_bits: 1
text_sensor:
- platform: ld2420
fw_version:
name: LD2420 Firmware
sensor:
- platform: ld2420
moving_distance:
name : Moving Distance
binary_sensor:
- platform: ld2420
has_target:
name: Presence
select:
- platform: ld2420
operating_mode:
name: Operating Mode
number:
- platform: ld2420
presence_timeout:
name: Detection Presence Minimum
min_gate_distance:
name: Detection Gate Minimum
max_gate_distance:
name: Detection Gate Maximum
# See "Number" section below for detail
gate_select:
name: Select Gate to Set
still_threshold:
name: Set Still Threshold Value
move_threshold:
name: Set Move Threshold Value
button:
- platform: ld2420
apply_config:
name: Apply Config
factory_reset:
name: Factory Reset
restart_module:
name: Restart Module
revert_config:
name: Undo Edits
```
### Anything in the logs that might be useful for us?
```txt
[23:10:40][I][logger:326]: Log initialized
[23:10:40][I][app:029]: Running through setup()...
[23:10:40]
[23:10:40]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[23:10:40]
[23:10:40]Exception (28):
WARNING Exception type: Access to invalid address: LOAD (wild pointer?)
[23:10:40]epc1=0x4010040f epc2=0x00000000 epc3=0x00000000 excvaddr=0x0000001c depc=0x00000000
WARNING Decoded 0x4010040f: esphome::uart::ESP8266SoftwareSerial::write_byte(unsigned char)
[23:10:40]
[23:10:40]>>>stack>>>
WARNING Found stack trace! Trying to decode it
[23:10:40]
[23:10:40]ctx: cont
[23:10:40]sp: 3ffffc20 end: 3fffffd0 offset: 0190
[23:10:40]3ffffdb0: 3ffffee0 3ffffed0 00000008 00000003
[23:10:40]3ffffdc0: 00000003 feefeffe feefeffe feefeffe
[23:10:40]3ffffdd0: feefeffe 3fff1e0c 000001f0 3ffe90ec
[23:10:40]3ffffde0: 3fffff60 3fffff50 00000010 40236779
WARNING Decoded 0x40236779: _vsnprintf_r at /workdir/repo/newlib/newlib/libc/stdio/vsnprintf.c:71 (discriminator 4)
[23:10:40]3ffffdf0: 3fffff60 3fffff50 00000010 ffff0208
[23:10:40]3ffffe00: 0000001a 000001e4 3ffffea3 40100fe4
WARNING Decoded 0x40100fe4: umm_free_core at umm_malloc.cpp
[23:10:40]3ffffe10: 0000000e 3fff2d7c 00000003 40209f7c
WARNING Decoded 0x40209f7c: esphome::ld2420::LD2420Component::send_cmd_from_array(esphome::ld2420::LD2420Component::CmdFrameT)
[23:10:40]3ffffe20: fafbfcfd 00ff0004 03040002 40230102
WARNING Decoded 0x40230102: EspClass::resetHeap()
[23:10:40]3ffffe30: 3fff1e9e 00000001 000001b5 ffff0208
[23:10:40]3ffffe40: 3fff1e84 000001cf 3ffe8644 3fff0724
[23:10:40]3ffffe50: 00000000 4021b411 00000020 40101200
WARNING Decoded 0x4021b411: void std::vector<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > > >::_M_realloc_insert<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > >(__gnu_cxx::__normal_iterator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >*, std::vector<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > > > >, std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >&&)
WARNING Decoded 0x40101200: malloc
[23:10:40]3ffffe60: 00002620 3fff1e0c 00000004 4022b043
WARNING Decoded 0x4022b043: operator new(unsigned int)
[23:10:40]3ffffe70: 00000000 00000000 00000001 4021b411
WARNING Decoded 0x4021b411: void std::vector<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > > >::_M_realloc_insert<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > >(__gnu_cxx::__normal_iterator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >*, std::vector<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > > > >, std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >&&)
[23:10:40]3ffffe80: 00000000 00000000 3ffffee0 401011d6
WARNING Decoded 0x401011d6: free
[23:10:40]3ffffe90: 40228334 3ffe9875 3fff0a24 3fff25f4
WARNING Decoded 0x40228334: HardwareSerial::write(unsigned char const*, unsigned int)
[23:10:40]3ffffea0: 3ffd0004 3fff0714 3fff0714 4021b4bf
WARNING Decoded 0x4021b4bf: esphome::Scheduler::push_(std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >)
[23:10:40]3ffffeb0: 000000ff 00000000 0000003c 4022b043
WARNING Decoded 0x4022b043: operator new(unsigned int)
[23:10:41]3ffffec0: 3ffffee0 00000000 00000000 3fff2c00
[23:10:41]3ffffed0: 3fff2d7c 00000001 3fff2d7c 4020a0bd
WARNING Decoded 0x4020a0bd: esphome::ld2420::LD2420Component::set_config_mode(bool)
[23:10:41]3ffffee0: fafbfcfd 00ff000e 00000002 4021b411
WARNING Decoded 0x4021b411: void std::vector<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > > >::_M_realloc_insert<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > >(__gnu_cxx::__normal_iterator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >*, std::vector<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > > > >, std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >&&)
[23:10:41]3ffffef0: 00000000 00000000 00023924 01020304
[23:10:41]3fffff00: fafbfcfd 00ff0000 00000002 4021b411
WARNING Decoded 0x4021b411: void std::vector<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > > >::_M_realloc_insert<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > >(__gnu_cxx::__normal_iterator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >*, std::vector<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > > > >, std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >&&)
[23:10:41]3fffff10: 00000000 00000000 00023924 01020304
[23:10:41]3fffff20: 3fffff28 00000002 3fff2d7c 4020ab97
WARNING Decoded 0x4020ab97: esphome::ld2420::LD2420Component::setup()
[23:10:41]3fffff30: 00000000 3fff3924 3fff0714 4021b67f
WARNING Decoded 0x4021b67f: esphome::Scheduler::process_to_add()
[23:10:41]3fffff40: 00000000 00000000 4021b130 3fff0714
WARNING Decoded 0x4021b130: esphome::Scheduler::SchedulerItem::cmp(std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > const&, std::unique_ptr<esphome::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > const&)
[23:10:41]3fffff50: 3fff0718 00000001 3fff0714 4021bc0c
WARNING Decoded 0x4021bc0c: esphome::preferences::IntervalSyncer::setup()
[23:10:41]3fffff60: 3fff2bd4 3fff2c00 00000000 3fff2c00
[23:10:41]3fffff70: 3fff2d7c 00000002 3fff0714 40219f95
WARNING Decoded 0x40219f95: esphome::Application::setup()
[23:10:41]3fffff80: 00000017 00000017 3fff3d7c feefeffe
[23:10:41]3fffff90: 0000000c 00000048 3fff39e4 feefeffe
[23:10:41]3fffffa0: feefeffe feefeffe feefeffe 3fff0bec
[23:10:41]3fffffb0: 3fffdad0 00000000 3fff0bd8 4022b368
WARNING Decoded 0x4022b368: loop_wrapper() at core_esp8266_main.cpp
[23:10:41]3fffffc0: feefeffe feefeffe 3ffe8640 401006d5
WARNING Decoded 0x401006d5: cont_wrapper
[23:10:41]<<<stack<<<
[23:10:41]
[23:10:41]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[23:10:41]
[23:10:41] ets Jan 8 2013,rst cause:2, boot mode:(3,6)
[23:10:41]
[23:10:41]load 0x4010f000, len 3460, room 16
[23:10:41]tail 4
[23:10:41]chksum 0xcc
[23:10:41]load 0x3fff20b8, len 40, room 4
[23:10:41]tail 4
[23:10:41]chksum 0xc9
[23:10:41]csum 0xc9
[23:10:41]v00077550
[23:10:41]~ld
[23:10:41][I][logger:326]: Log initialized
[23:10:41][I][app:029]: Running through setup()...
[23:10:41]
[23:10:41]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[23:10:41]
```
### Additional information
_No response_