Reading Toit Code (002)

After toit_start(), we have toit_esp32.cc to read. The first one is toit::start(). Toit here is just a namespace. As we know that toit supports OTA (over-the-air update) through WiFi and esp32 device is set to be a station (STA instead of AP). What we have here is as follows: RtcMemory::set_up(); FlashRegistry::set_up(); OS::set_up(); esp_partition_find_first(); setup_program(support_ota); Scheduler::ExitState exit_state; VM vm; vm.load_platform_event_sources(); int groud_id = vm.scheduler()->next_group_id(); exit_state = vm.scheduler()->run_boot_program(program, null, group_id); OS::tear_down(); FlashRegistry::tear_down(); After these, esp32 may go to deep sleep. ...

March 1, 2022 · 1 min · un01s

Reading Toit Code (001)

When I started to port the code to ESP32S3 following the example of ESP32C3, I realized I had to read the code closely. Here are the notes along the way. Where does the code get started on esp32? Based on esp-idf, Toit (I like to pronounce it as tight) creates a new platform with a new programming language for developers. For the code to start on the esp32 device, check all the files inside toolchains/esp32/. They contains all the building details for esp32. Inside its subfolder main, there is a toit.c. The function app_main() is the entry point. Inside toit_start() is called. ...

February 25, 2022 · 1 min · un01s

Invasion!

Today Putin ordered troops into pro-Russian region of eastern Ukraine in the name of peacekeeping. Ukraine invaded. Then I saw the news of Dr. Paul Farmer. “The idea that some lives matter less is the root of all that is wrong with the world.”

February 21, 2022 · 1 min · un01s

Infinite Dead

I remember once offering to an editor an article which began with a reference to the experience of last century. “Oh,” he said, “leave out the history and come to the present.” I felt like going to him over a thousand miles and taking him by the lapels and saying, “Dear, dear jackass! Don’t you understand that the past is the present; that without what was, nothing is? That, of the infinite dead, the living are but unimportant bits? ...

February 4, 2022 · 1 min · un01s

Do not ask your children

Do not ask your children to strive for extraordinary lives. Such striving may seem admirable, but it is the way of foolishness. Help them instead to find the wonder and the marvel of an ordinary life. Show them the joy of tasting tomatoes, apples and pears. Show them how to cry when pets and people die. Show them the infinite pleasure in the touch of a hand. And make the ordinary come alive for them ...

February 3, 2022 · 1 min · un01s

reading experience

“People without hope not only don’t write novels, but what is more to the point, they don’t read them. They don’t take long looks at anything, because they lack the courage. The way to despair is to refuse to have any kind of experience, and the novel, of course, is a way to have experience. The lady who only read books that improved her mind was taking a safe course - and a hopeless one. She’ll never know whether her mind is improved or not, but should she ever, by some mistake, read a great novel, she’ll know mighty well that something is happening to her.” ...

January 29, 2022 · 1 min · un01s

mindful and calm

The good and the bad are everywhere all the time. While reading stories and watching movies there are always heroes and villains in these endless dramas. There are always Don Quixote and Sancho. What am I? What are you? A mixture of good and bad. That’s all. What if we stop dividing us into black and white? One teaching of Budha is now and here. What does it mean? No regret and guilty for the past. No fear and anxiety for the future. Mindfulness is nothing but observing some unnoticed details before. Breath in and breath out. Be there all the time with ones and things you love. The key is your complete focus on the activity you are doing. ...

January 25, 2022 · 1 min · un01s

Use Jaguar to update

Use an Airport to setup a WiFi network. Then download the binary of Jaguar. Run the following commands one after another. The second command requires the WiFi credentials. Use CTRL+C to stop the third one. To run the forth and the fifth command, put your computer on the same WiFi network as the esp32 device. $./jag setup $./jag flash $./jag monitor $./jag scan $./jag run hello.toit ...

January 17, 2022 · 1 min · un01s

wasm3 on esp32

Stumbled on this repo. Run the modified code on one snowflake with 25 RGB LEDs (ws2812b-2020). Check the video tweet.

January 16, 2022 · 1 min · un01s

Toit on m5core2

Build some examples in toit and flash it to M5Core2. There is no problem to follow the steps in one toit discussion. While trying the step4 for ft63xx. Found a typo in package.yaml. mpu6886 should be ft63xx. Another issue is that the touch seems not working after unplugging the USB cable. Will investigate further. Will try jaguar tool later.

January 15, 2022 · 1 min · un01s