Forum > Embedded

Pine64 Pinenut 01S / 12S BL602

(1/2) > >>

rsz:
Hi,

Has anyone got a Free Pascal program compiled and running on the Pine64 Pinenut BL602 model 01S or 12S? These seem to be great and they compete with ESP8266.

BL602 is 32bit RISC-V. FreeRTOS and AliOS supposedly have support for it.
https://wiki.pine64.org/wiki/Nutcracker
https://lupyuen.github.io/articles/pinecone

How would I even get started developing with Free Pascal for this? I suppose the target would be embedded without any OS?
My experience with microcontrollers is pretty much limited to writing programs in C/C++ for nodemcu (ESP8266) and there the Arduino IDE takes care of pretty much everything, but I'd like to switch to using Free Pascal if possible.

ccrause:
In theory it is possible, in practice I think a bit of (mostly admin type, not low level compiler) work is required to support the E24 controllers, including a controller definition file added to the embedded RTL folder.  Then you can start programming bare metal.

FPC also has basic support for FreeRTOS but RISC-V is not yet supported.  I don't think this will entail lots of work, see e.g. ESP32, which pulls in low level hardware functionality from Espressif's SDK.  To access further SDK functionality requires translation of the SDK header files to pascal.

Another option is to look at mbf-freertos, seems to lack RISC-V support, so a bit of extra work is required here too. 

This is just my opinion, others may give you better information...

MiR:
I think Christo has already touched all major points....

One more think about:

Espressif has recently released a new SoC which is also RISC-V based and very affordable:

https://www.espressif.com/en/products/socs/esp32-c3

This SoC is pretty similar to the Pine chip when it comes to Specs. I already have a few dev-boards and sooner or later support will pop up in mbf-freertos but it is not something I have started working on.
There are already dev boards available for $3 on Aliexpress.
As it also uses the same SDK as the other Espressif Chips porting will be a lot easier than for a brand new chip.

Anyway, back to your questions, if you want to get your feet wet with the pine chip then the easiest way is to port the controller definitions that you want to try to Freepascal and add those defs in the embedded target.

This will allow you to do the usual stuff, blink LED's, SPI, I2C and will likely keep you busy for a while (and is also great fun)

I can help you to integrate your pascal unit into freepascal, this is an easy task, you only need to know a few files that you need to change.

For using WiFi on the chip you are better off with FreeRTOS but this task is a bit more complicated, so if this is not the highest point on your priority list I'd wait until support for esp32-c is available, then it will be a lot easier for you to actually make the pine chip work.

Michael

rsz:
Thanks for the detailed replies. I was asking because once I run out of ESP8266's I'll have to decide what I want to move to next for my projects.
I didn't know about ESP32-C3, it also seems like a good choice.

I have a few projects that I want to get done this year but they require WiFi. If the WiFi functionality is available with ESP8266 I'll try to get these projects done using Free Pascal.
Are there any example projects for the ESP8266 written in Pascal (preferably using WiFi) I could have a look at, or is it essentially the same as the C examples from the SDK just that one calls the C functions from Pascal?

Maybe once I got a few projects working and a bit more experience with this I'll revisit the Pine chip.

ccrause:

--- Quote from: rsz on August 27, 2021, 11:02:49 am ---I have a few projects that I want to get done this year but they require WiFi. If the WiFi functionality is available with ESP8266 I'll try to get these projects done using Free Pascal.
Are there any example projects for the ESP8266 written in Pascal (preferably using WiFi) I could have a look at, or is it essentially the same as the C examples from the SDK just that one calls the C functions from Pascal?

--- End quote ---
Have a look at these examples.  You can get prebuilt libraries for Linux here or use Michael's espsdk4fpc script to pull, build and install the necessary build tools (including a python venv).

The examples are very close to the the C examples from the SDK, except for the use of Pascal specific functionality such as write/writeln, GetMem/FreeMem, threads etc.

Navigation

[0] Message Index

[#] Next page

Go to full version