Hello,
I’m having troubles with getting LoRaMac-node to work with SAMR34 Xplained Pro board (SAM R34 Chip-down Design Package ). SAMR34 is basically SAML21 with SX1276 in one package. LoRaMac-node supports SAML21 with SX1276 “wing board” (that is not avaiable anywhere). It should be relatively easy to port when hardware is almost the same. There are some differences though, on page 4 of the board schematic you can find RF switch that is used to switch RFC between J1, J2 and J3. TXRX_RF switch is handled internally and I don’t need to switch it in code. There are only TCXO and BAND_SEL (switches PA_BOOST) pins. SPI and DIO pins are also different. It’s really hard to debug this setup because I can’t measure SPI nor DIO pins because they are connected internally. I forked feature/5.0.0 branch and configured it according to this setup.
I verified that tx-cw demo is working with my SDR:
Next I tried to test ABP mode using TTN gateway and TTN (end application will use loraserver and OTAA mode):
###### ===== ClassA demo application v1.0.RC1 ==== ######
DevEui : DE-25-FA-CE-FA-CE-FA-CE
AppEui : <deleted>
AppKey : <deleted>
###### ===== JOINED ==== ######
ABP
DevAddr : 26011B91
NwkSKey : <deleted>
AppSKey : <deleted>
###### ===== MCPS-Request ==== ######
STATUS : OK
###### ===== MCPS-Confirm ==== ######
STATUS : OK
###### ===== UPLINK FRAME 1 ==== ######
CLASS : A
TX PORT : 2
TX DATA : UNCONFIRMED
00
DATA RATE : DR_0
U/L FREQ : 868300000
TX POWER : 0
CHANNEL MASK: 0007
###### ===== MCPS-Indication ==== ######
STATUS : Error
I also enabled RADIO_DEBUG pins, here is a screenshot from logic analyzer:
TX is about 6ms. It’s always the same, even if I change datarate to DR_2 its still 6ms. I used Semtech LoRa Modem Calculator Tool to estimate time on air and I can’t get any value thats just 6ms time-on-air (in class A demo payload is just 1 byte), thats too short to send anything.
I also tried to debug this message
###### ===== MCPS-Indication ==== ###### STATUS : Error
and it leads me to this line LORAMAC_EVENT_INFO_STATUS_ERROR. Any ideas what might be wrong?
EDIT
When I use debugger and set breakpoint at Radio.Send function, then step over this function and stop on
return LORAMAC_STATUS_OK;
I can see proper LoRa phy waveform on my SDR. However, when I hit continue and don’t stop I can’t see any waveform.
I confirmed this with ABP mode, I can get data in the first case, in the second no data is received by gateway
SOLUTION
After hours of debugging I found that DIO0 and DIO5 share same EIC line. I can’t change that since it’s connected inside chip itself. It turns out that DIO5 line triggered DIO0 interrupt and put SX1276 to sleep earlier and it couldn’t transmit whole frame.