STM32 Arduino Core firmware for the Version 1.6
- Set up the detector with default values, if it hasn't been calibrated
- Send events from the detector via serial to Raspberry Pi
- Send data from all sensors on the board via serial
- Configure the on board GPS and pipe it's data to serial
Note that the LED's aren't very bright!
- Lower LED (blue): Power and GPS
- Solid: Power, but no GPS lock
- Blinking: Power and GPS lock
- Upper LED (blue): Event
- Flash: An Event has been registered
- The timer needs a rework, its current implementation is very imprecise (uses micros() rather than a proper timer)
- The detector should be able to calibrate it's parameters automatically
- High voltage
- Thresholds
- Add a mode for this from the Pi.
For regular users of the CosmicPi V1.6 this should be taken care of automatically by the software on the RaspberryPi. If you want to modify the firmware, you will need an ST-LINK programmer (we used the Nucleo64 STM32F401RE board). You can find out how to do the programming here: https://www.st.com/content/ccc/resource/technical/document/user_manual/98/2e/fa/4b/e0/82/43/b7/DM00105823.pdf/files/DM00105823.pdf/jcr:content/translations/en.DM00105823.pdf
For everybody interested in looking into developing this a bit more:
- Download the most recent Arduino IDE: https://www.arduino.cc/en/main/software
- Install the STM32 core for Arduino: https://github.com/stm32duino
- Install the COSMICPI variant https://github.com/CosmicPi/STM32_Arduino_Core
- Clone this repository:
git clone https://github.com/CosmicPi/cosmicpi-arduino_V1.6.git
(note you can also download the .zip file from the menu above to the right, expand and remember to re-name the directory so cosmpicpi-arduino_v1.6 otherwise Arduino will give you errors) - Open the file
cosmicpi-arduino_V1.6.ino
with the Arduino IDE - Connect your CosmicPi to your computer via the ST-LINK pins of your programmer, you may find it helpful to remove the Raspberry Pi, we use the +5V pin on the raspberry pi header to power the device, and the UART pins for debugging.
- Select the newly appearing port in the Arduino IDE (Tools -> Port)
- Select the correct board and variant (Board = Nucleo-64, Board Part Number = COSMICPI)
- Select the following 'standard' options - smallest OS default, newlib nano default, upload method ST-Link,
- Compile and upload the firmware (Sketch -> Upload)
As soon as the CosmicPi is connected you can open the software of your choice for monitoring serial data. Open the Arduinos serial port with a baudrate of 19200. This firmware is designed to be a plug and play, if you get stuck drop us a line! It will only send data. It will not accept inputs. What data is sent is defined here.
Note that the V1.6 firmware has been designed to be identical to the V1.5 firmware on the outside, but there are some major changes on the inside.