Control the display on your M5Stack Core2 with Toit #5
Replies: 5 comments 22 replies
-
Hi, Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/c++
Build flags: ;-m32
Id flags:
The output was:
1
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
Determining if the CXX compiler works failed with the following output:
Change Dir: /path/to/toit/build/ia32/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/ninja cmTC_e43f4 && [1/2] Building CXX object CMakeFiles/cmTC_e43f4.dir/testCXXCompiler.cxx.o
[2/2] Linking CXX executable cmTC_e43f4
FAILED: cmTC_e43f4
: && /usr/bin/c++ -m32 CMakeFiles/cmTC_e43f4.dir/testCXXCompiler.cxx.o -o cmTC_e43f4 && :
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed. I checked the cmake file(toolchains/ia32.cmake) carefully. I think it is caused by the "-m32" parameter.So I deleted the "-m32" parameter, it can compile success: make esp32 ESP32_ENTRY=../toit-m5stack-core2/examples/tft_demo.toit
...
App "toit" version: fc7362d-dirty
LD build/esp32/toit.elf
esptool.py v3.1-dev
Merged 2 ELF sections
To flash all build output, run 'make flash' or:
python /path/to/esp-idf-toit/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xd000
/path/to/toit/build/esp32/ota_data_initial.bin 0x1000
/path/to/toit/build/esp32/bootloader/bootloader.bin 0x10000
/path/to/toit/build/esp32/toit.bin 0x8000
/path/to/toit/build/esp32/partitions.bin But when I try to burn to esp32, it doesn't seem to run correctly. Rebooting...
[flash reg] address 0x3f43c000, size 0x00134000
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x4018aa06 PS : 0x00060130 A0 : 0x801054b8 A1 : 0x3ffbbb60
A2 : 0x3ffd000d A3 : 0x3f401bb4 A4 : 0x00000000 A5 : 0x00060523
A6 : 0x3ffc8000 A7 : 0x00008000 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x3ffcf9f0 A13 : 0x00000120
A14 : 0x000004e8 A15 : 0x3ffcfb0c SAR : 0x00000009 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000
Backtrace:0x4018aa03:0x3ffbbb60 0x401054b5:0x3ffbbb80 0x401054d3:0x3ffbbba0 0x401057cd:0x3ffbbbc0 0x40111441:0x3ffbbbe0 0x401114c2:0x3ffbbc00 0x401128a5:0x3ffbbc20 0x4011317d:0x3ffbbc60 0x40113277:0x3ffbbf20 0x400f9c27:0x3ffbbf40 0x4019516d:0x3ffbbf60
ELF file SHA256: bed0f0023456543a Do you have any advice? Am I missing something? |
Beta Was this translation helpful? Give feedback.
-
The general instructions have been updated. We will continue to improve them. Thanks again! Did you manage to get something shown on your M5Stack Core2 display from Toit code, @imliubo? |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for your help! core2-mpu6886.mp4 |
Beta Was this translation helpful? Give feedback.
-
Touch test. toit-ft63xx.mp4 |
Beta Was this translation helpful? Give feedback.
-
Very nice, runs on macOS and Ubuntu; had to change: b) in the Makefile All depending potentially/probably on the versions used (Mac Catalina 10.15.7, Ubuntu 20.04) Also IDF_PATH has always to be set (not only when using non-standard path). Also runs very good with jaguar. Question: it does not work (as expected) with M5Stack Basic, Fire, ... (which are not core2) and M5Sticks. They are all based on ESP32, but need a different package. Is that planned? Thanks a lot! |
Beta Was this translation helpful? Give feedback.
-
Control the display on your M5Stack Core2
The M5Stack Core2 is a cool little IoT device based on the ESP32. It comes with a screen and it is a great device for tinkering with Toit.
Steps
1. Get the source code
Clone the repositories in a suitable directory:
You should now have two additional directories:
toit-m5stack-core2/
andtoit/
.2. Set up the build environment for Toit
Go into the
toit/
directory and follow the instructions. You should be able to build the tools and the ESP32 firmware for a simple Toit:If you run into other build issues ("error: loading 'build.ninja'"), you may not have set up your development environment correctly before you tried to build. Clean your build using
make clean
and make sure yourIDF_PATH
environment variable points to the right directory.3. Install the package dependencies
The following command installs the package dependencies of the examples programs. Inside the
toit/
directory:4. Run the demo
Note: The core2 uses the QinHeng USB-to-serial chip, which needs a driver-update on macos.
The last step is to build the ESP32 firmware for the
tft_demo.toit
and flash it into your device. This is all done from thetoit/
directory:It is often useful to see the serial output from the device while it is running and you can use the
toit
command-line interface for that too:or you can stick to simpler alternatives like
cat
:5. Play!
Edit the
toit-m5stack-core2/examples/tft_demo.toit
or make a copy of it and try to change some of the text on the screen. Maybe something close to line 42 would be a good start!For more advanced changes to the example you probably want to take a look at how the display code works or look at the examples in the toit-color-tft repo.
Once you have changed the example, you need to build and run the demo again from step 4. Have fun!
Picture or it didn't happen
Beta Was this translation helpful? Give feedback.
All reactions