The interest in returning to the Moon for research and exploration has increased as new tipping point technologies are providing the possibility to do so. One of these initiatives is the Artemis program by NASA, which plans to return humans by 2024 to the lunar surface and study water deposits on the surface. This program will also serve as a practice run to plan the logistics of sending humans to explore Mars. To return humans safely to the Moon, multiple technological advances and diverse knowledge about the nature of the lunar surface are needed. This paper will discuss the design and implementation of the flight software of EagleCam, a CubeSat camera system based on the free open-source core Flight System (cFS) architecture developed by NASA's Goddard Space Flight Center. EagleCam is a payload transported to the Moon by the Commercial Lunar Payload Services Nova-C lander developed by Intuitive Machines. The camera system will capture the first third-person view of a spacecraft performing a Moon landing and collect other scientific data such as plume interaction with the surface. The complete system is composed of the CubeSat and the deployer that will eject it. This will be the first time WiFi protocol is used on the Moon to establish a local communication network.