Few questions about Zerynth: Debugging, Ethernet, add unsupported board, benchmarks, HTTPS, Tickless Mode, Muticore, & MVC Framework support

Hi,
I have been using Zerynth for the past few days, and I’m impressed with the architecture, ease of use & the documentation. I have few questions, and I hope you answer them for the best of your abilities:

  • Debugging: I have seen the debugging section, but I am not sure if I understood it correctly. Do you support debugging Zerynth Python code via ST-Link (for STM32 boards) & for JTAG? I haven’t tried it yet, I have been testing so far with Particle Photon & ESP32; and those require SAGGER JTAG which I don’t have at the present moment.

  • I quickly scanned through your HAL layer, and I wasn’t sure if the OS/VM/RTOS are integrated into the HAL layer? In other words: Does Zerynth blocks/sleeps when executing a HAL call? or Zerynth Polls until the HAL layer comes back with data or notifications? ChibiOS blocks by default which yields to other threads.

  • Ethernet interface: Is there Ethernet support? or just WiFi? I just bought STM32F746 Nucleo board; I know you don’t support Ethernet on this board yet. However I wonder if you will.

  • How to add unsupported board?.. Is there a process to do that?

  • Is there a benchmark for performance between Zerynth vs C? I’m aware I can embed C code, I just wanted to know if you have done any testing.

  • List item Do you support Tickless Mode? FreeRTOS & ChibiOS both supports it. If not, is there plans to do so?

  • Is multi-core being supported?

  • What is the status on HTTPS support? Any plans to incorporate it? & When!

  • Do you have any MVC framework? I have built a simple MVC Framework called Struts4Embedded. I think if one is incorporated in Zerynth or MicroPythom it will be a big plus for the community. Java community benefited a lot from Struts and Spring frameworks. If I have time, I shall ported it to MicroPython & Zerynth.

  • Is there something similar to Make or Maven for building and flashing projects outside the Zerynth Studio? i.e. especially from the command line? If so where can find instructions!!! This is a must for professional developers.

  • Any plans to add keyboard short cuts to Zerynth Studio? This is a must for developers who comes from Linux and java communities

Many thanks in advance; your work is being appreciated.

Cheers
S. Mansour

Hi @abusous2000

  1. Debugging: Currently, Zerynth supports debugging the C component of hybrid C/Python projects, this is done through gdb gui as front end of gdb debugger.
    Check this link for more info
    Python debugging, setting breakpoints … is on the pipeline and planned for but I cannot give an exact date for that feature.
  1. In general, Zerynth has Vosal Layer , on top of it, VHAL layer then application layer, In the VOSAL layer RTOS is implemented, if a certain thread is suspened for a period, by calling sleep() method for instance, other threads will execute in the mean time.

  2. Ethernet is supported in Zerynth, and Wifi too of course, for instance some supported ethernet drivers are Infineon Ethernet Driver, STM F4 Ethernet Driver,ESP32 EthernetKit.
    As for the ST Nucleo F746ZG, the ethernet on that board is not yet supported as mentioned in the docs.

  3. currently, Adding un-supported boards are only available to ESP32-based boards (adding custom VM), check this link for more details.

  4. Let me check this and get back to you.

  5. Tickles mode and multi-core are not yet supported.

  6. HTTPS is supported on boards where SSL and TLS are hardware managed like ESP32 boards, Check SSL.

  7. AFAIK, I don’t think zerynth has MVC framwork, but I will have a look at your MVC framework.

  8. Have a look at The Zerynth Toolchain (ZTC), It is a command line tool that allows managing all the aspects of the typical Zerynth workflow.

  9. Features are added continously for Zerynth studio, We are planning for some awesome stuff in 2020.

Let me know if you have further questions. :smile:

1 Like

Hi Karim,

Thanks for taking the time to answer my questions; a job well done.

With regards to the 2nd point, are you saying that when I call Zerynth’s I2C /read())/write() methods, the calling thread blocks (i.e. sleeps) until the DMA (or the driver) is done with copying from I2C buffer to memory(or reading reading from I2C to memory in the case of read())? If that is the case Karim; that is a GAME CHANGER. In my opinion; this will give Zerynth the BIGGEST performance boost even when compared with native HAL layer which is written in C (i.e. STM32 HAL Library) since those HAL libraries poll for the complete bit to be set. That is a BIG turn off; that is why I don’t use them. Zero multi-tasking this way.
OK, Karim, I like you to confirm my understanding because this is the primary reason I use ChibiOS. I quickly reversed engineered Zerynth’s methods calls & this is what I found:

  • i2c.write() (in i2c.py) which called by a thread
  • self.drv.ctl(_I2CDRIVER_WRITE,self.drvid,data,timeout,self.addr), and this is in
    - vhalI2CTransmit(drvid,tx,txlen,NULL,0,(timeout<0) ? (VTIME_INFINITE):TIME_U(timeout,MILLIS)); in vbl_i2c.c, inside this method

  • it calls the driver via DMA, and the

  • one shot timer waits until the DMA is complete, then wakes up/resumes the blocked thread

Is this is correct?; or I’ve missed something?

If what I wrote is correct; you need to emphasize it in your documentation guys because this is BIG. Usually architects spend a lot of time to do such things. Frankly STM and other MCU manufactures have not done it, and I understand since it is hard!!

Also if what I wrote is correct; that implies you don’t rely on STM32 HAL library which is a great call. Personally I think it is a LOT of code that makes a simple a thing complex; as if it was written by hardware engineers instead of software architects. :crazy_face:

Frankly; so far I am impressed with your product. If you’ll introduce Tickless Mode + debugger; your product with be a game changer. Plz share my comment with Zerynth’s stack holders. Few improvements here and there, and this will take off big. The market is waiting for something like this.

One more thing also I found missing in the documentation; MicroPython retains the code on the MCU itself; and the compilation is done there (I think). In my humble opinion, that is a BIG turn off for me. We developers want our code in repositories.

Cheers man, and I appreciate taking the time to answer my questions.

S. Mansour

Thanks a lot for this awesome feedback @abusous2000
We do implement our own HAL layer as you noticed.
regarding the code you mentioned, since we implement our own HAL, each architecture/device has it’s own peripherals implememtation, so In some I2C implementation we might use timers, suspend and resume threads if necessary …and some are just I2C operations as is.
I will make sure to pass your suggestions to the stakeholders. :smile:

Thanks.
Happy coding!

1 Like

Frankly, I didn’t think you re-implemented the HAL layer; I was mislead when I saw STM32 HAL libraries. Then after your reply I looked harder; and now I can see it.

I only spent few hours evaluating Zerynth Karim, and I am impressed. I’ve noticed too that you choose sensible defaults parameters, especially for DMAs and their corresponding channel.

Integrating the OS deep inside HAL allows developers and architect to scale the limited hardware beyond a few use cases; this is major performance & scalability boost. In my humble opinion; you need to emphasis it in your literature.

Many thanks for taking the time to answer my questions.

Cheers man