Random assortment of my suggestions and ideas (micropython, code formatting, binary section viewer, ...)

Hi there :slight_smile:

hope you all made it back home easily after last weeks embedded world.

Here are a bunch of ideas, as requested I’ll be dumping them here. Take it with a few grams of salt :smiley:

  • Micropython support. There are existing micropython editors, notably: Thonny (https://thonny.org/) is a Tcl/Tk application that works reasonably well. There is also https://codewith.mu/ (mu editor), literally a text view + 10 buttons. Some others as well, 6 Best MicroPython IDEs for Programming. But, they ain’t great.
    I am not sure how hard this is, but essentially all of the micropython IDEs listed are just Python Source Code editors. They integrate file managers for files on the device (this includes “flashing” - writing a python file like main.py to the device). And, there is a view for the serial port, which runs a python REPL (on-device), which also serves as the python programs STDOUT. There is no debugger in micropython.

  • Source code formatter. The page I recommended as inspiration was: clang-format configurator which allows you to generate your very own customized clang formatter config file. (Side note, we talked also about “inferring” the config from an existing codebase, but that’s an ambitious project :D)

  • Binary section view, some kind of hybrid between
    ST Community (first image)
    cargo bloat: https://crates.io/crates/cargo-bloat/0.6.1
    Executable and Linkable Format - Wikipedia (for sections with a statically known size, print the size?)

I noticed there are some files already for chips and boards that aren’t officially listed as supported such as esp32 and rp2040 - is there some “give me all the nasal demons” option I can select to try those out?

Lastly, some observation: on my Thinkpad P16 running linux with wayland, it was downright impossible to work with embeetle. The cursor freezes, there are rendering artifacts, and crashes when creating a new project. I’d be happy to send some diagnostics, if this niche configuration is something of interest to you, that is. I’d understand if it isn’t.

Keep it up and all the best :slight_smile:
Rafael

2 Likes

Hi Rafael,
Thanks a lot for your post. It was great to meet you at Embedded World :smile:

I will reply on just a few parts of your post (leaving the rest for my colleagues):

I noticed there are some files already for chips and boards that aren’t officially listed as supported such as ESP32 and RP2040 - is there some “give me all the nasal demons” option I can select to try those out?

Those are leftovers from trials. I tried to support both the ESP32 and RP2040 in Embeetle. Both trials failed at the time, because the projects from the manufacturer are CMake-based. I could not convert them into makefile-based projects in any meaningful way.

We will look into CMake-support in Embeetle. Are you familiar with CMake? If you have any suggestions here, please shoot.

platformio supports both chips nicely and is in general something I’d think might be worth a look at in case you haven’t.

@Hynreck We did look into platformio, especially for the chips mentioned above. It is CMake-based, which we couldn’t handle at the time. We plan to look into it again.

My current understanding is that CMake can generate a makefile-based project, given some settings. Our initial idea is to integrate these settings in the Embeetle dashboard, generate the makefile and continue from there.

I will certainly look into the code formatter, and probably MicroPython as well after that. It might take some time before I get there.

The information shown by arm-none-eabi-objcopy for the ELF file is very close to what we already show in the dashboard, under the heading Microcontroller

image

You can right-click on any memory region name and select Sections to get details about the memory sections assigned to each region. Any suggestions to improve this are welcome, as we are considering to redesign the dashboard. I guess the main use would be to have an overview of how much each section is contributing to the memory usage, right?

About the Thinkpad P16 issues: that sounds like a PyQt problem. Feel free to post some details, or send them to @matkuki

I would be very interested, yes.
Please give me some information about your linux distro and all the diagnostics that you can, thanks :+1::+1:

BTW: Nice name, Hynreck. Didn’t recognize it at first, the Dutch name is Huunreck :slight_smile:

1 Like

Just noting, platformio is completely unrelated to CMake. Platformio is the closest thing to cargo on this side of the fence.

CMake generates build files for all kinds of other build systems. It’ll generate a (funny-looking but perfect) Makefile. This is also how I used CMake in the past.

I guess the main use would be to have an overview of how much each section is contributing to the memory usage, right?

Exactly! Very nice.

Distro info:
uname -a: Linux rafael-thinkpad 6.1.12-1-MANJARO #1 SMP PREEMPT_DYNAMIC Tue Feb 14 21:59:10 UTC 2023 x86_64 GNU/Linux

How can I collect some diagnostics here? The only thing I can give you right now is this strace log: embeetle.strace.log · GitHub

The log is the result of starting the application, then clicking “CREATE”. The application then crashes, and there is no output in the shell.

1 Like

If PlatformIO integration was feasable, would it be a good idea to add support for it to Embeetle?

I’m mostly asking @Hynreck , but all opinions are welcome!