Hi @nuclearsandwich, I recently got a Circuit Playground Express, and an Arduboy, and micro:bit. Trying to get MRuby running on all of them, but haven’t gotten as far as you yet. I did notice that the memory sizes (program and SRAM) on these little microcontrollers is pretty small (Arduboy has a tiny 32K/2.5K ATmega32U4). Might have to use MRuby/c for the smallest of these, which might also be too big for some (~40K interpreter size I think, compared to ~400K for MRuby). For the Circuit Playground, we should be able to squeeze programs into the 2MB of SPI Flash (separate memory from the ATSAMD21 chip) — they were able to get CircuitPython on there, which perhaps has a similar footprint to MRuby. Also, I think we can compile and execute Ruby over the serial interface, rather than having to re-flash the entire thing, and that would be awesome.
Should we open an issue on the MRuby repo to talk generally about microcontroller support?
-Os), and fit it within the ATSAMD21's 256KB flash (not sure what RAM footprint is though). Otherwise if not, on to MRuby/c. As for the SPI flash, the Circuit Playground Express product site says "used primarily with CircuitPython to store code and libraries." Not sure what that means specifically though. A lot to figure out yet. 😞
Not sure what that means specifically though
One of the cool things about circuitpython is that the firmware acts as a USB mass storage device when connected to a computer. The SPI flash is used as a FAT filesystem and you can drop files including your main.py or code.py right there and then once you unplug it the circuitpython firmware just runs your python!
mrb_valuetypes to C types. For example say I know my
mrb_valueis always a string, can I cast it to a
char *to use in standard C functions? I see in the API that there are a bunch of functions to make C types into a corresponding type in the mruby C API but I could find anything to go the other way. Any help is greatly appreciated 🙏
mrb_gc_register()is more correct
mrb_valuecontaining Symbol with different symbols?
mrb_iv_set). When i do
c = MyClass.newand
p ci can see my instance variable so it works. But when i pass this instance to a C function (
my_c_func(c)) where i get it back this way
mrb_get_args("o", &my_mrb_value), it looks like my instance variables are set to 0 (getting those back using
mrb_get_integer(mrb_iv_get(mrb, my_symbol))is this something expected ?