This post was last edited by ly87802541 on 2021-4-4 22:59
Since I want to experience the open source rtos fuzix , which is known as Unix on rp2040 of pico , I have to download and install the SDK and development tool chain related to pico , so as to compile the fuzix source code myself. As for the development and compilation platform, the three major host platforms are all OK, but since our project plan is the interaction between Raspberry Pi 3b and pico , we still use Raspberry Pi 3b as the compilation platform. Anyway, 3b will be used to connect to the OneNET cloud platform later , so it is also good to familiarize yourself with it in advance and let the Raspberry Pi play the whole game.
We can go to the official website of the Raspberry Pi pico development board and visit the following www address https://www.raspberrypi.org/documentation/rp2040/getting-started/#rp2040-boards . This is where the official software and hardware documentation and microPython&CCSDK documents about the pico development board are located. Especially the get started with microPython label on this page. After clicking it, you can find the fuzix tutorial and finally find the get started with microPython on raspberry pi pico introductory manual. Paper books are charged, PDF documents are provided free of charge, but when you click the download button, you need to fill in a lot of registration information with the Raspberry Pi Press. Here I downloaded the resource post https://bbs.eeworld.com.cn/thread-1155453-1-1.html provided by dcexpert , a big boss on the EE forum , and saved it to read later. I must say thank you to the big boss here!
After reading the tutorial, I also understood the basic process of running Fuzix on the Pico development board . Then I had to prepare the software and hardware resources of the Raspberry Pi 3b , such as the SD card and operating system, and then install the CCSDK and tool chain of Pico on the Raspberry Pi system . I will not mention the general operation of the Raspberry Pi 3b here, as I believe everyone has played with the Raspberry Pi.
Let's start compiling fuzix from source code . First, download an automatic script file, the instructions are as follows:
wget https://raw.githubusercontent.com/raspberrypi/pico-setup/master/pico_setup.sh
chmod +x pico_setup.sh
./pico_setup.sh
You can use vi to open this script file to see the specific process. In fact, the relevant tool chains and their dependencies are installed.
Then we pull the fuzix source code, the instructions are as follows:
git clone https://github.com/davidgiven/FUZIX.git
cd FUZIX
git checkout rpipico
cd Kernel/platform-rpipico/
Modify the first line of the Makefile file to specify your own pico-sdk path, for example, mine is:
export PICO_SDK_PATH = /home/ubuntu/raspberrypi/pico/pico-sdk
Finally, compile the UF2 file and root file system of fuzix . The instructions are as follows:
make world -j4
./update-flash.sh
You can find this UF2 file in the directory build/fuzix.uf2 , and upload it to the win10 host together with the filesystem.img file in the current working directory . There are many ways, for example, I use LinuxQQ2.0 version, or QQ mailbox. If it doesn't work, you can also shut down the Raspberry Pi 3b , take out the SD card and put it into the virtual machine of the win10 host to read the two files we need.
Drag and drop the UF2 file directly into the USB flash drive popped up by pico . The operation method is the same as uploading microPython firmware in the second article . After the UF2 file is uploaded, pico will automatically restart, and fuzix is already running. We can use a serial port tool such as putty or xshell to connect to the uart0 of pico on the win10 host to log in to the fuzix system. The gpio0 of pico is tx and the gpio1 is rx .
The result is shown in the figure below.
From the boot information of the fuzix system, we can see that since we do not have the SD card module in the tutorial, the root directory file system cannot be found, so we cannot enter the init process, and the fuzix system cannot reach the login process.
If we have a required SD card hardware module, we need to use the filesystem.img image file compiled above to make a 34MB SD card that can boot the fuzix system , and then we can continue to explore more details of the fuzix system . So let's stop here and get the SD card later.