Skip to main content
cosmapa
Associate III
July 27, 2009
Question

Mini Basic/Jumentum for STM32

  • July 27, 2009
  • 12 replies
  • 3361 views
Posted on July 27, 2009 at 14:28

Mini Basic/Jumentum for STM32

    This topic has been closed for replies.

    12 replies

    cosmapa
    cosmapaAuthor
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:16

    Max,

    This code also looks too complicated for my needs but it looks like it can be reduced a lot by eliminating many compile options. I also found that it has two possible syntax for the Basic commands: one long, and one short so that the user scripts take less space in flash. The editor also an option that will reduce the code size if removed (there is a Windows GUI to my project and the editor would be hosted thre).

    I think it is workth a look and I will keep you informed of any progress.

    A C interpretter would be nice too. Please let me know if you have something to show & share.

    Thanks

    info144
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 13:16

    Dear Cosmapa,

    we also think about ''custom specific '' extensions , written in basic.

    I had a brief look at the project, for my opinion it seems to be a bit overpowered( in the moment ) for our project.

    We try to work with a high school concerning basic interpreter written in C.

    In any case we should try to share work.

    Our basic goal is to get it run without any extensions as ethernet....

    Just to understand how it works and make a framework to command/function extensions.

    With best regards,

    max

    cosmapa
    cosmapaAuthor
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:16

    For our project, I want to add a small resident Basic interpreter to allow users to write their own extensions.

    I found this open source Basic interpretter that is currently running on the NXP part.

    http://jumentum.sourceforge.net/

    It looks very complete (even has Ethernet support) and a very small footprint (as little as 20K flash).

    Porting doesnt look like it would be complicated.

    If anyone is interrested, please respond to this thread so that we could possibly form a group sharring the effort.

    Thanks

    Cosmapa

    trevor1
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:16

    Have you considered Lua as a scripting language?

    www.lua.org

    cosmapa
    cosmapaAuthor
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:16

    I am looking for something that would take no more than 10-20K of flash. I read ''Under Linux, the Lua interpreter built with all standard Lua libraries takes 153K and the Lua library takes 203K''. I'll investigate further, however. Thanks for the suggestion.

    cosmapa
    cosmapaAuthor
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:16

    BandyBasic looks good. TXT-only and serial console is all I need. How big is it when compiled for STM32? can you share the code?

    ccowdery9
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:16

    193Kbyte object file size.

    Chris.

    ccowdery9
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:16

    If you are considering Lua, why not BrandyBasic:

    http://sourceforge.net/projects/brandy/

    I have a part-finished port for STM32 (it works in text mode, i.e. no graphics, and the console is serial). However, it does use the EFSL library and SD cards so you can load / save (it is a bit buggy though).

    I have also hooked a couple of system calls up (to allow BASIC to access some of my hardware)

    It is a very comprehensive basic interpreter too as it's a clone of BBC BASIC V.

    Chris.

    st3
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:16

    Quote:

    Have you considered Lua as a scripting language?

    www.lua.org

    Note that there is an ''eLua'' specifically for embedded systems:

    Quote:

    eLua stands for Embedded Lua and the project aims to introduce the programming language Lua to the embedded software development world.

    Lua is the perfect example of a minimal, yet fully functional language. Although generally advertised as a ''scripting language'' (and used accordingly especially in the game industry), it is also fully capable of running stand-alone programs. Its limited resource requirements make it suitable to a lot of microcontroller families.

    The aim of the project is to have a fully functional Lua development environment on the microcontroller itself, without the need to install a specific toolchain on the PC side. Initially, a PC will still be needed in order to edit the Lua programs for the microcontroller. But as the project evolves this requirement will be relaxed, as a basic editor (also residing on the microcontroller) will be usable with a variety of input/output devices.

    ARM microcontrollers were chosen for the first implementations given their popularity, availability and small cost.

    See:

    http://www.eluaproject.net/en/Overview

    cosmapa
    cosmapaAuthor
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:16

    193K would be too large. I am using a 128K stm32. You may want to take a close look at the Jumentum project.

    I have been able to compile the main blocks (not build the full application). Size for the main components are (size optimized):

    basic.c 13.8K

    editor.c 5.8K

    malloc.c 2.1K

    lib.c 2.8K

    The rest looks like mostly I/O & hardware specif stuff and adds up to ~5K.

    The code looks clean and is running on the NXP MCUs. It hurts no to see this already ported to the STM32.