Close

Project Update: Firmware and Hardware Changes

A project log for S1G RF: Sub 1GHZ Radio Modules 915MHZ and 433MHZ

Sub 1GHZ RF wireless modules operating at 915MHZ and 433MHZ ISM bands, based on the ADF7023, full open source!

avrAVR 12/19/2016 at 23:080 Comments

Hey folks! this project has been on the backburner for a few weeks while I've been tending to other matters. A few developments have occurred since the last update. Shortly after posting about the adapter boards in the last project log I started on the firmware.

The firmware for the S1G-RF is going to be written in C using the manufacture libraries generated by ST Microelectronics' app STM32CubeMX. With that application I was able to generate all the driver code for all the peripherals in use on the STM32 for the S1G-RF hardware, this also includes USB virtual serial port code! STM32CubeMX is a simple GUI application and you just pick and choose everything you need, select the peripherals then configure the clocks, export code done, totally magic!

Peripherals selected and configured:

Clock Configuration:

After configuring all the peripherals and clocks on the STM32 the code is exported in the form of an Eclipse project, the flavor of which depends on which ARM IDE you select in the preferences, each option is effectively a custom build of Eclipse with an ARM toolchain and some GUI features shoved in it. Since I prefer to develop software on Linux and with a text editor I needed to convert the project to a standard C makefile format. To achive this I used a simple python script I found online, here it is:

https://github.com/baoshi/CubeMX2Makefile

Really easy to use and works like a charm. I am currently compiling and building the firmware with the ARM GNU Toolchain on Debian stretch using the makefile and code generated by STM32CubeMX and the python script. ARM GNU Toolchain can be found here for those of you that want to look at the code and compile it yourselves: https://launchpad.net/gcc-arm-embedded .

Now as far as the SPI driver code goes for the ADF7023 transceiver chip my original plan was to sleuth through the datasheet and write my own driver library, but fortunately Analog Devices did all the hard work. Turns out Analog Devices has a github page that has a ton of open source C drivers for many devices they sell. The repository is here: https://github.com/analogdevicesinc/no-OS it covers a lot of devices they have and assumes there is no OS in your application so these drivers are best suited for a baremetal firmware approach. The source code for the ADF7023 specifically is found here : https://github.com/analogdevicesinc/no-OS/tree/master/drivers/ADF7023 , it makes reference to another file pair called communication.h/.c where you need to implement a few functions for controlling the SPI peripheral on your master device, I simply implemented the functions as wrappers that call the STM32 SPI driver code. I only spent a couple hours working on the firmware but after a bit of reading compiler errors and debugging I got the ADF7023 driver code compiling onto of the STM32 peripheral driver codebase successfully. The project's firmware code can be found here: https://github.com/adamjvr/S1G-RF-firmwware all code that does not belong to ST Microelectronics or Analog Devices Inc. is released under the MIT open source license. Still much more to come on this, I'm still hammering out the overall functionality and when I have a clear roadmap I'll get back to writing more code.

At the start of the project log I mentioned some updates to the hardware. One of the updates will be adjustments made to the ground pours around the RF transceiver, RF amplifier matching circuits, and antenna connectors. I want to pull back the groun pours tad around the antenna traces and tranceiver, as recommended by the FaradayRF project. They are already several design iterations in on their 900MHZ radio and I appreciate their input! Please also check out their project too https://faradayrf.com/ if you are a ham interested in 900MHZ their platform is for you. Anyways back to S1G-RF!!! :) In addition to copper pour adjustments I want to had some small switch banks for setting which functional mode the S1G-RF is in. The switch will pull certain GPIO pins either low or high, when the STM32 onboard starts up it will read their pins for a 4 digit binary value. The binary value as set by the switches on the pins will correspond to one of the S1G-RF's functional modes. These additions won't take long to implement, after I get them in my plan is to go back to working the firmware some more before ordering PCBs. The idea is by writing the firmware now I will hopefully catch any possible mistakes I made in the hardware or perhaps learn that I need additional features for my desired functionalities. Anyways more to come on this project, soon I'm just getting started :) !

Discussions