Lora-net / sx1302_hal

SX1302/SX1303 Hardware Abstraction Layer and Tools (packet forwarder...)
Other
219 stars 272 forks source link

Stuck in "sx1302_agc_start" function #26

Closed myfreescalewebpage closed 3 years ago

myfreescalewebpage commented 3 years ago

Hello,

I'm using release 1.0.5 with a RAK2287 EU868 mini-pcie SX1302 board. I have difficulties to get it working. Impossible to start lora forwarder, impossible de get EUI with chip_id.

After adding some logs, I see the program is stuck in "sx1302_agc_start" function, at this step:

/* Wait for AGC fw to be started, and VERSION available in mailbox */
sx1302_agc_wait_status(0x01); /* fw has started, VERSION is ready in mailbox */

The byte retrieved from the SX1302 is always read "0". So it seems the AGC firmware doesn't start.

I don't know what is AGC and what is the purpose of all this stuff, just don't know how to get it working... If you had a similar issue or know details about this to help, it's welcome 👍

Joel

myfreescalewebpage commented 3 years ago

Hello,

To give a feedback and close this, I would like to inform how I have solved my issue.

First issue:

The RAK2287 has reset line on mini-pcie PERST signal but it is not compliant with the mini-pcie standard. The standard indicates the line should be active low and that a pull up is required on this line to go out of reset when it is no more asserted by the host.

However, the RAK2287 reset line is active high and the input impedance of the RAK2287 is quite low (about 10kohms).

On my motherboard, the PERST line is driven by a FET and a pull-up of 10kohms. Thus the pull-up was not enough strong to correctly assert the reset line of the RAK2287 high and perform the reset (it was about 1.6V only when reset was performed).

Even power cycling is not enough to reset the card, the card must be power cycled then reset correctly with a 3.3V high signal on PERST and then PERST should be tied low. At this moment you have packet forwarder working.

Second issue:

The RAK2287 has no temperature sensor, this should be patched in the packet forwarder to get it working. See RAK code at https://github.com/RAKWireless/rak_common_for_gateway/tree/master/lora/rak2287_spi.

Hope this will help in the future.

Joel