Prototype RF driver for STM Sub-1 GHz RF expansion board based on the SPSGRF-868 module for STM32 Nucleo.

Prototype RF Driver for STM Sub-1 GHz RF Expansion Boards based on the SPSGRF-868 and SPSGRF-915 Modules for STM32 Nucleo

Currently supported boards:

Note, in order to use expansion board X-NUCLEO-IDS01A4 in mbed you need to perform the following HW modifications on the board:

  • Unmount resistor R4
  • Mount resistor R7

Furthermore, on some Nucleo development boards (e.g. the NUCLEO_F429ZI), in order to be able to use Ethernet together with these Sub-1 GHz RF expansion boards, you need to compile this driver with macro SPIRIT1_SPI_MOSI=PB_5 defined, while the development board typically requires some HW modification as e.g. described here!

This driver can be used together with the 6LoWPAN stack (a.k.a. Nanostack).

Files at this revision

API Documentation at this revision

Comitter:
Wolfgang Betz
Date:
Thu Nov 17 08:26:41 2016 +0100
Parent:
28:6a71e15d5272
Child:
30:9c6dcfc47619
Commit message:
Version ping-pong fot two Nucleo boards

Changed in this revision

SimpleSpirit1.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/SimpleSpirit1.cpp	Thu Nov 17 08:24:29 2016 +0100
+++ b/SimpleSpirit1.cpp	Thu Nov 17 08:26:41 2016 +0100
@@ -116,8 +116,6 @@
 	irq_set_status(RX_FIFO_ERROR, S_ENABLE);
 	irq_set_status(RX_FIFO_ALMOST_FULL, S_ENABLE);
 	irq_set_status(VALID_SYNC, S_ENABLE);
-	irq_set_status(MAX_BO_CCA_REACH, S_ENABLE);
-	irq_set_status(READY, S_ENABLE); // betzw: gets never trigger ... WHY??? (to be investigated)
 
 	/* Configure Spirit1 */
 	radio_persistent_rx(S_ENABLE);
@@ -127,7 +125,7 @@
 	timer_set_rx_timeout_stop_condition(SQI_ABOVE_THRESHOLD);
 	timer_set_infinite_rx_timeout();
 	radio_afc_freeze_on_sync(S_ENABLE);
-	calibration_rco(S_ENABLE);      // betzw: test
+	calibration_rco(S_ENABLE);
 
 	spirit_on = OFF;
 	CLEAR_TXBUF();
@@ -146,7 +144,7 @@
 
 	/* Setup CSMA/CA */
 	CsmaInit x_csma_init = {
-			S_ENABLE,         // enable persistent mode // betzw: test
+			S_ENABLE,         // enable persistent mode
 			TBIT_TIME_64,     // Tcca time
 			TCCA_TIME_3,      // Lcca length
 			3,                // max nr of backoffs (<8)
@@ -465,15 +463,6 @@
 	/* get interrupt source from radio */
 	irq_get_status(&x_irq_status);
 
-	/* Have become ready */
-	if(x_irq_status.IRQ_READY) { // betzw: gets never trigger ... WHY??? (to be investigated)
-#ifdef DEBUG_IRQ
-		uint32_t *tmp = (uint32_t*)&x_irq_status;
-		debug("\n\r%s (%d): irq=%x", __func__, __LINE__, *tmp);
-#endif
-		cmd_strobe(SPIRIT1_STROBE_RX);
-	}
-
 	/* Reception errors */
 	if((x_irq_status.IRQ_RX_FIFO_ERROR) || (x_irq_status.IRQ_RX_DATA_DISC)) {
 #ifdef DEBUG_IRQ
@@ -595,26 +584,6 @@
 		}
 	}
 
-	/* Max number of back-off during CCA */
-	if(x_irq_status.IRQ_MAX_BO_CCA_REACH) {
-#ifdef DEBUG_IRQ
-		uint32_t *tmp = (uint32_t*)&x_irq_status;
-		debug("\n\r%s (%d): irq=%x", __func__, __LINE__, *tmp);
-#endif
-
-		_spirit_rx_err = false;
-		_spirit_tx_started = false;
-		csma_ca_state(S_DISABLE); // disable CSMA/CA
-		// cmd_strobe(SPIRIT1_STROBE_RX); // data-sheet says that  we will return to READY state automatically!
-		CLEAR_TXBUF();
-		CLEAR_RXBUF();
-
-		/* call user callback */
-		if(_current_irq_callback) {
-			_current_irq_callback(TX_ERR);
-		}
-	}
-
 	/* The IRQ_VALID_SYNC is used to notify a new packet is coming */
 	if(x_irq_status.IRQ_VALID_SYNC) {
 		_is_receiving = true;