Examples with Pavel Demin's Alpine Linux

Applications, development tools, FPGA, C, WEB
Post Reply
kasaudio
Posts: 50
Joined: Sun Mar 11, 2018 6:03 pm

Examples with Pavel Demin's Alpine Linux

Post by kasaudio » Fri Mar 13, 2020 12:33 am

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

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: Examples with Pavel Demin's Alpine Linux

Post by pavel » Fri Mar 13, 2020 12:36 pm

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

kasaudio
Posts: 50
Joined: Sun Mar 11, 2018 6:03 pm

Re: Examples with Pavel Demin's Alpine Linux

Post by kasaudio » Fri Mar 13, 2020 2:25 pm

Thank you Pavel. Allready installed gcc and will look further to compile my code.

kasaudio
Posts: 50
Joined: Sun Mar 11, 2018 6:03 pm

Re: Examples with Pavel Demin's Alpine Linux

Post by kasaudio » Mon Mar 16, 2020 12:11 pm

Hello everyone.

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

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: Examples with Pavel Demin's Alpine Linux

Post by pavel » Mon Mar 16, 2020 2:24 pm

What files and where do you copy them?

kasaudio
Posts: 50
Joined: Sun Mar 11, 2018 6:03 pm

Re: Examples with Pavel Demin's Alpine Linux

Post by kasaudio » Mon Mar 16, 2020 3:08 pm

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.

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: Examples with Pavel Demin's Alpine Linux

Post by pavel » Mon Mar 16, 2020 8:31 pm

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.

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: Examples with Pavel Demin's Alpine Linux

Post by pavel » Mon Mar 16, 2020 8:41 pm

Just found a good introduction to Alpine Linux:

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

kasaudio
Posts: 50
Joined: Sun Mar 11, 2018 6:03 pm

Re: Examples with Pavel Demin's Alpine Linux

Post by kasaudio » Mon Mar 16, 2020 10:01 pm

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..

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 16 guests