Page 1 of 1

Examples with Pavel Demin's Alpine Linux

Posted: Fri Mar 13, 2020 12:33 am
by kasaudio
Hello everyone.

I tried to run some of the examples

https://redpitaya.readthedocs.io/en/lat ... comC.html#

with Pavel Demin's distribution of RP OS.

http://pavel-demin.github.io/red-pitaya-notes/alpine/

I copied the compiled program, FPGA image to one of the application inside apps folder. Renamed the executable and fpga image acordingly to given app name. Restarted, clicked on the app given and nothing happens (no led indicators I put inside the code). On the latest official OS, my program works just fine.

How to work with iic (which I need) with the Pavel Demin's distribution? Again with official OS ads1115 outputs ADC values as expected.

BR, kas

Re: Examples with Pavel Demin's Alpine Linux

Posted: Fri Mar 13, 2020 12:36 pm
by pavel
I'd suggest running the following two commands from the Red Pitaya command line and checking for error messages:

Code: Select all

cat your_fpga_configuration.bit > /dev/xdevcfg
./your_program
If an error message appears when starting your program, then I think that the easiest solution would be to recompile the program directly under Alpine Linux running on the Red Pitaya board.

The gcc compiler can be installed with the following command:

Code: Select all

apk add gcc

Re: Examples with Pavel Demin's Alpine Linux

Posted: Fri Mar 13, 2020 2:25 pm
by kasaudio
Thank you Pavel. Allready installed gcc and will look further to compile my code.

Re: Examples with Pavel Demin's Alpine Linux

Posted: Mon Mar 16, 2020 12:11 pm
by kasaudio
Hello everyone.

With alpine linux and winSCP copying files succeeds, but copied files are not present after RP reboot. Please help...

Re: Examples with Pavel Demin's Alpine Linux

Posted: Mon Mar 16, 2020 2:24 pm
by pavel
What files and where do you copy them?

Re: Examples with Pavel Demin's Alpine Linux

Posted: Mon Mar 16, 2020 3:08 pm
by kasaudio
Hello.

Like it was suggested few posts above I shold recompile my code on RP with Alpine Linux. As my code is based on basic examples of RP with some additonal stuff like iic and UDP transfer I tried to copy all official C examples. Using WinSCP I created and copied .c files in folder named CExamples in a root folder (near apps and wifi folder). I also included required rp2.h and librp.so. I also copied required fpga .bin file. in the empty opt folder.

I also started compiling my code which resulted in expected error messages as I did not correctly link the .so file. (Try and error process).

As I reboot my RP all copied files disappeared.

Re: Examples with Pavel Demin's Alpine Linux

Posted: Mon Mar 16, 2020 8:31 pm
by pavel
Since the SD card is mounted read-only and nothing is written to the SD card during the normal operation, it's expected that the files that you copy via WinSCP aren't written to the SD card.

To save the new files to the SD card some additional actions are required.

I think the easiest way would be to copy your application files and all dependencies to a new directory /media/mmcblk0p1/apps/new_app. Where /media/mmcblk0p1 is the file system of the SD card.

Before copying the files to the SD card, the SD card must be remounted in writable mode using the following command:

Code: Select all

rw
Once all the files have been copied, modified, compiled, etc., the SD card must be remounted in read-only mode using the following command:

Code: Select all

ro
The root (/) file system is a RAM disk and the changes you make can be saved to the SD card using the following command:

Code: Select all

lbu commit -d
BTW. All of these commands can be found at the link from your first post. For more information on Alpine Linux, please read the Alpine Linux documentation.

Re: Examples with Pavel Demin's Alpine Linux

Posted: Mon Mar 16, 2020 8:41 pm
by pavel
Just found a good introduction to Alpine Linux:

https://pi3g.com/2018/10/24/alpine-linux-first-steps/

Re: Examples with Pavel Demin's Alpine Linux

Posted: Mon Mar 16, 2020 10:01 pm
by kasaudio
Thank you Pavel for your reply and guiding me to the Alpine Linux intro. Although I've read the docs from the link I provided, I forgot the final lbu commit -d step. Now it works and I keep going..