Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop fw 708 2sfk50 40msTS #444

Open
wants to merge 39 commits into
base: develop_FW-708
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
fab04fd
using 2fsk-50 kbps
jmmunoz86 Sep 11, 2018
40c3b58
update config 2-fsk 50kbps
jmmunoz86 Sep 12, 2018
27c95f2
def TS 40 ms
jmmunoz86 Sep 12, 2018
624449b
using 2-fsk 50 kbps
jmmunoz86 Sep 12, 2018
79336db
using only sub-GHz interface
jmmunoz86 Sep 12, 2018
ad8f24c
TS 40 ms
jmmunoz86 Sep 12, 2018
904fd34
modif slotframe length to 31 TS
jmmunoz86 Sep 12, 2018
edf69f9
using radiotype = 1 (sub-GHz)
jmmunoz86 Sep 12, 2018
8cfe8eb
update project 40 ms TS
jmmunoz86 Sep 12, 2018
51571fb
timing for 2fsk50kbps.
jmmunoz86 Sep 13, 2018
108e7f6
2fsk-50 CH with 2 ch
jmmunoz86 Sep 14, 2018
2568331
optimize timeslot 2fsk-50 kbps
jmmunoz86 Sep 17, 2018
48a0581
timeslot of 40 ms. One PHY, subGHz.
jmmunoz86 Oct 16, 2018
9313be0
2fsk timing OK.
jmmunoz86 Oct 17, 2018
d4973c1
refactoring: changing radiotype for modem.
jmmunoz86 Oct 18, 2018
d28132a
refactoring and cleaning
jmmunoz86 Oct 18, 2018
074bf13
adding timing for 3 PHYs
jmmunoz86 Oct 21, 2018
55795d4
corrected TsTxOffset. SPI config happens at the beginning of each TS.
jmmunoz86 Oct 22, 2018
d2f68d3
changed startup_iar.c, flashing with IAR and scons both working
jmmunoz86 Oct 23, 2018
98ed0f0
OpenWSN working with only OFDM1, TS 40 ms
jmmunoz86 Oct 23, 2018
f6466bd
modifies the open_addr_t struct.
jmmunoz86 Oct 24, 2018
db8a1cc
Merge branch 'develop_fw-708-2fsk_OFDM1' into develop_FW-708_2sfk50_40ms
jmmunoz86 Oct 24, 2018
abb9737
Slotframe of 33 TS. faster synch.
jmmunoz86 Oct 24, 2018
d70cef5
Merge branch 'develop_FW-708_OFDM1_40ms' into develop_FW-708_2sfk50_40ms
jmmunoz86 Oct 24, 2018
58969b9
added radioType to neighbors.
jmmunoz86 Oct 31, 2018
15cc4cb
return parent address and radioType
jmmunoz86 Nov 2, 2018
bb2ef57
assign the radioType on which the 6p transaction will take place.
jmmunoz86 Nov 2, 2018
bca732e
Not nice workaround to use a different radioType for consecutive DIOs.
jmmunoz86 Nov 2, 2018
685a029
send DAO on the correct radioType
jmmunoz86 Nov 4, 2018
d4837af
Increase maxTxDataPrepare to allow long packets to be loaded into the…
jmmunoz86 Nov 5, 2018
3ea9a0c
casting to correct type (radioType)
jmmunoz86 Nov 5, 2018
407c2eb
MAX output power
jmmunoz86 Nov 7, 2018
504d4eb
EB sent on each PHY
jmmunoz86 Nov 7, 2018
2706919
send DIO on each radioType available
jmmunoz86 Nov 8, 2018
5fb0705
SLOTFRAME_LENGTH of 101 TS
jmmunoz86 Nov 8, 2018
ee08839
adding radioType criterion to neighbors
jmmunoz86 Nov 8, 2018
1259f7b
Configuring the front end radio at synch time.
jmmunoz86 Nov 8, 2018
459b811
function to read the state of the radio.
jmmunoz86 Nov 8, 2018
ceb53fb
delayTX of OFDM (synch with this PHY).
jmmunoz86 Nov 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions bsp/boards/common/openradios.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ typedef void (*radio_setEndFrameCb_cbt)(radio_capture_cbt cb);
typedef void (*radio_rfOn_cbt)(void);
typedef void (*radio_rfOff_cbt)(void);
typedef void (*radio_setFrequency_cbt)(uint16_t channel_spacing, uint32_t frequency_0, uint16_t channel);
typedef void (*radio_change_modulation_cbt)(registerSetting_t * mod);
//typedef void (*radio_load_phy_cbt)(registerSetting_t * mod, uint8_t size);
typedef void (*radio_load_phy_cbt)(uint8_t phy_index);
typedef void (*radio_change_size_cbt)(uint16_t* size);
// reset
typedef void (*radio_reset_cbt)(void);
Expand Down Expand Up @@ -94,6 +95,11 @@ typedef uint8_t (*radio_calculateFrequency_cbt)(
);
typedef uint8_t (*radio_getDelayTx_cbt)(void);
typedef uint8_t (*radio_getDelayRx_cbt)(void);
typedef uint8_t (*radio_getChInitOffset_cbt)(void);
typedef uint16_t (*radio_getNumOfChannels_cbt)(void);
typedef uint16_t (*radio_getCh_spacing_cbt)(void);
typedef uint32_t (*radio_getCenterFreq_cbt)(void);
typedef uint8_t (*radio_getRadioStatus_cbt)(void);

typedef struct {
radio_powerOn_cbt radio_powerOn_cb;
Expand All @@ -105,8 +111,7 @@ typedef struct {
radio_rfOn_cbt radio_rfOn_cb;
radio_rfOff_cbt radio_rfOff_cb;
radio_setFrequency_cbt radio_setFrequency_cb;
radio_change_modulation_cbt radio_change_modulation_cb;
radio_change_size_cbt radio_change_size_cb;
radio_load_phy_cbt radio_load_phy_cb;
// reset
radio_reset_cbt radio_reset_cb;
// TX
Expand All @@ -124,10 +129,15 @@ typedef struct {
radio_calculateFrequency_cbt radio_calculateFrequency_cb;
radio_getDelayTx_cbt radio_getDelayTx_cb;
radio_getDelayRx_cbt radio_getDelayRx_cb;
radio_getChInitOffset_cbt radio_getChInitOffset_cb;
radio_getNumOfChannels_cbt radio_getNumOfChannels_cb;
radio_getCh_spacing_cbt radio_getCh_spacing_cb;
radio_getCenterFreq_cbt radio_getCenterFreq_cb;
radio_getRadioStatus_cbt radio_getRadioStatus_cb;
} radio_functions_t;

typedef struct {
radio_functions_t radio_funct[MAX_NUM_RADIOS];
radio_functions_t radio_funct[MAX_NUM_MODEM];
} openradios_vars_t;

//=========================== variables =======================================
Expand Down
4 changes: 2 additions & 2 deletions bsp/boards/openmote-b/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ void board_init(void) {
// initialize radios
openradios_getFunctions(&radio_functions);
radio_2d4ghz_init();
radio_2d4ghz_setFunctions(&radio_functions[RADIOTPYE_2D4GHZ]);
radio_2d4ghz_setFunctions(&radio_functions[MODEM_2D4GHZ]);
spi_init();
radio_subghz_init();
radio_subghz_setFunctions(&radio_functions[RADIOTPYE_SUBGHZ]);
radio_subghz_setFunctions(&radio_functions[MODEM_SUBGHZ]);

// sensors_init();
cryptoengine_init();
Expand Down
80 changes: 46 additions & 34 deletions bsp/boards/openmote-b/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,36 +59,40 @@

//===== IEEE802154E timing

//#define SLOTDURATION_10MS // by default, we use 10ms time slot
// #define SLOTDURATION_10MS // by default, we use 10ms time slot

#ifdef SLOTDURATION_10MS
// time-slot related
#define PORT_TsSlotDuration 328 // counter counts one extra count, see datasheet
// execution speed related
#define PORT_maxTxDataPrepare 10 // 305us (measured 82us)
#define PORT_maxRxAckPrepare 10 // 305us (measured 83us)
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)
// radio speed related
#ifdef L2_SECURITY_ACTIVE
#define PORT_delayTx 14 // 366us (measured xxxus)
#else
#define PORT_delayTx 12 // 366us (measured xxxus)
#endif
#define PORT_delayRx 0 // 0us (can not measure)
// radio watchdog
#else
// time-slot related
#define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet
// execution speed related
#define PORT_maxTxDataPrepare 66 // 2014us (measured 746us)
#define PORT_maxRxAckPrepare 30 // 305us (measured 83us)
#define PORT_maxRxDataPrepare 33 // 1007us (measured 84us)
#define PORT_maxTxAckPrepare 32 // 305us (measured 219us)
// radio speed related
#define PORT_delayTx 42 // 214us (measured 219us)
#define PORT_delayRx 0 // 0us (can not measure)
// radio watchdog
// time-slot related
#define PORT_TsSlotDuration 328 // counter counts one extra count, see datasheet
// execution speed related
#define PORT_maxTxDataPrepare 10 // 305us (measured 82us)
#define PORT_maxRxAckPrepare 10 // 305us (measured 83us)
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)
// radio speed related
#ifdef L2_SECURITY_ACTIVE
#define PORT_delayTx 14 // 366us (measured xxxus)
#else
#define PORT_delayTx 12 // 366us (measured xxxus)
#endif
#define PORT_delayRx 0 // 0us (can not measure)
// radio watchdog
#else // 40 ms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timing below depends on which radio is used by openmote-b, those timing should be moved to radio.h files can call dynamically.

I recommend to use a fixed timing for FSK modulation, and use the timing variable for 2.4GHz and OQPSK 800kb/s as well. Only delayTx timing need to be adjust to each three PHY layers. With this, the timing part would be much easier.

// time-slot related
#define PORT_TsSlotDuration 1310 // counter counts one extra count, see datasheet
// execution speed related
#define PORT_maxTxDataPrepare 60 // 2014us (measured 746us) 40
#define PORT_maxRxAckPrepare 30 // 305us (measured 83us)
#define PORT_maxRxDataPrepare 30 // 1007us (measured 84us)
#define PORT_maxTxAckPrepare 40 // 305us (measured 219us)
// radio speed related
#define delayTx_2FSK_50 67
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The delayTx , delayRx are defined in radio_2d4ghz / radio_subghz files

#define delayTx_OFDM1 40

#define PORT_wdAckDuration 260
#define PORT_wdRadioTx 140 // for 2FSK 50 kbps 140
#define PORT_wdDataDuration 754 // for 2FSK 50 kbps
// radio watchdog
#endif

//===== adaptive_sync accuracy
Expand All @@ -106,17 +110,25 @@


// number of radios in this board.
#define MAX_NUM_RADIOS 2

#define MAX_NUM_MODEM 2 // sub-GHz and 2.4 GHz interfaces or modem
#define MAX_NUM_RADIOS 3 // amount of active PHYs. 3
//#define DAGROOT


//#define wdAckDuration 260 // 5400us using 50 kbps
#define NUM_CHANNELS 3 // number of channels to channel hop on
#define DEFAULT_CH_SPACING 1200 // default channel spacing for subghz
#define DEFAULT_FREQUENCY_CENTER 863625 // defualt freque
#define delayTx_SUBGHZ delayTx_OFDM1 //delayTx_2FSK_50 //
#define delayRx_SUBGHZ 0
#define NUM_CHANNELS_SUBGHZ 3

//=========================== typedef ========================================

typedef enum {
RADIOTPYE_2D4GHZ = 0,
RADIOTPYE_SUBGHZ = 1,
RADIOTPYE_ANY = 2
} radioType_t;
MODEM_2D4GHZ = 0,
MODEM_SUBGHZ = 1
} modem_t;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why create a modem type here? what the difference betwen this and the radioType


//=========================== variables =======================================

Expand Down
2 changes: 1 addition & 1 deletion bsp/boards/openmote-b/cc2538rf.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*---------------------------------------------------------------------------*/
/* Constants */
#define CC2538_RF_CCA_THRES_USER_GUIDE 0xF8
#define CC2538_RF_TX_POWER_RECOMMENDED 0xD5 /* TODO: Check value */
#define CC2538_RF_TX_POWER_RECOMMENDED 0xFF /* TODO: Check value */
#define CC2538_RF_CHANNEL_MIN 11 //poipoi -- in fact is sending on 0x17 check that.
#define CC2538_RF_CHANNEL_MAX 26
#define CC2538_RF_CHANNEL_SPACING 5
Expand Down
16 changes: 13 additions & 3 deletions bsp/boards/openmote-b/radio_2d4ghz.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ void radio_2d4ghz_setFunctions(radio_functions_t* funcs){
funcs->radio_rfOn_cb = radio_2d4ghz_rfOn;
funcs->radio_rfOff_cb = radio_2d4ghz_rfOff;
funcs->radio_setFrequency_cb = radio_2d4ghz_setFrequency;
funcs->radio_change_modulation_cb = radio_2d4ghz_change_modulation;
funcs->radio_change_size_cb = radio_2d4ghz_change_size;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this callback function is not used, you need remove it from the openradio.h file as well.

Also the radio_2d4ghz_change_size function should be removed

funcs->radio_load_phy_cb = radio_2d4ghz_load_phy;
// reset
funcs->radio_reset_cb = radio_2d4ghz_reset;
// TX
Expand All @@ -89,6 +88,11 @@ void radio_2d4ghz_setFunctions(radio_functions_t* funcs){
funcs->radio_calculateFrequency_cb = radio_2d4ghz_calculateFrequency;
funcs->radio_getDelayTx_cb = radio_2d4ghz_getDelayTx;
funcs->radio_getDelayRx_cb = radio_2d4ghz_getDelayRx;
funcs->radio_getChInitOffset_cb = radio_2d4ghz_getChInitOffset;
funcs->radio_getCh_spacing_cb = radio_2d4ghz_getCh_spacing_cb;
funcs->radio_getNumOfChannels_cb = radio_2d4ghz_getNumOfChannels_cb;
funcs->radio_getCenterFreq_cb = radio_2d4ghz_getCenterFreq_cb;
funcs->radio_getRadioStatus_cb = radio_2d4ghz_getRadioStatus_cb;
}

void radio_2d4ghz_init() {
Expand Down Expand Up @@ -591,8 +595,14 @@ uint8_t radio_2d4ghz_calculateFrequency(uint8_t channelOffset, uint8_t asnOffset

// not used by 2.4ghz radio
void radio_2d4ghz_powerOn(void){}
void radio_2d4ghz_change_modulation(registerSetting_t * mod){}
//void radio_2d4ghz_load_phy(registerSetting_t * mod, uint8_t size){}
void radio_2d4ghz_load_phy(uint8_t phy_index){}
void radio_2d4ghz_change_size(uint16_t* size){}
void radio_2d4ghz_loadPacket_prepare(uint8_t* packet, uint8_t len){}
void radio_2d4ghz_rxPacket_prepare(void){}
void radio_2d4ghz_rxEnable_scum(void){}
uint8_t radio_2d4ghz_getChInitOffset(void){}
uint16_t radio_2d4ghz_getNumOfChannels_cb(void){}
uint16_t radio_2d4ghz_getCh_spacing_cb(void){}
uint32_t radio_2d4ghz_getCenterFreq_cb(void){}
uint8_t radio_2d4ghz_getRadioStatus_cb(void){}
9 changes: 7 additions & 2 deletions bsp/boards/openmote-b/radio_2d4ghz.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ void radio_2d4ghz_setEndFrameCb(radio_capture_cbt cb);
void radio_2d4ghz_rfOn(void);
void radio_2d4ghz_rfOff(void);
void radio_2d4ghz_setFrequency(uint16_t channel_spacing, uint32_t frequency_0, uint16_t channel);
void radio_2d4ghz_change_modulation(registerSetting_t * mod);
void radio_2d4ghz_change_size(uint16_t* size);
//void radio_2d4ghz_load_phy(registerSetting_t * mod, uint8_t size);
void radio_2d4ghz_load_phy(uint8_t phy_index);
// reset
void radio_2d4ghz_reset(void);
// TX
Expand All @@ -70,6 +70,11 @@ uint8_t radio_2d4ghz_getCRCLen(void);
uint8_t radio_2d4ghz_calculateFrequency(uint8_t channelOffset, uint8_t asnOffset, uint8_t numChannels, uint8_t* hopSeq, bool singleChannel);
uint8_t radio_2d4ghz_getDelayTx(void);
uint8_t radio_2d4ghz_getDelayRx(void);
uint8_t radio_2d4ghz_getChInitOffset(void);
uint16_t radio_2d4ghz_getNumOfChannels_cb(void);
uint16_t radio_2d4ghz_getCh_spacing_cb(void);
uint32_t radio_2d4ghz_getCenterFreq_cb(void);
uint8_t radio_2d4ghz_getRadioStatus_cb(void);
// interrupt handlers
kick_scheduler_t radio_2d4ghz_isr(void);

Expand Down
Loading