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

[Board]: Support for M5Stack Core2 ESP32 (Part 1: radio + display) #5043

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

lboue
Copy link
Contributor

@lboue lboue commented Oct 13, 2024

Adding support for M5Stack Core2 ESP32 because we no longer have an answer in PR #4471

  • Part 1: radio + display

@lboue lboue marked this pull request as ready for review October 13, 2024 17:00
lboue added a commit to lboue/meshtastic_firmware that referenced this pull request Oct 13, 2024
DataRegion struct from meshtastic#5043 PR
@lboue lboue mentioned this pull request Oct 13, 2024
Copy link
Member

@caveman99 caveman99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. Please see comments inline

src/graphics/Screen.cpp Show resolved Hide resolved
@lboue
Copy link
Contributor Author

lboue commented Nov 7, 2024

I have ordered a copy of Core2 for testing. I should receive it next week.

@lboue lboue marked this pull request as draft November 8, 2024 20:47
@lboue
Copy link
Contributor Author

lboue commented Nov 12, 2024

I managed to make it work with the following setup:

LoRa Pin Core2 GPIO
SPI_MOSI 23
SPI_MISO 38
SPI_CLK 18
RST 25
CS 27
IRQ 35

image

Boot log

[14:35:42]  DEBUG | ??:??:?? 0  SPI.begin(SCK=18, MISO=38, MOSI=23, NSS=27)
[14:35:42]  DEBUG | ??:??:?? 0  TFTDisplay!
[14:35:42]  DEBUG | ??:??:?? 0  Using compiled/slipstreamed tzplaceholder                                         
[14:35:42]  DEBUG | ??:??:?? 0  Set Timezone to GMT0
[14:35:42]  DEBUG | ??:??:?? 0  Read RTC time as 0
[14:35:42]  DEBUG | ??:??:?? 0  NeighborInfoModule is disabled
[14:35:42]  DEBUG | ??:??:?? 0  Rescanning for I2C keyboard
[14:35:42]  DEBUG | ??:??:?? 0  Scanning for I2C devices on port 1
[14:35:42]  DEBUG | ??:??:?? 0  Scanning address 0x1f
[14:35:42]  DEBUG | ??:??:?? 0  Scanning address 0x55
[14:35:42]  DEBUG | ??:??:?? 0  Scanning address 0x5f
[14:35:42]  INFO  | ??:??:?? 0  External Notification Module Disabled
[14:35:42] [   928][D][M5GFX.cpp:515] _read_panel_id(): [M5GFX] [Autodetect] read cmd:04 = ffffff3f
[14:35:42][   944][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=21 scl=22 freq=100000
[14:35:42][   953][D][M5GFX.cpp:817] autodetect(): [M5GFX] AXP192 found
[14:35:42][   961][D][M5GFX.cpp:515] _read_panel_id(): [M5GFX] [Autodetect] read cmd:04 = ffffff3f
[14:35:42][   974][D][M5GFX.cpp:515] _read_panel_id(): [M5GFX] [Autodetect] read cmd:04 = 3f0000e3
[14:35:42][   982][I][M5GFX.cpp:955] autodetect(): [M5GFX] [Autodetect] M5StackCore2
[14:35:42][   990][I][M5GFX.cpp:620] init_impl(): [M5GFX] [Autodetect] save to NVS : board:2
[14:35:42][  1119][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=21 scl=22 freq=100000
[14:35:42][  1129][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=21 scl=22 freq=100000
[14:35:42][  1137][E][Wire.cpp:137] setPins(): bus already initialized. change pins only when not.
[14:35:42][  1183][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=21 scl=22 freq=100000
[14:35:42] INFO  | ??:??:?? 1  Doing TFT init
[14:35:42]  INFO  | ??:??:?? 1  Power to TFT Backlight
[14:35:42]  INFO  | ??:??:?? 1  Turning on screen
[14:35:42]  DEBUG | ??:??:?? 1  haveGlyphs=1
[14:35:42]  DEBUG | ??:??:?? 1  haveGlyphs=1
[14:35:42]  DEBUG | ??:??:?? 1  waypoint wants a UI Frame
[14:35:42]  DEBUG | ??:??:?? 1  canned wants a UI Frame
[14:35:42]  DEBUG | ??:??:?? 1  RF95Interface(cs=27, irq=35, rst=25, busy=-1)
[14:35:42]  INFO  | ??:??:?? 1  Starting meshradio init...
[14:35:42]  INFO  | ??:??:?? 1  Radio freq=906.875, config.lora.frequency_offset=0.000
[14:35:42]  INFO  | ??:??:?? 1  Set radio: region=UNSET, name=LongFast, config=0, ch=19, power=30
[14:35:42]  INFO  | ??:??:?? 1  myRegion->freqStart -> myRegion->freqEnd: 902.000000 -> 928.000000 (26.000000 MHz)
[14:35:42]  INFO  | ??:??:?? 1  numChannels: 104 x 250.000kHz
[14:35:42]  INFO  | ??:??:?? 1  channel_num: 20
[14:35:42]  INFO  | ??:??:?? 1  frequency: 906.875000
[14:35:42]  INFO  | ??:??:?? 1  Slot time: 77 msec
[14:35:42]  INFO  | ??:??:?? 1  Set radio: final power level=20
[14:35:42]  DEBUG | ??:??:?? 1  Current limit set to 100.000000
[14:35:42]  DEBUG | ??:??:?? 1  Current limit set result 0
[14:35:42]  INFO  | ??:??:?? 1  RF95 init result 0
[14:35:42]  INFO  | ??:??:?? 1  Frequency set to 906.875000
[14:35:42]  INFO  | ??:??:?? 1  Bandwidth set to 250.000000
[14:35:42]  INFO  | ??:??:?? 1  Power output set to 20
[14:35:42] E (1573) gpio: gpio_isr_handler_remove(482): GPIO isr service is not installed, call gpio_install_isr_service() first
[14:35:42] INFO  | ??:??:?? 1  RF95 Radio init succeeded, using RF95 radio
[14:35:42]  INFO  | ??:??:?? 1  Not using WIFI
[14:35:42]  DEBUG | ??:??:?? 1  LoRA bitrate = 118.500000 bytes / sec
[14:35:42]  1���
��[0m| ??:??:?? 1  PowerFSM init, USB power=1
[14:35:42]  DEBUG | ??:??:?? 1  Enter state: BOOT
[14:35:42] [  1618][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 320 / 4 = 80 Mhz, APB: 80000000 Hz
[14:35:42] DEBUG | ??:??:?? 1 [Screen]  Screen: Started...
[14:35:42]  DEBUG | ??:??:?? 1 [Screen]  haveGlyphs=1
[14:35:42]  INFO  | ??:??:?? 1 [RangeTestModule]  Range Test Module - Disabled
[14:35:42]  DEBUG | ??:??:?? 2 [Screen]  haveGlyphs=1
[14:35:42]  DEBUG | ??:??:?? 3 [Screen]  haveGlyphs=1
[14:35:42]  INFO  | ??:??:?? 4 [PowerFSM]  Initialise the NimBLE bluetooth module
[14:35:42]  DEBUG | ??:??:?? 5 [Screen]  haveGlyphs=1
[14:35:42]  INFO  | ??:??:?? 6 [Screen]  Done with boot screen...
[14:35:42]  DEBUG | ??:??:?? 6 [Screen]  showing standard frames
[14:35:42]  DEBUG | ??:??:?? 6 [Screen]  Showing 0 module frames
[14:35:42]  DEBUG | ??:??:?? 6 [Screen]  Total frame count: 103
[14:35:42]  DEBUG | ??:??:?? 6 [Screen]  Added modules.  numframes: 0
[14:35:42]  DEBUG | ??:??:?? 6 [Screen]  Finished building frames. numframes: 2
[14:35:49]  INFO  | ??:??:?? 15  BLE disconnect
[14:35:49]  INFO  | ??:??:?? 15  PhoneAPI::close()
[14:35:53]  INFO  | ??:??:?? 19  BLE disconnect
[14:35:53]  INFO  | ??:??:?? 19  PhoneAPI::close()
[14:36:04]  INFO  | ??:??:?? 30 [NodeInfoModule]  Sending our nodeinfo to mesh (wantReplies=1)
[14:36:04]  INFO  | ??:??:?? 30 [NodeInfoModule]  sending owner !c9a2c808/Meshtastic c808/c808
[14:36:04]  DEBUG | ??:??:?? 30 [NodeInfoModule]  Partially randomized packet id 1772102779
[14:36:04]  DEBUG | ??:??:?? 30 [NodeInfoModule]  Update DB node 0xc9a2c808, rx_time=0
[14:36:04]  DEBUG | ??:??:?? 30 [NodeInfoModule]  handleReceived(LOCAL) (id=0x69a0247b fr=0x08 to=0xff, WantAck=0, HopLim=3 Ch=0x0 Portnum=4 WANTRESP priority=10)
[14:36:04]  DEBUG | ??:??:?? 30 [NodeInfoModule]  No modules interested in portnum=4, src=LOCAL
[14:36:04]  DEBUG | ??:??:?? 30 [NodeInfoModule]  Add packet record (id=0x69a0247b fr=0x08 to=0xff, WantAck=0, HopLim=3 Ch=0x0 Portnum=4 WANTRESP priority=10)
[14:36:04]  DEBUG | ??:??:?? 30 [NodeInfoModule]  Expanding short PSK #1
[14:36:04]  DEBUG | ??:??:?? 30 [NodeInfoModule]  Using AES128 key!
[14:36:04]  WARN  | ??:??:?? 30 [NodeInfoModule]  send - lora tx disabled because RegionCode_Unset

@lboue lboue changed the title Support for M5Stack Core2 ESP32 M5Stack Core2 ESP32 [Board]: Support for M5Stack Core2 ESP32 (Part 1: radio + display) Nov 12, 2024
@lboue lboue changed the title M5Stack Core2 ESP32 [Board]: Support for M5Stack Core2 ESP32 (Part 1: radio + display) [Board]: Support for M5Stack Core2 ESP32 (Part 1: radio + display) Nov 12, 2024
@lboue lboue marked this pull request as ready for review November 12, 2024 16:18
@lboue lboue requested a review from caveman99 November 12, 2024 16:20
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

Successfully merging this pull request may close these issues.

3 participants