LoRaMAC-node not sending SAMR34

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.

2 Likes

Hey, glad you found a solution to this issue. I share your frustration in trying to debug the SAMR34 radio, do you have any documentation for how to enable the RADIO_DEBUG pin? I’m very interested in inspecting TX_DEBUG and RX_DEBUG

Unfortunately this stack is rather poorly documented.

In src/radio CMakeLists.txt there is USE_RADIO_DEBUG flag that you need to enable. I remember that I had some troubles with it and just commented out USE_RADIO_DEBUG defines. Also, don’t forget to set RADIO_DBG_PIN_TX and RADIO_DBG_PIN_RX pins in corresponding boards-config.h

1 Like

Hi

I managed to install and compile the lora-mac in Visual Studio. Could please let me know how do you have downloaded the app to SAMR34 Xplained?

I am testing the ASF stack in AU915 band, but there are some problems. So I want to give a try with lora-mac.

BR
Gilberto

Hello guys,

I have added support of the SAMR34 and the ATECC608A-TNGLORA to the LoRaMac-node stack.

Check it out here:

Hope you find it helpful.