2

We have been working on FreeRTOS on the Pi but have been finding that the only way to program the Pi is to do the build on PC, copy the image to the SD card and then move the SD card back to the Pi.

When using FreeRTOS for Arduino we can program it over a USB cable.

Are we missing something obvious? Has anyone done anything other than popping SD cards back and forth?

Thanks!

0

The Arduino MCU is programmed with a bootloader that is able to reprogram the MCU's internal flash memory via commands sent over the serial port (which you talk to via a USB to serial converter). When the MCU is reset, the bootloader starts, waits a bit to see if there's a PC connected that wants to send over a new program and, if not, runs the program previously programmed into the flash by the bootloader.

Basically, you want to do the same thing on the Pi, but the way the Pi boots is different.

You don't say or provide links to the tools you're currently using to program the Pi or the details of what exactly you're putting on the SD card (what partitions you create and what files you put in them), so I can't really provide any help on how you might tweak them to be able to upload via USB.

However, the general idea is going to be similar to the Ardunio in that you'll need to write a program that takes control on boot, decides whether or not to receive a new program over USB and write it, and then passes control to whatever's written. NOOBS does something very similar, coming up with a menu and eventually starting another system on another partition. The details of how it works provide a good guide to what you need to do.

0

Not sure if you found a solution yet, but if not have a look at this boot-over-serial bootloader. You need to connect via UART though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.