Nice! Mine are somewhere in limbo between PostNL and Deutsche Post. Thankfully, the OPi Lite has risen from the dead. I guess I must have shorted something and triggered a polyfuse.

In the meantime, I have implemented a few features:

  • high-resolution screen modes up to 1920x1080 (SCREEN 14 to 20)
  • filtering for modes that don't scale well (CONFIG 3,1)
  • zero-copy rendering to the framebuffer
  • true color support (PALETTE 2)
  • SMP support, BG/sprite rendering now runs on the second CPU core
  • RTC support (not tested with a battery yet)
  • BG/sprite engine bindings for Lua
  • a better Lua command line that prints return values automatically
  • proper 16-bit, 48 kHz audio rendering
  • loading and saving of various image file formats (PNG, JPG, BMP etc.)
  • increased limits (subroutine, argument and loop stack sizes, synth timeout)
  • test suite fixed, 100% pass!

There are a lot of fixes and improvements in the bare metal framework as well:

  • (hopefully) SMP-safe libc implementation
  • support for stack protector and Undefined Behavior Sanitizer
  • memory layout rearranged with the heap at the end in order to be able to support boards with more RAM
  • GDB debugger stub on the serial port

[If anybody is playing along at home, you will have to rebuild the toolchain using the updated crosstool-ng.config for the reentrant syscalls to work.]

Most of this stuff (specifically the HQ audio and true color support) are available in the SDL version as well.

Unfortunately I'll have to do some real work some time as well, so things might go a little slower soon...

Well, I'm having no luck with my Orange Pi. I seem to find no way to install something on an SD card that can boot.
I tried with the official Debian and Ubuntu images from the Orange Pi site. And the best I got was a partial load of Debian, but that was all. I tried Armbian, and got a blank screen.
The BE image gives me a black screen too.

I tried different cards (class 10 in 8GB and 32GB, class 4 8GB, 32GB Ultracard), different ways to mount the cards on my Mac (USB-A reader, USB-C adapter) and different flashing programs (Balena Etcher, ApplePi Baker) to no avail...

I don't know if I'm doing something wrong or if my board is toast, so I can't report a thing.

The only thing I can mention is that I'm not sure if the only step I need to do with the firmware is flashing the image to an SD card or I'm missing a step, because when I burn the image I only see demo software there, and no BOOT image or kernel (Am I missing a step? I guess it's highly probable).

I'll try my old Mac that has an integrated card reader (than my son uses now) to see if I can flash a card that works.
Very disappointing. Sorry I can't be of any help right now...

Edit: I'm buying the official power supply... it seems that the board may not be reliable with a 5V 2A normal USB power supply. Let's hope it's just that.

The mask ROM loader on the H3 boots off the SD card by reading a 32k second-stage bootloader (SPL) at offset 8k. The one in the image is u-boot's SPL, which then loads a u-boot image from 40k, which in this case is Engine BASIC. None of these show up in the file system, and you can in fact boot Engine BASIC without a partition table on the SD.

The OPi Lite does not have any non-volatile storage that I'm aware of, so other than the SD card there is nothing that needs any preparation.

With Engine BASIC, last time I measured (before enabling SMP) the OPi Lite drew about 260mA, which would suggest that 2A is plenty. Linux probably draws more, especially during boot. At any rate, USB ports are not required to provide more than 100 mA without negotiation, or having certain resistance values between the data lines or stuff like that.

Have you tried powering the OPi off a bench supply? That would also show how much power it draws. The board can be powered via the expansion connector if you don't have a barrel plug, pinout is here: https://linux-sunxi.org/Xunlong_Orange_Pi_One_%26_Lite#Expansion_Port (Try pins 4 and 6, that worked for me.)

    I have just checked out "Balena Etcher". 90 MB to write a file to disk? WTF? And then...[editing out massive rant] ...it actually works, it seems my SD card is dodgy.

    Anyway, I'd suggest to stay away from the GUI tools and use dd:
    dd if=basic_sd.img of=/dev/<something> bs=4k

    Since you are apparently using a Mac, you will have to figure out on your own what /dev/<something> is supposed to be. There is a web page about it (https://www.cyberciti.biz/faq/how-to-create-disk-image-on-mac-os-x-with-dd-command/), and it seems to be pretty straightforward, but I obviously have not tried it myself.

    uli I don't have (yet) a bench supply. I'm missing that and a proper oscilloscope in my toolset.
    I'll wait for the power brick I bought. I hope the problems are solved with that.
    Thanks a lot for the explanation! I don't have a lot of knowledge in this regard, and love to learn new things. 😊

    Edit: Yes, Balena is an Electron app. It has served me for some images in the past, but I'm not particularly fond of it.
    Yes, I'm a Mac user. I'm not shy of using terminal or a CLI, so I'll try to use that to create the images. Thanks!

    Aaaand it's not the SD card's fault either, it's the card reader's. This SD stuff is driving me nuts! Anyway, I was able to successfully write an image with Etcher and could verify that the v0.89-97-g87d3 image from the nightly builds actually works. I guess the power supply is still our best bet...

      uli I sincerely thank you for taking the time (really, it was not necessary, since I fear your time is scarce, and better spent in other things than helping me). I'll keep you updated of any progress I make.
      On another (happier) note, the rest of the parts I needed to finish my BE boards arrived today, so it seems I have something to entertain myself while I wait for the power adapter.

      Well, I received an Orange Pi One and an Orange Pi PC Plus in the mail yesterday. I didn't have the correct power supply adaptor to fit the barrel jack, so I just powered via the GPIO header. I was able to flash the MicroSD card with Etcher which worked but formatted the card to be a little less than 500 MB. I'm not sure why as the card is an 8 GB but it's good for now. I'm happy to report that EngineBASIC booted on both models. I tried out the new screen modes and it's awesome to have such a high resolution now. I thought the esp8266 ran BASIC fast but the H3 blows it out of the water! I ran a few programs of mine and everything seemed to work fine so far, other than the lock keys on the keyboard. I tried three different keyboards and they all worked except for caps/scroll/num lock. I'm excited about the new board and I'm looking forward to testing more. Thanks for your hard work on this Uli!

        Peek Wonderful info! 😃

        How much current did you give to the OPi? They say 2A is enough, but when you look at the power adapter, it's rated at 3A. My 5V 2A seemed to power it, but when trying to boot Debian, it got stuck, and I read somewhere that somebody had the same problem, and it was because of the power supply...

        • Peek replied to this.

          Dmian
          I just used the same wall wart that I have been for the ESP8266. In it's former life it was the power supply for a Roku, rated for 5V@1A. I did not try to boot anything other than the BE image, but it worked fine as far as I could tell. Maybe I'll look for a better power supply though just in case... power supply issues are maddening when they crop up.

          New feature Friday:

          • sprite rotation and scaling (SPRITE ... ANGLE 45 SCALE 1.5, 2)
          • GPIO support
          • HELP command (HELP SPRITE); this is probably the best feature ever...
          • by popular demand: a working Caps Lock key 😀
          • audio mixer, allowing beeper, wavetable and speech synth to run at the same time
          • automatic memory size detection (this is largely untested because my other boards have not arrived yet)

          Have a nice weekend!

            Ok...

            I had one of those "what if..." moments, and decided to connect the Orange Pi to my current monitor (Dell U2412M), and, well, this happened...

            OPi

            I normally use old monitors and TVs for my retro endeavours, including the Basic Engine, so I was using an HP1740 (native resolution 1280x1024 @ 60Hz), and it seems that there's a slight disagreement between what the OPi's HDMI wants to send, and what that monitor accepts, so, that was the reason for the black screen... (the monitor doesn't have HDMI, it has DVI and I'm connecting with an HTML to DVI cable...)
            I feel pretty stupid, to be honest. But well, it looks like BE H3 works great.
            I'll keep you informed.

            uli
            Thanks for the update. You're right, the HELP command is the best. I used to always have a screen open to the B.E. manual, now I can just work with B.E. exclusively. Love it! The memory size detection appears to work, as it shows the PC Plus w/ 989MB free! Caps lock is working, but no love for Num Lock? 😛 Seriously though, great work and I'm looking forward to a long weekend so I can sit down and play with it some more. Between the speed boost and resolution increase, I can't wait to get back to work on that asteroids clone.

            Edit: one other thing I noticed is that the print screen functionality (the keyboard button) is not working.

            The HDMI output is (currently) fixed at 1920x1080 to keep the driver simple; different screen modes are implemented by using the DE2 to scale the output. I did not write that code, so I cannot say off the cuff how much effort it is to change that. Since that would apparently enable old-ass DVI monitors to work, though, I'll put it on the to-do list.

              uli Ok, but don't worry much, really (at least for me). It's just that I didn't realize that that was the problem, and wasn't able to test the build. I'll try to play a little with it these days (it's a holiday here Thursday and Friday) and try to give you some feedback to improve things.

              Btw, I decided to do a little video capture of the H3 in action:

              https://damianvila.com/basicengine/basicengine-h3.mp4

              I was having a little trouble finding the quotes in the beginning because most of my keyboards are in Spanish (I need an American English keyboard...)
              I don't know if this is useful or not, but I hope you enjoy it. 😄

              5 days later

              Here's an update: I have found, in the most unlikely of places, a set of bare-metal drivers for the H3. It was apparently written by someone selling Orange Pis as controllers for stage lighting and related performance equipment. (https://github.com/vanvught/rpidmx512/). It's rather comprehensive (HDMI, Ethernet, SPI, I2C, analog audio, thermal, MMC, timers etc.).

              I have integrated two of these driver so far: HDMI and MMC. MMC was a bit of a let-down; I expected it to perform better than my trivial implementation because it supports 4-bit mode and such, but I didn't notice any difference in practice. That might be an integration issue, though, so I left it in as an option.

              The second is more interesting: The HDMI driver seems to have been ported from Linux and is pretty comprehensive. Most importantly, it supports various physical resolutions, which should fix the issue some people were having with their DVI monitors. I have added a CONFIG option (10) with which to set the physical screen resolution. The resolutions available ATM are:

              0: 1920x1080 (HDMI)
              1: 1280x1024 (DVI)
              2: 1280x720 (HDMI)
              3: 1024x768 (DVI)
              4: 800x600 (DVI)
              5: 640x480 (DVI)
              6: 1920x1200 (HDMI)

              I don't know how tolerant DVI(-only) monitors are towards receiving an HDMI signal, so I have disabled HDMI in DVI modes, which therefore lack sound. I have also changed the config file to be plain-text and renamed it to config.ini. That way, if you want to boot the system with a resolution other than 1920x1080, you can create a config.ini file on the SD card containing, for instance, phys_mode=1, and it will come up in 1280x1024.

              On the USB side, there is now support for mass storage devices (CHDIR "/usb0") and USB controller 3. (The latter has a strange issue, at least on my OPi PC, in that devices plugged in on boot are not recognized. When they are attached while the system is running, they work...)

              [My new boards have arrived as well (hence the support for USB3), and exactly five minutes later the lost OPi One has turned up, so I have two now...]

              This is awesome Uli!
              So, if I understand it correctly, when this is available I will be able to either create a text file called config.ini and place it in the SD (I guess in the root directory, right?) and set my configuration there or change the config from within BE and do a SAVE CONFIG that will create this config.ini file, right?
              Any particular encoding for this file or UTF-8 is ok?
              In the case of the screen it's either phys_mode=1 inside the file or CONFIG 10,1 inside BE. Is that correct?

              If for example I want BE to init looking similar to a C64, I have to make a FONT 2 to get the PETSCII font, and then 3 CONFIG COLOR for foreground, background and border. Then SAVE CONFIG and next time I turn on BE it will read it from the file and do the changes. Is that correct? I guess I can see the settings in the file to see the parameters names and values.
              This is so great! Thanks a lot!

              • uli replied to this.

                Dmian That is all correct. Or it would be if I hadn't forgotten to push the changes to Github...

                Anyway, they are out now, I have manually triggered a new build, and as a bonus there is now:

                • analog audio (working since fifteen minutes ago); WARNING: It's always on, and there is no volume control yet, so be careful when using headphones!
                • wired network support, IPv4 and DHCP only ATM
                  • NET UP, NET DOWN
                  • WGET "http://google.com/" TO "bla.html"
                  • TFTPD ON, TFTPD OFF
                  • TFTPGET "192.168.0.1", "/file.txt"
                  • TFTPPUT "192.168.0.1", "/out.txt" (That one doesn't work for me for some reason, though. The file is generated on the server side, but it's 0 bytes, and on the client side the transfer never finishes. Not sure what's going on there.)

                Enjoy!

                Remember that the H3 didn't work with my DVI monitor?
                Well, no more:

                H3 DVI

                Works flawlessly! Thanks a lot. 😊

                Powered by: FreeFlarum.
                (remove this footer)