Hi there:
I tried to build my custom firmwire since i made a pcb with a esp-32-s module and a ra-01s(sx1268) lora module on it. I followed the doc and successfully compiled, but when i flash to esp32 the oled show start menue and chip reboot over and over again. and this is debug output:
//\ E S H T /\ S T / C
??:??:?? 0 booted, wake cause 0 (boot count 1), reset_reason=reset
??:??:?? 0 Filesystem files:
??:??:?? 0 /prefs/channels.proto (53 Bytes)
??:??:?? 0 /prefs/db.proto (139 Bytes)
??:??:?? 0 /prefs/radio.proto (5 Bytes)
??:??:?? 0 I2C device found at address 0x3c
??:??:?? 0 0x3 subtype probed
??:??:?? 0 ssd1306 display found
??:??:?? 0 done
??:??:?? 0 Meshtastic hwvendor=255, swver=1.3.5.e5b19fdf-d
??:??:?? 0 Setting random seed 1103890559
??:??:?? 0 Total heap: 237844
??:??:?? 0 Free heap: 205716
??:??:?? 0 Total PSRAM: 0
??:??:?? 0 Free PSRAM: 0
??:??:?? 0 NVS: UsedEntries 267, FreeEntries 363, AllEntries 630, NameSpaces 8
??:??:?? 0 Setup Preferences in Flash Storage
??:??:?? 0 Number of Device Reboots: 1173
??:??:?? 0 Initial packet id 1772541751, numPacketId 4294967295
??:??:?? 0 Setting default channel and radio preferences!
??:??:?? 0 Expanding short PSK #1
??:??:?? 0 Wanted region 0, using Unset
??:??:?? 0 Loading /prefs/db.proto
??:??:?? 0 Loaded saved preferences version 11
??:??:?? 0 Loading /prefs/radio.proto
??:??:?? 0 Loading /prefs/channels.proto
??:??:?? 0 Number of Device Reboots: 1173
??:??:?? 0 Expanding short PSK #1
??:??:?? 0 Wanted region 0, using Unset
??:??:?? 0 region=0, NODENUM=0xf7ecc4c0, dbsize=1
??:??:?? 0 Read RTC time as 50 (cur millis 230) quality=0
??:??:?? 0 Using MSL altitude model
??:??:?? 0 WANT GPS=1
??:??:?? 0 Setting GPS power=1
??:??:?? 2 ERROR: No UBLOX GPS found
??:??:?? 2 Using NMEA Mode
??:??:?? 2 WANT GPS=1
??:??:?? 2 GxGSA NOT available
??:??:?? 2 Turning on screen
??:??:?? 2 Module wants a UI Frame
??:??:?? 2 Starting meshradio init...
??:??:?? 2 (bw=250, sf=11, cr=4/8) packet symLen=8 ms, payloadSize=16, time 559 ms
??:??:?? 2 Set radio: name=LongFast, config=2, ch=19, power=0
??:??:?? 2 Radio myRegion->freqStart / myRegion->freqEnd: 902.000000 -> 928.000000 (26.000000 mhz)
??:??:?? 2 Radio myRegion->numChannels: 104
??:??:?? 2 Radio channel_num: 19
??:??:?? 2 Radio frequency: 433.174988
??:??:?? 2 Short packet time: 559 msec
??:??:?? 2 Set radio: final power level=22
??:??:?? 2 ++++++++++++++++++++++++++++++++SX126x init result -20
??:??:?? 2 Current limit set to 140.000000
??:??:?? 2 Current limit set result 0
assertion "err == ERR_NONE" failed: file "src/mesh/SX126xInterface.cpp", line 223, function: void SX126xInterface<T>::startReceive() [with T = SX1268]
abort() was called at PC 0x40126a33 on core 1
ELF file SHA256: 0000000000000000
Backtrace: 0x4008fdbb:0x3ffd5d50 0x40090141:0x3ffd5d70 0x40126a33:0x3ffd5d90 0x400de311:0x3ffd5dc0 0x400de416:0x3ffd5de0 0x400dda3e:0x3ffd5e10 0x4012527a:0x3ffd5e40
Rebooting...
ets Jul 29 2019 12:21:46
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:728
load:0x40078000,len:9132
load:0x40080400,len:5100
entry 0x40080640
E (657) spiram: SPI RAM enabled but initialization failed. Bailing out.
⸮⸮
the line start with “+++++” is the simble i put in source code, so i checked Radiolib and it tells that sx1268 is not properly configured:
| \brief User tried to execute modem-exclusive method on a wrong modem. |
| - |
| | For example, this can happen when you try to change LoRa configuration when FSK modem is active. |
| | */ |
| | #define RADIOLIB_ERR_WRONG_MODEM (-20) |
Then i changed the code in “SX126xInterface.cpp” line 55:
`int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage, useRegulatorLDO);`
to:
`int res = lora.begin(getFreq(), 125.0, 9, 7, 0x2b, 17, 32, 0, false);`
and it did enter mainpage, but on screen it shows “Critical fault#3”, meaning that lora module not found.
I have tried a demo from RadioLib and i can say the module ra-01s works well, so i really want to know where i should go to solve the problem.
My sch: