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).

Revision:
44:aedd63cb0ce3
Parent:
43:a512f909514a
Child:
45:2d01cc9bc761
diff -r a512f909514a -r aedd63cb0ce3 source/SimpleSpirit1.cpp
--- a/source/SimpleSpirit1.cpp	Fri Dec 16 12:06:21 2016 +0100
+++ b/source/SimpleSpirit1.cpp	Fri Dec 16 13:46:02 2016 +0100
@@ -138,8 +138,6 @@
 	};
 	spirit_gpio_init(&x_gpio_init);
 
-// #ifdef RX_FIFO_THR_AO_CSMA_WA
-	// betzw - TODO: enabling CSMA/CA seems to be incompatible with TX FIFO usage (to be investigated)
 	/* Setup CSMA/CA */
 	CsmaInit x_csma_init = {
 			S_ENABLE,         // enable persistent mode
@@ -150,12 +148,9 @@
 			8                 // BU prescaler
 	};
 	csma_ca_init(&x_csma_init);
-// #endif
 
-#ifdef RX_FIFO_THR_AO_CSMA_WA
+#ifdef RX_FIFO_THR_WA
 	linear_fifo_set_almost_full_thr_rx(SPIRIT_MAX_FIFO_LEN-(MAX_PACKET_LEN+1));
-#else
-	linear_fifo_set_almost_full_thr_rx(20); // betzw: heuristic value
 #endif
 
 #ifdef USE_STANDBY_STATE
@@ -190,10 +185,7 @@
 
 	pkt_basic_set_payload_length(payload_len); // set desired payload len
 
-// #ifdef RX_FIFO_THR_AO_CSMA_WA
-	// betzw - TODO: enabling CSMA/CA seems to be incompatible with TX FIFO usage (to be investigated)
 	csma_ca_state(S_ENABLE); // enable CSMA/CA
-// #endif
 
 	int i = 0;
 	int remaining = payload_len;
@@ -229,10 +221,7 @@
 
 	_spirit_tx_started = false; // in case of state timeout
 
-// #ifdef RX_FIFO_THR_AO_CSMA_WA
-	// betzw - TODO: enabling CSMA/CA seems to be incompatible with TX FIFO usage (to be investigated)
 	csma_ca_state(S_DISABLE); // disable CSMA/CA
-// #endif
 
 	cmd_strobe(SPIRIT1_STROBE_RX); // Return to RX state
 
@@ -518,8 +507,8 @@
 		debug_if(!((*tmp) & IRQ_RX_DATA_READY_MASK), "\n\rAssert failed in: %s (%d)\n\r", __func__, __LINE__);
 #endif
 
-		if(!_is_receiving) { // spurious irq?!?
-#ifdef DEBUG_IRQ
+		if(!_is_receiving) { // spurious irq?!? (betzw: see comments on macro 'RX_FIFO_THR_WA'!)
+#ifdef HEAVY_DEBUG
 			debug("\n\r%s (%d): irq=%x\n\r", __func__, __LINE__, *tmp);
 #endif
 		} else {