-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RP2040 suport. problem with start on Pi Pico #19491
Comments
Similar issue faced by me , after loading the firmware the LED lights up, but nothing shows up in QGC. |
I didn't realize people were actually using this board yet. I'll order some of this hardware to try and help maintain it. Any suggestions? FYI @vxj9800 |
@svs072477 @say-paul are either of you able to get a serial console working? |
I also did not expect that someone would use this apart from me. In any case, I never checked the board with QGC. I always used the nuttx serial console. Give me today's time. I'll set up my things and check if the board is still functional. |
Thank you, are you connecting the console to some of the UART port? |
@svs072477 Yes, I used to connect to PICO using minicom. Check if a ttyS* or ttyACM* device shows up in /dev/. If it does, then everything should work fine. You can then use putty or minicom to connect to the serial port. |
Use UART0 or UART1 for connect? |
You don't have to connect any UART. This is done through USB serial communication. So, just copy the uf2 file to pico. Let it reboot. Then you should see a ttyS* or ttyACM* device shows up in /dev/ if PX4 is running fine. Then you can connect to it using putty or minicom. |
@vxj9800 I checked from both mac and windows, no where it shows up in /dev/ and COM port respectively. |
Yes, it should be fine without any sensors attached. I did try running the uf2 file directly but it didn't boot properly on my pico either. There is some issue for sure. I'm currently setting up debugging using another pico to see exactly where the problem is. |
I have already done this, on a linux computer, but no device ttyS* or ttyACM* after the flashing firmware. |
@svs072477 @say-paul Some update on the issue. The code is going into hardfault from cromfs_find_node function in fs_cromfs.c. I am not sure what is causing this yet. May be @davids5 can help. But, a temporary fix is to go to the defconfig file and make CONFIG_FS_CROMFS=n. This will avoid the cromfs hardfault. You should at least be able to access the Nuttx shell through usb serial communication as I described earlier. |
I did make CONFIG_FS_CROMFS=n, PX4 PespberryPi Pico at /dev/ttyACM0 device appeared, but not connect in putty. |
@svs072477 Try opening putty with 'sudo' in linux or 'Admin Privileges' in windows. If it still doesn't work, then hit me up on slack. I'll have to see exactly where things are going wrong in your case. |
I tried it on a computer with windows and mac os, on them I was able to connect to the nuttx console. Problem with connecting only in linux. Another interesting point is that when pi pico is connected, the RTK streaming icon appears in QGC |
@svs072477 Thanks for letting me know about the QGC part. It's quite weird that it would show the RTK icon in QGC. I had never tested pico with QGC since my primary goal was to develop PX4 base layer and to get the PX4 to run on the pico. I am developing a fight controller board using RP2040 so I better start looking at QGC as well at some point. In any case, if the issue with linux is the permissions for ttyACM* devices, then something along the lines of https://askubuntu.com/questions/58119/changing-permissions-on-serial-port should solve it. |
@vxj9800 I conducted some experiments by connecting the module, GY-91 with MPU9250 and BMP280.
|
@nrodichenko I work on this during my free time so I may not be able to help you with issues immediately. But, yes, I'm happy to help. You can take a look at my minimalistic version of a flight controller that uses RP2040 here. @dagar I also had concerns regarding the lack of FPU when I started working on it. So far I haven't seen any major performance issues though. Also, RP2040 has a fast floating point library in it's bootrom, take a look at Section 2.8.3.2 of the datasheet. However, I'm not sure if the Nuttx uses it or not. |
Thanks for the update! I've looked at your schematic, and came up with some questions.
|
My team is also working on an inexpensive RP2040 based FC here: https://gitlab.com/amadoruavs/microdrone/microfcv3 and https://github.com/amadoruavs/microfc-fmu-v3.1. Note that the first board has multiple errors and missing features but was just used a proof of concept/practice run. For the v3.1 board, I'm planning to use 2 RP2040s, one as an IO processor (after porting px4iofirmware). This gives me extra IO to do SBUS and more PWM. I'm somewhat worried about not having FPU but I think it should be manageable. The feature set will be lower than an FMUv5 - single IMU suite, so no multi-ekf, etc. But I'll have to see how it goes. |
I think rp2040 gives us a good chance to implement multiprocessing technology to PX4. rp2040 has two cores and some tasks like camera control can run on the second one. I guess that the implementation might not be easy, however this feature can help to keep needed processing power under control and also it’ll increase the redundancy of the system. Pixhawk's new versions (+v5X) will use ST32H7 - 480 MHz controllers. Some of the STM32H7 processors have multi core and multiprocessing can be very useful for upcoming Pixhawk versions. Also it might help to solve the lack of FPU problem. |
As per my knowledge, Nuttx already supports multicore processing on RP2040. However, I have not tested it along with PX4. But, if everything is in working condition then it should be as simple as adding two lines to the Nuttx config file. Take a look at it here. |
|
Yes. SBUS uses an inverted UART data line.
I've been thinking about this some more. Here's the list of things that would ideally use a UART:
We have 2 hardware UARTs, and a USB controller. USB is currently being used as a debug shell, but it doesn't really need to be. I don't particularly like this idea but if necessary, the USB can be repurposed as a telemetry line with a USB-UART converter module on the other end. If implemented correctly, the RP2040 PIO module can act as a third UART with no/minimal CPU overhead compared to a native UART. Currently I'm thinking GPS and telemetry on UART 0 and 1, IO processor on PIO, and Debug on USB, but this might be swapped around. Then SBUS would be implemented on the IO processor. Another key thing to note is that sbus only requires a UART RX line, not TX. If software allows, the TX line could be used for something else. If planned out correctly, this might help. Additional reason to use PIO for the io processor is that I care less about it, I have 4 fmu PWM outputs that will be the primary use. IO will just be a bonus for sbus, ppm, and more PWM. And anything else the io processor has firmware to do. @vxj9800 do you have any other thoughts?
Doesn't PX4 have a dshot driver? Does it require a hardware port or something else to be written that I'm not aware of? |
@coderkalyan I haven't looked at your complete design. However, I would set up things as follows.
For oneShot, the output is a pulse of specific time width. Thus, you can use a hardware timer and it's done. Since DSHOT is a digital interface, the GPIO output needs to be controlled very accurately and the PX4 DSHOT driver is one part of the equation. The low level code to control GPIO output accurately needs to be developed, here is an implementation for STM32. A similar code needs to be developed for RP2040. I think it would be easier to do using PIOs. Moreover, current PX4 support for RP2040 doesn't have DMA activated. I would like to work on DMA first before thinking about adding more to the communication. |
The USB UART input / output error still persists for me when trying to access the NSH console (on Ubuntu 20.04) |
@vxj9800 have you tested it and flown without any issues, I am going to test it with F450 Frame and 1000 Kv motors |
I have not, yet. My goal was to implement the PX4 base layer at the time. So far, I've got pico to get detected correctly in QGC and I've also got the SD card to work. However, mavlink is taking too much computational resources right now. So, I'm trying to figure out where to cut corners so that I can make it fly. |
Hello! I'm curious to know if you managed to find a solution to this challenge. I'm currently in the process of building code for a low-cost drone using PX4-Autipilot on RPi-Pico, but as someone new to embedded systems, I'm encountering difficulties in the process. If you've successfully navigated this, I would greatly appreciate any guidance or tips you could share on building the code for the RPi-Pico. Your insights could be incredibly helpful. Thank you in advance for any assistance you can provide! |
The size of the firmware is not more than 1 MB
|
I have a problem to open nuttx shell but i can connect via mavlink can anyone help me out |
can you tell me at which version of px4 you are able to connect with QGC ? |
@LalitKandpal12 It has been a long time since I have worked on this, so I am not sure. An when I was able to connect with the QGC, it was barely able to run because of the lack of computational power. So, I am not sure how it will behave now. |
Hi, I build firmware for rp2040 with make raspberrypi_pico_default - it's OK. I convert .elf file to .uf2 with elf2uf2 tool.
Then, I take pi pico board, connect to this board module G-91 with MPU9250 and BMP280, and upload firmware.
After that, the LED on the board lit up. But the board has ceased to be defined as a usb device. And not connect to QGC.
What could be the problem? What am I doing wrong?
The text was updated successfully, but these errors were encountered: