rosflight_firmware
rosflight_firmware copied to clipboard
Firmware update (remotely)
I intend to implement some code of several control theories modifying the Rosflight firmware code. The goal is to create a quadcopter (or more than one) that will be a research platform. I am a beginner at ROS and I have a Flip32. I want to know if its possible to update the Firmware remotely, without rebooting manually and through a command line in the onboard computer (Im using a rapberry Pi 3). This will probably save a lot of debugging time.
Thank you for the help
Hey @GabrielPaliari! welcome to ROSflight.
I wouldn't say this was perfectly supported, but there is a way to do it. It's pretty clunky, but it works... most of the time (sometimes the board gets stuck and needs a hard reset. We're not sure why this happens, but it works about about 90% of the time)
The last pull request into master merged in #229, which added a reboot_to_bootloader service to rosflight_io. If you call this, then the flight controller will enter bootloader mode, which can be used to flash the firmware. Here are the steps
rosrun rosflight rosflight_io(to connect the MAVlink communication to the board)rosservice call /reboot_to_bootloader- kill
rosflight_io(to free the serial port) make flash(in the firmware directory) orstm32flash -w rosflight.hex -v -g 0x0 -b 921600 /dev/ttyUSB0with some custom.hexfile. (Per the documentation to flash the new firmware)
I would imagine there is some way we could do these steps programmatically either with a standalone python node, or from within rosflight_io. I don't have time to implement this right now, but I don't think it would be too hard.
Thank You very much for the help. I think this will be very useful and will make things easier :)
You're welcome!
Good luck! I'd love to see your finished product, sounds like a cool project!
Hey @GabrielPaliari , I just realized this afternoon that the reboot_to_bootloader service does not actually work properly (see #229 ). Until we get this fixed, the only way to be flash code and be completely sure that it will work is by shorting the boot pins on your Flip32 before applying power to the board. Sorry for any inconvenience!
@cmcquinn thank You for the support. The Rosflight is already helping me a lot and after getting things done in the simplest way i will probably also try to figure out a way to Reboot the Flip32 from distance. Thank You for the atention!
Reboot to bootloader should be working for the H7 boards.